![]() ![]() ![]() Therefore in the terminal itself, issue the following - sudo sensors-detect We need to first make sure that lm-sensors detects the hardware. Next, to install lm-sensors - sudo apt install lm-sensors Monitor CPU temperature in Ubuntu through lm-sensors Hence, open a terminal and issue the following - sudo apt update This is just to make sure we get to have the latest version of the package. Therefore, we update the repository first. Since the package is already available through standard Ubuntu repository. In case you don't have one then, we advise you to contact your System Administrator for assistance. Note: Following operations would require you to have superuser privileges. Still, we cover the installation steps for those who don't have the package for some reason. If you identify that a process is consuming more that what our system can handle then, we can limit CPU usage of the process in Ubuntu.Īlthough, the package lm-sensors is installed as default in Ubuntu distribution. So, it is always better to monitor our hardware health at regular intervals. This results in critical errors leading to system shutdown. Certain processes may require resources which are more than what our system can offer. It is quite a useful tool to monitor the health of our hardware.Ī process needs system resources to perform a task. The same package can also be used to monitor voltage, fan speed etc. Max_ = int(cat(os.path.join(hwmon, 'temp1_max'))) / 1000Ĭrit = int(cat(os.path.In this article, we cover how to monitor CPU temperature in Ubuntu through lm-sensors package. Label = cat(os.path.join(hwmon, 'temp1_label'))Īssert 'cpu temp' in label.lower(), label Installed on the system as a list of namedtuples as in:Ĭat = lambda file: open(file, 'r').read().strip() """Return temperatures expressed in Celsius for each physical CPU _nt_cpu_temp = namedtuple('cputemp', 'name temp max critical') Reading files in /sys/class/hwmon/hwmon*/temp1_* worked for me but AFAIK there are no standards for doing this cleanly.Īnyway, you can try this and make sure it provides the same number of CPUs shown by " sensors" cmdline utility, in which case you can assume it's reliable. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |