Table of Contents
NAME
snm_cmd - Site/SunNet/Domain Manager command - line manager application
SYNOPSIS
snm_cmd [-d] { -a agent | -f schema } -g group [ options ... ] snm_cmd -e threshold -f schema -g group -n attribute -r relation [ options ... ] snm_cmd -S set_value -f schema -g group -n attribute [ options ... ] snm_cmd -v -f schema [ -h host ] [ -t target ]
DESCRIPTION
snm_cmd is a command- line manager for Site/SunNet/Domain Manager agents. It provides a way to send requests to agents without having to run the SNM Console or write dedicated test programs.
snm_cmd can be used to validate an agent schema by verifying the names and types of attributes in the agent schema against those returned by the agent.
In addition to testing agents, snm_cmd can be used with at(1) or cron(1M) to start agents at a particular time for a given duration and to log the information at a designated rendezvous.
You can use snm_cmd from a terminal or from a machine not running the SNM Console, although the SNM Console support environment (logger, agent schema files, run-time database, event dispatcher, etc) must be available. The SNM Console has no knowledge of agents started by snm_cmd.
OPTIONS
Each option is recognized as a separate argument.
- -aagent
- name or RPC program number of the agent to send the request to, as it appears in the rpc.bynumber NIS map or rpc file. This option is only used for data reports if the -f option is not specified. If it is specified without the -f option and a schema file is needed, the program will look for the schema file that corresponds with the named agent. See the discussion of the - f option to understand the search for the schema file.
- -ccount
- maximum reports to generate. A value of zero asks the agent to report forever. The default is 1 unless the -i option is specified, in which case the default is zero.
- -d
- start data reporting. This is the default unless -e, -S or -v is specified.
- -ethreshold
start event reporting and set the threshold to thres_hold. Threshold is ignored if the relational operator given with the -r option is ``CHANGED'', but it is still required. The -n and -r options are also required to request an event report. snm_cmd will convert threshold to the correct data type based on the type of the attribute given with the -n option. You need to specify a key (use the -k option) if you want to do event reporting on tables.
- -E
- print enumerations as text rather than integers.
- -ffilename
- name of the agent schema file. This is required for event reporting, setting, graphing or validation requests-everything but data requests. If the name is not an absolute path name, or the -f option is not given but the -a option is, snm_cmd will try to look up the agent schema file based on the agent name. It first looks in the current directory for a file called agent.schema. If not found, it then uses the SNMHOME environment variable, if available; otherwise snm_cmd looks in /opt/SUNWconn/snm for Solaris 2.x and /usr/snm for Solaris 1.x. The following two subdirectories are searched: the agents subdirectory, and then the schemas subdirectory. (This won't work if the name given with
- the
- -a option is an RPC program number rather than an agent name.)
- -ggroup
- a named collection of attributes the agent treats as a unit. The group names are defined in the agent schema. Specify the special group oids when asking the SNMP proxy agent for attributes via object IDs.
- -G
- send the named attributes to the SNM Results Grapher. Specify the attributes to graph with the -n option. You can specify more than one -n option when you are graphing. snm_cmd will start the grapher if it is not already running. When the request finishes, snm_cmd will exit, but the graph will stay around until you remove it. You need to specify a key (use the - k option) if you want to do graphing on tables.
- -hhost
- hostname where the agent is running. This is the system where the request will be sent (and performed), as opposed to the target device (see the - t discussion). The default is the local host.
- -iinterval
- minimum time (in seconds) between each report. Default is zero, which asks the agent to select an appropriate default.
- -kkey
- identification of a particular row of a table. Default is NULL (no key). Only one key can be specified per request.
- -mrecipient
- send mail to recipient when an event occurs. If this option is not given, no mail is sent.
- -nattribute
- attribute name, as defined in the named group in the agent schema file. For event reports, this is the attribute associated with the given threshold. For graphing or specifying SNMP object IDs, you can specify multiple -n options (up to 30), each with a single attribute. Specify the attribute in standard SNMP dot notation.
- -ostring
- optional agent - specific information, passed as a string. The interpretation of this string (if any) is up to the agent.
- -O
- have the agent stop after the first event report (``send Once'').
- -p
- priority (HIGH, MEDIUM, or LOW) of the event.
- -Prpc#
- RPC program number to use as a rendezvous, rather than the RPC number for na.logger.
- -roperator
- relational operator applied to the event reporting threshold. Operators don't always apply; for example, DECRBYLESS on a string is not supported. Case is not significant. Relational operators may be specified as text or symbols, which probably need to be escaped when specified from the shell. Only one operator is possible per request. == EQ or = != NE
- >
- GT
- <
- LT >= GE <= LE +- CHANGED or -+ += INCRBY or + -= DECRBY or +< INCRBYMORE +> INCRBYLESS -> DECRBYMORE -< DECRBYLESS
- -Rrendez_host
- host name running the rendezvous process. Default is the local host.
- -s
- send the reports to standard output. Without this option, reports from the agent are sent to the logger on the host specified with the -R option. Reports are formatted for human display only. The output cannot be read by the Results Browser.
- -Sset_value
- the value to set the attribute specified by the -g, -n, and (possibly) -k flags. Note that you can only set one attribute per request.
- -tdevice
- name of the target device. While the request will be sent to the agent on the system given by the -h option, the agent there will be instructed to perform the requested activity on the target device rather than the host where it is running. This option is only useful for proxy agents, since native agents can only get information about the systems where they are running.
- -Ttimeout
- maximum time to wait for a confirmation from the agent, in seconds. The default is the value of NETMGT_TIMEOUT, defined in netmgt_define.h.
- -v
- send a data report request to every group the agent handles, to verify the agent schema attributes and data types against those returned by the agent. Any discrepancies are reported.
- -Vversion
- protocol version of the agent. Use 10 for the current release, which is also the default.
- -x
- attempt to restart the request if the agent stops from some external cause.
EXAMPLES
1. Start ping data reporting on host delta, returning a total of 10 sets of reachability group statistics for host omega, one every ten minutes, to the terminal: snm_cmd -h delta -a ping -g reach -t omega -c 10 -i 600 -s
2. Ask the rpcnfs agent to send an event report every time the server tweedle gets another bad NFS call. The check happens every five minutes until the agent is later killed:
snm_cmd -f rpcnfs -g server -n nfs_bad -r changed -e 1 -h tweedle -i 300
3. Ask the SNMP proxy agent residing on the default host (localhost) to set the administrative status of interface 3 on router ouch to 2 (down):
snm_cmd -f snmp -g ifStatus -k 3 -n ifAdminStatus -t ouch -S 2
4. Verify the hostperf proxy agent schema against the agent running on host delta:
snm_cmd -v -f /opt/SUNWconn/snm/agents/hostperf.schema -h delta (Solaris 2.x)
snm_cmd -v -f /usr/snm/agents/hostperf.schema -h delta (Solaris 1.x)
5. Get only the ifInUcastPkts for jupiter's first two interfaces by raw object ID:
snm_cmd -f snmp -g oids -t jupiter -s -n ``1.3.6.1.2.1.2.2.1.11.1'' -n ``1.3.6.1.2.1.2.2.1.11.2''
6. Graph the average round trip time between zigzag and exodus every 10 seconds:
snm_cmd -G -f ping -g stats -n tripavg -h zigzag -t exodus -i 10
FILES
netmgt_define.h
ERRORS
Attribute type does not match: group `(group)', attribute `(attr)': schema type `(type1)', returned type `(type2)'
The agent and schema disagree on the attribute's data type.
Cannot get agent ID : (why)
A call to the agent to get its ID failed. The reason is given.
Cannot request data report for group `(groupname)' (Reason)
The request to the agent failed. The next line explains why.
Could not open schema file : (filename) The listed file could not be opened for reading. (Fatal error)
Detected n errors between schema file and agent `(agentname)' on This is a summary of the number of errors found.
Duplicate attribute name (attrname)
The named attribute has been previously defined in this group/table. (Fatal error)
Duplicate definition of group (groupname) The named group/table has been previously defined in this agent schema. (Fatal error)
Duplicate error code = n
The agenterror number listed has been previously defined in this agent schema. (Fatal error)
No groups in this agent?
There were no groups or tables listed in the schema file.
Note -attribute
is `writeonly': group `(group)', attribute Since the named attribute is write-only, the agent doesn't return it, so it cannot be checked with snm_cmd -v.
attribute validation done.
Schema serial number mismatch: agent wants n, schema is m. No The agent was initialized with a particular serial number (hard coded in the agent). The agent schema serial number (given by the `serial' keyword) should match, otherwise the agent and schema are out of sync. If no `serial' keyword is given, serial 1 is assumed. This is a fatal error; snm_cmd will not continue.
These attribute(s) not returned by agent `(agentname)' group `(group)'
attribute `(attr1)' (type (type1))
- attribute `(attr2)' (type (type2))
- . . .
The given list of attributes was named in the agent schema but the agent didn't return any of them.
Two agent definitions in schema file
Only one agent definition is allowed per schema file. (Fatal error)
Undefined attribute `(attr)' (type (type)) returned by agent An attribute with the given name and type was returned by the agent but was not listed in the agent schema.
(file): parsing error n
(file): n errors encountered.
SEE ALSO
Site/SunNet/Domain Manager Application and Agent Development Guide
Table of Contents