temp sensors and mrtg
Temperature monitoring using openbsd's sensor framework and mrtg.
- Locate sensors on main board:
$ dmesg | grep lm
lm0 at isa0 port 0x290/8: LM79 - Locate number of CPU temperature sensor:
$ sysctl hw.sensors | grep temp
hw.sensors.7=lm0, Temp1, temp, 36.00 degC / 96.80 degF - Write a simple script for passing temperature to mrtg:
#!/bin/sh
sysctl hw.sensors.7 | awk '{ print $4 }'
sysctl hw.sensors.7 | awk '{ print $4 }' - Add the following lines to your mrtg config:
Target[Temp1]: `/root/temp.sh`
MaxBytes[Temp1]: 70
Options[Temp1]: gauge, noinfo, nopercent
YLegend[Temp1]: Celsius
LegendI[Temp1]: Temp
LegendO[Temp1]: Temp
Title[Temp1]: CPU temp
ShortLegend[Temp1]: C
PageTop[Temp1]: <h1>CPU temp</h1> - Have fun!