-2

We're using Nagios based Op5 to monitor hosts. I've minimum requirement to check a host if it is live or not.

So I simply want to know if a host is live with max RTA of 10 seconds. I don't care how long it takes care to respond to ICMP requests.

I've tried these commands:

time /opt/plugins/check_ping -H ns1.linode.com     -i 1000 -n 30

it exits in 10 seconds with output

CRITICAL - ns1.linode.com: rta nan, lost 100%|rta=0.000ms;200.000;500.000;0; pl=100%;40;80;;

real    0m10.006s
user    0m0.001s
sys     0m0.008s

When I tried with

 time /opt/plugins/check_ping -H ns1.linode.com   -c 10000,100% -w 10000,100%  -i 1000 -n 21

or time /opt/plugins/check_ping -H ns1.linode.com -c 11s,100% -w 11s,100% -i 1000 -n 29

both of these exit in 10.013 and 10.006 seconds respectively. So even changing those option it seems it exits in only 10 seconds max( don't know why). I expect it to be something like value of i * value of n.

AgA
  • 181
  • 1
  • 10

1 Answers1

3

First, read the --help output of check_ping (all of the standard plugins have --help output). Or read the online help page.

So what is the right way to configure Ping command to fail only for RTA beyond 10 second?

It's taking 10 seconds to run because you're not getting any ping replies, and the default timeout of the plugin is 10 seconds. Try it with a host you can actually ping, like something on the local network. To increase this timeout, you use the -t flag.

So in this case what is the difference between -c and -w option?

-c is for critical, -w is for warning. See the --help output of check_ping (all of the standard plugins have --help output). This is a fundamental concept for using Nagios.

Keith
  • 4,637
  • 15
  • 25
  • I did read the -t option. It isn't intuitive for non-admin people. All it says is "Seconds before connection times out" – AgA Dec 19 '14 at 09:09