MightySlaytanic / pve-monitoring

Proxmox VE temperature and disk-health stats upload to influxdb2
MIT License
74 stars 9 forks source link

[SUGGESTION] System PCH & CPU Type Variables #10

Closed boomam closed 1 year ago

boomam commented 1 year ago

Add environment variables for cpu arch, pch name, etc. into the sh files. Existing code references cannon-lake/similar, not every intel system is cannon-lake, and not every system is Intel.

Would allow the code to be more resilient to different system configs in the same way you have done with disk names.

Example -

    stats["pch"] = int(data["pch_cannonlake-virtual-0"]["temp1"]["temp1_input"])
    stats["acpitz"] = int(data["acpitz-acpi-0"]["temp2"]["temp2_input"])
    stats["nvme-pci"] = int(data["nvme-pci-3a00"]["Composite"]["temp1_input"])

On a skylake system -

MightySlaytanic commented 1 year ago

Hi @boomam, have a look at the updated README where there is an example of /home/scripts/pve_temp_stats_to_influxdb2.sh, I've added 4 environment variables that can be setup like the following (in the example I suppose you have 2 nvme entries):

export PCH_INFO="pch:pch_cannonlake-virtual-0:temp1:temp1_input"
export ACPITZ_INFO="acpitz:acpitz-acpi-0:temp2:temp2_input"
export NVME_INFO="nvme:nvme-pci-3a00:Composite:temp1_input,nvme2:nvme-pci-XXXX:Composite:temp1_input"
export CORETEMP_NAME="coretemp-isa-0000"

If you do not have ACPITZ info, simply set it to ACPITZ_INFO=""

boomam commented 1 year ago

Hi @boomam, have a look at the updated README where there is an example of /home/scripts/pve_temp_stats_to_influxdb2.sh, I've added 4 environment variables that can be setup like the following (in the example I suppose you have 2 nvme entries):

export PCH_INFO="pch:pch_cannonlake-virtual-0:temp1:temp1_input"
export ACPITZ_INFO="acpitz:acpitz-acpi-0:temp2:temp2_input"
export NVME_INFO="nvme:nvme-pci-3a00:Composite:temp1_input,nvme2:nvme-pci-XXXX:Composite:temp1_input"
export CORETEMP_NAME="coretemp-isa-0000"

If you do not have ACPITZ info, simply set it to ACPITZ_INFO=""

That was quick! I'll test it later this weekend, but it should be a great improvement regardless. :-)

boomam commented 1 year ago

Just tested, appears to work fine.

I'll submit a PR shortly to update the readme. :-)

boomam commented 1 year ago

https://github.com/MightySlaytanic/pve-monitoring/pull/11

Closing issue. :-)

MightySlaytanic commented 1 year ago

@boomam I've merged the readme and added acpitz info from my Intel NUC. Thanks.