Driven Administrator Guide
version 2.1.4Using Nagios Plugins with Driven
Nagios can be used for monitoring IT infrastructure, including a Hadoop cluster. With Nagios, you can either use the Bash shell or the JMX interface to develop custom plugins for monitoring applications through the Driven interface.
For more information about developing Nagios plugins, refer to Nagios online documentation. There are multiple tutorials available in the Nagios community describing how to build Bash-based plugins by calling Driven scope commands.
Nagios Bash Plugin Examples
Here are some simple examples of Nagios Bash plugins developed using the scope CLI:
This is an example of tracking all the applications that did not complete successfully.
#!/bin/bash
driven scope --fields type,id,name,owner,status,failedCause | awk '$5!="SUCCESSFUL" { print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $5 "\t" $6}'
exit 1
To track the longest running applications:
#!/bin/bash
driven scope --fields type,id,name,owner,status,startTime:submitTime,startTime:finishedTime,duration | awk 'BEGIN { OFS = "\t" } NR == 1 { $9 = "diff." } NR >= 3 { $9 = $7 - $6 } 1' | sort -rgk 9 | head -n 10
exit 1
To track the applications that are consuming the most storage on the cluster:
#!/bin/bash
driven scope --fields type,id,name,owner,status,tuplesWritten,bytesWritten | awk '{ print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $5 "\t" $6 "\t" $7}' | sort -rgk 7 | head -n 10
exit 1