SNMP4J Command-Line Tool, version 3.
...
4.0
Type
Code Block |
---|
java -SNMP4J-CLT.jar help <command> |
...
to register your license (you then do not need to enter it for subsequent commands).
...
...
java -jar snmp4j-clt.jar [<option> [<value>]] command [subcommand] [<parameter>...]
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.
...
No Format |
---|
create-snapshot: create-snapshot <file> <address> <OID> defaults: defaults <action> list reset save dump-snapshot: dump-snapshot <file> example: example <command> get: get <address> <OID> [..] getbulk: [-Cr <repeaters>] [-Cn <non-repeaters>] getbulk <address> <OID> [..] getnext: getnext <address> <OID> [..] help: help [command]|all inform: inform <address> <OID>={<type>}<value> [..] license: license listen: listen <address> mib: mib <action> [<mib>] add <mib-file> del <mib-module-name> list oid: oid [find|find-by-descr] <regex> find oid find <regex> find-by-descr oid find-by-descr <regex> set: set <address> <OID>={<type>}<value> [..] smi: smi <OID> [..] table: table <address> <OID> [..] trap: [-To <notificationID>] trap <address> <OID>={<type>}<value> [..] usmDHKey: usmKey auth|priv|authPriv <address> <old><oldpwd> <new><newpwd> [<user>] auth usmDHKey auth <address> [<user>] priv usmDHKey priv <address> [<user>] authPriv usmDHKey authPriv <address> [<user>] usmDHKickstartInit: usmDHKickstartInit -privateKeysFile <dhKickstartPrivKeys.properties> <address> [<user> ..] usmDHKickstartRun: usmDHKickstartRun -privateKeysFile <dhKickstartPrivKeys.properties> <address> [<user> ..] usmKey: usmKey auth|priv|authPriv <address> <old> <new> [<user>] auth usmKey auth <address> <old> <new> [<user>] priv usmKey priv <address> <old> <new> [<user>] authPriv usmKey authPriv <address> <old><oldpwd> <new><newpwd> [<user>] usmUser: usmUser create|delete <address> <user> [<cloneFromUser> [<cloneFromEngineID>]] create [-CE <usmUserEngineID>] [-createAndWait] usmUser create <address> <user> [<cloneFromUser> [<cloneFromEngineID>]] delete [-CE <usmUserEngineID>] usmUser delete <address> <user> v1trap: -Te eid -Ts sid -Tg gid -Ta addr v1trap <address> <OID>={<type>}<value> [..] version: version walk: walk <address> <OID> xml: xml <output-dir> OPTIONS: -A authPassphrase Set the authentication pass phrase for authenticated SNMPv3 messages. -CB Display brief column headers. Common prefixes will be dropped. -CE usmUserTableEngineID Set usmUserTableEngineID to be used as part of the index of the usmUserTable. Default is to use the authoritative engine ID (set via -e or probed) as the usmUserTableEngineID. -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 -Djavax.net.ssl.keyStore keyStoreFile The key store file with SSL keys for the TLS protocol. -Djavax.net.ssl.keyStorePassword keyStorePassword The password for the key store file with SSL keys for TLS. -Djavax.net.ssl.trustStore keyStoreFile The trust store file with trusted (public) SSL keys for the TLS protocol. -Djavax.net.ssl.trustStorePassword keyStorePassword The password for the trust store file. -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. -OrsOesc escapeCharacter maxSizeRespPDU Escape character Theused maximumin size of the response PDU in bytes. non-printable OCTET-STRING -OtCSV For eachvalues SNMPto rowprint receivedthem exactlyas onestrings row(instead of comma separated values will printed to the console wherehex-strings). Default is '_' and 'x' disables theescaping firstand columnenables contains the row indexhex-string output. -OtdOrs maxSizeRespPDU The maximum size of the response PDU in bytes. -OtCSV Activates dense table operation mode which improves For each SNMP row received exactly one row of comma table retrieval performance on regular (dense) separated values will printed to the console where tables. This option must not be used with sparse the first column contains the row index. -Otd tables. -OttCSV Activates dense table operation mode which improves Same as -OtCSV except that each row's first column table retrieval performance on regular (dense) will report the current time (millis after tables. This option must not be used with sparse 1.1.1970) when the request has been sent. -Ta agentAddress Set the agent address field of a V1TRAP PDUtables. The -OttCSV Same as -OtCSV except that each row's defaultfirst value is '0.0.0.0'. -Tecolumn enterpriseOID Set the enterprise OID field of a V1TRAP PDU. -Tg genericID will report Set the genericcurrent ID for SNMPv1 TRAPs (V1TRAP). Thetime (millis after default is 0 (coldStart)1.1.1970) when the request has been sent. -ToTa trapOIDagentAddress Set the agent address field Setsof thea trapOID (1.3.6.1.6.3.1.1.4.1.0) of anV1TRAP PDU. The INFORMdefault orvalue TRAP PDU. The default is is '0.0.0.0'. -Te enterpriseOID Set the enterprise OID field of a 1.3.6.1.6.3.1.1.5.1.V1TRAP PDU. -TsTg specificIDgenericID Set the specificgeneric ID for SNMPv1 TRAPs (V1TRAP PDU). The default is default is 0 (coldStart). -TuTo upTimetrapOID SetSets the sysUpTime fieldtrapOID (1.3.6.1.6.3.1.1.4.1.0) of an INFORM, TRAP, or INFORM or V1TRAPTRAP PDU. The -Y privacyPassphrase Set the privacy pass phrase for encrypted SNMPv3 default is messages1.3.6.1.6.3.1.1.5.1. -aTs specificID authProtocol Set the authenticationspecific protocolID usedfor toV1TRAP PDU. The default is authenticate SNMPv3 messages. Valid values0. are MD5 -Tu upTime Set the sysUpTime field of an INFORM, TRAP, or and SHA, SHA224, SHA256, SHA384, and SHA512. -b bindAddress V1TRAP SetPDU. local interface and port-Y to use for outgoingprivacyPassphrase Set the privacy pass phrase for encrypted SNMPv3 SNMP messages. By default this is 0.0.0.0/0 (host messages. -a authProtocol Set the authentication protocol used to chosen port on all local IPv4 addresses). -bc engineBootCount Set the engineauthenticate bootSNMPv3 countmessages. toValid thevalues specifiedare valueMD5 greaterand orSHA, equalSHA224, to zero. Default is zeroSHA256, SHA384, and SHA512. -cb community bindAddress Set thelocal communityinterface forand SNMPv1/v2c messages. -createAndWaitport to use for outgoing Use the createAndWait(5) RowStatus to create new SNMP messages. By default this rows instead of createAndGo(4) which might not be is 0.0.0.0/0 (host chosen port on all supportedlocal on certain devicesIPv4 addresses). -dbc engineBootCount debugLevel Set the engine boot count Setto the globalspecified debugvalue level for Log4J logging greater or equal to outputzero. ValidDefault valuesis arezero. OFF, ERROR, WARN, INFO,-c community Set the community for SNMPv1/v2c messages. -createAndWait and DEBUG. Use -dhp usmDHParameters The octet string (provided as colon separated the createAndWait(5) RowStatus to create new rows instead of createAndGo(4) which might not hexadecimalbe string) containing the BER encoded supported on certain devices. ASN.1 sequence of-d prime (p) and basedebugLevel (g) as defined Set the global debug level for Log4J logging by RFC2786 usmDHParamters OBJECT-TYPE. The default output. Valid values are OFF, ERROR, WARN, INFO, value is (without line breaks): and DEBUG. -dhp usmDHParameters The octet string (provided as colon 10:69:02:61:00:ff:ff:ff:ff:ff:ff:ff:ff:c9:0f: separated hexadecimal da:a2:21:68:c2:34:c4:c6:62:8b:80:dc:1c:d1:29: string) containing the BER encoded ASN.1 sequence of prime (p) and base (g) 02:4e:08:8a:67:cc:74:02:0b:be:a6:3b:13:9b:22:as defined 51:4a:08:79:8e:34:04:dd:ef:95:19:b3:cd:3a:43: by RFC2786 usmDHParamters OBJECT-TYPE. The default 1b:30:2b:0a:6d:f2:5f:14:37:4f:e1:35:6d:6d:51:value is (without line breaks): c210:4569:e402:8561:b500:76ff:62ff:5eff:7eff:c6ff:f4:4c:42:e9:a6: ff:ff:ff:c9:0f: da:a2:21:68:c2:34:c4:c6:62:8b:80:dc:1c:d1:29: 02:4e:08:8a:67:cc:74:02:0b:be:a6:3b:13:9b:22: 51:4a:08:79:8e:34:04:dd:ef:95:19:b3:cd:3a:43: 1b:30:2b:0a:6d:f2:5f:14:37:4f:e1:35:6d:6d:51: c2:45:e4:85:b5:76:62:5e:7e:c6:f4:4c:42:e9:a6: 3a:36:20:ff:ff:ff:ff:ff:ff:ff:ff:02:01:02:02: 01:10 -dhx diffieHellmanPropertyPrefix The property prefix used with the privateKeysFile for the usmDHKickstartInit and usmDHKickstartRun commands. By default 'org.snmp4j.' is used. -dtls-version dtlsVersion Specifies the DTLS version to use. Possible 3a:36:20:ff:ff:ff:ff:ff:ff:ff:ff:02:01:02:02: values are DTLSv1.0 and DTLSv1.2 (default). -e engineID 01:10 -dhx diffieHellmanPropertyPrefixSet Thethe propertyauthoritative prefixengine usedID withof the command responder privateKeysFileused for the usmDHKickstartInit and SNMPv3 request messages. If not usmDHKickstartRun commands. By default supplied, the engine ID will be discovered. -f 1|2|3|4 Set 'org.snmp4j.' is used. -dtls-version dtlsVersion Specifies the DTLS version to use. Possible the OID output format, where 1 = numeric, 2 = last name and numeric index, 3 values= arelast DTLSv1.0name and DTLSv1.2 (default). -e engineID Set the authoritative engine ID of the command formatted index without quoting, and 4 = last name responder used for SNMPv3 request messages. If not and formatted index including hex-formatting of supplied, the engine ID will be discovered. non-fprintable strings. The default is 1|2|3|44. -h windowSize Set the OID outputSet format,the wherewindow 1height =in numeric,rows. 2If =the value is last name andgreater numericthan indexzero, 3every =windowSize lastrows namethe anduser formattedis indexprompted withoutto quoting,continue andoutput. 4Default = last name is zero. -ilo Do not check for andlexicographic formattedordering indexerrors including hex-formatting of while walking a non-printable strings. The default is 4.subtree. Using this option may -h windowSize Set the window height in rows. If the value is cause endless looping if an agent does not greater than zero, every windowSize rows the user implement lexicographic ordering correctly! -l localEngineID Set the local engine ID of isthe promptedcommand togenerator continue output. Default is zero. -ilo Doand notthe checknotification forreceiver lexicographicused orderingfor errorsSNMPv3 request whilemessages. walkingThis aoption subtree.can Usingbe thisused optionto mayavoid causeengine endlessID loopingclashes ifthrough anduplicate agentIDs doesleading notto implement lexicographic ordering correctly!usmStatsNotInTimeWindows reports. -lm localEngineIDmibModuleName SetLoad the localspecified engineMIB IDmodule offrom the commandMIB generator repository specified andby the notification-M receiveroption. usedThe for SNMPv3 mibModuleName can requestbe messages.a Thisregular option can be used to avoid expression, e.g. use 'SNMPv2-.*' to load all engineMIB IDmodules clashesin throughthe duplicate IDs leading to repository that start usmStatsNotInTimeWindows reportswith 'SNMPv2-'. -mn contextName mibModuleName LoadSet the specifiedtarget MIBcontext modulename fromfor theSNMPv3 MIBmessages. repositoryDefault specified byis the -Mempty optionstring. The -p Dump sent mibModuleNameand canreceived bepackets aas regular expression, e.g. usehex string. -r retries Set the number 'SNMPv2-.*' to load all MIB modules in the of retries used for requests. A zero value will send repositoryout thata startrequest with 'SNMPv2-'.exactly once. Default -n contextName Set the target context name for SNMPv3 messages. is 1. -rsl low|basic|secure Set the security level strategy for auto-responses Default is the empty string. -p to REPORT PDUs The default is 'low' for better Dump sent and received packets as hex string. -r retries Set the numbererror ofhandling. retriesUse used'secure' for requestsmax. Asecurity zero value will(i.e. never send outnoAuthNoPriv). aThe requestbasic exactlylevel once.is Default conforming isto 1. RFC 3412 and 3414 -rslallowing low|basic|secure Set the security level strategy for auto-responses 'noAuthNoPriv' for engine ID discovery and wrong to REPORT PDUs The default is 'low' for better username reports. -s error handling. Use 'secure' for max. security Suppress any output on stderr (silent mode). -t timeout (i.e. never send noAuthNoPriv). The basicSet levelthe istimeout in milliseconds between retries. conforming to RFC 3412 andDefault 3414is allowing1000 milliseconds. -tls-cert-fingerprint certFingerprint The fingerprint of the trusted 'noAuthNoPriv' for engine ID discovery and wrong certificate presented by the remote SNMP engine as username reports. -s hex string. If the fingerprint does not match, Suppress any output on stderr (silent mode). -t timeout connection will not Setbe theestablished. timeoutUse inthis millisecondsoption between retries. with the "tls:" Default is 1000 millisecondsor "dtls:" transport domain. -tls-local-id certAlias The local certificate alias identity which selects a certificate chain from the local key store. Only the selected certificate chain will be presented to the remote SNMP engine. Use this option with the "tls:" or "dtls:" transport domain. -tls-peer-id subjectDN The subject DN (e.g., "EMAILADDRESS=email@host.com, C=US, CN=My Name") of the trusted certificate presented by the remote SNMP engine ID. Use this option with the "tls:" or "dtls:" transport domain. -tls-trust-ca issuerDN The issuer DN (e.g., "Company Name CA") of a trusted certification authority (CA) presented by the remote SNMP engine ID for TLS and DTLS. -tls-version tlsVersion The TLS version to use with the 'tls:' transport protocol. Currently only 'TLSv1', 'TLSv1.1', and 'TLSv1.2' are supported with Java 7 or later. 'TLSv1' is the default which is supported with Java 6 too. -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, AES192p, AES256p, and 3DES(DESEDE). The AES protocols that end with 'p' (for proprietary) are using a non-standardized key extension algorithm from 3DES. Up |