-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lm_sensors: fix invalid json if specified more than one chip #2226
Conversation
Patch worked good. Got an added benefit of getting the GPU fan colored: The remaining fans in the whole image are also from the NCT6793 sensor (along with MoBo and CPU temp in first image). I'm guessing that it doesn't particularly care to call the same sensor twice. Not a show stopper; this actually fixed my original request (getting drives colorized). anything else is probably out-of-scope. Thanks, @lasers!!!! |
You should try putting everything in one config... For starters, go with I might add Your issue with fans... I think it may be already fixable by fixing up your sensors.conf https://github.com/lm-sensors/lm-sensors/blob/master/etc/sensors.conf.eg.... You need to add EDIT: Your issue with fans not being colorized... is due to values. There is nothing to compare against. You can try changing them with |
This fan have "fan1":{
"fan1_input": 2055.000,
"fan1_min": 0.000,
"fan1_max": 3600.000
}, This fans doesn't have "CHA_FAN1":{
"fan1_input": 1106.000,
"fan1_min": 0.000,
"fan1_alarm": 0.000,
"fan1_beep": 0.000,
"fan1_pulses": 2.000
},
"CPU_FAN":{
"fan2_input": 1800.000,
"fan2_min": 0.000,
"fan2_alarm": 0.000,
"fan2_beep": 0.000,
"fan2_pulses": 2.000
},
"M_2_FAN":{
"fan3_input": 0.000,
"fan3_min": 0.000,
"fan3_alarm": 0.000,
"fan3_beep": 0.000,
"fan3_pulses": 2.000
},
"AIO_PUMP":{
"fan5_input": 1434.000,
"fan5_min": 0.000,
"fan5_alarm": 0.000,
"fan5_beep": 0.000,
"fan5_pulses": 2.000
},
"CHA_FAN2":{
"fan6_input": 1162.000,
"fan6_min": 0.000,
"fan6_alarm": 0.000,
"fan6_pulses": 2.000
}, EDIT: Try |
Ok. So the machine idled for a couple of hours this afternoon, and no matter what I tried, this is the current output: Here's my updated config:
If I don't use a I'll try playing some more tomorrow.
Already have one (both for the nct6793 (eg: the aio_pump is actually a header on my mobo, and is called fan5 normally) and drivetemp. Since I set my fan curves in BIOS, the .conf file has no effect for setting a min speed.
I'll play around with that tomorrow as well. Thanks!!! |
I see two I'll put together an updated config for you to try later. |
Yeah; I can't come up with a way to combine
Using the former, I'd get 1191°C, (fan speed) the latter would give me 42 RPM (temp)
That's cool... |
To give you an answer right now... Something like this.
Crazy, I know.
|
Untested in the config. lm_sensors {
format_chip = '{format_sensor}'
format_sensor = ''
format_sensor += '[\?if=name=samsung_860_ssd_(sda) SDA [\?color=auto.input {input:.0f}°C]]'
format_sensor += '[\?if=name=samsung_860_ssd_(sdb) SDB [\?color=auto.input {input:.0f}°C]]'
format_sensor += '[\?if=name=hitachi_hds72302_(sdc) SDC [\?color=auto.input {input:.0f}°C]]'
format_sensor += '[\?if=name=motherboard MB [\?color=auto.input {input:.0f}°C]]'
format_sensor += '[\?if=name=cpu CPU [\?color=auto.input {input:.0f}°C]]'
format_sensor += '[\?if=name=edge GPU [\?color=auto.input {input:.0f}°C]]'
format_sensor += '[\?if=name=composite NVMe [\?color=auto.input {input:.0f}°C]]'
format_sensor += '[\?if=name=fan1 GPU Fan [\?color=auto.input {input} RPM]]'
format_sensor += '[\?if=name=aio_pump Pump [\?color=auto.input {input} RPM]]'
format_sensor += '[\?if=name=cpu_fan CPU Fan [\?color=auto.input {input} RPM]]'
format_sensor += '[\?if=name=cha_fan1 Top Fan [\?color=auto.input {input} RPM]]'
format_sensor += '[\?if=name=cha_fan2 Rear Fan [\?color=auto.input {input} RPM]]'
chips = ["drivetemp-scsi-0-0", "drivetemp-scsi-2-0", "drivetemp-scsi-4-0"]
chips += ["nct6793-*", "*-pci-*"]
sensors = ['samsung*', 'hitachi*']
sensors += ['input', 'composite', 'edge', 'motherboard', 'cpu']
sensors += ['aio_pump', 'cpu_fan', 'cha_fan1', 'cha_fan2', 'fan1']
format_chip_separator = '\?color=lightblue \|'
format_sensor_separator = '\?color=lightpink \|'
color_excl_input = "lightgreen"
} |
@lasers, you are the $BEING!!!!! Thank you so much!! |
e977579
to
6ea8c62
Compare
Well I'm in after the fight and once again @lasers mastered it all, you'll never cease to impress me as you're far way better than me on this formatting things... So thanks a lot @lasers and thanks @mlmatlock for your nice gesture which I don't feel I deserve :/ |
Config
chips
worked perfectly before we switched from-u Raw output
to-j Json output
.The issue is that
sensor -j
does not always output valid json with multiple chips.If you specify multiple chips using wildcard, you get valid json.
If you specify multiple chips individually, you don't get valid json.
This dirty fix is a workaround to deal with invalid json lm-sensors/lm-sensors#372.
Ought to close #2224.