Advertisement
Guest User

thresholds in service

a guest
May 30th, 2012
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. ------service--------
  2. # Dell Temperature Check
  3. define service {
  4. use hardware-service
  5. hostgroup_name dell_general_hosts
  6. service_description Dell Temperature
  7. check_command check_dell_temp_math!280!330!'TEST'
  8. }
  9. ------command--------
  10. # check Dell temp with divide by 10 script
  11.  
  12. define command {
  13.  
  14. command_name check_dell_temp_math
  15. command_line $USER1$/check_dell_temp_custom $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -l $ARG3$
  16. }
  17.  
  18. ------custom script--------
  19. #!/bin/bash
  20.  
  21. 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|cut -b 11-14)
  22.  
  23. temp=$(/bin/echo "$snmp / 10" | /usr/bin/bc)
  24.  
  25. if [ $temp -lt 28 ] ; then
  26. /bin/echo "Input Temperature OK - $temp | iso.1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1=$temp"
  27.  
  28. elif [ $temp -ge 28 ] ; then
  29. /bin/echo "Input Temperature WARNING - *$temp* | iso.1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1=$temp"
  30.  
  31. elif [ $temp -ge 33 ] ; then
  32. /bin/echo "Input Temperature CRITICAL - *$temp* | iso.1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1=$temp"
  33.  
  34. else
  35. /bin/echo "Temperature Input problem - No data received from host"
  36.  
  37. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement