Updated: 16 November 2026 · Applies to: Net-SNMP 5.9.4 (snmpd) on AlmaLinux 10 and Debian 13
When SNMP monitoring times out, shows gaps or makes snmpd use a lot of CPU on a busy server, the usual cause is the TCP connection table. A monitoring tool that walks the whole tree asks snmpd to list every open TCP connection, and on a web or mail server with thousands of connections that takes longer than the poller waits. The fix is to exclude the connection tables from the SNMP view while keeping everything else, including the TCP counters.
Fix: exclude the TCP connection tables
- Open
/etc/snmp/snmpd.confand find the view your community uses. Look at therocommunityline (-Vnames the view) or theaccessline. On a stock Debian 13 server it issystemonly; on a stock AlmaLinux 10 server it issystemview. In the example below the view is calledall. - Add
excludedlines with that same view name, below itsincludedlines:view all included .1 view all excluded .1.3.6.1.2.1.6.13 view all excluded .1.3.6.1.2.1.6.19
.1.3.6.1.2.1.6.13isTCP-MIB::tcpConnTableand.1.3.6.1.2.1.6.19isTCP-MIB::tcpConnectionTable(the newer version of the same list, with IPv6). - Restart the agent:
systemctl restart snmpd
- Check that the table is hidden and the counters still answer. Replace
COMMUNITYwith your community string:snmpwalk -v2c -c COMMUNITY 127.0.0.1 TCP-MIB::tcpConnectionState
Output after the change:TCP-MIB::tcpConnectionState = No Such Object available on this agent at this OID
snmpget -v2c -c COMMUNITY 127.0.0.1 TCP-MIB::tcpCurrEstab.0
Output:TCP-MIB::tcpCurrEstab.0 = Gauge32: 100
In our lab test with about 100 open connections, the same walk returned 122 rows before the change and none after, while tcpCurrEstab (the number of established connections, which most graphs use) kept working.
Why the view name matters
According to the Net-SNMP manual, several view lines with the same name are combined, and excluded entries cut a subtree out of what included lines allow. An excluded line with a view name that no community uses has no effect. So a line such as view all excluded .1.3.6.1.2.1.6 only helps if your community really reads the view called all.
Older guides exclude the whole TCP group, .1.3.6.1.2.1.6. That also works, but it hides the TCP counters too (established connections, resets, retransmissions), so your monitoring loses those graphs. Excluding only the two tables is enough.
If UDP is also busy (for example a DNS server), the UDP listener tables can be excluded the same way: .1.3.6.1.2.1.7.5 (udpTable) and .1.3.6.1.2.1.7.7 (udpEndpointTable).
Check how many connections the server has
ss -s
If the TCP total runs into thousands, the connection table is very likely what slows SNMP down. You can time a walk of it to be sure:
time snmpwalk -v2c -c COMMUNITY 127.0.0.1 TCP-MIB::tcpConnectionTable | wc -l
Other reasons SNMP does not answer
- snmpd listens only on localhost. Debian's default
snmpd.confhasagentaddress 127.0.0.1,[::1], so a remote poller gets no reply. According to the Net-SNMP manual, without anagentaddressline the agent listens on UDP port 161 on all IPv4 interfaces. To listen on one public address only, use for exampleagentaddress udp:203.0.113.10:161. - The view is too small. Both stock configurations only show the system group and a small part of the host resources group to the
publiccommunity, so interface traffic is missing. Add anincludedline for what you need, such as.1.3.6.1.2.1.2(interfaces) and.1.3.6.1.2.1.31(64-bit interface counters). - The firewall blocks UDP 161. Allow it only from your monitoring server's address, not from everyone. See How to Open a Port in Linux and Ubuntu: Firewall Commands and How to Open a Port in the Firewall on RHEL, AlmaLinux and Rocky Linux.
- The poller gives up too early. Raise the timeout on the monitoring side, for example
snmpwalk -t 10 -r 1(10 seconds, one retry).
Use a long, random community string (or SNMPv3 with a user and password) and never leave public open to the internet. If you would rather not run SNMP yourself, our server monitoring service can watch the server for you.
Official documentation: snmpd.conf manual page.