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
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