读取CPU温度
apt install lm-sensors sensors-detect sensors
显示CPU温度
vim /usr/share/perl5/PVE/API2/Nodes.pm 在 PVE::pvecfg::version_text(); 后面加入 $res->{thermalstate} = `sensors`;
定期读取sensors
vim /usr/share/pve-manager/js/pvemanagerlib.js 在 PVE Manager Version 后面加一个item: { itemId: 'thermal', colspan: 2, printBar: false, title: gettext('CPU Thermal State'), textField: 'thermalstate', renderer:function(value){ const c0 = value.match(/Core 0.*?\+([\d\.]+)?/)[1]; const c1 = value.match(/Core 1.*?\+([\d\.]+)?/)[1]; return `Core 0: ${c0} ℃ | Core 1: ${c1} ℃ `; } }
重启Web管理服务
systemctl restart pveproxy
Proxmox Web界面显示CPU温度
网络维护交流
3.2K+
还木有评论哦,快来抢沙发吧~