Monit and PVE - Auto-start KVM on fail.

bliapis

New Member
Jul 14, 2021
5
0
1
45
Hello,

I was experiencing some issues with KVMs freezing - haven't found out the source yet, any help welcomed and decided to start actively monitoring and in case the KVM freezes, restart them.

There is alot of info on the web, although i havent yet found a source with a detailed list of commands. Some commands also seem to be deprecated or removed or simply not working.

Managed to get this one working though and i though i'd share it with the community:

check host Someone with address 192.168.1.120
stop program = "/usr/sbin/qm stop 500"
start program = "/usr/sbin/qm start 500"
if failed ping count 5 size 64 with timeout 5 seconds
then restart

As a preface, i want to add that once you setup Monit/ M/Monit, you have to create a file in /etc/monit/conf-available (if on Debian/Proxmox), add the above statements and change host (Someone) to something that corresponds to the KVM, change IP (192.168.1.120) to the IP of the KVM and ofcourse change the number of the KVM (500 in this example).

Any notes, commends or additions are welcome :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!