Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The command line syntax of agentcmd is:

 

Code Block
languagetext
agentcmd <-/+s> <-p #> hostname command

...

Where:

  • -s = do not use an SSL connection to the agent (default).
  • +s = connect to the agent using SSL.

    If SSL is not enabled on the host, the following error message appears:

    ERR The host was not configured to use SSL

  • -p # = connect to the agent on the specified port (default is 9998).
  • hostname = the name or IP address of the host on which the agent is running.
  • command = the agent command to run.

For example, to get basic system information from an agent running on the server Solaris1, type the following command: 

Code Block
languagetext
agentcmd +s Solaris1 sysinfo

...

 SYSNAME=Solaris1
 DOMAIN=myDomain.com
 ARCH="SunOS Solaris1 5.9 Generic_118558-03 sun4u sparc SUNW,Ultra-Enterprise"
 OSVER=5.9
 NUMCPUS=4
 MEMSIZE=1048576
 PAGESIZE=8192
 SWAPSIZE=1021624
 GPGSLO=25
 VXVM=""
 SDS="YES"
 HOSTID="808cf673"
 CPU0=" 0 - - 168 - UltraSPARC - "
 CPU1=" 1 - - 168 - UltraSPARC - "
 CPU4=" 4 - - 168 - UltraSPARC - "
 CPU5=" 5 - - 168 - UltraSPARC - "
 NET0=lo0=127.0.0.1
 NET1=hme0=10.0.0.010
 

Using agentcmd in an agent-side script

As with netcat, agentcmd is typically used in a script on the monitoring station to perform the following tasks:

...

The following example illustrates how to run agentcmd in an agent side script:

...

Note
titleNote

The rexec in the command below does not indicate use of the rexec system utility. It is a keyword that is used to indicate to the agent that you are attempting to run a pre-defined command.

...

If you use netcat in your scripts, see the following Knowledge Base articles for information on replacing netcat with agentcmd: