Proxmox Web界面显示CPU温度

悠悠技术网 网络维护交流 3.2K+
  1. 读取CPU温度

    apt install lm-sensors
    sensors-detect
    sensors
  2. 显示CPU温度

    vim /usr/share/perl5/PVE/API2/Nodes.pm
    在 PVE::pvecfg::version_text(); 后面加入
    $res->{thermalstate} = `sensors`;
  3. 定期读取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} ℃ `;
        }
    }
  4. 重启Web管理服务

    systemctl restart pveproxy


标签: Proxmox Web 界面 显示 CPU 温度

上一篇当前分类已是最后一篇

下一篇Proxmox VE(PVE)安装LEDE/OpenWrt

发布评论 0条评论)

还木有评论哦,快来抢沙发吧~