Page 1 of 1

Inverse Ping Alert

Posted: Wed Dec 19, 2012 9:26 am
by isadmin
We are wanting to monitor our 3G failover on routers. So normally the circuit would be down and has a public IP.
We want alerts when the circuit comes up and is active but dont really want to allow SNMP queries from the outside interface.
Any thoughts? We thought about just an inverse ping but I am not sure how to accomplish that?
Thanks

Re: Inverse Ping Alert

Posted: Wed Dec 19, 2012 12:41 pm
by scottwilkerson
There is a plugin installed with XI by default called negate that can do this

You can create a new command like the following:

link_down

Code: Select all

$USER1$/negate $USER1$/check_icmp -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5 -t 5

Re: Inverse Ping Alert

Posted: Thu Dec 20, 2012 7:51 am
by isadmin
Thanks Scott but it isnt quite working.
The circuit is down right now and should show OK
or does negate somehow just send OK for the Critical Response?

./negate /usr/lib/nagios/plugins/check_icmp -H 166.156.67.150 -w 3000.0 80 -c 5000.0 90 -p 5 -t 5
CRITICAL - 166.156.67.150: rta nan, lost 100% :: 80: rta nan, lost 100% :: 90: rta nan, lost 100%|166.156.67.150rta=0.000ms;3000.000;5000.000;0; 166.156.67.150pl=100%;40;80;; 166.156.67.150rtmax=0.000ms;;;; 166.156.67.150rtmin=0.000ms;;;; 80rta=0.000ms;3000.000;5000.000;0; 80pl=100%;40;80;; 80rtmax=0.000ms;;;; 80rtmin=0.000ms;;;; 90rta=0.000ms;3000.000;5000.000;0; 90pl=100%;40;80;; 90rtmax=0.000ms;;;; 90rtmin=0.000ms;;;;

Re: Inverse Ping Alert

Posted: Thu Dec 20, 2012 8:46 am
by scottwilkerson
you were missing the required % after 80 & 90

Code: Select all

./negate /usr/lib/nagios/plugins/check_icmp -H 166.156.67.150 -w 3000.0 80% -c 5000.0 90% -p 5 -t 5
not

Code: Select all

./negate /usr/lib/nagios/plugins/check_icmp -H 166.156.67.150 -w 3000.0 80 -c 5000.0 90 -p 5 -t 5

Re: Inverse Ping Alert

Posted: Thu Dec 20, 2012 10:03 am
by isadmin
Thanks but I tried that and got these results

/negate /usr/lib/nagios/plugins/check_icmp -H 166.156.67.150 -w 3000.0 80% -c 5000.0 90% -p 5 -t 5
check_icmp: Failed to resolve 80%

Re: Inverse Ping Alert

Posted: Thu Dec 20, 2012 10:42 am
by scottwilkerson
sorry, there was supposed to be a comma in there...

Code: Select all

./negate /usr/lib/nagios/plugins/check_icmp -H 166.156.67.150 -w 3000.0,80% -c 5000.0,100% -p 5 -t 5
Also, if you want it to change the words CRITICAL to OK, do

Code: Select all

./negate -s /usr/lib/nagios/plugins/check_icmp -H 166.156.67.150 -w 3000.0,80% -c 5000.0,100% -p 5 -t 5

Re: Inverse Ping Alert

Posted: Thu Dec 20, 2012 10:45 am
by isadmin
SWEET! Thanks so much Scott that does the trick!