You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: check-plugins/snmp/README.rst
+43-63Lines changed: 43 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,29 +200,29 @@ If needed, get any MIB files ready. Copy them to ``$HOME/.snmp/mibs`` or ``/usr/
200
200
Create an OID list in ``/usr/lib64/nagios/plugins/device-oids/...`` using CSV format. For details, have a look at "Defining a Device" within this document.
201
201
202
202
203
-
Defining a Device
204
-
-----------------
203
+
Defining a Device via CSV file
204
+
------------------------------
205
205
206
206
If you want to define a device-specific list of OIDs, including any calculations, warning and critical thresholds, create a CSV file located at ``device-oids``, using ``,`` as delimiter and ``"`` as quoting character. A minimal example for nearly any device:
|The Object-Identifier from any of your MIB files.
220
-
* | Column 2: Name (String)
221
-
|If provided, the check prints this instead of the OID.
222
-
* | Column 3: Re-Calc (Python code, or empty)
223
-
|Feel free to use any Python Code based on the variables ``value`` and ``values``, which contain the result (always a string) of the SNMPGET operation on the given OID.
224
-
* | Column 4: Unit (String, or empty)
225
-
|This is the "Unit of Measurement", case-insensitiv. One of:
218
+
* | **OID**:
219
+
|String. The Object-Identifier from any of your MIB files.
220
+
* | **Name**:
221
+
|String. If provided, the check prints this instead of the OID.
222
+
* | **Re-Calc**:
223
+
|Python code, or empty. Feel free to use any Python Code based on the variables ``value`` and ``values``, which contain the result (always a string) of the SNMPGET operation on the given OID.
224
+
* | **Unit**:
225
+
|String, or empty. This is the "Unit of Measurement", case-insensitiv. One of:
226
226
227
227
* s - seconds (also us, ms)
228
228
* % - percentage
@@ -237,32 +237,20 @@ The columns in detail:
237
237
* b - bytes
238
238
* bps - bits per second
239
239
240
-
* | Column 5: WARN (Python condition, or empty)
241
-
|The warning condition for the re-calculated or raw ``value``.
242
-
* | Column 6: CRIT (Python condition, or empty)
243
-
|The critical condition for the re-calculated or raw ``value``.
244
-
* | Column 7: Show in first line (Bool, either "False", "True", or empty)
245
-
|Should ``value`` be printed in the first line of the check output?
246
-
* | Column 8: Report Change as (String, either "WARN", "CRIT", or empty)
247
-
|Should a change of ``value`` be reported as ``WARN`` or ``CRIT``? The check stores the initial values on the first run in ``$TEMP/linuxfabrik-monitoring-plugins-snmp.db``.
248
-
* | Column 9: Ignore in Perfdata (Bool, either "False", "True", or empty)
249
-
|By default, all numeric values are automatically returned as perfdata objects. Set to ``True`` to exclude this item from the perfdata list.
|Add warning and critical thresholds to performance data by defining a valid Python tuple - first element for warning, second one for critical. Use double quotes around the tuple because the comma is the separator between the fields. Normally, the values of WARN and CRIT should be repeated here so that the actual thresholds used are written to the performance data.
252
-
253
-
The output would be something like this
254
-
255
-
.. code-block:: text
256
-
257
-
Uptime: 5M 1W
258
-
259
-
Key Value State
260
-
--- ----- -----
261
-
Name BRW38B1DB3B30F4 [OK]
262
-
Location Office [OK]
263
-
Contact The Printer Guy [OK]
264
-
Description Brother NC-350w [OK]
265
-
Uptime 5M 1W [WARNING]
240
+
* | **WARN**:
241
+
|Python condition, or empty. The warning condition for the re-calculated or raw ``value``.
242
+
* | **CRIT**:
243
+
|Python condition, or empty. The critical condition for the re-calculated or raw ``value``.
244
+
* | **Show in first line**:
245
+
|Bool, either "False", "True", or empty. Should ``value`` be printed in the first line of the check output?
246
+
* | **Report Change as**:
247
+
|String, either "WARN", "CRIT", or empty. Should a change of ``value`` be reported as ``WARN`` or ``CRIT``? The check stores the initial values on the first run in ``$TEMP/linuxfabrik-monitoring-plugins-snmp.db``.
248
+
* | **Ignore in Perfdata**:
249
+
|Bool, either "False", "True", or empty. By default, all numeric values are automatically returned as perfdata objects. Set to ``True`` to exclude this item from the perfdata list.
250
+
* | **Perfdata Alert Thresholds**:
251
+
|Python tuple. Add warning and critical thresholds to performance data by defining a valid Python tuple - first element for warning, second one for critical. Use double quotes around the tuple because the comma is the separator between the fields. Normally, the values of WARN and CRIT should be repeated here so that the actual thresholds used are written to the performance data.
252
+
* | **Skip Output**:
253
+
|Bool, either "False", "True", or empty. Should this row be included in the resulting table output? Set this to "True" if you only need the row for calculations.
266
254
267
255
The check divides the OID list automatically into blocks of 25 OIDs per SNMPGET request.
Q: **I get ``Too many object identifiers specified. Only 128 allowed in one request.``**
337
-
338
-
A: Probably your SNMP v3 parameters are incomplete or incorrect.
339
-
340
-
Q: **I get ``add_mibdir: strings scanned in from .snmp/mibs/.index are too large. count = ...``**
341
-
342
-
A: There seems to be a malformed, a duplicated MIB file or one with spaces in its filename within one of your MIB directories.
343
-
344
-
Q: **I get ``Error in packet. Reason: (tooBig) Response message would have been too large.``**
345
-
346
-
A: A "tooBig" response simply means that the SNMP agent tried to generate a response with all requested OID's, but the response grew too big for its buffer, resulting in this error message. To avoid this, we divide your OID list and send a maximum of 25 oids per request each.
347
-
348
-
Q: **Within Icinga, if I acknowledge a value change in WARN or CRIT state, does the plugin returns OK?**
349
-
350
-
A: If you acknowledge a value change in Icinga, the desired WARN or CRIT state remains - due to the fact that SNMP is mostly run against hardware, and you have to check what triggered the change. If everything is fine, delete ``$TEMP/linuxfabrik-monitoring-plugins-snmp.db``. On the next run of the plugin, it will recreate the inventory.
351
-
352
-
353
321
States
354
322
------
355
323
@@ -373,6 +341,18 @@ Troubleshooting
373
341
`IndexError: list index out of range`
374
342
Something is wrong with your CSV file format. Try editing it in LibreOffice Calc, for example, to get the right amount of commas, quotes, etc.
375
343
344
+
Too many object identifiers specified. Only 128 allowed in one request.
345
+
Probably your SNMP v3 parameters are incomplete or incorrect.
346
+
347
+
add_mibdir: strings scanned in from .snmp/mibs/.index are too large. count = ...
348
+
There seems to be a malformed, a duplicated MIB file or one with spaces in its filename within one of your MIB directories.
349
+
350
+
Error in packet. Reason: (tooBig) Response message would have been too large.
351
+
A "tooBig" response simply means that the SNMP agent tried to generate a response with all requested OID's, but the response grew too big for its buffer, resulting in this error message. To avoid this, we divide your OID list and send a maximum of 25 oids per request each.
352
+
353
+
Within Icinga, if I acknowledge a value change in WARN or CRIT state, does the plugin returns OK?
354
+
If you acknowledge a value change in Icinga, the desired WARN or CRIT state remains - due to the fact that SNMP is mostly run against hardware, and you have to check what triggered the change. If everything is fine, delete ``$TEMP/linuxfabrik-monitoring-plugins-snmp.db``. On the next run of the plugin, it will recreate the inventory.
0 commit comments