Featured image of post Proxmox (PVE) Retrieve CPU, Disk, and Other Hardware Temperature Information

Proxmox (PVE) Retrieve CPU, Disk, and Other Hardware Temperature Information

If you want to obtain hardware temperature information for the PVE host and display it in the PVE control panel for real-time server monitoring, refer to the image below: …

If you want to obtain hardware temperature information for the PVE host and display it in the PVE control panel for real-time server monitoring, refer to the image below:

Proxmox (PVE) Retrieve CPU, Disk, and Other Hardware Temperature Information

Install Hardware Monitoring Software Sensors

You need to install hardware monitoring software. For detailed installation procedures, please refer to this article: https://bmzhp.com/experience/281

Modify and Add Display Code

Edit the following file: /usr/share/perl5/PVE/API2/Nodes.pm
Open the file using:

1
vi /usr/share/perl5/PVE/API2/Nodes.pm

Search for the line containing PVE::pvecfg::version_text(); and add the following line below it:

1
$res->{sensorsInfo} = `sensors`;

Proxmox (PVE) Retrieve CPU, Disk, and Other Hardware Temperature Information

Next, edit /usr/share/pve-manager/js/pvemanagerlib.js
Open the file using:

1
vi /usr/share/pve-manager/js/pvemanagerlib.js

Search for the section labeled PVE Manager Version and insert the following code right before the closing curly brace:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
|  | { |
| --- | --- |
|  | itemId: 'sensorsInfo', |
|  | colspan: 2, |
|  | printBar: false, |
|  | title: gettext('CPU Temperature'), |
|  | textField: 'sensorsInfo', |
|  | renderer:function(value) |
|  | {const p0 = value.match(/Package id 0: ++(\d+.\d+)/)[1]; |
|  | const c0 = value.match(/Core 0: ++(\d+.\d+)/)[1]; |
|  | const c1 = value.match(/Core 1: ++(\d+.\d+)/)[1]; |
|  | const c2 = value.match(/Core 2: ++(\d+.\d+)/)[1]; |
|  | const c3 = value.match(/Core 3: ++(\d+.\d+)/)[1]; |
|  | const c4 = value.match(/Core 4: ++(\d+.\d+)/)[1]; |
|  | const c5 = value.match(/Core 5: ++(\d+.\d+)/)[1]; |
|  | const c6 = value.match(/Core 6: ++(\d+.\d+)/)[1]; |
|  | const c7 = value.match(/Core 7: ++(\d+.\d+)/)[1]; |
|  | const c8 = value.match(/Core 8: ++(\d+.\d+)/)[1]; |
|  | const c9 = value.match(/Core 9: ++(\d+.\d+)/)[1]; |
|  | return Package: ${p0}  || Core 1: ${c0}  | Core 2: ${c1}  | Core 3: ${c2}  | Core 4: ${c3}  | Core 5: ${c4}  | Core 6: ${c5}  | Core 7: ${c6}  | Core 8: ${c7}  | Core 9: ${c8}  | Core 10: ${c9}  |
|  | } |
|  | }, |

Proxmox (PVE) Retrieve CPU, Disk, and Other Hardware Temperature Information

Restart PVE Web Service

To restart the web service, use the following command:

1
systemctl restart pveproxy

This will restart the web service and refresh the page.

Now, simply access the control panel and refresh the page to see the changes.

Licensed under CC BY-NC-SA 4.0