[Nagiosplug-help] How to use negate plugin

Zoran Milenkovic mizoran at galeb.etf.bg.ac.yu
Thu Dec 2 08:27:04 CET 2004


Great!!! Thanks Jeff

If sombody is interested, I'm using it this way:

# 'RecentRebootAlarm' service definition from services.cfg
define service{
        use                               default-service-template
        hostgroup_name                    routers
        service_description               RecentRebootAlarm
        check_command  negated_check_snmp!RFC1213-MIB::sysUpTime.0!public!100000!200000!timeticks
        }

# 'negated_check_snmp' command definition from checkcommands.cfg
# syntax: !hostname!OID!community!warntrshld!crittrshld!unit
define command{
        command_name                    negated_check_snmp
        command_line                    $USER1$/negate 
"/usr/local/nagios/libexec/check_snmp -H $HOSTADDRESS$ -o $ARG1$ -C $ARG2$ 
-w $ARG3$ -c $ARG4$ -l $ARG5$"
        }

and everything's fine and running just in expected way except one little
detail: plugin output is potentially confusing, i.e. if you in your
PROBLEM Alert find plugin output that says *OK* like inhere "Additional
Info: timeticks OK - 9200" but that's not such important :-)


Tnx again,

Zoran Milenkovic, dipl.ing.
sistem in.enjer
______________________________
HK CORES d.o.o.
Makenzijeva 31, Belgrade, Serbia and Montenegro
tel:    +381 11 30 80 451
email: zoran.milenkovic at cores.co.yu

From: "jeff vier" <boinger at tradingtechnologies.com>
To: "Zoran Milenkovic" <mizoran at galeb.etf.bg.ac.yu>
Cc: "nagiosplug-help" <nagiosplug-help at lists.sourceforge.net>; <zoran.milenkovic at cores.co.yu>
Sent: Wednesday, December 01, 2004 4:01 PM
Subject: Re: [Nagiosplug-help] How to use negate plugin


> On Wed, 2004-12-01 at 04:55 -0600, Zoran Milenkovic wrote:
> > Is there anybody who uses negate Nagios plugin for inverting plugin
> > check 
> > results? Would somebody like to share any example of negate plugin
> > usage 
> > or give any sugestions?
> > 
> > I've tryed the following but results are simply the same :-( just as 
> > negate doesnt exist:
> > 
> > 
> > root at monitor:~# su
> > nagios                                                                                                     
> > 
> > sh-2.05b$
> > 
> > sh-2.05b$ /usr/local/nagios/libexec/negate -V 
> > negate (nagios-plugins 1.4.0alpha1) 1.13
> > 
> > sh-2.05b$ /usr/local/nagios/libexec/negate 
> > "/usr/local/nagios/libexec-1.3.1/check_snmp -H 10.0.0.254 -C public 
> > -v 1 -o 1.3.6.1.2.1.1.3.0 -w 300 -c 600"
> > 
> > /usr/local/bin/snmpget -t 1 -r 9 -m ALL -v 1 -c public 10.0.0.254:161 
> > 1.3.6.1.2.1.1.3.0 
> > RFC1213-MIB::sysUpTime.0 = Timeticks: (130293500) 15 days, 1:55:35.00
> > 
> > SNMP CRITICAL - *130293500*
> > 
> > sh-2.05b$ /usr/local/nagios/libexec-1.3.1/check_snmp -H 10.0.0.254 -C 
> > public -v 1 -o 1.3.6.1.2.1.1.3.0 -w 100 -c 200 
> > /usr/local/bin/snmpget -t 1 -r 9 -m ALL -v 1 -c public 10.0.0.254:161 
> > 1.3.6.1.2.1.1.3.0 
> > RFC1213-MIB::sysUpTime.0 = Timeticks: (130295100) 15 days, 1:55:51.00
> > 
> > SNMP CRITICAL - *130295100*
> 
> negate is inverting the return code.  try 'echo $?' right after you run
> the command.
> 
> 





More information about the Help mailing list