check_ping
Checks the ICMP ping connection.
Implementation
| Windows | Linux | FreeBSD | MacOSX |
|---|
| ✅ | ✅ | ✅ | ✅ |
Argument Defaults
| Argument | Default Value |
|---|
| filter | none |
| warning | rta > 1000 || pl > 30 |
| critical | rta > 5000 || pl > 80 |
| empty-state | 3 (UNKNOWN) |
| empty-syntax | %(status) - could not get any ping data |
| top-syntax | %(status) - %(list) |
| ok-syntax | |
| detail-syntax | Packet loss = %(pl)%{{ IF rta != ’’ }}, RTA = %(rta)ms{{ END }} |
Check Specific Arguments
| Argument | Description |
|---|
| -4 | Force using IPv4. |
| -6 | Force using IPv6. |
| -t | timeout in seconds for each ICMP ECHO packet |
| host | host name or IP address to ping |
| packets | number of ICMP ECHO packets to send (default: 5) |
Attributes
Filter Keywords
these can be used in filters and thresholds (along with the default attributes):
| Attribute | Description |
|---|
| host_name | host name ping was sent to. |
| ttl | time to live. |
| sent | number of packets sent. |
| received | number of packets received. |
| rta | average round trip time in milliseconds. |
| pl | packet loss in percent. |
Examples
Default Check
check_ping host=localhost
OK - Packet loss = 0%, RTA = 0.113ms |...
Example using check_snclient and Naemon
Naemon Config
define command{
command_name check_snclient
command_line $USER1$/check_snclient -k -p 'your-password' -u 'https://$HOSTADDRESS$:8443' $ARG1$ $ARG2$
}
define service {
host_name testhost
service_description check_ping
use generic-service
check_command check_snclient!check_ping!'host=localhost' 'warn=rta > 1000 || pl > 30' 'crit=rta > 5000 || pl > 80'
}