I am trying to add support for FiberStore datacenter switches (N5860 in my specific case). One odd thing I’ve run across is that the SFP optical power levels are split across two integer OIDs, like:
for a value of -2.07. Is there a way to turn this into a single value for LibreNMS? I.e. fetch two values, do math (which is harder because the decimal part appears to be absolute), then treat as a single value for storage/graph use?
Hi @cmadamsgit
This is possible but not with YAML discovery, only using PHP code. You need to create a discovery and a poller code for your sensors, and impement the math here. Then the result will be saved as a single value in both DB and graphs.
In the discovery code, you can do all in one file and get the proper value into the discover_sensor function. Of course, you won’t be able to put more than one OID. You will only put the main one, but this should not be a problem, cause you’ll also patch the polling code.
For the polling part:
you can pre-cache the 2 missing OIDs (decimal and sign).
in the polling file itself, you do the math with the 3 OID values, and put the result in the variable so it will get added automatically to the DB as well as the graphs.
But as it turns out, there are variables returned that aren’t documented in the MIB… but appear to be the whole dBm scaled by 100, so I don’t think I’ll have to do anything special after all (I’ve opened a ticket with FiberStore to see if they have updated MIBs that document this - I think the alarm levels are in there too, and it’d be nice to be sure).
and that did not work. I’ve asked FiberStore for an updated MIB, but is there any relative easy way to handle this, other than just editing the MIB file?