monitor transceiver temps?

Started by OPNsense4ever, November 28, 2024, 05:58:50 AM

Previous topic - Next topic
Is there a way to monitor transceiver temps with SNMP? It doesn't look like there is anything there without modifying the SNMP config files manually.

If there isn't I'll request it as a feature?

What chipset are these interfaces? For example by appliance uses the axp (AMD 10G) driver.

With that knowledge you can check if the driver is able to read and deliver that information at all. Unfortunately in my case it doesn't. So what the kernel does not know you cannot report via SNMP and consequently a feature request does not make much sense, I guess.

I don't know if that is a hardware limitation of the chipset or a lacking implementation in FreeBSD.

To check what information is available for your interfaces (substitute the proper device):
sysctl dev.ax

No temperature data  :(
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

December 02, 2024, 12:47:34 AM #2 Last Edit: December 02, 2024, 12:59:01 AM by OPNsense4ever
That info is definitely available via my Intel NICs.

# ifconfig -v ixl3 | awk '/module temperature/'
   module temperature: 52.00 C voltage: 3.25 Volts

I assume this information is getting to ifconfig via DDM? https://community.fs.com/article/how-to-view-the-ddm-information-of-optical-transceiver-via-snmp.html

Looks like it is just an SNMP configuration, but there isn't a way to make customized configs anymore.

You are right - same for me:
root@opnsense:~ # ifconfig -v ax0
ax0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        [...]
module temperature: 50.95 C voltage: 3.30 Volts


It's not in the FreeBSD sysctl OID tree and neither does net-snmp expose these values in any way.

But the strength of net-snmp over bsnmpd is that it can easily be extended with simple shell scripts mapped to an OID.

So the question before I start hacking on this: do you know where exactly this value should end up in the SNMP MIB?
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

December 02, 2024, 06:08:35 PM #4 Last Edit: December 03, 2024, 08:26:30 PM by OPNsense4ever
Thanks Patrick!

Unfortunately I don't know where that MIB should end up. I looked around a bit and various switches put it in different places.

I stuck it in .1.3.6.1.4.1.2021.7890.5 as it was just the next one in /usr/local/share/snmp/snmpd.conf.

extend .1.3.6.1.4.1.2021.7890.1 distro /usr/local/opnsense/scripts/OPNsense/Netsnmp/distro.sh
extend .1.3.6.1.4.1.2021.7890.2 hardware /bin/kenv smbios.planar.product
extend .1.3.6.1.4.1.2021.7890.3 vendor /bin/kenv smbios.planar.maker
extend .1.3.6.1.4.1.2021.7890.4 serial /bin/kenv smbios.planar.serial
extend .1.3.6.1.4.1.2021.7890.5 ixl3_temp /usr/local/bin/ixl3_temp.sh


/usr/local/bin/ixl3_temp.sh:

#!/bin/sh
# Extract the module temperature from ifconfig output
ifconfig -v ixl3 | awk '/module temperature/ {print $3}'


It "works," but obviously gets overwritten quickly.

I'll go ask on the Observium discord. I'm interested in coding a generic solution. An option switch or a list of interfaces in the SNMP plugin menu.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)