Sensor Customization (Health)

Hi,

I have been messing with lm-sensors on one of my Linux boxes - to change the names to be a bit more descriptive / useful (e.g. in2 => +12V), and also to change the scaling factor … as some power supplies, like +12V and +5V, need a scaling factor (i.e. it87xx limits to ~ 3V input range). This all works fine, but … it’s not seen by LibreNMS. Is there a way to have the name change carry over (or at least be able to customize in LibreNMS), and also read across the scaling factor (as the voltages in LibreNMS are not correct - again, at least the ability to customize them in LibreNMS, on a per-client basis)?

One step even further would be for LibreNMS to use the custom alarm limits set up in lm-sensors.

Thanks!

If those changes are sent back in the same way we normally expect then it should just need a discovery.

I’m guessing they aren’t though and you’ll need to add actual support for the sensors.

Yep, that makes sense - and I’m guessing the same … it’s sending back values without the scaling / corrections from lm-sensors. I admin, not real sure of the interface that LibreNMS is using (not lm-sensors I assume?). Is there any info on this anywhere? I’m happy to dig into this more, see what I can do - but so far no real luck finding any info in it.

Thanks!

Unfortunately all we have for this is the code.

find includes/discovery/sensors/ -name unix.inc.php
includes/discovery/sensors/voltage/unix.inc.php
includes/discovery/sensors/fanspeed/unix.inc.php
includes/discovery/sensors/temperature/unix.inc.php

OK, I just checked this node (part of voltage in the MIB file),
.iso.org.dod.internet.private.enterprises.ucdavis.ucdExperimental.lmSensors.lmVoltSensorsTable

And the names and scaled voltages are there! So we have a chance … ;-). Could it be that I have to wipe out my sensor data, re-discover / re-load?

Thanks!

OK, interestingly enough … after a reboot, the sensors are all updated … ;). And I can see in the recent events, that’s what triggered it.

So I guess I need to clear out the legacy sensor data - it’s all misaligned now. Is there an easy way to do this?

Thanks!

What do you mean it’s misaligned now? Any sensors which aren’t sent back by snmp will be removed so I expect the device is still sending all this data.

Sorry, meaning that the voltages before didn’t include scaling, now they do … so the old data and new (and limits) don’t really align … make sense?

That said, I’ll just clear out the legacy lm-sensors data (for this client only). Is there an easy way to do that?

Thanks!

If you mean that you have two sensors then either the device is sending both sets of data or the OID and index is the same so the DB isn’t clearing out. SELECT * FROM sensors WHERE device_id=X; then just DELETE FROM SENSORS WHERE sensor_id=y; for duplicates.

Yep, that did it - thanks! For some reason, a couple of the old ones were not cleared out. Did it manually, and all is good now … :smile:

Thanks again.