Use MRTG to monitor the CPU temperature of a Linux system-Linux Enterprise Application-Linux server application information. The following is a detailed description. In Linux, there is a software named lm_sensors that can help us monitor the motherboard, CPU operating voltage, fan speed, temperature, and other data. We can see this data in the BIOS of the motherboard. When the machine runs, lm_sensors can be used to monitor CPU temperature changes at any time, which can prevent the CPU from being burned due to overheating.
1. Install lm_sensors
Now, each Linux has the lm_sensors package. We can install it. Or we can compile the source file by ourselves.
Here we can see that there is no CPU corresponding to the temperature, and we will slightly modify/etc/sensors. conf is enough, but we don't need to do it ourselves. Generally, we can download the configuration file from the motherboard manufacturer. With lmsensors, we can obtain information about the motherboard temperature, CPU voltage, and fan speed. We can monitor the operating status of the system based on the data to prevent system problems.
Let's integrate it with MRTG.
[Root @ securitycn ~] # Cd/usr/local/mrtg/bin
[Root @ securitycn ~] # Vi temp. sh
# Content:
#! /Bin/bash
Cputemp = '/usr/bin/sensors | grep temp1 | awk' {print $2}' | cut-c 2-4 '# Find the row with temp1, 2-4 characters in the second column
Systemp = '/usr/bin/sensors | grep temp2 | awk' {print $2}' | cut-c 2-5 'no need to explain
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.