homersssearchJune 15, 2018

Sensorsd


Sensorsd config for OpenBSD ( sensorsd.conf )

Sensord is a daemon which watches the "sysctl" values for specified directives and can execute a job if specified values are exceeded. Normally sensorsd is used to watch a systems temperature and voltages being reported by a compatible motherboard chipset.

Getting Started

The first thing you need to do is see if the chipset on the motherboard you are using is supported by OpenBSD. Execute "sysctl hw.sensors" and you should see something similar to this output. What we are looking for are the volt, temp and fan lines.

 # sysctl hw.sensors

  hw.sensors.lm0.temp0=26.00 degC
  hw.sensors.lm0.temp1=31.00 degC
  hw.sensors.lm0.fan1=1607 RPM
  hw.sensors.lm0.fan2=1308 RPM
  hw.sensors.lm0.volt0=1.10 VDC (VCore)
  hw.sensors.lm0.volt1=11.31 VDC (+12V)
  hw.sensors.lm0.volt2=3.23 VDC (+3.3V)
  hw.sensors.lm0.volt3=4.85 VDC (+5V)
  hw.sensors.lm0.volt4=6.07 VDC (-12V)
  hw.sensors.lm0.volt5=5.12 VDC (5VSB)
  hw.sensors.lm0.volt6=0.58 VDC (VBAT)

Verify the output

If your output is similar, though it might not look exactly the same, then you have a compatible chip set and you can use sensorsd. If you did not get any output then check to make sure you typed in the commands correctly. If the command was correct then check at the bottom of this page for any help.

Checking the devices

Next, you need to make sure the sensors listed from the sysctl command correspond to the correct device. The voltages are easy as they have a label on them. The temps and fans are a little harder. As a rule, the CPU temp will be higher then the chip set temp. The fans will normally be listed with the CPU fan being first and the power supply fan second. These are not rules, but a guide to go by.

Once you have identified the correct hw.sensors.lm0 line with the correct device then it is time to make sure the sensorsd.conf reflects the correct settings. On some mother boards the devices will be in a different order than shown in the example above. For example, in the example above the +3.3V sensor corresponds to sensor "hw.sensors.lm0.volt2" but on your motherboard the +3.3V might be linked to "hw.sensors.lm0.volt4". Just take a moment to compare your "sysctl hw.sensors" with the sensorsd.conf file below.

The follwoing config will monitor: 1. Voltages on the 3.3V, 5V and 12V busses. 2. Tempatures from the motherboard chipset and the CPU. 3. Fan speeds of the CPU and power supply. If any of these values are exceeded mail will be sent to root with the result as well as the preset high and low limits.

#######################################################
###  Calomel.org  sensord.conf  BEGIN
#######################################################

# +3.3 voltage (volts)
hw.sensors.lm0.volt2:low=3.0V:high=4.0V:command=echo "%2 \( low=%3 high=%4 \)" \
   | mail -s "`hostname` sensorsd WARNING \(+3.3V\)" root

# +5 voltage (volts)
hw.sensors.lm0.volt3:low=4.79V:high=5.2V:command=echo "%2 \( low=%3 high=%4 \)" \
   | mail -s "`hostname` sensorsd WARNING \(+5V\)" root

# +12 voltage (volts)
hw.sensors.lm0.volt1:low=11.2V:high=12.5V:command=echo "%2 \( low=%3 high=%4 \)" \
   | mail -s "`hostname` sensorsd WARNING \(+12V\)" root

# Chipset temperature (degrees Celsius)
hw.sensors.lm0.temp0:high=29C:command=echo "%2 \( high=%4 \)" \
   | mail -s "`hostname` sensorsd WARNING \(chipset temp\)" root

# CPU temperature (degrees Celsius)
hw.sensors.lm0.temp1:high=36C:command=echo "%2 \( high=%4 \)" \
   | mail -s "`hostname` sensorsd WARNING \(cpu temp\)" root

# CPU fan (RPM)
hw.sensors.lm0.fan1:low=1000:high=3000:command=echo "%2 \( low=%3 high=%4 \)" \
   | mail -s "`hostname` sensorsd WARNING \(cpu fan\)" root

# Power Supply fan (RPM)
hw.sensors.lm0.fan2:low=1000:high=3000:command=echo "%2 \( low=%3 high=%4 \)" \
   | mail -s "`hostname` sensorsd WARNING \(psu fan\)" root

#######################################################
###  Calomel.org  sensord.conf  END
#######################################################

Executing the daemon

With the sensorsd.conf file in place and all of the sensors verified we can now test out the sensorsd daemon. You can start the daemon manually by typing "/usr/sbin/sensorsd". You should see a few emails from sensorsd reporting a change. No worries.

Lastly, we need to make sure sensorsd will start on the next reboot. You can edit the /etc/rc.conf file directly and change the line sensorsd_flags=NO to sensorsd_flags="" . Or you can edit the /etc/rc.conf.local file and add the line sensorsd_flags="" and this will also start the daemon on boot.

Questions?

When I execute "sysctl hw.sensors" I do not see any sensors! This means that your motherboard chipset is not compatable. There is not much else to do at this point. The sysctl values are kernel dependent so if the kernel does not have a driver for your chipset then you can go no futher.

One of my sensors is reporting zero! Whats wrong?It is possible that your motherboard has a bad sensor on it. It is more common than you might think. Whether you have an expensive server board or an inexpensive e-machine you will find that some of the time you will have a blown sensor. Nothing can be done except to replace the board.

When I start sensorsd I get a bunch of email. Is this a problem?Sensorsd will send out mail when there is a change in excess of the settings you have in sensorsd.conf. Since the values for the sensors are, in effect, zero before the daemon starts and on the first poll of the chipset the values are normal sensorsd see this as an event. Just like when you expect mail to be sent out if your CPU fan goes from 2000 rpm to 0 rpm, then you will also get mail if sensord see the fan speed go from 0 rpm to 2000 rpm.


Contact UsGoogle Site SearchRSS Feed