Advertisement
Guest User

thresholds in custom bash script

a guest
May 30th, 2012
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.66 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. snmp=$(/usr/local/nagios/libexec/check_snmp -H $1 -C 'Community_String' -o .1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1 -w 110 -c 115|cut -b 11-14)
  4.  
  5. temp=$(/bin/echo "$snmp / 10" | /usr/bin/bc)
  6.  
  7. if [ $temp -lt 28 ] ; then
  8. /bin/echo "Input Temperature OK - $temp | iso.1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1=$temp"
  9.  
  10. elif [ $temp -ge 28 ] ; then
  11. /bin/echo "Input Temperature WARNING - *$temp* | iso.1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1=$temp"
  12.  
  13. elif [ $temp -ge 33 ] ; then
  14. /bin/echo "Input Temperature CRITICAL - *$temp* | iso.1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1=$temp"
  15.  
  16. else
  17. /bin/echo "Temperature Input problem - No data received from host"
  18.  
  19. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement