warning and critical if less than

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
lukecolb
Posts: 12
Joined: Thu Apr 11, 2013 9:35 am

warning and critical if less than

Post 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
Last edited by lukecolb on Wed Oct 02, 2013 8:42 am, edited 1 time in total.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: waring and critical if less than

Post by slansing »

Can you share this example in a plugin you are using?
lukecolb
Posts: 12
Joined: Thu Apr 11, 2013 9:35 am

Re: warning and critical if less than

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: warning and critical if less than

Post 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
lukecolb
Posts: 12
Joined: Thu Apr 11, 2013 9:35 am

Re: warning and critical if less than

Post by lukecolb »

Oh cool that was simple adding : to -c220 to make it -c220: reverses it

Thanks
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: warning and critical if less than

Post 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
Former Nagios employee
lukecolb
Posts: 12
Joined: Thu Apr 11, 2013 9:35 am

Re: warning and critical if less than

Post by lukecolb »

Cool i may have to use that elsewhere


:)
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: warning and critical if less than

Post by lmiltchev »

Sounds good. Let us know if you have any more questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked