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
- `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

View File

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