#!/bin/sh # check_virt_doms - Check on various aspects of the virtual host and domains. # Written by Andreas Kasenides # # Inspired b check_virt written by Richard W.M. Jones # #---------------------------------------------------------------------- set -e HOSTNAME=$1 HOSTNAME="perseas" if [ -z "$HOSTNAME" ]; then echo "Usage: $0 hostname" exit 3 ;# Status 3 = UNKNOWN (orange) fi ### status=$(sudo /usr/bin/virsh domstate "$HOSTNAME" | head -1) status=$(sudo /usr/bin/virsh list|sed 's/$/;/') /usr/bin/printf "$status" #status=$(sudo /usr/bin/virsh list|sed 's/$/;\n/') #/usr/bin/printf "$status\n" ####echo "Status: check_virt_doms" exit 0 ##case "$status" in ### running|blocked) ### exit 0 ;# Status 0 = OK (green) ### ;; ### paused) ### exit 1 ;# Status 1 = WARNING (yellow) ### ;; ## shutdown|shut\ off|crashed) ## exit 2 ;# Status 2 = CRITICAL (red) ## ;; ## *) ## exit 2 ;# Status 2 = CRITICAL (red) ###esac