Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_xen

Rating
2 votes
Favoured:
0
Hits
96224
Files:
FileDescription
check_xenCheck_Xen Shell script
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Checks a xen virtual host to make sure it is up and running
This is a simple plugin that checks the status of the xen virtual host

if the status is running or blocking it will return an OK
if the status is Paused it will return a Warning
if the status is Shutdown, Crashed, or Dieing it will return a Critical
If the host does not exist it will return an Unknown.

The only option is -m and the virtual host name.

This is released under the GNU License Mod it and redistribute it if you like.
Reviews (2)
bymhd-ali, April 22, 2013
- use $DATA instead of do the command again in every status
- add Shutoff status "because when the virtual host if off it'll appear nothing"

DATA=`xm list $NAME | tail -1`
R=`echo "$DATA" | cut -c 64`
B=`echo "$DATA" | cut -c 65`
P=`echo "$DATA" | cut -c 66`
S=`echo "$DATA" | cut -c 67`
C=`echo "$DATA" | cut -c 68`
D=`echo "$DATA" | cut -c 69`

if [ -z $R ] || [ -z $B ] || [ -z $B ] || [ -z $P ] || [ -z $C ] || [ -z $D ]; then
echo "Critical - Virtual System is Shutoff"
exit 2
fi

if [ $R = "r" ] || [ $B = "b" ]; then
echo "OK - Virtual System is Up"
exit 0
fi

if [ $P = "p" ]; then
echo "Warning - Virtual System is Paused"
exit 1
fi

if [ $S = "s" ] || [ $C = "c" ] || [ $D = "d" ]; then
echo "Critical - Virtual System is Down"
exit 2

fi
byDaB., February 5, 2013
--- check_xen.sh 2013-02-05 16:22:02.000000000 +0000
+++ check_xen.sh.org 2013-02-05 16:19:19.000000000 +0000
@@ -30,12 +30,12 @@
exit 3
fi
DATA=`xm list $NAME`
-R=`xm list $NAME | tail -1 | cut -c 64`
-B=`xm list $NAME | tail -1 | cut -c 65`
-P=`xm list $NAME | tail -1 | cut -c 66`
-S=`xm list $NAME | tail -1 | cut -c 67`
-C=`xm list $NAME | tail -1 | cut -c 68`
-D=`xm list $NAME | tail -1 | cut -c 69`
+R=`xm list test | tail -1 | cut -c 64`
+B=`xm list test | tail -1 | cut -c 65`
+P=`xm list test | tail -1 | cut -c 66`
+S=`xm list test | tail -1 | cut -c 67`
+C=`xm list test | tail -1 | cut -c 68`
+D=`xm list test | tail -1 | cut -c 69`

if [ $R == "r" ] || [ $B == "b" ]; then
echo "OK - Virtual System is Up"