Software:hw.sensors

From HandWiki
Short description: Hardware monitoring sensors framework

hw.sensors
Original author(s)Constantine A. Murenin (2006) and Alexander Yurchenko (2003/2004)
Developer(s)The OpenBSD Project
Initial release25 April 2003; 20 years ago (2003-04-25)
Written inC
Operating systemOpenBSD, DragonFly
Typesystem monitoring
LicenceISC licence

The hw.sensors framework is a kernel-level hardware sensors framework originating from OpenBSD, which uses the sysctl kernel interface as the transport layer between the kernel and the userland. (As of 2019), the framework is used by over a hundred device drivers in OpenBSD to export various environmental sensors, with temperature sensors being the most common type.[1][2] Consumption and monitoring of sensors is done in the userland with the help of sysctl, systat, sensorsd, ntpd, snmpd, ports/sysutils/symon and GKrellM.[3][4]

Drivers

In OpenBSD, the framework is integrated with Dell's ESM, IPMI and I2C,[5][6] in addition to a number of popular Super I/O chips through lm(4).[2]

A major difference compared to other solutions like lm sensors is simplicity and a works-by-default approach in the drivers, which don't require nor support any configurability; no installation or configuration actions are required by the system administrator in order to get the sensors going.[7][6] This is coupled with a fine-tuned ad-hoc read-only scan procedure on the I2C bus, written by Theo de Raadt in a centralised way with a cache, making it possible to leave it enabled by default at all times, unlike the competing solutions.[7][6][8]

RAID drive sensors

Support for automatic monitoring of RAID drives is also provided through the sensors framework,[5] this concept of sensors of drive type has been backported by NetBSD back into envsys in 2007.[2]

OpenNTPD timedelta sensors

OpenNTPD uses sensors of type timedelta in order to synchronise time.[9] These are provided by NMEA and other drivers.[10][11]

History

The framework was originally devised in 2003 by Alexander Yurchenko, when he was porting several envsys-based drivers from NetBSD. Instead of porting NetBSD's envsys, a simpler sysctl-based mechanism was developed.[2]

The framework received a major uptick in usage by the device drivers with the release of OpenBSD 3.9, where in a period of merely 6 months, the number of individual drivers using the framework went from 9 in OpenBSD 3.8 (released 2005) to 33 in OpenBSD 3.9 (released 2006).[2]

(As of December 2006), the framework was used by 44 devices drivers; it is at this time that a patchset has been committed converting a simple one-level addressing scheme into a more stable multi-layer addressing.[12][13]

In 2007, the framework was ported to FreeBSD as part of a Google Summer of Code grant; it has been adopted by DragonFly BSD later that year.[14] The usability of the sensorsd(8), the sensors monitoring daemon, has been vastly improved in 2007, partly due to same GSoC grant.[15]

(As of November 2008), the total number of drivers stood at 68 in OpenBSD 4.4; growing by 7 drivers in a 6-month release cycle.[16] This level of growth, of one new driver per month on average, has been common throughout the history of the framework since OpenBSD 3.9.[2]

The values exported by the drivers through the framework are read-only; however, an external patch exists that implements the fan control functionality in both the framework as well as one of the drivers for the most popular family of Super I/O chips; this patchset was provided for both OpenBSD and DragonFly BSD.[17][1]

See also

References

  1. 1.0 1.1 Constantine A. Murenin (2010-05-21). OpenBSD Hardware Sensors — Environmental Monitoring and Fan Control (MMath). University of Waterloo, Waterloo, Ontario, Canada: UWSpace. hdl:10012/5234. Document ID: ab71498b6b1a60ff817b29d56997a418.
  2. 2.0 2.1 2.2 2.3 2.4 2.5 Constantine A. Murenin; Raouf Boutaba (2009-03-17). "OpenBSD Hardware Sensors Framework.". AsiaBSDCon 2009 Proceedings, 12–15 March 2009. Tokyo University of Science, Tokyo, Japan (published 2009-03-14). https://www.openbsd.org/papers/asiabsdcon2009-sensors-paper.pdf. Retrieved 2019-03-04. 
  3. Jeremy Andrews (2008-06-07). "BSDCan 2008: Hardware Sensors Framework". http://kerneltrap.org/OpenBSD/BSDCan_2008_Hardware_Sensors_Framework. 
  4. "gkrellm-server-2.3.10p1 – single process stack of system monitors for GTK+2 (server)". OpenBSD ports. 2018-06-01. http://ports.su/sysutils/gkrellm/gkrellm,-main. 
  5. 5.0 5.1 David Gwynne; Marco Peereboom (2006-12-03). "bio and sensors in OpenBSD". OpenCON 2006, 2–3 December 2006. Courtyard Venice Airport, Venice/Tessera, Italy. https://www.openbsd.org/papers/opencon06-bio.pdf. Retrieved 2019-03-04. 
  6. 6.0 6.1 6.2 Ingrid Marson (2006-03-24). "OpenBSD 3.9 adds sensor framework". ZDNet. https://www.zdnet.com/article/openbsd-3-9-adds-sensor-framework/. 
  7. 7.0 7.1 Manolis Tzanidakis (2006-03-28). "Interview: Theo de Raadt of OpenBSD". Linux.com. https://www.linux.com/news/interview-theo-de-raadt-openbsd. 
  8. Theo de Raadt (2015-05-29). "/sys/dev/i2c/i2c_scan.c". https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/dev/i2c/i2c_scan.c. 
  9. Henning Brauer (2016-09-03). "ntpd/sensors.c". https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/ntpd/sensors.c. 
  10. Marc Balmer (2007-03-15). "Support for Radio Clocks in OpenBSD". AsiaBSDCon 2007 Proceedings, 8–11 March 2007. Tokyo, Japan (published 2007-03-10). https://www.openbsd.org/papers/radio-clocks-asiabsdcon07.pdf. Retrieved 2019-03-04. 
  11. Marc Balmer (2019-01-26). "/sys/kern/tty_nmea.c". https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/kern/tty_nmea.c. 
  12. Constantine A. Murenin (2007). "Generalised Interfacing with Microprocessor System Hardware Monitors". Proceedings of 2007 IEEE International Conference on Networking, Sensing and Control, 15–17 April 2007.. London, United Kingdom. doi:10.1109/ICNSC.2007.372901. IEEE ICNSC 2007, pp. 901—906.. 
  13. Constantine A. Murenin (2006-12-30). "New two-level sensor API". in Marco Peereboom. https://undeadly.org/cgi?action=article&sid=20061230235005. 
  14. Constantine A. Murenin (2007-10-14). "GSoC2007/cnst-sensors". FreeBSD. https://wiki.freebsd.org/GSoC2007/cnst-sensors. 
  15. Federico Biancuzzi (2007-11-01). "Puffy's Marathon: What's New in OpenBSD 4.2". O'Reilly Media. http://onlamp.com/lpt/a/7155. 
  16. Federico Biancuzzi (2008-11-03). "Source Wars - Return of the Puffy: What's New in OpenBSD 4.4". O'Reilly Media. http://broadcast.oreilly.com/2008/11/source-wars---return-of-the-pu.html. 
  17. Constantine A. Murenin (2010-03-14). "Quiet computing with BSD: Fan control with sysctl hw.sensors and lm(4) on OpenBSD and DragonFly BSD". http://sensors.cnst.su/fanctl/. 

External links