I have a strange problem with the ethernet interface of my laptop (Dell XPS 15 with Linux Mint 18.1) in LibreNMS. When I start my laptop the interface name in LibreNMS is ‘eth0’. LibreNMS does not draw interface graphics for this interface. When I restart the snmd service on my laptop the proper interface name is polled and interface graphics are drawn.
I’d say this is most likely the case of ifIndex value changing and it needs to be rediscovered. You could try changing the default port association mode for that device and set it to something ifName or ifDescr.
This is before I restart the snmp daemon on my laptop.
When I do snmpwalk -v 2c -c public 192.168.1.95 | grep -i enx18dbf260f245 on my laptop one of the output lines is: iso.184.108.40.206.220.127.116.11.2.3 = STRING: "enx18dbf260f245", which translates to iso.org.dod.internet.mgmt.mib-2.interfaces.iftable.ifentry.ifdescr.3
So I set the Port Association Mode to “ifDescr”, so it should read ‘enx18dbf260f245’. But after the next polling round only my deactivated wireless interface with the IP address of my LAN port, shows up:
This is the ouput of ‘./poller.php -h laptop_erik -d -m ports’. The strange thing is that ifDescr and ifName both show up in the snmpbulkwalk with the value ‘enx18dbf260f245’.
But when I set Port Association Mode to “ifDescr” or “ifName” the interface ‘enx18dbf260f245’ does not show up. Only the wireless interface with the IP address of my LAN port, shows up.
When I restart the snmp daemon and set Port Association Mode back to ‘ifIndex’ again the wireless interface shows up two times as seen in the first picture. The interface ‘enx18dbf260f245’ does not show up at all.
Will reboot my laptop to see if the exact thing as described above will happen again.
[EDIT]. Rebooted the laptop. But now the interfaces appear as follows in LibreNMS:
I am a bit puzzled here. The first interface shows the name of my wireless interface, with the MAC address of the wireless interface and the graphs of the Ethernet interface. Then second interface shows the name of my wireless interface, with the MAC address of the wireless interface but with the IP address of my LAN interface.
I am beginning to suspect my LAN interface. I have a Dell XPS15 with a external Thunderbolt to Ethernet adapter. This adapter seems still a bit buggy under Linux. Sometimes I have to pull out and reinsert the adapter to get network connection. Maybe this is causing the trouble with the SNMP daemon.
So this is what happens. The event log lines from 10:45:03 - 10:50:11 appear when I start my laptop. When I restart the snmp daemon the eventlog lines 11:20:11 - 11:20:14 appear. Clearly when the snmp daemon is started the wrong interface name is advertised in snmp.
Maybe it is my Linux Mint version. I still have 18.0 installed. It has a rather old 4.4.0 kernel. Maybe this kernel is a bit outdated for my relatively new hardware (Dell XPS 15 9550). When I have a bit of time I will try a version bump from mint 18.0 to 18.3 which has a 4.10 kernel.
My dmesg output however, shows that the lan interface is renamed way before the snmp daemon is started
[ 4.899843] r8152 4-1:1.0 eth0: v1.08.6
[ 5.751696] r8152 4-1:1.0 enx18dbf260f245: renamed from eth0
[ 5.775808] IPv6: ADDRCONF(NETDEV_UP): enx18dbf260f245: link is not ready
[ 5.805620] IPv6: ADDRCONF(NETDEV_UP): enx18dbf260f245: link is not ready
[ 8.107933] IPv6: ADDRCONF(NETDEV_CHANGE): enx18dbf260f245: link becomes ready
[ 626.837156] VBoxNetFlt: attached to ‘enx18dbf260f245’ / 18:db:f2:60:f2:45
If a newer kernel does not help maybe I have to investigate the SNMP daemon and it’s startup process.