Skip to content

Instantly share code, notes, and snippets.

@discreet
Last active August 29, 2015 14:01
Show Gist options
  • Save discreet/f28c60944e01249b08ca to your computer and use it in GitHub Desktop.
Save discreet/f28c60944e01249b08ca to your computer and use it in GitHub Desktop.
Drive Path for NRPE
#!/bin/bash
#This script pulls the drive path and sets the check command for NRPE. It is outputted to a file that is included int he nrpe.cfg file.
rm -f check_disk.cfg 2> /dev/null;
df -H | grep "/dev" | awk {'print $1'}> out.txt
sed -i "s|tmpfs|/dev/shm|g" out.txt;
no="0"
while read line
do
no=$[$no+1]
echo command[check_disk$no]=/usr/lib64/nagios/plugins/check_disk -e -w 10% -c 5% -p $line;
done < "out.txt" > check_disk.cfg
chmod 755 check_disk.cfg;
rm out.txt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment