Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------service--------
- # Dell Temperature Check
- define service {
- use hardware-service
- hostgroup_name dell_general_hosts
- service_description Dell Temperature
- check_command check_dell_temp_math!280!330!'TEST'
- }
- ------command--------
- # check Dell temp with divide by 10 script
- define command {
- command_name check_dell_temp_math
- command_line $USER1$/check_dell_temp_custom $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -l $ARG3$
- }
- ------custom script--------
- #!/bin/bash
- 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)
- temp=$(/bin/echo "$snmp / 10" | /usr/bin/bc)
- if [ $temp -lt 28 ] ; then
- /bin/echo "Input Temperature OK - $temp | iso.1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1=$temp"
- elif [ $temp -ge 28 ] ; then
- /bin/echo "Input Temperature WARNING - *$temp* | iso.1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1=$temp"
- elif [ $temp -ge 33 ] ; then
- /bin/echo "Input Temperature CRITICAL - *$temp* | iso.1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1=$temp"
- else
- /bin/echo "Temperature Input problem - No data received from host"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement