\n \n \n \n \n \n \n \n \n \n \n \n \n
Related DocumentationVersion of up.time \naffectedAffected Platforms
\n4.5 or newerAll
\n \n

There are two main scenarios for using the agentcmd utility:

\n \n \n \n

You can use agentcmd in two ways: from the command line or in an agent-side script.

\n \n

Using agentcmd at the command line

\n \n

The command line syntax of agentcmd is:

\n \n

agentcmd <-/+s> <-p #> hostname command

\n \n

Where:

\n \n \n \n

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

\n \n

agentcmd +s Solaris1 sysinfo

\n \n

The agent will return output similar to the following:

\n \n
\nSYSNAME=Solaris1
\nDOMAIN=myDomain.com
\nARCH="SunOS Solaris1 5.9 Generic_118558-03 sun4u sparc SUNW,Ultra-Enterprise"
\nOSVER=5.9
\nNUMCPUS=4
\nMEMSIZE=1048576
\nPAGESIZE=8192
\nSWAPSIZE=1021624
\nGPGSLO=25
\nVXVM=""
\nSDS="YES"
\nHOSTID="808cf673"
\nCPU0=" 0 - - 168 - UltraSPARC - "
\nCPU1=" 1 - - 168 - UltraSPARC - "
\nCPU4=" 4 - - 168 - UltraSPARC - "
\nCPU5=" 5 - - 168 - UltraSPARC - "
\nNET0=lo0=127.0.0.1
\nNET1=hme0=10.0.0.010
\n
\n \n

Using agentcmd in an agent-side script

\n \n

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

\n \n \n \n

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

\n \n

NOTE: 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.

\n \n
\n/usr/local/uptime4/scripts/agentcmd [-s/+s] -p [agent port] [agent hostname] rexec [password] [path]
\n
\n \n

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

\n \n