[Linux-cluster] Nagios check
Maciej Bogucki
maciej.bogucki at artegence.com
Mon Apr 7 08:23:06 UTC 2008
jr napisał(a):
> Hi Everybody,
> i wonder if i'm the first with the need to check the status of GFS /
> cman with nagios.
> Did anyone maybe already write a check script i did not find yet?
> i found one via google, but it basically just did an ls -l on the GFS
> share, and that seems to be a little bit too less for monitoring..
> thanks in advance,
Here [1] is some tool to monitoring GFS. And below You have my own script.
---cut---
#!/bin/bash
ok() {
echo "OK - $*"; exit 0
}
warning() {
echo "WARNING - $*"; exit 1
}
critical() {
echo "CRITICAL - $*"; exit 2
}
unknown() {
echo "UNKNOWN - $*"; exit 3
}
procfsf=/proc/cluster/services
if [ ! -f $procfsf ] ; then
critical "RHCS not running"
fi
procfss=$(cat /proc/cluster/services)
check_clvmd=$(echo "$procfss"|grep "^DLM Lock Space"|grep "clvmd"|head
-1|awk '{print $7}')
check_dlm=$(echo "$procfss"|grep "^DLM Lock Space"|grep -v "clvmd"|head
-1|awk '{print $7}')
check_fenced=$(echo "$procfss"|grep "^Fence Domain"|head -1|awk '{print
$6}')
check_gfs=$(echo "$procfss"|grep "^GFS Mount Group"|head -1|awk '{print
$7}')
if [ -z "$check_clvmd" ] ; then
critical "CLVM not running"
fi
if [ -z "$check_dlm" ] ; then
critical "DLM not running"
fi
if [ -z "$check_fenced" ] ; then
critical "FENCED not running"
fi
if [ -z "$check_gfs" ] ; then
critical "GFS not running"
fi
if [ "$check_clvmd" != "run" ] ; then
warning "CLVM in state $check_clvmd"
fi
if [ "$check_dlm" != "run" ] ; then
warning "DLM in state $check_dlm"
fi
if [ "$check_fenced" != "run" ] ; then
warning "FENCED in state $check_fenced"
fi
if [ "$check_gfs" != "run" ] ; then
warning "GFS in state $check_gfs"
fi
gfs_res=$(echo "$procfss"|grep "^GFS Mount Group"|awk '{print $4}'|xargs
echo)
if [ -z "$gfs_res" ] ; then
critical "RHCS is running without any active resources"
fi
ok "RHCS is running ($gfs_res)"
---cut---
[1] -
http://www.nagiosexchange.org/cgi-bin/page.cgi?g=Detailed%2F2442.html;d=1
Best Regards
Maciej Bogucki
More information about the Linux-cluster
mailing list