Setting up lm sensors: Difference between revisions

From Alpine Linux
m (Reverted edits by 80.227.1.100 (Talk); changed back to last version by Nangel)
No edit summary
(9 intermediate revisions by 4 users not shown)
Line 2: Line 2:


Install the neccessary packages. You will need perl to run the sensors-detect script.
Install the neccessary packages. You will need perl to run the sensors-detect script.
  apk_add lm_sensors perl
{{Cmd|apk_add lm_sensors lm_sensors-detect perl}}


Load the i2c-dev module:
Load the i2c-dev module:
  echo i2c-dev >> /etc/modules
{{Cmd|<nowiki>echo i2c-dev >> /etc/modules-load.d/i2c.conf
  modprobe i2c-dev
modprobe i2c-dev</nowiki>}}


'''Note:''' If you already know the name of the sensor module, you can modprobe it now, and skip the sensors-detect and perl install.   
'''Note:''' If you already know the name of the sensor module, you can modprobe it now, and skip the sensors-detect and perl install.   


Run sensors detect:
Run sensors detect:
  sensors-detect
{{Cmd|sensors-detect}}


On the question to scan ISA bus and Super I/O sensors, select "no". Grsec will not allow you to access /proc/port. On all other questions select the default.
There are multiple types of sensors that you must skip scanning for (answer "no" to the prompt) because grsec will not allow you to access /proc/port. If you encounter an error that says something like "/dev/port: no such file..", re-run the script and answer "no" to that question on the next attempt.  Examples of ones that you must enter "no" for: ISA bus, other Super I/O sensors, and IPMI.
 
Be sure to enter "yes" (non-default) for the question "Do you want to generate /etc/conf.d/lm_sensors?"


You will not need perl anymore. Remove it before you forget.
You will not need perl anymore. Remove it before you forget.
  apk_delete perl
{{Cmd|apk_del lm_sensors-detect perl}}
 


Make services start during next reboot.
Make services start during next reboot.
  rc_add -k lm_sensors sensord
{{Cmd|rc-update add lm_sensors default
rc-update add sensord default}}


Start services:
Start services:
  /etc/init.d/lm_sensors start
{{Cmd|/etc/init.d/lm_sensors start && /etc/init.d/sensord start}}
  /etc/init.d/sensord start
 
Don't forget to save your new server configuration using {{Cmd|lbu commit}}.


Save config using ''lbu commit''.
[[Category:Monitoring]]

Revision as of 09:05, 12 February 2020

This document is a short note on how to set up lm_sensors in Alpine.

Install the neccessary packages. You will need perl to run the sensors-detect script.

apk_add lm_sensors lm_sensors-detect perl

Load the i2c-dev module:

echo i2c-dev >> /etc/modules-load.d/i2c.conf modprobe i2c-dev

Note: If you already know the name of the sensor module, you can modprobe it now, and skip the sensors-detect and perl install.

Run sensors detect:

sensors-detect

There are multiple types of sensors that you must skip scanning for (answer "no" to the prompt) because grsec will not allow you to access /proc/port. If you encounter an error that says something like "/dev/port: no such file..", re-run the script and answer "no" to that question on the next attempt. Examples of ones that you must enter "no" for: ISA bus, other Super I/O sensors, and IPMI.

Be sure to enter "yes" (non-default) for the question "Do you want to generate /etc/conf.d/lm_sensors?"

You will not need perl anymore. Remove it before you forget.

apk_del lm_sensors-detect perl

Make services start during next reboot.

rc-update add lm_sensors default rc-update add sensord default

Start services:

/etc/init.d/lm_sensors start && /etc/init.d/sensord start

Don't forget to save your new server configuration using

lbu commit

.