Page 1 of 1

warning and critical if less than

Posted: Wed Oct 02, 2013 8:36 am
by lukecolb
Hi

I've not been able to work out or find how to do this.

Does anyone know how you set you warning levels to be warning if less than say ten and critical if less than 5

Thanks


Luke

Re: waring and critical if less than

Posted: Wed Oct 02, 2013 8:37 am
by slansing
Can you share this example in a plugin you are using?

Re: warning and critical if less than

Posted: Wed Oct 02, 2013 8:44 am
by lukecolb
The command is

# 'snmp_ups_voltage_in' command definition
define command{
command_name snmp_ups_voltage_in
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.3.2.1.0 -l '\Input Voltage\' -u '\Volts\'
}


I would want it to go critical if it is below 220

Re: warning and critical if less than

Posted: Wed Oct 02, 2013 9:11 am
by slansing
If the plugin itself does not support the ability to reverse this, then you can not do that. Have you looked at check_snmp's usage? To do so run:

Code: Select all

/usr/local/nagios/libexec/check_snmp -h

Re: warning and critical if less than

Posted: Wed Oct 02, 2013 9:28 am
by lukecolb
Oh cool that was simple adding : to -c220 to make it -c220: reverses it

Thanks

Re: warning and critical if less than

Posted: Wed Oct 02, 2013 9:35 am
by tmcdonald
EDIT: slansing beat me to it, but here's an alternative that may work if a plugin does not support it natively:

You could also use the Negate plugin to turn a CRITICAL into an OK and vice versa

http://assets.nagios.com/downloads/nagi ... Plugin.pdf

Re: warning and critical if less than

Posted: Wed Oct 02, 2013 9:47 am
by lukecolb
Cool i may have to use that elsewhere


:)

Re: warning and critical if less than

Posted: Wed Oct 02, 2013 10:54 am
by lmiltchev
Sounds good. Let us know if you have any more questions.