/qemu-ping

A script to ping QEMU VMs and see whether or not they're running or unresponsive.

Primary LanguageGoBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

QEMU Ping

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.

config.yaml

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

Usage

go build

# add to cron
*/1 * * * * /bin/bash -c "cd /opt/QEMU-ping && ./QEMU-ping"