ICMPmonitor pings a set of hosts, executing per-host, user-defined commands whenever a host begins or ceases to respond. It has been tested on OpenBSD, FreeBSD and Debian Linux.

Configuration is simple. Each host to monitor should have a corresponding entry in the configuration file. Details of each entry may be found in README.md. The example below monitors the host zardoz.subgeniuskitty.com with a ping every 30 seconds, printing A terrible silence echoes... whenever 180 seconds elapse without receiving a ping response.

host = zardoz.subgeniuskitty.com
interval = 30
max_delay = 180
up_cmd = "echo Zardoz returns..."
down_cmd = "echo A terrible silence echoes..."
start_condition = up

Assuming your build environment is suitable, build and execute the example configuration with the following commands.

% make clean && make
% sudo ./icmpmonitor -f ./icmpmonitor.ini
ICMPmonitor: localhost up

ICMPmonitor will execute any command you specify. This requires caution but allows access to the full power of the command line. Potential uses include power cycling ports on a PDC, triggering DNS changes, executing remote commands via SSH, writing to syslog, sending an email, or any other command you can imagine.

For longer monitoring sessions, consider using tmux or screen to wrap ICMPmonitor.

Obtain ICMPmonitor at https://git.subgeniuskitty.com/icmpmonitor/.git.

See README.md for more information.