SNMP4J Command-Line Tool, version
...
3.4.
...
0
Type
Code Block |
---|
java -SNMP4J-CLT.jar help <command> |
...
Standard parameter formats are:
<OID>:
- An object identifier is either a dotted notation like '1.3.6.1.2.2.1.0
...
- '.
...
- An object name
...
- with dotted numeric suffix like 'IF-MIB:ifDescr.0' or 'sysName' (requires MIB information).
- An columnar OBJECT-TYPE name with formatted index, e.g. vacmAccessContextMatch."v3group"."".3.'authPriv(3)' (requires MIB information).
<address>: *<address>*: \ [upd:|tcp:\]<host>\[/<port>\]
Wiki Markup
Host is either an IP address or hostname and port is the SNMP port
of the target SNMP entity.
No Format |
---|
create-snapshot: create-snapshot <file> <address> <OID> defaults: Creates a snapshot <file> by walking the subtree specified by <OID> at the defaults <action> list reset save dump-snapshot: agent at <address>.dump-snapshot <file> defaultsexample: defaults <action> example <command> get: Manageget the<address> default options stored in the SNMP4J-CLT config file in your home directory. <action> 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> [..] 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> [..] 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> [..] 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>={<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>={<type>}<value> where <type> is one of the following single characters enclosed by '{' 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. list: List all MIB modules in the MIB repository specified by -M or -Msmi. oid: oid [find|find-by-descr] <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>={<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>={<type>}<value> where <type> is one of the following single characters enclosed by '{' 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. smi: smi <OID> [..] Dump the SMI definition of the MIB object specified by the OID parameter(s). table: table <address> <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>={<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>={<type>}<value> where <type> is one of the following single characters enclosed by '{' 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. usmKey: usmKey auth|priv|authPriv <address> <old> <new> [<user>] Change the key(s) of an USM user. This command requires the usage of a SNMPv3 user, thus the options "-v 3" and "-u <user>" are mandatory. auth: usmKey auth <address> <old> <new> [<user>] Change the authentication key (passphrase) of the current (-u user) or the specified <user>. priv: usmKey priv <address> <old> <new> [<user>] Change the privacy key (passphrase) of the current (-u user) or the specified <user>. authPriv: usmKey authPriv <address> <old> <new> [<user>] Change both, the authentication and the privacy key (passphrase) of the current (-u user) or the specified <user>. usmUser: usmUser create|delete <address> <user> [<cloneFromUser> [<cloneFromEngineID>]] Create and delete entries in the USM user table. This command requires the usage of a SNMPv3 user, thus the options "-v 3" and "-u <user>" are mandatory. create: [-CE <usmUserEngineID>] [-createAndWait] usmUser create <address> <user> [<cloneFromUser> [<cloneFromEngineID>]] Create an USM <user> at the SNMP entity identified by <address>. If <cloneFromUser> is not specified then the new user will be cloned from the user specified with the -u option (which is mandatory for this command), otherwise the <cloneFormUser> is used. The <cloneFromEngineID> can be specified if the engine ID of the template user does not match the <usmUserEngineID> and/or does not match theauthoritative engine ID of the agent. delete: [-CE <usmUserEngineID>] usmUser delete <address> <user> Delete an USM user from the USM of a SNMPv3 entity. v1trap: -Te eid -Ts sid -Tg gid -Ta addr v1trap <address> <OID>={<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>={<type>}<value> where <type> is one of the following single characters enclosed by '{' 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. 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<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> <oldpwd> <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> <oldpwd> <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. -Oesc escapeCharacter Escape character used in non-printable OCTET-STRING values to print them as strings (instead of hex-strings). Default is '_' and 'x' disables escaping and enables hex-string output. -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 authenticated SNMPv3 messages. -CB 1.1.1970) when the request has been sent. -Ta agentAddress Set the agent address field Displayof briefa columnV1TRAP headersPDU. CommonThe prefixes will default value be droppedis '0.0.0.0'. -CETe usmUserTableEngineIDenterpriseOID Set usmUserTableEngineID to be usedSet asthe partenterprise ofOID field of a V1TRAP PDU. -Tg genericID Set the generic ID for SNMPv1 the index of the usmUserTable. Default is to use TRAPs (V1TRAP). The default is 0 the(coldStart). authoritative engine ID (set via -eTo or probed) trapOID Sets the trapOID (1.3.6.1.6.3.1.1.4.1.0) of an as the usmUserTableEngineID. -CH INFORM or TRAP PDU. The default is Do not display column headers. -Cb bufferSize The number of table rows to buffer before computing 1.3.6.1.6.3.1.1.5.1. -Ts specificID Set the specific ID for V1TRAP PDU. The default is column sizes. -Cc columnWidth Print table columns with specified character width0. -CfTu columnSeparatorupTime Separate table columns with the specified separator Set the sysUpTime field of an INFORM, TRAP, or string. The table is printed in compact form. By V1TRAP PDU. -Y privacyPassphrase Set the privacy pass phrase for encrypted SNMPv3 default columns are separated by spaces and messages. -a authProtocol Set aligned. the authentication protocol used -Chto Display only column headers. -Ci authenticate SNMPv3 messages. Valid values are MD5 Prepend the index for each printed row. -Cil lowerBoundIndex Setand theSHA, lowerSHA224, boundSHA256, indexSHA384, forand TABLE operationsSHA512. -Ciub upperBoundIndexbindAddress Set the upper bound indexSet forlocal TABLEinterface operations. and port to use -Clfor outgoing Left justify all cells when printing a table. SNMP messages. -CnBy default this non-repeaters Set the non-repeaters field for GETBULK PDUs. It is 0.0.0.0/0 (host chosen port on all local IPv4 addresses). specifies-bc the number ofengineBootCount supplied variables thatSet the engine boot count to the specified value should not be iterated over. The default is 0. greater or equal to -Crzero. Default max-repetitions is zero. Set the max-repetitionsc field for GETBULK PDUs.community Set the community for SNMPv1/v2c messages. -createAndWait Use This specifies the maximum number of iterations the createAndWait(5) RowStatus to create new rows overinstead the repeating variables. The default is 10.of createAndGo(4) which might not be -Cw Specify the line widthsupported whenon printingcertain tablesdevices. -Dn d debugLevel Set the global Dodebug notlevel usefor anyLog4J defaultlogging option values stored in output. Valid values are config. -EOFF, ERROR, WARN, INFO, contextEngineID Set the context engine ID used for the SNMPv3 and DEBUG. -dhp usmDHParameters The octet string (provided as colon scopedseparated PDU. The authoritative engine ID will be hexadecimal string) containing the BER encoded used for the context engine ID, if the latter is ASN.1 sequence of prime (p) and base (g) as defined not specified. -L license key Specify license and associated key. The license by RFC2786 usmDHParamters OBJECT-TYPE. The default info will be saved in the SNMP4J-CLT config filevalue in is (without line breaks): your home directory. Enter each license part 10:69:02:61:00:ff:ff:ff:ff:ff:ff:ff:ff:c9:0f: enclosed in quotes, for example by '-L "b6 80 4d 68 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: 3a 8 c0 f4" "O?fWO-3s"' -M mibRepositoryPath Set the path to the MIB repository to be used to 51:4a:08:79:8e:34:04:dd:ef:95:19:b3:cd:3a:43: resolve object names (OIDs) and parse/format object1b:30:2b:0a:6d:f2:5f:14:37:4f:e1:35:6d:6d:51: values ('repository' is the default). The c2:45:e4:85:b5:76:62:5e:7e:c6:f4:4c:42:e9:a6: repository directory must contain compiled MIB 3a:36:20:ff:ff:ff:ff:ff:ff:ff:ff:02:01:02:02: modules files only.01:10 -Msmidhx mibRepositoryPath SetdiffieHellmanPropertyPrefix theThe pathproperty toprefix theused MIB repository to be used towith the resolveprivateKeysFile objectfor namesthe (OIDs)usmDHKickstartInit and parse/format object values ('repository' is the default). The MIB usmDHKickstartRun commands. By default repository directory must contain SMI MIB files 'org.snmp4j.' is used. -dtls-version dtlsVersion Specifies the DTLS version to use. Possible (v1/v2). The file names of the MIB files have to values are DTLSv1.0 and DTLSv1.2 (default). -e match their MIBengineID module name or there has to be a Set the authoritative engine ID of the command properties file named 'module-index.properties' responder used for SNMPv3 request messages. If not which maps to the module file by supplied, the engine ID will be discovered. -f 1|2|3|4 '<modulename>.path=<path>' entries. -Ors maxSizeRespPDU The maximum size of the response PDU in bytes. -OtCSV Set the OID output format, where 1 = numeric, 2 = last Forname eachand SNMPnumeric rowindex, received3 exactly= onelast rowname ofand comma formatted separatedindex valueswithout willquoting, printedand to4 the= consolelast wherename theand firstformatted columnindex containsincluding thehex-formatting rowof index. -Otd Activates dense table operation mode which improves non-printable strings. The default is 4. -h windowSize Set the window height in rows. If the value is table retrieval performance on regular (dense) greater than zero, every windowSize rows tables.the Thisuser option must not be used with sparse is prompted to continue output. Default is tableszero. -OttCSVilo Same as -OtCSVDo exceptnot thatcheck eachfor row'slexicographic firstordering columnerrors willwhile walking reporta thesubtree. currentUsing timethis (millisoption aftermay 1.1.1970) when the request has been sent. -Ta agentAddress cause endless looping if an agent does not Set the agent address field of a V1TRAP PDU. The implement lexicographic ordering correctly! -l localEngineID default value is '0.0.0.0'. -Te enterpriseOID Set the local engine ID of the command generator Set the enterprise OID field of a V1TRAP PDU. -Tg genericID Setand the notification genericreceiver IDused for SNMPv1 TRAPs (V1TRAP). The SNMPv3 defaultrequest ismessages. 0 (coldStart). -To trapOIDThis option can be used to avoid Sets the trapOID (1.3.6.1.6.3.1.1.4.1.0) of an engine ID clashes through duplicate IDs leading to INFORM or TRAP PDU. The default is usmStatsNotInTimeWindows reports. -m mibModuleName Load the specified 1.3.6.1.6.3.1.1.5.1. -TsMIB module from the MIB specificID Set the specific ID for V1TRAP PDU. The default is repository specified by the -M option. The 0. -Tu upTime mibModuleName can be a regular Set the sysUpTime field of an INFORM, TRAP, or expression, e.g. use 'SNMPv2-.*' to load all MIB modules in V1TRAPthe PDU. -Y privacyPassphrase Set the privacy pass phrase for encrypted SNMPv3 repository that start with 'SNMPv2-'. -n contextName messages. Set the -atarget context name for authProtocolSNMPv3 messages. Set the authentication protocol used to Default is the empty string. -p authenticate SNMPv3 messages. Valid values are MD5 Dump sent and received packets as hex string. -r andretries SHA. -bc engineBootCount Set the enginenumber bootof countretries toused thefor specifiedrequests. valueA zero value greater or equal to zerowill send out a request exactly once. Default is zero. -c community Set the community for SNMPv1/v2c messages. -createAndWaitis 1. -rsl low|basic|secure UseSet the createAndWait(5) RowStatus to create new security level strategy for auto-responses to rowsREPORT insteadPDUs of createAndGo(4) which might not beThe default is 'low' for better supported on certain devices. -d debugLevel error handling. Use 'secure' for max. security Set the global debug level for Log4J logging (i.e. never send noAuthNoPriv). The basic level is output. Valid values are OFF, ERROR, WARN, INFO, conforming to RFC 3412 and 3414 allowing and DEBUG. -e engineID Set the'noAuthNoPriv' authoritativefor engine ID ofdiscovery theand commandwrong responder used for SNMPv3 request messages. If not username reports. -s Suppress supplied, the engine ID will be discoveredany output on stderr (silent mode). -ht timeout windowSize Set the timeout windowin heightmilliseconds inbetween rowsretries. If the value is Default is 1000 milliseconds. greater than zero, every windowSize rows -tls-cert-fingerprint certFingerprint The fingerprint of the usertrusted certificate ispresented promptedby tothe continueremote output.SNMP Defaultengine isas zero. -ilo hex Dostring. notIf checkthe forfingerprint lexicographicdoes orderingnot errorsmatch, connection whilewill walkingnot abe subtreeestablished. UsingUse this option may causewith endless looping if an agent does not the "tls:" or "dtls:" transport domain. -tls-local-id certAlias The local certificate alias identity which selects implement lexicographic ordering correctly! -l localEngineID a certificate chain Setfrom the local enginekey IDstore. ofOnly the command generator the selected certificate and thechain notificationwill receiverbe usedpresented forto SNMPv3 the remote requestSNMP messagesengine. Use Thisthis option with the can be used to avoid "tls:" or "dtls:" transport domain. engine ID clashes through duplicate IDs leading to -tls-peer-id subjectDN The subject DN (e.g., "EMAILADDRESS=email@host.com, usmStatsNotInTimeWindows reports. -m mibModuleName C=US, CN=My Name") of the trusted certificate Load the specified MIB module from the MIB presented by the remote SNMP engine ID. Use this repository specified by the -M option. The option with the "tls:" or "dtls:" transport domain. mibModuleName can be a regular expression, -tls-trust-ca issuerDN The issuer DN (e.g., use "Company Name CA") of a 'SNMPv2-.*' to load all MIB modules in the trusted certification authority (CA) presented by repository that start with 'SNMPv2-'. -n the remote contextNameSNMP engine ID for TLS and DTLS. Set the target context name for SNMPv3 messages. -tls-version tlsVersion The TLS version to use with the 'tls:' transport Default is the empty string. protocol. Currently -p only 'TLSv1', 'TLSv1.1', and Dump sent and received packets as hex string. -r retries 'TLSv1.2' are supported with Java 7 or later. Set the number of retries used for requests. A zero 'TLSv1' is the default which is supported with Java value will send out a request exactly once. Default 6 too. -u securityName Set the issecurity 1. name for authenticated v3 -s Suppress any output on stderr (silent mode)messages. -tv 1|2c|3 timeout Set the SNMP timeoutprotocol inversion millisecondsto betweenbe retriesused. Default Default is 1000 milliseconds3. -uw securityNameconsoleWidth SetSpecifies the width securityof namethe forconsole authenticatedoutput, v3default is messages80 characters. -vy 1|2c|3 privacyProtocol Set the SNMPprivacy protocol version to be used. to Defaultencrypt isSNMPv3 3. -wmessages. Valid values are DES, AES consoleWidth Specifies the width of the console output, default (AES128), AES192, AES256, AES192p, AES256p, and is 80 characters. -y privacyProtocol Set the privacy protocol to be used to encrypt3DES(DESEDE). The AES protocols that end with 'p' SNMPv3 messages. Valid values are DES, AES(for proprietary) are using a non-standardized key (AES128), AES192, AES256, and 3DES(DESEDE). extension algorithm from 3DES. Up |