SNMP4J Command-Line Tool, version
...
3.4.
...
0
Type
Code Block |
---|
java -SNMP4J-CLT.jar help <command> |
...
No Format |
---|
create-snapshot: create-snapshot <file> <address> <OID> defaults: Creates a snapshot <file> by walking the subtree specified by <OID> at thedefaults <action> list reset agent at <address>.save defaultsdump-snapshot: defaults <action>dump-snapshot <file> example: Manage the default options stored in the SNMP4J-CLT config file in your example <command> get: get <address> <OID> [..] getbulk: 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[-Cr <repeaters>] [-Cn <non-repeaters>] getbulk <address> <OID> [..] getnext: getnext <address> <OID> [..] help: help [command]|all inform: inform <address> <OID>={<type>}<value> [..] license: Set one or more object values in the SNMP agent at <address> with the license listen: listen <address> mib: specifiedmib 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: <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> where <type> is one of the following single [..] smi: smi <OID> [..] table: characterstable enclosed<address> by '{' and '}': i Integer32<OID> [..] trap: [-To <notificationID>] trap <address> <OID>={<type>}<value> [..] usmDHKey: u UnsingedInteger32, Gauge32 usmKey auth|priv|authPriv <address> <oldpwd> <newpwd> [<user>] sauth OCTET STRING usmDHKey auth <address> [<user>] x OCTETpriv STRING specified as hexusmDHKey stringpriv with bytes separated by ':'. <address> [<user>] authPriv d usmDHKey authPriv OCTET STRING specified as decimal string with bytes separated by '.'.<address> [<user>] usmDHKickstartInit: usmDHKickstartInit -privateKeysFile <dhKickstartPrivKeys.properties> <address> [<user> ..] usmDHKickstartRun: nusmDHKickstartRun -privateKeysFile <dhKickstartPrivKeys.properties> Null <address> [<user> ..] usmKey: o usmKey OBJECT IDENTIFIER t TimeTicksauth|priv|authPriv <address> <old> <new> [<user>] aauth IpAddress usmKey auth <address> b<old> 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<new> [<user>] priv usmKey priv <address> <old> <new> [<user>] authPriv usmKey authPriv <address> <oldpwd> <newpwd> [<user>] usmUser: tableusmUser create|delete <address> <OID><user> [<cloneFromUser> [..<cloneFromEngineID>]] Receives tabular datacreate 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[-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: 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 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 authenticated SNMPv3 messages. -CB over the repeating variables. The default is 10. -Cw Display brief column headers. Common prefixes will Specify the line width when printing tables -Djavax.net.ssl.keyStore keyStoreFile The key store file with SSL keys befor dropped. -CE usmUserTableEngineID Set usmUserTableEngineID to be used as part of the TLS protocol. -Djavax.net.ssl.keyStorePassword keyStorePassword The password for the key the index of the usmUserTable. Default is to use store file with SSL keys for TLS. -Djavax.net.ssl.trustStore keyStoreFile theThe authoritativetrust enginestore IDfile (setwith viatrusted -e or probed) (public) SSL keys asfor the usmUserTableEngineIDTLS protocol. -CH Djavax.net.ssl.trustStorePassword keyStorePassword The password for the Do not display column headers. -Cb bufferSize trust store file. -Dn The number of table rows to buffer before computing Do not use any default option values stored in column sizes. -Cc columnWidth Print table columns with specified character widthconfig. -CfE columnSeparator contextEngineID Separate table columns withSet the specifiedcontext separator engine ID used for the SNMPv3 string. The table is printed in compactscoped formPDU. ByThe authoritative engine ID will be default columns are separated by spacesused andfor the context engine ID, if the latter is aligned. -Ch not specified. -L license key DisplaySpecify onlylicense column headers. -Ci and associated key. The license Prepend the index for each printed row. -Cil info lowerBoundIndexwill be saved Setin the lowerSNMP4J-CLT boundconfig indexfile forin TABLE operations. -Ciu upperBoundIndex Set the upper bound index for TABLE operations. -Cl your home directory. Enter each license part Left justify all cells when printing a table. -Cn non-repeaters Set theenclosed non-repeaters fieldin quotes, for GETBULKexample PDUs. It by '-L "b6 80 4d 68 specifies the number of3a supplied8 variablesc0 that f4" "O?fWO-3s"' -M mibRepositoryPath Set the path to the MIB repository to be used to should not be iterated over. The default is 0. -Cr max-repetitions Set theresolve max-repetitionsobject fieldnames for(OIDs) GETBULK PDUs. and parse/format object values This specifies('repository' is the maximum number of iterationsdefault). The over therepository repeatingdirectory variables.must Thecontain defaultcompiled isMIB 10. -Cw Specify the line widthmodules when printing tablesfiles only. -Djavax.net.ssl.keyStore keyStoreFile The key store file with SSL keys for Oesc escapeCharacter Escape character used in non-printable OCTET-STRING values theto TLSprint protocol. them as strings -Djavax.net.ssl.keyStorePassword keyStorePassword The password for the key (instead of hex-strings). Default is '_' and 'x' storedisables file with SSL keys for TLS. -Djavax.net.ssl.trustStore keyStoreFile The trust store file with trusted escaping and enables hex-string output. -Ors maxSizeRespPDU The maximum size (public)of SSLthe keysresponse forPDU thein TLS protocolbytes. -Djavax.net.ssl.trustStorePassword keyStorePassword The password for the OtCSV For each SNMP row received exactly one row of comma trust store file. -Dn separated values will printed to Dothe notconsole usewhere any default option values stored in the first column contains the row configindex. -EOtd contextEngineID Set the context engine ID used for the SNMPv3 Activates dense table operation mode which improves scoped PDU. The authoritative engine ID will be table retrieval performance on regular (dense) used for the context engine ID, if the lattertables. isThis option must not be used with sparse not specified. -L license key tables. -OttCSV Specify license and associated key. The license Same as -OtCSV except that each row's first column info will be saved in the SNMP4J-CLT config file in will report the current time (millis after your home directory. Enter each license part 1.1.1970) when the request has been sent. -Ta agentAddress enclosedSet inthe quotes,agent foraddress examplefield byof '-L "b6 80 4d 68a V1TRAP PDU. The 3adefault 8value c0 f4" "O?fWO-3s"'is '0.0.0.0'. -MTe enterpriseOID mibRepositoryPath Set the path toSet the MIBenterprise repositoryOID tofield beof useda toV1TRAP PDU. -Tg genericID Set the generic ID for SNMPv1 resolve object names (OIDs) and parse/format objectTRAPs (V1TRAP). The values ('repository'default is the0 default(coldStart). The -To trapOID Sets the trapOID (1.3.6.1.6.3.1.1.4.1.0) of an repository directory must contain compiled MIB INFORM or TRAP PDU. The default is modules files only. -Msmi mibRepositoryPath Set the path to the MIB repository to be used to 1.3.6.1.6.3.1.1.5.1. -Ts specificID Set the specific ID for V1TRAP PDU. The default resolveis object names (OIDs) and parse/format object 0. -Tu values ('repository' isupTime the default). The MIB Set the sysUpTime field of an INFORM, TRAP, or repository directory must contain SMI MIB files V1TRAP PDU. -Y privacyPassphrase Set the privacy pass phrase for encrypted SNMPv3 (v1/v2). The file names of the MIB files have to messages. -a authProtocol match their MIB moduleSet namethe orauthentication thereprotocol hasused to be a authenticate SNMPv3 properties file named 'module-index.properties'messages. Valid values are MD5 whichand mapsSHA, toSHA224, theSHA256, moduleSHA384, fileand by SHA512. -b bindAddress Set local interface and port to use for outgoing '<modulename>.path=<path>' entries. -Ors maxSizeRespPDU The maximum size of the response PDU in bytes. -OtCSV SNMP messages. By default this is 0.0.0.0/0 (host For each SNMP row received exactly one row of comma chosen port on all local IPv4 addresses). -bc engineBootCount Set the separatedengine valuesboot will printedcount to the consolespecified wherevalue greater theor firstequal columnto containszero. theDefault rowis indexzero. -Otdc community Set the community for Activates dense table operation mode which improves SNMPv1/v2c messages. -createAndWait Use the createAndWait(5) RowStatus tableto retrievalcreate performancenew on regular (dense) rows instead tables. This option mustof createAndGo(4) which might not be used with sparse supported on certain tablesdevices. -OttCSVd debugLevel Set the global debug level Samefor asLog4J -OtCSVlogging except that each row's first column output. Valid values are OFF, ERROR, willWARN, report the current time (millis after INFO, and 1.1.1970) when the request has been sent. DEBUG. -dhp usmDHParameters The -Taoctet string (provided agentAddressas colon separated Set the agent address field of a V1TRAP PDU. The hexadecimal string) containing the BER encoded default value is '0.0.0.0'. -Te enterpriseOID Set the enterprise OID field of aASN.1 V1TRAPsequence PDU. of prime (p) and -Tgbase (g) as genericIDdefined Set the generic ID for SNMPv1 TRAPs (V1TRAP). The by RFC2786 usmDHParamters OBJECT-TYPE. The default default is 0 (coldStart). -To trapOID value is (without line breaks): Sets the trapOID (1.3.6.1.6.3.1.1.4.1.0) of an 10:69:02:61:00:ff:ff:ff:ff:ff:ff:ff:ff:c9:0f: INFORM or TRAP PDU. The default is da:a2:21:68:c2:34:c4:c6:62:8b:80:dc:1c:d1:29: 1.3.6.1.6.3.1.1.5.1. -Ts specificID Set the specific ID for V1TRAP PDU. The default is 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: 0. -Tu upTime Set the sysUpTime field of an INFORM, TRAP, or 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: V1TRAP PDU. -Y privacyPassphrase Set the privacy pass phrase for encrypted SNMPv3 3a:36:20:ff:ff:ff:ff:ff:ff:ff:ff:02:01:02:02: messages. -a authProtocol01:10 -dhx SetdiffieHellmanPropertyPrefix theThe authenticationproperty protocolprefix used with tothe authenticateprivateKeysFile for SNMPv3the messages.usmDHKickstartInit Validand values are MD5 usmDHKickstartRun commands. By anddefault SHA. -bc engineBootCount Set the engine boot count to the specified value 'org.snmp4j.' is used. -dtls-version dtlsVersion Specifies the DTLS version to use. Possible greater or equal to zero. Default is zero. -c community Setvalues theare communityDTLSv1.0 for SNMPv1/v2c messagesand DTLSv1.2 (default). -createAndWaite engineID Use the createAndWait(5) RowStatus toSet createthe newauthoritative engine ID of the command rows instead of createAndGo(4) which mightresponder notused befor SNMPv3 request messages. If not supported on certain devices. supplied, the -dengine ID will be debugLeveldiscovered. -f Set the global debug level for Log4J logging 1|2|3|4 Set the OID output format, where 1 = numeric, 2 = output. Valid values are OFF, ERROR, WARN, INFO, last name and numeric index, 3 = last name and and DEBUG. -e engineID formatted Setindex thewithout authoritativequoting, engineand ID4 of= thelast commandname responderand usedformatted forindex SNMPv3including request messages. If nothex-formatting of supplied, the engine ID will be discovered. -f 1|2|3|4 non-printable strings. The default is 4. -h windowSize Set the OIDwindow outputheight format,in whererows. 1If =the numeric, 2 =value is lastgreater name and numeric indexthan zero, 3every =windowSize lastrows namethe anduser formattedis indexprompted withoutto quoting,continue andoutput. 4Default = last name is zero. -ilo Do not check for andlexicographic formatted index including hex-formatting ofordering errors non-printable strings. The default is 4. -h windowSizewhile walking a subtree. Using this option may 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 andrepository thespecified notificationby receiverthe used-M foroption. SNMPv3The request messages. This option can be used to avoid mibModuleName can be a regular expression, e.g. use 'SNMPv2-.*' to load engineall IDMIB clashesmodules throughin duplicatethe 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 isconforming 1. to RFC 3412 and -rsl3414 allowing 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 |