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 :(
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?
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.
Observium folks give you any guidance?
Nope, there is no specific place to use. Thanks for reminding me to at least report back. I have another idea I could try.
OK, so longer exchange with Adam Armstrong on the Observium Discord ...
As long as there is no MIB on OPNsense with net-snmp that provides these values where Observium expects them, there is no way to inject them via scripting on the OPNsense side.
I.e. if Observium detects a switch as e.g. Mikrotik RouterOS it walks the MIKROTIK-MIB which among other things contains transceiver temperatures if there are any transceivers present. Similarly if Cisco IOS is detected etc. etc.
OPNsense with net-snmp has these MIBs:
DISMAN-EVENT-MIB
HOST-RESOURCES-MIB
IF-MIB
IP-FORWARD-MIB
IP-MIB
IPV6-ICMP-MIB
IPV6-MIB
IPV6-TCP-MIB
IPV6-UDP-MIB
MTA-MIB
NET-SNMP-AGENT-MIB
NET-SNMP-EXTEND-MIB
NET-SNMP-VACM-MIB
NOTIFICATION-LOG-MIB
SNMP-FRAMEWORK-MIB
SNMP-MPD-MIB
SNMP-TARGET-MIB
SNMP-USER-BASED-SM-MIB
SNMP-VIEW-BASED-ACM-MIB
SNMPv2-MIB
TCP-MIB
UCD-DISKIO-MIB
UCD-DLMOD-MIB
UCD-SNMP-MIB
UDP-MIB
None of which has an OID for any interface related temperature values :-(