Command Line Workstation, or just CLW, is Introscope's command line tool that lets you perform certain tasks on the command line. Following is an example of how to issue a command using CLW.
When first getting acquianted with CLW, it is usually best to issue CLW commands on the server that is running the collector. In other words, you wouldn't want to start by issuing commands on the Manager of Managers (MoM) server. This assumes the Enterprise Manager is running and a username and password has already been defined in users.xml or LDAP and that realms.xml is configured to get users from users.xml or LDAP.
cd <EM_root>/lib java -Duser=<your username> -Dpassword=<your password> -jar CLWorkstation.jar help
The above example should return stdout, like this.
Command Line Workstation Commands: (activate|enable) snmp collections matching [REGULAR EXPRESSION] in management modules matching [REGULAR EXPRESSION] et cetera
mm/dd/yy hh:mm:ss [INFO] [Manager.SessionBean] Command Line Work Station User "john.doe" connected successfully from host "Node=Workstation_1623, Address=localhost/127.0.0.1:52242, Type=socket"
Mom / Collector
Once CLW is working as expected on the collector, you can then try the same on the MoM. One way to do this would be to used the --Dhost option, like this.
java -Duser=<your username> -Dpassword=<your password> -Dhost=<your collector server> -jar CLWorkstation.jar help
However, a better approach is probably to define the collector servers in <em root>/config/IntroscopeEnterpriseManager.properties. In this example, CLW commands run on the MoM would run against server1. In this scenario, there is no need to use the -Dhost option.
introscope.enterprisemanager.clustering.login.server1.host=server1 introscope.enterprisemanager.clustering.login.server1.port=5001 introscope.enterprisemanager.clustering.login.server1.publickey=example.crt
When using this approach, ensure the IntroscopeEnterpriseManager.log shows a successful connection from the MOM server to the collector server.
mm/dd/yy hh:mm:ss [INFO] [Manager.Cluster] Connected to the Introscope Enterprise Manager at server1@5001
To put this another way, you want to ensure that IntroscopeEnterpriseManager.log does not have "failed to connect".
mm/dd/yy hh:mm:ss [WARN] [Manager.Cluster] Failed to connect to the Introscope Enterprise Manager at server1@5001 (1) because: java.net.ConnectException: Connection refused (Connection refused)
Note that the server name (server1 in this example) is defined in <em root>/config/loadbalancing.xml, like this.
<agent-collector name="server1"> <collector host="server1" port="5001"/>
Command Line Workstation can also be invoked from remote servers, as long as the remote servers are able to communicate with the Enterprise Manager server on the network. You would simply copy the CLWorkstation.jar file from the Enterprise Manager server to the remote server, and then include the -Dhost option on the command line, where -Dhost is the hostname of the Enterprise Manager server.
java -Duser=<your username> -Dpassword=<your password> -Dhost=<hostname> -jar CLWorkstation.jar help
A good starting point is the list agents command.