I noticed that there does not seem to be a simple reset / reboot script for problematic clients so I made one.
Copy / Paste this to autorestart-vm1100.sh using nano
#! /bin/bash
# Replace VM id number and IP address with your own "VM" id number and IP address
ping -c 1 10.168.100.100 &> /dev/null && echo "Ping OK - VM 1100" || /usr/sbin/qm stop 1100 && /usr/sbin/qm start 1100 && echo "No response: Restarting VM 1100"
Remember to:
chmod +x /root/autorestart-vm1100.sh
Add this "oneliner" to run every hour on cron like this...
On your host use crontab -e to add this line:
@hourly /root/autorestart-vm1100.sh
Restart your cron
service cron restart
Copy / Paste this to autorestart-vm1100.sh using nano
#! /bin/bash
# Replace VM id number and IP address with your own "VM" id number and IP address
ping -c 1 10.168.100.100 &> /dev/null && echo "Ping OK - VM 1100" || /usr/sbin/qm stop 1100 && /usr/sbin/qm start 1100 && echo "No response: Restarting VM 1100"
Remember to:
chmod +x /root/autorestart-vm1100.sh
Add this "oneliner" to run every hour on cron like this...
On your host use crontab -e to add this line:
@hourly /root/autorestart-vm1100.sh
Restart your cron
service cron restart
Last edited: