[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Linux-cluster] Nagios check



Hi Maciej,
thanks a lot for your script. If you look at [1], i'm the guy that had
commented on that ;)
I don't seem to have /proc/cluster? is that a rhel4 specific thing
maybe? or do i need to load something first?

johannes


Am Montag, den 07.04.2008, 10:23 +0200 schrieb Maciej Bogucki:
> 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
> 
> --
> Linux-cluster mailing list
> Linux-cluster redhat com
> https://www.redhat.com/mailman/listinfo/linux-cluster


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]