Cisco light levels not reported correctly

There appears to be a bug in the way that libreNMS reports light levels. I have a 3850-48T reporting -1.7 dbm at the command line for rx power while libre shows -.1. The tx power is reported as -2.4 at the cli while libre shows -.2. It appears there may be a decimal point error somewhere.

Can you pastebin ./poller.php -d -h hostname -m sensors/dBm

https://pastebin.com/3ieu6qzz

Something went wrong. That didnt polled sensors/dBm. What command you used exactly?

Expected to see:
Modules status: Global+ OS Device
#### Load poller module sensors ####

./poller.php -d -h myhostname -m sensors/dBm

And you have in your gui the optics dBm for that device? Are they under dBm health sensors?

image

Take a look to Getting dbm info from Cisco devices
I think its the IOS-XE version that have problems reporting optics levels in snmp

Before the update the levels weren’t reported at all. The thread you pointed me to is my own.

I think there’s a legit bug on Cisco’s side reporting the data via SNMP. The update to Denali made it start reporting, but digging further into the snmp data:

snmpwalk -v 2c labswitch | grep -i 1120 gives me the names of things.
SNMPv2-SMI::mib-2.47.1.1.1.1.2.1120 = STRING: “Te1/1/4 Receive Power Sensor”
SNMPv2-SMI::mib-2.47.1.1.1.1.3.1120 = OID: SNMPv2-SMI::enterprises.9.12.3.1.8.46
SNMPv2-SMI::mib-2.47.1.1.1.1.4.1120 = INTEGER: 1115
SNMPv2-SMI::mib-2.47.1.1.1.1.5.1120 = INTEGER: 8
SNMPv2-SMI::mib-2.47.1.1.1.1.6.1120 = INTEGER: 5
SNMPv2-SMI::mib-2.47.1.1.1.1.7.1120 = STRING: “Te1/1/4 Receive Power Sensor”
SNMPv2-SMI::mib-2.47.1.1.1.1.8.1120 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.9.1120 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.10.1120 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.11.1120 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.12.1120 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.13.1120 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.14.1120 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.15.1120 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.16.1120 = INTEGER: 2
SNMPv2-SMI::mib-2.47.1.1.1.1.17.1120 = Hex-STRING: 00 00 00 00 00 00 00 00
SNMPv2-SMI::mib-2.47.1.1.1.1.18.1120 = “”
SNMPv2-SMI::mib-2.47.1.3.3.1.1.1115.1120 = INTEGER: 1120

snmpwalk -v 2c -c labswitch 1.3.6.1.4.1.9.9.91.1.1.1.1 shows me values

snmpwalk -v 2c -c labswitch 1.3.6.1.4.1.9.9.91.1.1.1 | grep 1120
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.1.1120 = INTEGER: 14
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.2.1120 = INTEGER: 9
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.3.1120 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.1120 = INTEGER: -1
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.5.1120 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.6.1120 = Timeticks: (1) 0:00:00.01
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.7.1120 = INTEGER: 600
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.8.1120 = INTEGER: 1115

Same with Tx power:

snmpwalk -v 2c -c labswitch | grep -i 1119
SNMPv2-SMI::mib-2.47.1.1.1.1.2.1119 = STRING: “Te1/1/4 Transmit Power Sensor”
SNMPv2-SMI::mib-2.47.1.1.1.1.3.1119 = OID: SNMPv2-SMI::enterprises.9.12.3.1.8.47
SNMPv2-SMI::mib-2.47.1.1.1.1.4.1119 = INTEGER: 1115
SNMPv2-SMI::mib-2.47.1.1.1.1.5.1119 = INTEGER: 8
SNMPv2-SMI::mib-2.47.1.1.1.1.6.1119 = INTEGER: 4
SNMPv2-SMI::mib-2.47.1.1.1.1.7.1119 = STRING: “Te1/1/4 Transmit Power Sensor”
SNMPv2-SMI::mib-2.47.1.1.1.1.8.1119 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.9.1119 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.10.1119 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.11.1119 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.12.1119 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.13.1119 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.14.1119 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.15.1119 = “”
SNMPv2-SMI::mib-2.47.1.1.1.1.16.1119 = INTEGER: 2
SNMPv2-SMI::mib-2.47.1.1.1.1.17.1119 = Hex-STRING: 00 00 00 00 00 00 00 00
SNMPv2-SMI::mib-2.47.1.1.1.1.18.1119 = “”
SNMPv2-SMI::mib-2.47.1.3.3.1.1.1115.1119 = INTEGER: 1119

snmpwalk -v 2c -c labswitch 1.3.6.1.4.1.9.9.91.1.1.1 | grep 1119
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.1.1119 = INTEGER: 14
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.2.1119 = INTEGER: 9
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.3.1119 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.1119 = INTEGER: -2
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.5.1119 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.6.1119 = Timeticks: (1) 0:00:00.01
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.7.1119 = INTEGER: 600
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.8.1119 = INTEGER: 1115

1.3.6.1.4.1.9.9.91.1.1.1.1.4 is the Cisco sensor info. The -1 and -2 match what libre is showing(Seems that Cisco is not storing the value properly), except the graph seems to be dividing the number by quite a bit.

If I’m understanding this correctly the numbers should be stored in the Cisco SNMP data as -24 and -17, which libre would then divide by 10. Is they any way to fix it for this situation so we at least get the whole number portion logged? I realize that with the way the dbm scale works this is still very inaccurate.

If Cisco report incorrectly the values, there is no way to LibreNMS to show them correctly.
Im using IOS-XE 15.4(1)S in an asr1002-x and reports correctly.

PD: Sorry, didnt saw the other post is also yours

Is there any part of the code that we edit to provide ourselves with a temporary workaround to at least display the whole number? Cisco is somewhat notorious for taking a long time to fix bugs.

Well. Im not sure for what Im going to say but, if you check includes/polling/sensor/dbm/iosxr.inc.php you will have a start to modifying sensor value.

I’ll start making and iosxe.inc.php in that directory with a *10 math operation to $sensor_value

Let us know if that works. If anyone with same problem comes here will have a solution