Openconnect causes SNMP to restart

This is a rather trivial issue but one that is curious...

I use SNMP to monitor a lot of devices, among them OpenWRT. One thing I look for is the SNMP time-up resetting, which is normally an indication that the device rebooted, and I report it as such.

Whenever I connect via OpenConnect, SNMP restarts. I just tried and checked via ps and got a new pid. There's nothing in the system log, it looks like that's off by default and I didn't see off hand a persistent place to change it.

Is there some reason snmp restarts on a VPN connection? Bug? Report to OpenConnect? SNMP? Ignore it and just realize it's going to reset?

The latter is not exactly unreasonable, it's just a bit annoying that it happens. My guess is very few people use snmp for home routers.

I am using snmp to monitor my routers with mrtg.
I have OpenVPN and Wireguard tunnels and I have not noticed such a behavior.
I just tried to connect from my phone to the router over WG and snmpd is still with the same PID.

1 Like

Hmmmm... do you know how to turn on logging for snmp, maybe it's crashing and restarting. I see /etc/config/snmpd but nothing in there jumps out at me unless it's an option under general. Can't find much documentation, figured out most sections in there, but I see the "-Lf /dev/null" on the ps line, but not where it originates.

I tried just killing it and running it manually but it restarts before I can run it by hand and they just ignores my run command.

Never mind... I found the service definition, so long as I don't reboot that seems persistent, let me experiment and see if I can get a log.

Are you doing a down/up of an interface that you bound an IP in snmpd to?

Yep, it's some kind of crash, though not entirely consistent as I did it three times and got two restarts, but the log doesn't quite show the same thing each time. Maybe this will mean something to someone. The ifIndex change kind of makes sense if openconnect is creating a virtual interface, though I would have hoped it created a new, higher one not rearranged. But the subsequent errors (which came a bit later) are probably why it died. Maybe. Though I can't quite reconcile that with where the missing MIB's came out and why they are different on different instances. And the "11<11" is also strange.

Any thoughts?

root@OpenWRT:/etc/init.d# tail -f /tmp/snmp.log
Cannot find module (TUNNEL-MIB): At line 0 in (none)
Cannot find module (IPV6-FLOW-LABEL-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-PASS-MIB): At line 0 in (none)
Turning on AgentX master support.
NET-SNMP version 5.7.3
No pgpgin line in /proc/vmstat
No pgpgout line in /proc/vmstat
No pswpin line in /proc/vmstat
No pswpout line in /proc/vmstat
IfIndex of an interface changed. Such interfaces will appear multiple times in IF-MIB.
error finding row index in _ifXTable_container_row_restore
error finding row index in _ifXTable_container_row_restore
error finding row index in _ifXTable_container_row_restore
error finding row index in _ifXTable_container_row_restore
error finding row index in _ifXTable_container_row_restore
error finding row index in _ifXTable_container_row_restore
NET-SNMP version 5.7.3
buffer too small to read octet string (11 < 11)
MIB search path: //.snmp/mibs:/usr/share/snmp/mibs
Cannot find module (NET-SNMP-EXTEND-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 0 in (none)
Cannot find module (DISMAN-SCHEDULE-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (TUNNEL-MIB): At line 0 in (none)
Cannot find module (IPV6-FLOW-LABEL-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-PASS-MIB): At line 0 in (none)
Turning on AgentX master support.
error finding row index in _ifXTable_container_row_restore
error finding row index in _ifXTable_container_row_restore
NET-SNMP version 5.7.3
No pgpgin line in /proc/vmstat
No pgpgout line in /proc/vmstat
No pswpin line in /proc/vmstat
No pswpout line in /proc/vmstat

Sorry, last post overlapped -- only if OpenConnect does it implicitly. By the way I'm using it in Cisco Anyconnect mode.

What package did you install?

Sorry, should have been more complete.

Openwrt is OpenWrt 18.06.4 r7808-ef686b7292 / LuCI openwrt-18.06 branch (git-19.170.32094-4d6d8bc)

Package snmpd 5.7.3-10

Installed on Linksys WRT1900ACS

1 Like