Using check_snmp to check if a metric is within a range or not

Nagios and NagiosXI

Sometimes a metric needs to fall between a range to be considered OK, and outside the range (i.e. above and below) for a warning, and outside that range (i.e. above and below) for a critical.

So for example monitoring the input voltage into a APC UPS to ensure it is within a certain range.

So lets say OK is between 220 and 240, WARNING would be between 210 and 219; and 241 to 250. With CRITICAL being less than 209 or greater than 251.

So something like:

< 220 and 240 < means OK

> 219 and < 241 means WARNING

> 209 and < 251 means CRITICAL.

To configure the Nagios check use the following, this example pulls out the input voltage from the UPS:

$USER1$/check_snmp -H 172.17.1.15 -o .1.3.6.1.4.1.318.1.1.1.3.2.1.0 -C community -w 219:241 -c 209:251

So some examples if the input voltage is:

230v = OK (within the range of 220 to 240)

218v = WARNING (below the range of 219 for warning)

255v = CRITICAL (above the range of 251 for warning)

Leave a Reply

Your email address will not be published. Required fields are marked *