Possible feature request: KVM Watchdog

faceless

New Member
Jul 4, 2009
25
0
1
Hi there

We have a KVM host which keeps falling into a kernel panic. Is there any way to check for this and reboot he server if this happens - kind of a "virtual Watchdog timer"? If not, any chance of getting one in the next release?

Yes, I know fixing it so the panic doesn't happen is a better option. This requires more work and we don't have the time to research this right now.

Cheers... Mike
 
Try adding this script to cron job:

Code:
#!/bin/bash

KVM_IP=x.x.x.x
VMID=xxx

PING=$(which ping)
QM=$(which qm)

is_ip_up() {
SERVERIP="$1"
$PING -c 3 $SERVERIP  | grep "bytes from"
[[ "$?" -ne "1" ]] && return 0 || return 1
}

if (is_ip_up "$KVM_IP" > /dev/null 2>&1)
then
 echo "OK!"
else
 echo "Not ok! Restarting"
 $QM stop $VMID
 sleep 3
 $QM start $VMID
fi