Our AIX(this could be used on any *nix) servers all have different drives and different requirements per drive. So every mount point we want monitored is a separate check as the W and C values are different. We also wanted a mechanism to alert the Nagios admins(me) if a new mount point was ever added to a server so I could add a check for it. If you run the check_disk check and exclude and/or ignore everything, then your get an unknown reply. I wrote this to change the unknown into an OK and anything else(meaning a new drive was found) into a critical.



if [[ $(“$@”) == “DISK UNKNOWN – free space:|” ]]
echo “OK: No new drives!”;
exit 0;
echo “CRITICAL: New drives!”;
exit 2;

Nagios Command Definition:

$USER1$/check_new_disk $USER1$/check_nrpe -n -H $HOSTADDRESS$ -t 30 -c check_disk -a ‘$ARG1$’

Example command:

/usr/local/nagios/libexec/check_new_disk /usr/local/nagios/libexec/check_nrpe -n -H -t 30 -c check_disk -a ‘-w 1000 -c 500 -A -x / -x /usr -x /home -x /tmp -x /u01 -x /proc -x /opt -x /tomaxbin -i ‘/var*$’ -i ‘^/notes*$”