Wiki source code of SNMP4J-CLT-Usage
Version 19.1 by Admin on 2022/03/18 00:10
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
19.1 | 1 | === SNMP4J Command-Line Tool, version 3.4.0 === |
2 | |||
3 | Type | ||
4 | |||
5 | {{code}} | ||
6 | java -SNMP4J-CLT.jar help <command> | ||
7 | {{/code}} | ||
8 | |||
9 | for help on a specific command. | ||
10 | Type | ||
11 | |||
12 | {{code}} | ||
13 | java -jar SNMP4J-CLT.jar example <command> | ||
14 | {{/code}} | ||
15 | |||
16 | for examples on a specific command. | ||
17 | Type | ||
18 | |||
19 | {{code}} | ||
20 | java -jar SNMP4J-CLT.jar version | ||
21 | {{/code}} | ||
22 | |||
23 | to see the program version. | ||
24 | Type | ||
25 | |||
26 | {{code}} | ||
27 | java -jar SNMP4J-CLT.jar -L "<license>" "<key>" defaults list | ||
28 | {{/code}} | ||
29 | |||
30 | to register your license //(you then do not need to enter it for subsequent commands)//. | ||
31 | |||
32 | Most commands take agent address and OID list arguments. A list of the | ||
33 | available options for each command is listed after the command description. | ||
34 | The description of all options follows the command list. | ||
35 | |||
36 | Standard parameter formats are: | ||
37 | |||
38 | **<OID>**: | ||
39 | |||
40 | 1. An object identifier is either a dotted notation like '1.3.6.1.2.2.1.0'. | ||
41 | 1. An object name with dotted numeric suffix like 'IF-MIB:ifDescr.0' or 'sysName' (requires MIB information). | ||
42 | 1. An columnar OBJECT-TYPE name with formatted index, e.g. vacmAccessContextMatch."v3group"."".3.'authPriv(3)' (requires MIB information). | ||
43 | |||
44 | **<address>**: [upd:|tcp:]<host>[/<port>] | ||
45 | Host is either an IP address or hostname and port is the SNMP port | ||
46 | of the target SNMP entity. | ||
47 | |||
48 | {{noformat}} | ||
49 | create-snapshot: | ||
50 | create-snapshot <file> <address> <OID> | ||
51 | |||
52 | |||
53 | |||
54 | defaults: | ||
55 | defaults <action> | ||
56 | |||
57 | |||
58 | list | ||
59 | |||
60 | reset | ||
61 | |||
62 | save | ||
63 | |||
64 | |||
65 | |||
66 | dump-snapshot: | ||
67 | dump-snapshot <file> | ||
68 | |||
69 | |||
70 | |||
71 | example: | ||
72 | example <command> | ||
73 | |||
74 | |||
75 | |||
76 | get: | ||
77 | get <address> <OID> [..] | ||
78 | |||
79 | |||
80 | |||
81 | getbulk: | ||
82 | [-Cr <repeaters>] [-Cn <non-repeaters>] getbulk <address> <OID> [..] | ||
83 | |||
84 | |||
85 | |||
86 | getnext: | ||
87 | getnext <address> <OID> [..] | ||
88 | |||
89 | |||
90 | |||
91 | help: | ||
92 | help [command]|all | ||
93 | |||
94 | |||
95 | |||
96 | inform: | ||
97 | inform <address> <OID>={<type>}<value> [..] | ||
98 | |||
99 | |||
100 | |||
101 | license: | ||
102 | license | ||
103 | |||
104 | |||
105 | |||
106 | listen: | ||
107 | listen <address> | ||
108 | |||
109 | |||
110 | |||
111 | mib: | ||
112 | mib <action> [<mib>] | ||
113 | |||
114 | |||
115 | add <mib-file> | ||
116 | |||
117 | |||
118 | del <mib-module-name> | ||
119 | |||
120 | |||
121 | list | ||
122 | |||
123 | |||
124 | |||
125 | oid: | ||
126 | oid [find|find-by-descr] <regex> | ||
127 | |||
128 | |||
129 | find oid find <regex> | ||
130 | |||
131 | |||
132 | find-by-descr oid find-by-descr <regex> | ||
133 | |||
134 | |||
135 | |||
136 | |||
137 | set: | ||
138 | set <address> <OID>={<type>}<value> [..] | ||
139 | |||
140 | |||
141 | |||
142 | smi: | ||
143 | smi <OID> [..] | ||
144 | |||
145 | |||
146 | |||
147 | table: | ||
148 | table <address> <OID> [..] | ||
149 | |||
150 | |||
151 | |||
152 | trap: | ||
153 | [-To <notificationID>] trap <address> <OID>={<type>}<value> [..] | ||
154 | |||
155 | |||
156 | |||
157 | usmDHKey: | ||
158 | usmKey auth|priv|authPriv <address> <oldpwd> <newpwd> [<user>] | ||
159 | |||
160 | |||
161 | auth usmDHKey auth <address> [<user>] | ||
162 | |||
163 | |||
164 | priv usmDHKey priv <address> [<user>] | ||
165 | |||
166 | |||
167 | authPriv usmDHKey authPriv <address> [<user>] | ||
168 | |||
169 | |||
170 | |||
171 | |||
172 | usmDHKickstartInit: | ||
173 | usmDHKickstartInit -privateKeysFile <dhKickstartPrivKeys.properties> <address> [<user> ..] | ||
174 | |||
175 | |||
176 | |||
177 | usmDHKickstartRun: | ||
178 | usmDHKickstartRun -privateKeysFile <dhKickstartPrivKeys.properties> <address> [<user> ..] | ||
179 | |||
180 | |||
181 | |||
182 | usmKey: | ||
183 | usmKey auth|priv|authPriv <address> <old> <new> [<user>] | ||
184 | |||
185 | |||
186 | auth usmKey auth <address> <old> <new> [<user>] | ||
187 | |||
188 | |||
189 | priv usmKey priv <address> <old> <new> [<user>] | ||
190 | |||
191 | |||
192 | authPriv usmKey authPriv <address> <oldpwd> <newpwd> [<user>] | ||
193 | |||
194 | |||
195 | |||
196 | |||
197 | usmUser: | ||
198 | usmUser create|delete <address> <user> [<cloneFromUser> [<cloneFromEngineID>]] | ||
199 | |||
200 | |||
201 | create [-CE <usmUserEngineID>] [-createAndWait] usmUser create <address> <user> [<cloneFromUser> [<cloneFromEngineID>]] | ||
202 | |||
203 | |||
204 | delete [-CE <usmUserEngineID>] usmUser delete <address> <user> | ||
205 | |||
206 | |||
207 | |||
208 | |||
209 | v1trap: | ||
210 | -Te eid -Ts sid -Tg gid -Ta addr v1trap <address> <OID>={<type>}<value> [..] | ||
211 | |||
212 | |||
213 | |||
214 | version: | ||
215 | version | ||
216 | |||
217 | |||
218 | |||
219 | walk: | ||
220 | walk <address> <OID> | ||
221 | |||
222 | |||
223 | |||
224 | xml: | ||
225 | xml <output-dir> | ||
226 | |||
227 | |||
228 | |||
229 | |||
230 | |||
231 | OPTIONS: | ||
232 | -A authPassphrase Set the authentication pass phrase for | ||
233 | authenticated SNMPv3 messages. | ||
234 | -CB Display brief column headers. Common prefixes will | ||
235 | be dropped. | ||
236 | -CE usmUserTableEngineID Set usmUserTableEngineID to be used as part of | ||
237 | the index of the usmUserTable. Default is to use | ||
238 | the authoritative engine ID (set via -e or probed) | ||
239 | as the usmUserTableEngineID. | ||
240 | -CH Do not display column headers. | ||
241 | -Cb bufferSize The number of table rows to buffer before computing | ||
242 | column sizes. | ||
243 | -Cc columnWidth Print table columns with specified character width. | ||
244 | -Cf columnSeparator Separate table columns with the specified separator | ||
245 | string. The table is printed in compact form. By | ||
246 | default columns are separated by spaces and | ||
247 | aligned. | ||
248 | -Ch Display only column headers. | ||
249 | -Ci Prepend the index for each printed row. | ||
250 | -Cil lowerBoundIndex Set the lower bound index for TABLE operations. | ||
251 | -Ciu upperBoundIndex Set the upper bound index for TABLE operations. | ||
252 | -Cl Left justify all cells when printing a table. | ||
253 | -Cn non-repeaters Set the non-repeaters field for GETBULK PDUs. It | ||
254 | specifies the number of supplied variables that | ||
255 | should not be iterated over. The default is 0. | ||
256 | -Cr max-repetitions Set the max-repetitions field for GETBULK PDUs. | ||
257 | This specifies the maximum number of iterations | ||
258 | over the repeating variables. The default is 10. | ||
259 | -Cw Specify the line width when printing tables | ||
260 | -Djavax.net.ssl.keyStore keyStoreFile The key store file with SSL keys for | ||
261 | the TLS protocol. | ||
262 | -Djavax.net.ssl.keyStorePassword keyStorePassword The password for the key | ||
263 | store file with SSL keys for TLS. | ||
264 | -Djavax.net.ssl.trustStore keyStoreFile The trust store file with trusted | ||
265 | (public) SSL keys for the TLS protocol. | ||
266 | -Djavax.net.ssl.trustStorePassword keyStorePassword The password for the | ||
267 | trust store file. | ||
268 | -Dn Do not use any default option values stored in | ||
269 | config. | ||
270 | -E contextEngineID Set the context engine ID used for the SNMPv3 | ||
271 | scoped PDU. The authoritative engine ID will be | ||
272 | used for the context engine ID, if the latter is | ||
273 | not specified. | ||
274 | -L license key Specify license and associated key. The license | ||
275 | info will be saved in the SNMP4J-CLT config file in | ||
276 | your home directory. Enter each license part | ||
277 | enclosed in quotes, for example by '-L "b6 80 4d 68 | ||
278 | 3a 8 c0 f4" "O?fWO-3s"' | ||
279 | -M mibRepositoryPath Set the path to the MIB repository to be used to | ||
280 | resolve object names (OIDs) and parse/format object | ||
281 | values ('repository' is the default). The | ||
282 | repository directory must contain compiled MIB | ||
283 | modules files only. | ||
284 | -Oesc escapeCharacter Escape character used in non-printable OCTET-STRING | ||
285 | values to print them as strings (instead of | ||
286 | hex-strings). Default is '_' and 'x' disables | ||
287 | escaping and enables hex-string output. | ||
288 | -Ors maxSizeRespPDU The maximum size of the response PDU in bytes. | ||
289 | -OtCSV For each SNMP row received exactly one row of comma | ||
290 | separated values will printed to the console where | ||
291 | the first column contains the row index. | ||
292 | -Otd Activates dense table operation mode which improves | ||
293 | table retrieval performance on regular (dense) | ||
294 | tables. This option must not be used with sparse | ||
295 | tables. | ||
296 | -OttCSV Same as -OtCSV except that each row's first column | ||
297 | will report the current time (millis after | ||
298 | 1.1.1970) when the request has been sent. | ||
299 | -Ta agentAddress Set the agent address field of a V1TRAP PDU. The | ||
300 | default value is '0.0.0.0'. | ||
301 | -Te enterpriseOID Set the enterprise OID field of a V1TRAP PDU. | ||
302 | -Tg genericID Set the generic ID for SNMPv1 TRAPs (V1TRAP). The | ||
303 | default is 0 (coldStart). | ||
304 | -To trapOID Sets the trapOID (1.3.6.1.6.3.1.1.4.1.0) of an | ||
305 | INFORM or TRAP PDU. The default is | ||
306 | 1.3.6.1.6.3.1.1.5.1. | ||
307 | -Ts specificID Set the specific ID for V1TRAP PDU. The default is | ||
308 | 0. | ||
309 | -Tu upTime Set the sysUpTime field of an INFORM, TRAP, or | ||
310 | V1TRAP PDU. | ||
311 | -Y privacyPassphrase Set the privacy pass phrase for encrypted SNMPv3 | ||
312 | messages. | ||
313 | -a authProtocol Set the authentication protocol used to | ||
314 | authenticate SNMPv3 messages. Valid values are MD5 | ||
315 | and SHA, SHA224, SHA256, SHA384, and SHA512. | ||
316 | -b bindAddress Set local interface and port to use for outgoing | ||
317 | SNMP messages. By default this is 0.0.0.0/0 (host | ||
318 | chosen port on all local IPv4 addresses). | ||
319 | -bc engineBootCount Set the engine boot count to the specified value | ||
320 | greater or equal to zero. Default is zero. | ||
321 | -c community Set the community for SNMPv1/v2c messages. | ||
322 | -createAndWait Use the createAndWait(5) RowStatus to create new | ||
323 | rows instead of createAndGo(4) which might not be | ||
324 | supported on certain devices. | ||
325 | -d debugLevel Set the global debug level for Log4J logging | ||
326 | output. Valid values are OFF, ERROR, WARN, INFO, | ||
327 | and DEBUG. | ||
328 | -dhp usmDHParameters The octet string (provided as colon separated | ||
329 | hexadecimal string) containing the BER encoded | ||
330 | ASN.1 sequence of prime (p) and base (g) as defined | ||
331 | by RFC2786 usmDHParamters OBJECT-TYPE. The default | ||
332 | value is (without line breaks): | ||
333 | 10:69:02:61:00:ff:ff:ff:ff:ff:ff:ff:ff:c9:0f: | ||
334 | da:a2:21:68:c2:34:c4:c6:62:8b:80:dc:1c:d1:29: | ||
335 | 02:4e:08:8a:67:cc:74:02:0b:be:a6:3b:13:9b:22: | ||
336 | 51:4a:08:79:8e:34:04:dd:ef:95:19:b3:cd:3a:43: | ||
337 | 1b:30:2b:0a:6d:f2:5f:14:37:4f:e1:35:6d:6d:51: | ||
338 | c2:45:e4:85:b5:76:62:5e:7e:c6:f4:4c:42:e9:a6: | ||
339 | 3a:36:20:ff:ff:ff:ff:ff:ff:ff:ff:02:01:02:02: | ||
340 | 01:10 | ||
341 | |||
342 | -dhx diffieHellmanPropertyPrefix The property prefix used with the | ||
343 | privateKeysFile for the usmDHKickstartInit and | ||
344 | usmDHKickstartRun commands. By default | ||
345 | 'org.snmp4j.' is used. | ||
346 | -dtls-version dtlsVersion Specifies the DTLS version to use. Possible | ||
347 | values are DTLSv1.0 and DTLSv1.2 (default). | ||
348 | -e engineID Set the authoritative engine ID of the command | ||
349 | responder used for SNMPv3 request messages. If not | ||
350 | supplied, the engine ID will be discovered. | ||
351 | -f 1|2|3|4 Set the OID output format, where 1 = numeric, 2 = | ||
352 | last name and numeric index, 3 = last name and | ||
353 | formatted index without quoting, and 4 = last name | ||
354 | and formatted index including hex-formatting of | ||
355 | non-printable strings. The default is 4. | ||
356 | -h windowSize Set the window height in rows. If the value is | ||
357 | greater than zero, every windowSize rows the user | ||
358 | is prompted to continue output. Default is zero. | ||
359 | -ilo Do not check for lexicographic ordering errors | ||
360 | while walking a subtree. Using this option may | ||
361 | cause endless looping if an agent does not | ||
362 | implement lexicographic ordering correctly! | ||
363 | -l localEngineID Set the local engine ID of the command generator | ||
364 | and the notification receiver used for SNMPv3 | ||
365 | request messages. This option can be used to avoid | ||
366 | engine ID clashes through duplicate IDs leading to | ||
367 | usmStatsNotInTimeWindows reports. | ||
368 | -m mibModuleName Load the specified MIB module from the MIB | ||
369 | repository specified by the -M option. The | ||
370 | mibModuleName can be a regular expression, e.g. use | ||
371 | 'SNMPv2-.*' to load all MIB modules in the | ||
372 | repository that start with 'SNMPv2-'. | ||
373 | -n contextName Set the target context name for SNMPv3 messages. | ||
374 | Default is the empty string. | ||
375 | -p Dump sent and received packets as hex string. | ||
376 | -r retries Set the number of retries used for requests. A zero | ||
377 | value will send out a request exactly once. Default | ||
378 | is 1. | ||
379 | -rsl low|basic|secure Set the security level strategy for auto-responses | ||
380 | to REPORT PDUs The default is 'low' for better | ||
381 | error handling. Use 'secure' for max. security | ||
382 | (i.e. never send noAuthNoPriv). The basic level is | ||
383 | conforming to RFC 3412 and 3414 allowing | ||
384 | 'noAuthNoPriv' for engine ID discovery and wrong | ||
385 | username reports. | ||
386 | -s Suppress any output on stderr (silent mode). | ||
387 | -t timeout Set the timeout in milliseconds between retries. | ||
388 | Default is 1000 milliseconds. | ||
389 | -tls-cert-fingerprint certFingerprint The fingerprint of the trusted | ||
390 | certificate presented by the remote SNMP engine as | ||
391 | hex string. If the fingerprint does not match, | ||
392 | connection will not be established. Use this option | ||
393 | with the "tls:" or "dtls:" transport domain. | ||
394 | -tls-local-id certAlias The local certificate alias identity which selects | ||
395 | a certificate chain from the local key store. Only | ||
396 | the selected certificate chain will be presented to | ||
397 | the remote SNMP engine. Use this option with the | ||
398 | "tls:" or "dtls:" transport domain. | ||
399 | -tls-peer-id subjectDN The subject DN (e.g., "EMAILADDRESS=email@host.com, | ||
400 | C=US, CN=My Name") of the trusted certificate | ||
401 | presented by the remote SNMP engine ID. Use this | ||
402 | option with the "tls:" or "dtls:" transport domain. | ||
403 | -tls-trust-ca issuerDN The issuer DN (e.g., "Company Name CA") of a | ||
404 | trusted certification authority (CA) presented by | ||
405 | the remote SNMP engine ID for TLS and DTLS. | ||
406 | -tls-version tlsVersion The TLS version to use with the 'tls:' transport | ||
407 | protocol. Currently only 'TLSv1', 'TLSv1.1', and | ||
408 | 'TLSv1.2' are supported with Java 7 or later. | ||
409 | 'TLSv1' is the default which is supported with Java | ||
410 | 6 too. | ||
411 | -u securityName Set the security name for authenticated v3 | ||
412 | messages. | ||
413 | -v 1|2c|3 Set the SNMP protocol version to be used. Default | ||
414 | is 3. | ||
415 | -w consoleWidth Specifies the width of the console output, default | ||
416 | is 80 characters. | ||
417 | -y privacyProtocol Set the privacy protocol to be used to encrypt | ||
418 | SNMPv3 messages. Valid values are DES, AES | ||
419 | (AES128), AES192, AES256, AES192p, AES256p, and | ||
420 | 3DES(DESEDE). The AES protocols that end with 'p' | ||
421 | (for proprietary) are using a non-standardized key | ||
422 | extension algorithm from 3DES. | ||
423 | Up | ||
424 | {{/noformat}} | ||
425 | |||
426 | (% class="auto-cursor-target" %) | ||
427 | \\ |