You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

SNMP4J Command-Line Tool, version 1.0.0

Type SNMP4J-CLT help <command> for help on a specific command.
Type SNMP4J-CLT example <command> for examples on a specific command.
Type SNMP4J-CLT version to see the program version.

Most commands take agent address and OID list arguments. A list of the
available options for each command is listed after the command description.
The description of all options follows the command list.

Standard parameter formats are:

<OID>:
An object identifier is either a dotted notation like 1.3.6.1.2.2.1.0 or
by an object name (requires MIB information) like IF-MIB:ifDescr.0 or sysName

<address>: [upd:]<host>[/<port>]
Host is either an IP address or hostname and port is the SNMP port
of the target SNMP entity.

{{
[create-snapshot]:
create-snapshot <file> <address> <OID>

Creates a snapshot <file> by walking the subtree specified by <OID> at the
agent at <address>.

[defaults]:
defaults <action>

Manage the default options stored in the SNMP4J-CLT config file in your
home directory. <sub-command> is one of 'list', 'reset', and 'save'.

list:
List default options to stdout and exit. The default options are stored in
the SNMP4J-CLT config file in your home directory.

reset:
Reset (delete) all option defaults and exit.

save:
Save specified options as defaults and exit.

[dump-snapshot]:
dump-snapshot <file>

Dumps the contents of the snapshot <file> to STDOUT.

[example]:
example <command>

Display the help for a command including usage example (if available).

[get]:
get <address> <OID> [OID..]

Get one or more object values from the SNMP agent at <address> with the
specified instance <OID>.

[getbulk]:
[-Cr <repeaters>] [-Cn <non-repeaters>] getbulk <address> <OID> [OID..]

Send a SNMP GETBULK message to <address>. The options -Cr and -Cn are
GETBULK specific - defaults are 10 and 0 respectively.

[getnext]:
getnext <address> <OID> [OID..]

Get one or more object values from the SNMP agent at <address> with an
instance OID lexicographic following the specifed <OID> in the accessible
MIB view.

[help]:
help [command]|all

Display this message and then exits the application. If command is
specified then specific help on that command is displayed. By specifying
'all' as command a description for each command is displayed.

[inform]:
inform <address> <OID>=

Unknown macro: {<type>}

<value> [..]

Send an INFORM request with one or more object values to the SNMP agent at
<address> with the specified instance <OID>, <type> and <value>s. Type is
one of i,u,s,x,d which selects how <value> is being parsed and which SNMP
(SMI) type is being send to the agent.
The <value> for an <OID> is specified by using the following form:
<OID>=

<value> where <type> is one of the following single
characters enclosed by '

Unknown macro: {' and '}

':
i Integer32
u UnsingedInteger32, Gauge32
s OCTET STRING
x OCTET STRING specified as hex string with bytes separated by ':'.
d OCTET STRING specified as decimal string with bytes separated by dots
('.').
n Null
o OBJECT IDENTIFIER
t TimeTicks
a IpAddress
b OCTET STRING specified as binary string with bytes separated by spaces.

license:
license

Print the license agreement for SNMP4J-CLT on the console.

listen:
listen <address>

Listen for incoming traps, notifications, and inform requests a dumps their
content to STDOUT.

mib:
mib <action> <mib>

Add MIB files to a MIB repository or remove MIB modules from it. The MIB
repository directory has to be specified by the mandatory options -M or
-Msmi.

add:
<mib-file>

Compiles and then adds the MIB module(s) contained in 'mib-file' to the MIB
repository specified by -M or -Msmi.

del:
<mib-module-name>

Removes the MIB module with name 'mib-module-name' from the MIB repository
specified by -M or -Msmi.

oid:
oid [find] <regex>

Search the MIB repository specified by the -M option for SMI definitions
with an object name/description that matches the specified regular
expression.

find:
oid find <regex>

Search the MIB repository for object names that match <regex>

find-by-descr:
oid find-by-descr <regex>

Search the MIB repository for descriptions that match <regex>

set:
set <address> <OID>=

Unknown macro: {<type>}

<value> [..]

Set one or more object values in the SNMP agent at <address> with the
specified instance <OID>, <type> and <value>s. Type is one of i,u,s,x,d
which selects how <value> is being parsed and which SNMP (SMI) type is
being send to the agent.
The <value> for an <OID> is specified by using the following form:
<OID>=

<value> where <type> is one of the following single
characters enclosed by '

':
i Integer32
u UnsingedInteger32, Gauge32
s OCTET STRING
x OCTET STRING specified as hex string with bytes separated by ':'.
d OCTET STRING specified as decimal string with bytes separated by '.'.
n Null
o OBJECT IDENTIFIER
t TimeTicks
a IpAddress
b OCTET STRING specified as binary string with bytes separated by spaces.

[smi]:
smi <OID> [..]

Dump the SMI definition of the MIB object specified by the OID
parameter(s).

[table]:
table <address> <OID> [OID..]

Receives tabular data from the column OIDs specified as parameters. The
retrieved rows will be dumped to the console (STDOUT) ordered by their
index values.

[trap]:
[-To <notificationID>] trap <address> <OID>=

Unknown macro: {<type>}

<value> [..]

Send a TRAP/NOTIFICATION to the SNMP agent at <address> with the specified
instance <OID>s and <value>s.The <value> for an <OID> is specified by using
the following form: <OID>=

<value> where <type> is one of the
following single characters enclosed by '

Unknown macro: {' and '}

':
i Integer32
u UnsingedInteger32, Gauge32
s OCTET STRING
x OCTET STRING specified as hex string with bytes separated by ':'.
d OCTET STRING specified as decimal string with bytes separated by '.'.
n Null
o OBJECT IDENTIFIER
t TimeTicks
a IpAddress
b OCTET STRING specified as binary string with bytes separated by spaces.

[v1trap]:
v1trap <address> <OID>=

Unknown macro: {<type>}

<value> [..]

Sends a TRAP/NOTIFICATION to the SNMP agent at <address> with the specified
instance <OID>s and <value>s.The <value> for an <OID> is specified by using
the following form: <OID>=

<value> where <type> is one of the
following single characters enclosed by '

':
i Integer32
u UnsingedInteger32, Gauge32
s OCTET STRING
x OCTET STRING specified as hex string with bytes separated by ':'.
d OCTET STRING specified as decimal string with bytes separated by '.'.
n Null
o OBJECT IDENTIFIER
t TimeTicks
a IpAddress
b OCTET STRING specified as binary string with bytes separated by spaces.

version:
version

Display version information and then exits.

walk:
walk <address> <OID>

The walk operation mode uses GETNEXT or GETBULK PDUs to retrieve a MIB
subtree with the specified root OID.

OPTIONS:
-A authPassphrase Set the authentication pass phrase for
authenticated SNMPv3 messages.
-CB Display brief column headers. Common prefixes will
be dropped.
-CH Do not display column headers.
-Cb bufferSize The number of table rows to buffer before computing
column sizes.
-Cc columnWidth Print table columns with specified character width.
-Cf columnSeparator Separate table columns with the specified separator
string. The table is printed in compact form. By
default columns are separated by spaces and
aligned.
-Ch Display only column headers.
-Ci Prepend the index for each printed row.
-Cil lowerBoundIndex Set the lower bound index for TABLE operations.
-Ciu upperBoundIndex Set the upper bound index for TABLE operations.
-Cl Left justify all cells when printing a table.
-Cn non-repeaters Set the non-repeaters field for GETBULK PDUs. It
specifies the number of supplied variables that
should not be iterated over. The default is 0.
-Cr max-repetitions Set the max-repetitions field for GETBULK PDUs.
This specifies the maximum number of iterations
over the repeating variables. The default is 10.
-Cw Specify the line width when printing tables
-Dn Do not use any default option values stored in
config.
-E contextEngineID Set the context engine ID used for the SNMPv3
scoped PDU. The authoritative engine ID will be
used for the context engine ID, if the latter is
not specified.
-L license key Specify license and associated key. The license
info will be saved in the SNMP4J-CLT config file in
your home directory. Enter each license part
enclosed in quotes, for example by '-L "b6 80 4d 68
3a 8 c0 f4" "O?fWO-3s"'
-M mibRepositoryPath Set the path to the MIB repository to be used to
resolve object names (OIDs) and parse/format object
values ('repository' is the default). The
repository directory must contain compiled MIB
modules files only.
-Msmi mibRepositoryPath Set the path to the MIB repository to be used to
resolve object names (OIDs) and parse/format object
values ('repository' is the default). The MIB
repository directory must contain SMI MIB files
(v1/v2). The file names of the MIB files have to
match their MIB module name or there has to be a
properties file named 'module-index.properties'
which maps to the module file by
'<modulename>.path=<path>' entries.
-Ors maxSizeRespPDU The maximum size of the response PDU in bytes.
-OtCSV For each SNMP row received exactly one row of comma
separated values will printed to the console where
the first column contains the row index.
-Otd Activates dense table operation mode which improves
table retrieval performance on regular (dense)
tables. This option must not be used with sparse
tables.
-OttCSV Same as -OtCSV except that each row's first column
will report the current time (millis after
1.1.1970) when the request has been sent.
-Ta agentAddress Set the agent address field of a V1TRAP PDU. The
default value is '0.0.0.0'.
-Te enterpriseOID Set the enterprise OID field of a V1TRAP PDU.
-Tg genericID Set the generic ID for SNMPv1 TRAPs (V1TRAP). The
default is 0 (coldStart).
-To trapOID Sets the trapOID (1.3.6.1.6.3.1.1.4.1.0) of an
INFORM or TRAP PDU. The default is
1.3.6.1.6.3.1.1.5.1.
-Ts specificID Set the specific ID for V1TRAP PDU. The default is
0.
-Tu upTime Set the sysUpTime field of an INFORM, TRAP, or
V1TRAP PDU.
-Y privacyPassphrase Set the privacy pass phrase for encrypted SNMPv3
messages.
-a authProtocol Set the authentication protocol used to
authenticate SNMPv3 messages. Valid values are MD5
and SHA.
-bc engineBootCount Set the engine boot count to the specified value
greater or equal to zero. Default is zero.
-c community Set the community for SNMPv1/v2c messages.
-d debugLevel Set the global debug level for Log4J logging
output. Valid values are OFF, ERROR, WARN, INFO,
and DEBUG.
-e engineID Set the authoritative engine ID of the command
responder used for SNMPv3 request messages. If not
supplied, the engine ID will be discovered.
-h windowSize Set the window height in rows. If the value is
greater than zero, every windowSize rows the user
is prompted to continue output. Default is zero.
-l localEngineID Set the local engine ID of the command generator
and the notification receiver used for SNMPv3
request messages. This option can be used to avoid
engine ID clashes through duplicate IDs leading to
usmStatsNotInTimeWindows reports.
-m mibModuleName Load the specified MIB module from the MIB
repository specified by the -M option. The
mibModuleName can be a regular expression, e.g. use
'SNMPv2-.*' to load all MIB modules in the
repository that start with 'SNMPv2-'.
-n contextName Set the target context name for SNMPv3 messages.
Default is the empty string.
-r retries Set the number of retries used for requests. A zero
value will send out a request exactly once. Default
is 1.
-s Suppress any output on stderr (silent mode).
-t timeout Set the timeout in milliseconds between retries.
Default is 1000 milliseconds.
-u securityName Set the security name for authenticated v3
messages.
-v 1|2c|3 Set the SNMP protocol version to be used. Default
is 3.
-w consoleWidth Specifies the width of the console output, default
is 80 characters.
-y privacyProtocol Set the privacy protocol to be used to encrypt
SNMPv3 messages. Valid values are DES, AES
(AES128), AES192, AES256, and 3DES(DESEDE).
}}

  • No labels