You are not logged in.

#1 2024-02-20 19:44:18

sukolyn
Member
Registered: 2024-02-14
Posts: 154

lm_sensors' json seems wrong even it's valid

hi,

here's what outputs lm_sensors when  I ask it to print JSON :

$ sensors -j | jq -r '.'
{
  "radeon-pci-0100": {
    "Adapter": "PCI adapter",
    "temp1": {
      "temp1_input": 34.000,
      "temp1_crit": 120.000,
      "temp1_crit_hyst": 90.000
    }
  },
  "coretemp-isa-0000": {
    "Adapter": "ISA adapter",
    "Package id 0": {
      "temp1_input": 32.000,
      "temp1_max": 80.000,
      "temp1_crit": 99.000,
      "temp1_crit_alarm": 0.000
    },
    "Core 0": {
      "temp2_input": 32.000,
      "temp2_max": 80.000,
      "temp2_crit": 99.000,
      "temp2_crit_alarm": 0.000
    },
    "Core 1": {
      "temp3_input": 25.000,
      "temp3_max": 80.000,
      "temp3_crit": 99.000,
      "temp3_crit_alarm": 0.000
    },
    "Core 2": {
      "temp4_input": 28.000,
      "temp4_max": 80.000,
      "temp4_crit": 99.000,
      "temp4_crit_alarm": 0.000
    },
    "Core 3": {
      "temp5_input": 26.000,
      "temp5_max": 80.000,
      "temp5_crit": 99.000,
      "temp5_crit_alarm": 0.000
    }
  }
}

as you can see "temps" are numbered.
imho, it's wrong JSON as it is "the same" data for different objects, and it makes it difficult to parse to get temperatures

do you know why it is so ?

Offline

#2 2024-02-20 19:53:58

dogknowsnx
Guest

Re: lm_sensors' json seems wrong even it's valid

#3 2024-02-20 20:12:16

sukolyn
Member
Registered: 2024-02-14
Posts: 154

Re: lm_sensors' json seems wrong even it's valid

copied message to feedback. thank you.

if it's ok, I don't close immediately, because I hope an answer, and I'll repost it here.

Offline

Board footer

Powered by FluxBB