Skip to content
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

Custom descriptions for lmsens fields #131

Closed
w41ru5 opened this issue Dec 17, 2015 · 2 comments
Closed

Custom descriptions for lmsens fields #131

w41ru5 opened this issue Dec 17, 2015 · 2 comments

Comments

@w41ru5
Copy link

w41ru5 commented Dec 17, 2015

I have had to do some modifications to my lmsensors configuration to get CPU temps to work with Monitorix. I was wanting to make a custom desc like in other graphs to name my modifications correctly.

@mikaku
Copy link
Owner

mikaku commented Dec 21, 2015

Can you please elaborate it a bit more?

I mean, you could show the current output of your sensors command, then explain why and where it doesn't work in Monitorix, and finally, what modifications you introduced in the lm-sensors configuration file to solve the problem.

This way, I could even create a FAQ for this in the Monitorix web site, so other people could benefit from your solution.

Thanks.

@mikaku
Copy link
Owner

mikaku commented Dec 21, 2015

@w41ru5, thanks for your commentaries in IRC freenode.

I'm going to explain the problem you had with your lm-sensors and the solution you found to solve it:

The Problem

The output of your sensors command uses the same label names for the temperatures of cores in two drivers, which makes impossible to include them in the Monitorix lmsens graph:

http://pastebin.com/TKswX3Ts

# sensors
[...]
coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +30.0°C  (high = +80.0°C, crit = +96.0°C)
Core 1:       +30.0°C  (high = +80.0°C, crit = +96.0°C)
Core 2:       +31.0°C  (high = +80.0°C, crit = +96.0°C)
Core 8:       +32.0°C  (high = +80.0°C, crit = +96.0°C)
Core 9:       +24.0°C  (high = +80.0°C, crit = +96.0°C)
Core 10:      +31.0°C  (high = +80.0°C, crit = +96.0°C)

coretemp-isa-0001
Adapter: ISA adapter
Core 0:       +30.0°C  (high = +80.0°C, crit = +96.0°C)
Core 1:       +29.0°C  (high = +80.0°C, crit = +96.0°C)
Core 2:       +25.0°C  (high = +80.0°C, crit = +96.0°C)
Core 8:       +27.0°C  (high = +80.0°C, crit = +96.0°C)
Core 9:       +28.0°C  (high = +80.0°C, crit = +96.0°C)
Core 10:      +28.0°C  (high = +80.0°C, crit = +96.0°C)
[...]

As you can see Core 0, Core 1, etc. are repeated in drivers coretemp-isa-0000 and coretemp-isa-0001. Monitorix is unable to differentiate them.

The Solution

With the help of the sensors -u command you are able to know the labels that need to be changed in the lm-sensors configuration in order to differentiate all the temperatures (http://pastebin.com/LH5yuZ0J).

Then just edit the file /etc/sensors.d/custom adding the following lines:

chip "coretemp-isa-0000"
    label temp2 "cpu0core0"
    label temp3 "cpu0core1"
    label temp4 "cpu0core2"
    label temp10 "cpu0core3"
    label temp11 "cpu0core4"
    label temp12 "cpu0core5"

chip "coretemp-isa-0001"
    label temp2 "cpu1core0"
    label temp3 "cpu1core1"
    label temp4 "cpu1core2"
    label temp10 "cpu1core3"
    label temp11 "cpu1core4"
    label temp12 "cpu1core5"

Now the output of the sensors command looks like this:

[...]
coretemp-isa-0000
Adapter: ISA adapter
cpu0core0:    +29.0°C  (high = +80.0°C, crit = +96.0°C)
cpu0core1:    +29.0°C  (high = +80.0°C, crit = +96.0°C)
cpu0core2:    +29.0°C  (high = +80.0°C, crit = +96.0°C)
cpu0core3:    +29.0°C  (high = +80.0°C, crit = +96.0°C)
cpu0core4:    +23.0°C  (high = +80.0°C, crit = +96.0°C)
cpu0core5:    +29.0°C  (high = +80.0°C, crit = +96.0°C)

coretemp-isa-0001
Adapter: ISA adapter
cpu1core0:    +29.0°C  (high = +80.0°C, crit = +96.0°C)
cpu1core1:    +27.0°C  (high = +80.0°C, crit = +96.0°C)
cpu1core2:    +27.0°C  (high = +80.0°C, crit = +96.0°C)
cpu1core3:    +26.0°C  (high = +80.0°C, crit = +96.0°C)
cpu1core4:    +28.0°C  (high = +80.0°C, crit = +96.0°C)
cpu1core5:    +28.0°C  (high = +80.0°C, crit = +96.0°C)
[...]

Finally, in the /etc/monitorix/monitorix.conf you can setup the <lmsens> section like this:

<lmsens>
        <list>
                core0   = cpu0core0            
                core1   = cpu0core1
                core2   = cpu0core2
                core3   = cpu0core3
                core4   = cpu0core4
                core5   = cpu0core5
                core6   = cpu1core0
                core7   = cpu1core1
                core8   = cpu1core2
                core9   = cpu1core3
                core10  = cpu1core4
                core11  = cpu1core5
[...]

I hope that helped to anyone with a similar situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants