Add temperature as status output, too

This commit is contained in:
Jonny007-MKD 2020-10-03 16:49:06 +02:00
parent 662d6622cc
commit 4bc4fd5c07
2 changed files with 4 additions and 4 deletions

View file

@ -5,7 +5,7 @@ Icinga2/Nagios check program for Raspberry Pi temperature
## Requirements ## Requirements
- `bc` for floating point calculation - `bc` for floating point calculation
- Adding executing user to video group: `sudo adduser nagios video` - Adding executing user to video group: `sudo adduser nagios video`. Otherwise "VCHI initialization failed"
## Arguments ## Arguments

View file

@ -74,10 +74,10 @@ fi
temp=${output/temp=/} temp=${output/temp=/}
temp=${temp/\'C/} temp=${temp/\'C/}
unit="°C" unit="'C"
if $FAHRENHEIT; then if $FAHRENHEIT; then
temp=$(bc <<< "scale=1; ($temp * 1.8) + 32") temp=$(bc <<< "scale=1; ($temp * 1.8) + 32")
unit="°F" unit="'F"
fi fi
@ -91,7 +91,7 @@ elif [ $w -eq 1 ]; then
else else
result="OK" result="OK"
fi fi
echo "$result | 'temperature'=$temp;$unit;$WARN;$CRIT;-40;85" echo "$result. $temp$unit | 'temperature'=$temp;$unit;$WARN;$CRIT;-40;85"
case $result in case $result in