Skip to content

Instantly share code, notes, and snippets.

@HendrikHaase
Last active July 20, 2023 14:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save HendrikHaase/626659cec61106debfeefa5f9a0a3cc7 to your computer and use it in GitHub Desktop.
Save HendrikHaase/626659cec61106debfeefa5f9a0a3cc7 to your computer and use it in GitHub Desktop.
proxmox add thermal stats to summary

proxmox add thermal stats to summary

apt install lm-sensors


open file

nano /usr/share/perl5/PVE/API2/Nodes.pm

    $res->{pveversion} = PVE::pvecfg::package() . "/" .
        PVE::pvecfg::version_text();
    
    my $dinfo = df('/', 1);     # output is bytes

add to content

    $res->{pveversion} = PVE::pvecfg::package() . "/" .
        PVE::pvecfg::version_text();
    
    $res->{thermalstate} = `sensors`;
    
    my $dinfo = df('/', 1);     # output is bytes

open file

nano /usr/share/pve-manager/js/pvemanagerlib.js

    ...,
    height: 300,
    bodyPadd...

change

    ...,
    height: 320,
    bodyPadd...

search for PVE Manager Version

     {
         itemId: 'version',
         colspan: 2,
         printBar: false,
         title: gettext('PVE Manager Version'),
         textField: 'pveversion',
         value: ''
     },

add/change 6-core cpu, adjust accordingly

    {
         itemId: 'version',
         colspan: 2,
         printBar: false,
         title: gettext('PVE Manager Version'),
         textField: 'pveversion',
         value: ''
     },
     {
         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];
             const c2 = value.match(/Core 2.*?\+([\d\.]+)Â/)[1];
             const c3 = value.match(/Core 3.*?\+([\d\.]+)Â/)[1];
             const c4 = value.match(/Core 4.*?\+([\d\.]+)Â/)[1];
             const c5 = value.match(/Core 5.*?\+([\d\.]+)Â/)[1];
             return `${c0} ℃ | ${c1} ℃ | ${c2} ℃ |${c3} ℃ | ${c4} ℃ | ${c5} ℃`
         }
     }

restart pveproxy

systemctl restart pveproxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment