Need help with setting warning and critical ranges

Hi all. I’m having trouble setting effective warning and critical ranges. I’m monitoring some UPS devices, and I want to monitor battery capacity. I currently have it monitoring successfully, but my warnings and critical ranges are not working, at least now how I want them to. As its set up, it constantly issues a critical because the battery capacity > 25. The entry is setup like this…

Arguements are set up as such…

So in plain terms, I want to issue a warning when battery capacity hits 50 or lower, and I want to issue a critical when it hits 25 or lower. I have a feeling I’m missing something simple but I’ve had no luck reading the documentation. Some help would be greatly appreciated :smiley:

could it be you have them the wrong way round?

[quote=“luca”]

[quote]
-w, --warning=INTEGER_RANGE(s)
Range(s) which will not[/quote]

result in a WARNING status
-c, --critical=INTEGER_RANGE(s)
Range(s) which will not result in a CRITICAL status

could it be you have them the wrong way round?[/quote]

I don’t think I know what you mean by the wrong way around…Do you mean switch the position of -w and -c in the command definition? Also, how do I define the “range” I tried doing…

-w $ARG1$
where $ARG1$=“50,26”(I also tried $ARG1$=“50:26”)

-c $ARG2$
where $ARG2$=“25,0”(I also tried $ARG1$=“25:0”)

Any suggestions?

elwood:/usr/local/nagios/libexec# ./check_snmp -H 127.0.0.1 -C public -o .1.3.6.1.2.1.25.5.1.1.1.2919 -w 20:30
SNMP OK - 26 | iso.3.6.1.2.1.25.5.1.1.1.2919=26

elwood:/usr/local/nagios/libexec# ./check_snmp -H 127.0.0.1 -C public -o .1.3.6.1.2.1.25.5.1.1.1.2919 -w 30:40
SNMP WARNING - 26 | iso.3.6.1.2.1.25.5.1.1.1.2919=26

you need to define a range which will NOT generate a warning or critical. with : as a delimiter it looks like the range works correctly.

[quote=“luca”]elwood:/usr/local/nagios/libexec# ./check_snmp -H 127.0.0.1 -C public -o .1.3.6.1.2.1.25.5.1.1.1.2919 -w 20:30
SNMP OK - 26 | iso.3.6.1.2.1.25.5.1.1.1.2919=26

elwood:/usr/local/nagios/libexec# ./check_snmp -H 127.0.0.1 -C public -o .1.3.6.1.2.1.25.5.1.1.1.2919 -w 30:40
SNMP WARNING - 26 | iso.3.6.1.2.1.25.5.1.1.1.2919=26

you need to define a range which will NOT generate a warning or critical. with : as a delimiter it looks like the range works correctly.[/quote]

Ok I think I’ve got it. Just for my clarification…

EX: Monitoring Battery capacity in a UPS device

I want it to show a warning when battery capacity drops below 75%, and a critical when it drops below 50%, so I would set up my ranges as “-w 75:100” and “-c 50:74” correct?

i suspect -c 50:100 would be better or else it could trigger a critical if the battery is above 74 % :slight_smile:

But a simple test should show that