Hello,
Here I am confused with how nagios pings the devices.
1)Check host alive:
# 'check-host-alive' command definition
define command{
command_name check-host-alive
command_line $USER1$/check_ping -4 -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
}
what is -w 3000.0,80% -c 5000.0,100% -p 5 in the above command
2)# 'check_ping' command definition
define command{
command_name check_ping
command_line $USER1$/check_ping -4 -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}
What is -w $ARG1$ -c $ARG2$ -p 5 in the above command.
How ping works in nagios
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: How ping works in nagios
This isn't "How ping works in nagios" - this is "How monitoring works in nagios"
In the following usage, note the bottom where it describes how the thresholds work:
In your second example you're demonstrating a command that allows you to specify arguments in the service. In this case you would define your check_command in your service as follows to mimic the check-host-alive command:
Make sense? I suggest going over the quick start material:
https://assets.nagios.com/downloads/nag ... start.html
This is the literal check run by the Nagios monitoring box.ceh wrote:check_ping -4 -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
In the following usage, note the bottom where it describes how the thresholds work:
Code: Select all
[root@localhost libexec]# ./check_ping --help
check_ping v2.0.3 (nagios-plugins 2.0.3)
Copyright (c) 1999 Ethan Galstad <[email protected]>
Copyright (c) 2000-2014 Nagios Plugin Development Team
<[email protected]>
Use ping to check connection statistics for a remote host.
Usage:
check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>%
[-p packets] [-t timeout] [-4|-6]
Options:
-h, --help
Print detailed help screen
-V, --version
Print version information
--extra-opts=[section][@file]
Read options from an ini file. See
https://www.nagios-plugins.org/doc/extra-opts.html
for usage and examples.
-4, --use-ipv4
Use IPv4 connection
-6, --use-ipv6
Use IPv6 connection
-H, --hostname=HOST
host to ping
-w, --warning=THRESHOLD
warning threshold pair
-c, --critical=THRESHOLD
critical threshold pair
-p, --packets=INTEGER
number of ICMP ECHO packets to send (Default: 5)
-L, --link
show HTML in the plugin output (obsoleted by urlize)
-t, --timeout=INTEGER
Seconds before connection times out (default: 10)
THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel
time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the
percentage of packet loss to trigger an alarm state.
This plugin uses the ping command to probe the specified host for packet loss
(percentage) and round trip average (milliseconds). It can produce HTML output
linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in
the contrib area of the downloads section at http://www.nagios.org/
Send email to [email protected] if you have questions regarding use
of this software. To submit patches or suggest improvements, send email to
[email protected]Code: Select all
check_command check_ping!3000.0,80%!5000.0,100%https://assets.nagios.com/downloads/nag ... start.html
Re: How ping works in nagios
Hello,
Here I am putting check command as "check_ping -4 -H $HOSTADDRESS$ -w 300.0,80% -c 500.0,100% -p 5" so does the nagios pings only 5 times per minute. The check interval I defined is for 1 minute.
Here I am putting check command as "check_ping -4 -H $HOSTADDRESS$ -w 300.0,80% -c 500.0,100% -p 5" so does the nagios pings only 5 times per minute. The check interval I defined is for 1 minute.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: How ping works in nagios
-5 means send 5 packets (it all happens in a matter of microseconds). In relation to the 80% and 100% warning and critical thresholds this is how they are determined. Losing 4 packets equals 80%.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: How ping works in nagios
Hello,
Its very clear now thank you all.
Its very clear now thank you all.
Re: How ping works in nagios
I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee