Created
May 11, 2011 21:02
-
-
Save fredsmith/967351 to your computer and use it in GitHub Desktop.
Hadoop Nagios check namenode storage mounts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
function http { (exec 3<>/dev/tcp/$1/$2; echo -e "$3 $4 HTTP/1.0\r\n\r\n" >&3; cat <&3); } | |
ACTIVEMOUNTS=$(http localhost 50070 GET /dfshealth.jsp | grep "Storage Directory" | sed -e 's/<tr>/\n/g' | grep -c Active) | |
if [ $ACTIVEMOUNTS -lt 3 ]; then | |
echo "CRITICAL - $ACTIVEMOUNTS storage directories active" | |
exit 2 | |
fi | |
echo "OK - $ACTIVEMOUNTS storage directories active" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment