Pyng: PING check

Description

PING check uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host.

PING sends 1 packet, and waits 5 seconds to receive a response.

PING requires ping and ping6 commands to be present in $PATH.

Options

PING supports following options, which may be used upon creation of a new check object:

host
Destination host (required)
ipv6
Set to True to request that IPv6 be used for the check. IPv6 ping is used if host contains the ":" character.

In addition, PING supports following generic check settings:

desc
Check description
silent
Information about check runs is not output by certain runners
interval
Number of seconds between check runs
alert
Callable (or a list of callables) to run in order to alert of check status changes
notify
Callable (or a list of callables) to run in order to notify of changes in check's output
run_condition
Callable to run to decide if check run should be skipped
run_threshold
Threshold for mean run time in order to consider check to be degraded
result_filter
Callable to run to filter check command output lines prior to matching check results
on_result
on_first
on_up
on_down
on_degrade
on_restore
on_change
Callable to run with the result of the check on the specified events

Example

# ping ::1 every minute
PING(
    'localhost',
    ipv6=True,
    interval=60
)

# ping ::1 every minute
PING(
    '::1',
    interval=60
)

# ping 127.0.0.1 every minute
PING(
    'localhost',
    interval=60
)
    

Return to Pyng