Lm-sensors tool installation and use abstract: host sensor information monitoring recently in the cloud computing project, there is a need to monitor the hardware information of the physical machine, for example, the main board temperature, CPU voltage, fan speed, etc. previous experience was to query through I2C channel commands, based on customized hardware devices... capital lm-sensors tool installation and use abstract: host sensor information monitoring recently in the cloud computing project, there is a need to monitor the hardware information of the physical machine, for example, the main board temperature, CPU voltage, fan speed, etc. previous experience was to query through I2C channel commands and develop based on customized hardware devices. However, you cannot query the hardware information that supports pc debugging machines. A brief introduction of sensor classification: temperature, speed, and pressure. I accidentally read the private dish of laruence and found that the lm-sensors tool can meet the requirements. let's introduce it from installation and use. There are two installation methods: 1) direct installation of rpm/yum; 2) source code compilation and installation. The former is not much said, but the latter is a little bit ?? What do you mean ?? Ww.lm-sensors.org download to the source code, decompress, the main directory, see the install file, need to rely on gcc, bison, flex, rrd (optional), gcc know, bison and flex can be considered as powerful tools for parsing text data in linux. They are mainly used to parse the content of their configuration files, such as the default/etc/sensors3.conf file. After installing these dependencies, run make all and make install. In addition, use/prog/detect/sensors-detect to detect monitored sensors and write the results to modules in/etc/lm-sensors/sensors. Then let's use it. in the terminal, enter sensors to check whether it is supported. if the command cmd is not supported, the installation may fail. repeat the result. If no modules is displayed, the monitor chip lm-sensors is not supported, or the driver is not installed. If the output contains temperature, voltage, and so on, OK. (The simplest way is to directly check whether subdirectories exist under/sys/class/hwmon .) Let's talk about the principle. What lm-sensors tool does is actually a translation job. what actually monitors is the hwmon module in the kernel, hwmon is a class that exists in the kernel (you can view/sys/class/hwmon). During kernel initialization, all devices, such as monitoring chips and sensors, are registered with the hwmon module, drivers of each device are responsible for monitoring and reporting information at regular intervals. hwmon is responsible for updating the information in the corresponding files under/sys/class/hwmon/hwmonN, for example, the input file of temperature sensor 1 is temp1_input. The sensors command is customized based on the user's configuration file (-c specified, see man libsensors syntax). If this parameter is not specified, use the default configuration file/etc/sensors3.conf to replace the corresponding fields, for example, temp1 can be identified as M/B Temp.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.