This was originally written to check the status of a QEMU VM under a Proxmox host via PING, but should work on any system using /usr/sbin/qm.
See example.yaml for an example config. Config should be named config.yaml.
privileged sets whether or not to send a privileged raw ICMP ping (recommended).
vms is a map of VM IDs (integers)
ip ip of VM (this is required).
action action to take (qm reset) on a VM being unresponsive or offline.
timeout grace period of unavailability.
start start if VM status is currently not running?
privileged: true
vms:
100:
ip: 10.255.255.1
action: reset
timeout: 1m
start: true
101:
ip: 10.255.255.2
action: reset
timeout: 1m
start: true
go build
# add to cron
*/1 * * * * /bin/bash -c "cd /opt/QEMU-ping && ./QEMU-ping"