MightySlaytanic / pve-monitoring

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

ERROR: Can't get value of subfeature temp1_input: Can't read #1

Closed jaberhadi closed 1 year ago

jaberhadi commented 1 year ago

Using: pve_temp_stats_to_influxdb2.py I am getting an error because one of my sensor is absent (disabled)

root@pve2:~/temptoinflux sensors ..... iwlwifi_1-virtual-0 Adapter: Virtual device temp1: N/A .....

root@pve2:~/temptoinflux# ./pve_temp_stats_to_influxdb2.sh -t ERROR: Can't get value of subfeature temp1_input: Can't read<

i changed the line calling sensors (line number 38) to handle this error to this one data = json.load(popen("/usr/bin/sensors -j 2>/dev/null "))

it is silence the error. I understand that this is hiding the problem, but well...

MightySlaytanic commented 1 year ago

What's the output of sensors -j on your box?

jaberhadi commented 1 year ago

"acpitz-acpi-0":{ "Adapter": "ACPI interface", "temp1":{ "temp1_input": 27.800, "temp1_crit": 119.000 } }, "iwlwifi_1-virtual-0":{ "Adapter": "Virtual device", "temp1":{ ERROR: Can't get value of subfeature temp1_input: Can't read } }, "coretemp-isa-0000":{ "Adapter": "ISA adapter", "Package id 0":{ "temp1_input": 44.000, "temp1_max": 100.000, "temp1_crit": 100.000, "temp1_crit_alarm": 0.000 >

jaberhadi commented 1 year ago

also I tried to fix the lm-senors, so it ignores the troublesome chip. for iwlwifi-virtual-0 virtual device

by write a file /etc/sensors.d/iwlwifi with the following contents chip "iwlwifi-virtual-*" ignore temp1

it solve the problem when I use sensors -u and ignore that value but when using sensors -j it didnt i got the same error

MightySlaytanic commented 1 year ago

Btw does it upload the stats correctly to your Influxdb2 server?

jaberhadi commented 1 year ago

Yes it did , Thank so much its helped me alot, Please keep up the extremely-good work!

Screen Shot 2023-01-28 at 3 52 08 PM Screen Shot 2023-01-28 at 3 53 19 PM
MightySlaytanic commented 1 year ago

Great dashboard, maybe I'll implement some changes in mine :)

MightySlaytanic commented 1 year ago

Hi @jaberhadi, I've changed my code replacing popen() with subprocess.run and excluding STDERR. Thanks for the suggestion.

jaberhadi commented 1 year ago

Excellent, it just test it works perfectly, Thank you

MightySlaytanic commented 1 year ago

Thank you for pointing out the issue :)