Skip to content

SNMP Monitoring

This chapter covers SNMP (Simple Network Management Protocol) for network monitoring.


SNMP Versions
+------------------------------------------------------------------+
| |
| SNMPv1 - Original, security by community string |
| +------------------------------------------------------------+ |
| | Read-only and read-write communities | |
| +------------------------------------------------------------+ |
| |
| SNMPv2c - Like v1 with enhanced operations |
| +------------------------------------------------------------+ |
| | GetBulk, GetNext improvements | |
| +------------------------------------------------------------+ |
| |
| SNMPv3 - Secure version |
| +------------------------------------------------------------+ |
| | User-based (USM), View-based (VACM) | |
| | Authentication: MD5, SHA | |
| | Encryption: DES, AES | |
| +------------------------------------------------------------+ |
| |
+------------------------------------------------------------------+

Terminal window
# System
1.3.6.1.2.1.1.1.0 - sysDescr
1.3.6.1.2.1.1.3.0 - sysUpTime
1.3.6.1.2.1.1.5.0 - sysName
# Interface
1.3.6.1.2.2.1.1.2 - ifNumber
1.3.6.1.2.2.1.2.2 - ifDescr
1.3.6.1.2.2.1.10.2 - ifInOctets
1.3.6.1.2.2.1.16.2 - ifOutOctets
# CPU
1.3.6.1.4.1.2021.10.1.5.1 - laLoad.1 (5-min)
1.3.6.1.4.1.2021.10.1.6.1 - laLoad.2 (10-min)
# Memory
1.3.6.1.4.1.2021.4.5.0 - memTotalReal
1.3.6.1.4.1.2021.4.6.0 - memAvailReal
1.3.6.1.4.1.2021.4.11.0 - memTotalFree

Terminal window
# Walk all OIDs
snmpwalk -v2c -c public localhost
# Walk system OIDs
snmpwalk -v2c -c public localhost system
# Walk interface info
snmpwalk -v2c -c public localhost interfaces
# Get specific OID
snmpget -v2c -c public localhost sysUpTime.0
# Get multiple OIDs
snmpget -v2c -c public localhost sysUpTime.0 sysContact.0
Terminal window
# Get system description
snmpget -v2c -c public localhost sysDescr.0
# Get interface statistics
snmpget -v2c -c public localhost ifInOctets.1 ifOutOctets.1
# Get CPU load
snmpget -v2c -c public localhost laLoad.1

Terminal window
# /etc/snmp/snmpd.conf (snmpd.conf)
# SNMPv2c community
rocommunity public
rwcommunity private
# SNMPv3 user
createUser admin MD5 "mypassword" DES
rouser admin authPriv
# System location
syslocation "Data Center Rack 1"
syscontact admin@example.com
# Agent configuration
agentAddress udp:161
/etc/snmp/snmp.conf
# Default community
defCommunity public
# Default version
defVersion 2c

Terminal window
# Check CPU
check_cpu -w 80 -c 90
# Check memory
check_memory -w 80 -c 90
# Check disk
check_disk -w 20% -c 10% -p /
# Check load
check_load -w 1.5,1.2,1.0 -c 2.0,1.8,1.5
Terminal window
# Nagios/Icinga - Traditional monitoring
# Zabbix - Enterprise monitoring
# Prometheus - Metrics-based
# Grafana - Visualization
# Cacti - Graphing (RRDTool)
# Smokeping - Latency monitoring

SNMP remains important for network infrastructure monitoring:

SNMP in Enterprise Monitoring
+------------------------------------------------------------------+
| |
| Network Devices: |
| +----------------------------------------------------------+ |
| | Routers → Interface statistics | |
| | Switches → Port usage, VLANs | |
| | Firewalls → Connection tables | |
| | UPS → Battery status, load | |
| +----------------------------------------------------------+ |
| |
| Hardware Monitoring: |
| +----------------------------------------------------------+ |
| | iLO → HP server hardware | |
| | iDRAC → Dell server hardware | |
| | IPMI → Baseboard management | |
| +----------------------------------------------------------+ |
| |
| Modern Integration: |
| +----------------------------------------------------------+ |
| | SNMP exporter → Prometheus metrics | |
| | Zabbix → Enterprise SNMP monitoring | |
| | LibreNMS → Open source SNMP | |
| +----------------------------------------------------------+ |
| |
+------------------------------------------------------------------+

Practical Impact:

  • Monitor network infrastructure at scale
  • Hardware health monitoring for servers
  • Integration with modern monitoring systems

Terminal window
# ❌ WRONG: Using unencrypted SNMPv2c
snmpget -v 2c -c public target OID
# Community string sent in plain text!
# ✅ CORRECT: Use SNMPv3 with auth
snmpget -v 3 -u myuser -l authPriv -a SHA -A myauthpass -x AES -X myprivpass target OID
Terminal window
# ❌ WRONG: Using numeric OID only
snmpget target 1.3.6.1.2.1.1.1.0
# Hard to read and maintain
# ✅ CORRECT: Use symbolic names
snmpget target sysDescr.0
snmpget target sysUpTime.0
Terminal window
# ❌ WRONG: Polling every second
* * * * * snmpwalk target # Every minute is too much
# ✅ CORRECT: Appropriate polling interval
# Network stats: 1-5 minutes
# Interface counters: 5-10 minutes
# Hardware sensors: 5-15 minutes

  1. What are the different SNMP versions?
  2. What is the difference between SNMP GET, GETNEXT, and WALK?
  3. Explain OID and MIB.
  4. What is SNMPv3 security?
  5. How do you monitor network devices with SNMP?

In this chapter, you learned:

  • ✅ SNMP versions and security
  • ✅ Common OIDs
  • ✅ SNMP tools (snmpwalk, snmpget)
  • ✅ SNMP configuration
  • ✅ Network monitoring tools

In this part, you learned:

  • ✅ System logging (rsyslog, syslog-ng)
  • ✅ Logrotate for log management
  • ✅ System monitoring tools
  • ✅ Prometheus and Grafana
  • ✅ SNMP monitoring

Chapter 42: Backup Strategies and Concepts


Last Updated: February 2026