Good afternoon everybody,
I wondered if the following was possible:
HP hardware is returning the following values when checked with check_snmp:
1 - unknown/other
2 - ok
3 - warning
4 - critical
I'd want to set my warning level so that a return value of 3 or below 2 results in "warning" and 4 results in "critical". The obvious solution is to append the "-s 2" directive to the check_snmp command, but this will report any status but 2 as "critical". I'd want only 4 as "critical" and anything else (without 2, obviously) as "warning". Is there a way to achieve this?
TIA
Matthias
Setting multiple thresholds
Setting multiple thresholds
Hulluna humpasta taas
Minä olen hulluna humpasta taas
Minen toivu koskaan, luotan voimaan votkan
Hulluna humpasta taas
Minä olen hulluna humpasta taas
Minen toivu koskaan, luotan voimaan votkan
Hulluna humpasta taas
Re: Setting multiple thresholds
Assuming the OID's value is correctly typed as a numeric value and not as something like a string, yeah you can do that. From the manpage:
Here's how the Nagios Plugin Development Guidelines says you should handle ranges in your plugins:
https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT
-w @3: -c 4
If it's a String value, you probably need to leverage regular expressions to get the desired effect.
Code: Select all
-w, --warning=THRESHOLD(s)
Warning threshold range(s)
-c, --critical=THRESHOLD(s)
Critical threshold range(s)
...
- When checking multiple OIDs, separate ranges by commas like '-w 1:10,1:,:20'
https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT
Following the guidelines, this should work (again, assuming a numeric data type for the OIDs value):mksmr wrote:I'd want to set my warning level so that a return value of 3 or below 2 results in "warning" and 4 results in "critical".
-w @3: -c 4
If it's a String value, you probably need to leverage regular expressions to get the desired effect.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/