Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:lrupp
clewarecontrol
check_temperature
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File check_temperature of Package clewarecontrol
#!/bin/sh if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then echo "CRITICAL - Parameter(s) missing (Warning Critical)." exit 2 fi PARAM1=`echo $1 | tr -c -d [:digit:]` PARAM2=`echo $2 | tr -c -d [:digit:]` PARAM3=`echo $3 | tr -c -d [:digit:]` if [ "$1" != "$PARAM1" -o "$2" != "$PARAM2" -o "$3" != "$PARAM3" ] ; then echo "CRITICAL - invalid parameter(s), only integers allowed." exit 2 fi /usr/bin/clewarecontrol -l | grep -P "serial\snumber\:\s$PARAM3" >> /dev/null if [ $? -ne 0 ]; then echo "CRITICAL - invalid parameter, serial number not found" exit 2 fi MEASURED_TEMPERATURE=`/usr/bin/clewarecontrol -d $PARAM3 -rt 2> /dev/null | grep 'Temperature' | awk '{ print $2; }' | sed '1!{$!d}'` NAGIOS_TEMPERATURE=`echo $MEASURED_TEMPERATURE | sed -e "s/^\([0-9]*\).*$/\1/g"` if [ -z "$NAGIOS_TEMPERATURE" ] ; then echo "CRITICAL - invalid temperature $MEASURED_TEMPERATURE | temperature=$MEASURED_TEMPERATURE" exit 2 fi if [ $NAGIOS_TEMPERATURE -gt $2 ] ; then echo "CRITICAL - temperature above $2 - $MEASURED_TEMPERATURE | temperature=$MEASURED_TEMPERATURE" exit 2 fi if [ $NAGIOS_TEMPERATURE -gt $1 ] ; then echo WARNING - "temperature above $1 - $MEASURED_TEMPERATURE | temperature=$MEASURED_TEMPERATURE" exit 1 fi echo OK - "temperature is $MEASURED_TEMPERATURE | temperature=$MEASURED_TEMPERATURE" exit 0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor