#! /bin/bash #This Plug-in monitors the Blacklisted node entry on Job tracker UI page , and if there are any Blacklisted nodes present will generate an alert. # Possible Alerts are ( Ok- NO blacklisted alerts , Critical- Not able to access the Job Tracker Status Page, Warning - one or more node got blacklisted ) # Author - Juned Memon #########THIS part is for Nagios ################################ PROGNAME=`/usr/bin/basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` REVISION=`echo '$Revision: 1749 $' | sed -e 's/[^0-9.]//g'` #. $PROGPATH/utils.sh . /usr/local/nagios/libexec/utils.sh ###################################################################### curl_call=`curl -m 10 -sS http://127.0.0.1:50030/machines.jsp?type=blacklisted` pagestatus=$? check=`echo "$curl_call"|grep -i 'There are currently no known blacklisted Task Trackers.'` if [[ "$pagestatus" == "0" ]]; then if [[ "$check" != "There are currently no known blacklisted Task Trackers." ]]; then echo "Warning:A Node is Blacklisted!" exitstatus=$STATE_CRITICAL exit $exitstatus else echo "OK: No Blacklisted nodes found" exitstatus=$STATE_OK exit $exitstatus fi else echo "Critical: Problem Getting Status Page. " exitstatus=$STATE_CRITICAL exit $exitstatus fi ~ ~