Add temperature as status output, too
This commit is contained in:
		
							parent
							
								
									662d6622cc
								
							
						
					
					
						commit
						4bc4fd5c07
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue