Explain the Function of SNMP in Network Operations

Explain the function of SNMP in network operations

Picture a network operations center (NOC) monitoring thousands of devices — routers, switches, firewalls, servers — spread across dozens of locations. No human team could manually log into each device every few minutes to check CPU load, interface traffic, or temperature. SNMP (Simple Network Management Protocol) was created to solve exactly this problem: it allows a central management system to automatically query and monitor huge numbers of devices, and even receive automatic alerts when something goes wrong.

This article explains SNMP from first principles, covers its versions and security model, and walks through configuration, verification, and practical automation.

What Problem Does SNMP Solve?

Without SNMP, monitoring a network at scale would require either manual CLI checks (impossible at scale) or a unique custom monitoring tool for every vendor’s device. SNMP provides a standardized, vendor-neutral protocol so that a single monitoring platform (like SolarWinds, PRTG, Zabbix, or LibreNMS) can query devices from Cisco, Juniper, HP, Linux servers, and more, all using the same protocol.

Core Components of SNMP

ComponentRole
SNMP ManagerThe central monitoring system that requests data (e.g., a NOC monitoring server)
SNMP AgentSoftware running on the managed device (router, switch, server) that responds to queries
MIB (Management Information Base)A structured database defining what data can be queried on a device (e.g., CPU load, interface counters)
OID (Object Identifier)A unique numeric address for a specific piece of data within the MIB (e.g., 1.3.6.1.2.1.1.5.0 = system name)
TrapAn unsolicited alert sent from the agent to the manager when something significant happens

How SNMP Communication Works

SNMP defines a small set of operations:

  • GET — Manager asks the agent for a specific value.
  • GET-NEXT — Manager asks for the next value in the MIB tree (used to “walk” through a table of values).
  • SET — Manager changes a value on the agent (rarely used, since it requires write access).
  • TRAP — Agent proactively sends an alert to the manager, without being asked.
  • INFORM — Like a trap, but the agent expects an acknowledgment back, making it more reliable.
sequenceDiagram
    participant Manager as SNMP Manager (NOC)
    participant Agent as SNMP Agent (Router)
    Manager->>Agent: GET-REQUEST (OID: CPU utilization)
    Agent-->>Manager: GET-RESPONSE (value: 42%)
    Note over Agent,Manager: Later, interface goes down unexpectedly
    Agent->>Manager: TRAP: Interface Gi0/1 down

SNMP Versions and Why Security Matters

VersionAuthenticationEncryptionSecurity Level
SNMPv1Community string (plaintext)NoneVery weak
SNMPv2cCommunity string (plaintext)NoneWeak (adds GET-BULK, better performance, still insecure)
SNMPv3Username/password (hashed)Optional AES encryptionStrong

Community strings in SNMPv1/v2c act like a shared password (commonly public for read-only and private for read-write by default) — but they travel across the network in plaintext, meaning anyone capturing traffic can read them and potentially gain access to sensitive monitoring data or even modify device configuration if a write community is exposed. This is why SNMPv3, which supports real authentication and encryption, is strongly recommended in any production or security-conscious environment.

Configuring SNMP on a Cisco Router

SNMPv2c (Simpler, Read-Only Example)

Router(config)# snmp-server community MonitorRO ro
Router(config)# snmp-server community MonitorRW rw
Router(config)# snmp-server location "HQ - Server Room B"
Router(config)# snmp-server contact "netops@company.com"

Restrict access with an ACL for extra safety, even on v2c:

Router(config)# access-list 40 permit 10.1.1.50
Router(config)# snmp-server community MonitorRO ro 40

Configuring SNMP Traps (v2c)

Router(config)# snmp-server enable traps
Router(config)# snmp-server host 10.1.1.50 version 2c MonitorRO

SNMPv3 (Recommended, Secure Example)

Router(config)# snmp-server group NOC-GROUP v3 priv
Router(config)# snmp-server user netmon NOC-GROUP v3 auth sha AuthPass123 priv aes 128 PrivPass123
Router(config)# snmp-server host 10.1.1.50 version 3 priv netmon

This configuration:

  • Uses SHA for authentication.
  • Uses AES-128 for encryption of the SNMP data itself.
  • Requires both a valid username and matching authentication/privacy passwords — far stronger than a plaintext community string.

Verifying SNMP Configuration

Router# show snmp
Router# show snmp community
Router# show snmp user
Router# show snmp group
Router# show run | section snmp

Example show snmp output snippet:

Chassis: 12345678
0 SNMP packets input
0 Bad SNMP version errors
0 Unknown community name
...
SNMP packets output
0 Too big errors

Testing from a Linux machine using snmpwalk (part of the net-snmp package):

sudo apt install snmp -y

# SNMPv2c GET example - query system uptime
snmpget -v2c -c MonitorRO 192.168.1.1 1.3.6.1.2.1.1.3.0

# SNMPv2c WALK example - list all interface descriptions
snmpwalk -v2c -c MonitorRO 192.168.1.1 1.3.6.1.2.1.2.2.1.2

# SNMPv3 example
snmpget -v3 -u netmon -l authPriv -a SHA -A AuthPass123 -x AES -X PrivPass123 192.168.1.1 1.3.6.1.2.1.1.5.0

Common OIDs You Should Know

OIDMeaning
1.3.6.1.2.1.1.1.0sysDescr — system description
1.3.6.1.2.1.1.3.0sysUpTime — how long the device has been running
1.3.6.1.2.1.1.5.0sysName — device hostname
1.3.6.1.2.1.2.2.1.2ifDescr — interface descriptions (table)
1.3.6.1.2.1.2.2.1.10ifInOctets — bytes received on an interface
1.3.6.1.2.1.2.2.1.16ifOutOctets — bytes sent on an interface
flowchart TD
    A[MIB Tree Root] --> B[1.3.6.1 - Internet]
    B --> C[1.3.6.1.2.1 - MIB-2]
    C --> D[1.3.6.1.2.1.1 - System Group]
    C --> E[1.3.6.1.2.1.2 - Interfaces Group]
    D --> F[sysDescr, sysUpTime, sysName]
    E --> G[ifDescr, ifInOctets, ifOutOctets]

SNMP Agent on Linux (net-snmp)

sudo apt install snmpd -y
sudo nano /etc/snmp/snmpd.conf
rocommunity MonitorRO 10.1.1.50
syslocation "Data Center A"
syscontact netops@company.com
sudo systemctl restart snmpd
sudo systemctl status snmpd

Test locally:

snmpwalk -v2c -c MonitorRO localhost 1.3.6.1.2.1.1

Automating SNMP Polling with Python

The pysnmp library allows engineers to build custom monitoring scripts — useful for quick checks or integrating SNMP data into custom dashboards.

from pysnmp.hlapi import *

def snmp_get(host, community, oid):
    iterator = getCmd(
        SnmpEngine(),
        CommunityData(community),
        UdpTransportTarget((host, 161)),
        ContextData(),
        ObjectType(ObjectIdentity(oid))
    )
    errorIndication, errorStatus, errorIndex, varBinds = next(iterator)
    if errorIndication:
        print(errorIndication)
    else:
        for varBind in varBinds:
            print(f"{varBind[0]} = {varBind[1]}")

# Query system uptime
snmp_get("192.168.1.1", "MonitorRO", "1.3.6.1.2.1.1.3.0")

This kind of lightweight script forms the backbone of many custom monitoring tools that poll dozens of OIDs across a fleet of devices on a schedule.

Comparison Table: SNMP vs Syslog vs NetFlow

FeatureSNMPSyslogNetFlow/IPFIX
PurposePolled + trap-based device metricsEvent/log messagesTraffic flow analysis
Data DirectionPull (GET) and Push (Trap)Push onlyPush only
Typical UseCPU, memory, interface stats, alertsErrors, warnings, config changesBandwidth usage by application/host
Security (modern)SNMPv3 (encrypted)Syslog over TLSUsually unencrypted, sent within trusted network

Best Practices

  • Never use default community strings (public/private) — always customize them.
  • Prefer SNMPv3 with authentication and encryption over v1/v2c whenever the platform supports it.
  • Restrict SNMP access with an ACL, even when using v2c, limiting queries to known monitoring server IPs.
  • Use read-only communities for monitoring; reserve read-write access only for systems that genuinely need to push configuration changes via SNMP (increasingly rare in modern network automation, which favors APIs/NETCONF instead).
  • Configure traps for critical events (interface down, high CPU, power supply failure) so problems are reported immediately instead of waiting for the next poll cycle.
  • Regularly review and rotate SNMP credentials as part of standard security hygiene.

Troubleshooting

SymptomLikely CauseFix
SNMP GET times outWrong community string, ACL blocking, or SNMP not enabledVerify show snmp community, check ACL, confirm agent enabled
Traps never arrive at managerWrong host IP in snmp-server host, UDP/162 blocked by firewallVerify config, check firewall rules for UDP 162
“Unknown community name” errorsMismatched community string between manager and agentRe-check both sides carefully — case-sensitive
SNMPv3 authentication failsMismatched auth/priv passwords or algorithmsConfirm SHA/AES settings match exactly on both ends
High CPU on device from SNMP pollingPolling interval too aggressive, or polling large tables (bulk walks)Increase poll interval, limit OIDs polled to what’s needed

Real-World Example: Building a Monitoring Baseline

A NOC team deploys SNMPv3 across all core and distribution switches to feed a central monitoring platform (e.g., LibreNMS):

snmp-server group NOC-MONITORING v3 priv
snmp-server user noc_poller NOC-MONITORING v3 auth sha $ANSIBLE_VAULT_AUTH priv aes 128 $ANSIBLE_VAULT_PRIV
snmp-server host 10.1.1.50 version 3 priv noc_poller
snmp-server enable traps snmp linkdown linkup
snmp-server enable traps cpu threshold

The monitoring platform polls interface utilization every 5 minutes and immediately receives traps the moment a link goes down or CPU crosses a defined threshold — giving the NOC both a historical trend view and real-time alerting from a single protocol.

Conclusion

SNMP is the standardized backbone of network monitoring, letting a central system pull metrics from and receive alerts across an entire multi-vendor infrastructure using a common protocol. Understanding its components — managers, agents, MIBs, OIDs, and the critical difference between insecure community-string versions and the encrypted SNMPv3 — is essential for building visibility into any production network.

References

  1. RFC 3411 – SNMP Management Framework — https://datatracker.ietf.org/doc/html/rfc3411
  2. Cisco SNMP Configuration Guide — https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/snmp/configuration/xe-16/snmp-xe-16-book.html
  3. net-snmp Official Documentation — http://www.net-snmp.org/docs/
  4. pysnmp Documentation — https://pysnmp.readthedocs.io/
  5. RFC 3414 – User-based Security Model for SNMPv3 — https://datatracker.ietf.org/doc/html/rfc3414
  6. Cisco MIB Locator — https://cisco.com/go/mibs
Total
0
Shares

Leave a Reply

Previous Post
Explain the role of DHCP and DNS within the network

Explain the Role of DHCP and DNS Within the Network

Next Post
Describe the use of syslog features including facilities and levels

Describe the Use of Syslog Features Including Facilities and Levels

Related Posts