RMIAdmin support command line usage, therefore you may further develop script/batch which invoke
activity such as "Connection Monitoring", as a result to promote automation.
For example, you may wish to check remote server connection status via Command Prompt (for Windows) or Console
(for Unix-like Computer) rather than using the RMIAdmin GUI. The benefit is that you could then
embed all your instructions into batch (*.bat) or shell script (*sh), and therefore the integration
with other scripting/programming languages is made possible.
Usage instructions
-
java RMIAdmin.RMIAdminClient_ConnectionMonitor -h
Display the help menu
-
java RMIAdmin.RMIAdminClient_ConnectionMonitor -i ip_address
Specify the "IP Address" of remote RMIServer e.g. "203.186.94.62"
-
java RMIAdmin.RMIAdminClient_ConnectionMonitor -p port_no
Specify the "Port Number" of remote RMIServer e.g. "1099"
-
java RMIAdmin.RMIAdminClient_ConnectionMonitor -a "action"
Specify the "Action" to be executed, e.g. test the remote connection, restart remote RMI service
Usage examples
java RMIAdmin.RMIAdminClient_ConnectionMonitor -i ip_address -p port_no -a "action"
-
Test the connection status of remote server
[Windows]
java RMIAdmin.RMIAdminClient_ConnectionMonitor -i 203.186.94.62 -p 1099 -a connect
[Linux]
java RMIAdmin.RMIAdminClient_ConnectionMonitor -i 203.186.94.61 -p 1099 -a connect
-
Restart the RMI service of remote server
[Windows]
java RMIAdmin.RMIAdminClient_ConnectionMonitor -i 203.186.94.62 -p 1099 -a restart
[Linux]
java RMIAdmin.RMIAdminClient_ConnectionMonitor -i 203.186.94.61 -p 1099 -a restart
Usage Tips
-
Note that the command entered is non-case sensitive for Windows, but
case sensitive for all unix-like system.
-
If the command entered contain double quotes, the \ symbol should be included for the double quotes to
be passed in properly.
[Windows Example]
java RMIAdmin.RMIAdminClient_CommandLine -i 203.186.94.62 -p 1099 -s cmd.exe -c "dir \"c:\program files\""
-
Cross-platform execution is supported, therefore you can perform use command mode on a Linux Machine to
invoke instructions on remote Windows Machine, and vice versa.
-
To run this command successfully, you must include the path (including filename) where
you placed the RMIAdmin program (RMIAdmin.jar) in the system classpath.
[Windows Example]
set CLASSPATH=%CLASSPATH%;fullpath_of_RMIAdmin.jar
e.g. set CLASSPATH=%CLASSPATH%;c:\RMIAdmin\RMIAdmin.jar
* Assume RMIAdmin.jar is installed in C:\RMIAdmin
[Linux Example]
CLASSPATH=$CLASSPATH:fullpath_of_RMIAdmin.jar
e.g. CLASSPATH=$CLASSPATH:/RMIAdmin/RMIAdmin.jar
* Assume RMIAdmin.jar is installed in /RMIAdmin
-
Other than setting the system classpath, you may also use the java -cp parameter to
specify the CLASSPATH at runtime.
[Windows Example]
java -cp fullpath_of_RMIAdmin.jar
e.g. java -cp C:\RMIAdmin\RMIAdmin.jar RMIAdmin.RMIClient_ConnectionMonitor -i ......
* Assume RMIAdmin.jar is installed in C:\RMIAdmin
[Linux Example]
java -cp fullpath_of_RMIAdmin.jar
e.g. java -cp /RMIAdmin/RMIAdmin.jar RMIAdmin.RMIClient_ConnectionMonitor -i ......
* Assume RMIAdmin.jar is installed in /RMIAdmin
Related Topics:
|