check_ping
Checks the ICMP ping connection.
Implementation
| Windows | Linux | FreeBSD | macOS |
|---|
| ✅ | ✅ | ✅ | ✅ |
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, maximum: 50). |
Attributes
Filter Keywords
Use these attributes 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'
}