Skip to content

Instantly share code, notes, and snippets.

@Unitech
Created February 13, 2015 01:23
Show Gist options
  • Select an option

  • Save Unitech/152b8ef7e7abcb42806c to your computer and use it in GitHub Desktop.

Select an option

Save Unitech/152b8ef7e7abcb42806c to your computer and use it in GitHub Desktop.
log_facility=daemon
pid_file=/var/run/nagios/nrpe.pid
server_port=5666
nrpe_user=nrpe
nrpe_group=nrpe
allowed_hosts=198.211.117.251
dont_blame_nrpe=1
debug=0
command_timeout=60
connection_timeout=300
include_dir=/etc/nagios/nrpe.d/
command[usedspace_bash]=/usr/lib/nagios/plugins/usedspace.sh
#!/bin/bash
used_space=`df -h / | grep -v Filesystem | awk '{print $5}' | sed 's/%//g'`
case $used_space in
[1-84]*)
echo "OK - $used_space% of disk space used."
exit 0
;;
[85]*)
echo "WARNING - $used_space% of disk space used."
exit 1
;;
[86-100]*)
echo "CRITICAL - $used_space% of disk space used."
exit 2
;;
*)
echo "UNKNOWN - $used_space% of disk space used."
exit 3
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment