nagios plugin script for checking status of mirrored drives via nrpe.

Following script need to be defined in both nagios comamnds and nrpe agent on the client side

#!/bin/bash
# Copyright (c) 2005 Opengaming Israel, Naor Weissmann
# operations: check if all metastat unitx are operational.
#
RETSTR="initial"
RETVAL=0
youtput=`metastat |grep -i stat |grep 'State:' |grep -v 'Okay' |wc -l`

if [ $youtput -eq 0 ]; then
RETVAL=0
RETSTR="OK - All metadevices are stable"
else
RETVAL=2
RETSTR="ERROR - Metadevices need Maintainence"
fi

echo $RETSTR
exit $RETVAL

Comments

Popular posts from this blog

How to set or disable auto-logout on bash shell

How to install PGPool II on PostgreSQL Servers in master-slave architecture + PGPoolAdmin web managment

Setting Filezilla Server on Amazon EC2 instance with passive ftp