Hi,
I have a few VMs that sometimes randomly stop respond. I have no idea why this happens. I've tried to look at it, but failed to find answer. So I'm thinking about doing script pings VM once every 30minutes to check that it's online, if not then restart VM.
First of all I'm not the best coder, but here's what I've come up with so far:
#! /bin/bash
case "ping -c 1 192.168.1.xxx" in
0) echo "Restarting VM:"
qm restart 10x
;;
1) echo "no problems detected"
;;
esac
Fairly simple bash script which I'm planing to run with cronjob every 30minutes.
Now I want to ask if you have any better suggestions? Is there more optimal way of doing this?
I'm open for any suggestions.
Thank you
I have a few VMs that sometimes randomly stop respond. I have no idea why this happens. I've tried to look at it, but failed to find answer. So I'm thinking about doing script pings VM once every 30minutes to check that it's online, if not then restart VM.
First of all I'm not the best coder, but here's what I've come up with so far:
#! /bin/bash
case "ping -c 1 192.168.1.xxx" in
0) echo "Restarting VM:"
qm restart 10x
;;
1) echo "no problems detected"
;;
esac
Fairly simple bash script which I'm planing to run with cronjob every 30minutes.
Now I want to ask if you have any better suggestions? Is there more optimal way of doing this?
I'm open for any suggestions.
Thank you