Skip to content

Instantly share code, notes, and snippets.

@fredsmith
Created May 11, 2011 21:03
Show Gist options
  • Save fredsmith/967354 to your computer and use it in GitHub Desktop.
Save fredsmith/967354 to your computer and use it in GitHub Desktop.
Hadoop Nagios check hdfs health
#! /bin/sh
chk_hdfs=`sudo -u hdfs /usr/bin/hadoop fsck / | grep 'filesystem under path'`
case $chk_hdfs in
*HEALTHY*)
echo "OK - HDFS is healthy"
exit 0
;;
*)
echo "CRITICAL - HDFS is corrupt!"
exit 2
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment