SNMP Monitoring
Chapter 41: SNMP and Network Monitoring
Section titled “Chapter 41: SNMP and Network Monitoring”Overview
Section titled “Overview”This chapter covers SNMP (Simple Network Management Protocol) for network monitoring.
41.1 SNMP Basics
Section titled “41.1 SNMP Basics”SNMP Versions
Section titled “SNMP Versions” 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 | || +------------------------------------------------------------+ || |+------------------------------------------------------------------+41.2 SNMP OIDs
Section titled “41.2 SNMP OIDs”Common OIDs
Section titled “Common OIDs”# System1.3.6.1.2.1.1.1.0 - sysDescr1.3.6.1.2.1.1.3.0 - sysUpTime1.3.6.1.2.1.1.5.0 - sysName
# Interface1.3.6.1.2.2.1.1.2 - ifNumber1.3.6.1.2.2.1.2.2 - ifDescr1.3.6.1.2.2.1.10.2 - ifInOctets1.3.6.1.2.2.1.16.2 - ifOutOctets
# CPU1.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)
# Memory1.3.6.1.4.1.2021.4.5.0 - memTotalReal1.3.6.1.4.1.2021.4.6.0 - memAvailReal1.3.6.1.4.1.2021.4.11.0 - memTotalFree41.3 SNMP Tools
Section titled “41.3 SNMP Tools”snmpwalk
Section titled “snmpwalk”# Walk all OIDssnmpwalk -v2c -c public localhost
# Walk system OIDssnmpwalk -v2c -c public localhost system
# Walk interface infosnmpwalk -v2c -c public localhost interfaces
# Get specific OIDsnmpget -v2c -c public localhost sysUpTime.0
# Get multiple OIDssnmpget -v2c -c public localhost sysUpTime.0 sysContact.0snmpget
Section titled “snmpget”# Get system descriptionsnmpget -v2c -c public localhost sysDescr.0
# Get interface statisticssnmpget -v2c -c public localhost ifInOctets.1 ifOutOctets.1
# Get CPU loadsnmpget -v2c -c public localhost laLoad.141.4 SNMP Configuration
Section titled “41.4 SNMP Configuration”snmpd Configuration
Section titled “snmpd Configuration”# /etc/snmp/snmpd.conf (snmpd.conf)
# SNMPv2c communityrocommunity publicrwcommunity private
# SNMPv3 usercreateUser admin MD5 "mypassword" DESrouser admin authPriv
# System locationsyslocation "Data Center Rack 1"syscontact admin@example.com
# Agent configurationagentAddress udp:161Client Configuration
Section titled “Client Configuration”# Default communitydefCommunity public
# Default versiondefVersion 2c41.5 Network Monitoring Tools
Section titled “41.5 Network Monitoring Tools”nagios-plugins
Section titled “nagios-plugins”# Check CPUcheck_cpu -w 80 -c 90
# Check memorycheck_memory -w 80 -c 90
# Check diskcheck_disk -w 20% -c 10% -p /
# Check loadcheck_load -w 1.5,1.2,1.0 -c 2.0,1.8,1.5Monitoring Tools Comparison
Section titled “Monitoring Tools Comparison”# Nagios/Icinga - Traditional monitoring# Zabbix - Enterprise monitoring# Prometheus - Metrics-based# Grafana - Visualization# Cacti - Graphing (RRDTool)# Smokeping - Latency monitoringWhy This Matters in DevOps/SRE
Section titled “Why This Matters in DevOps/SRE”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
Common Mistakes & Anti-Patterns
Section titled “Common Mistakes & Anti-Patterns”1. Using SNMPv1/v2c in Production
Section titled “1. Using SNMPv1/v2c in Production”# ❌ WRONG: Using unencrypted SNMPv2csnmpget -v 2c -c public target OID# Community string sent in plain text!
# ✅ CORRECT: Use SNMPv3 with authsnmpget -v 3 -u myuser -l authPriv -a SHA -A myauthpass -x AES -X myprivpass target OID2. Not Using Correct OID Format
Section titled “2. Not Using Correct OID Format”# ❌ WRONG: Using numeric OID onlysnmpget target 1.3.6.1.2.1.1.1.0# Hard to read and maintain
# ✅ CORRECT: Use symbolic namessnmpget target sysDescr.0snmpget target sysUpTime.03. Polling Too Frequently
Section titled “3. Polling Too Frequently”# ❌ 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 minutesInterview Questions
Section titled “Interview Questions”- What are the different SNMP versions?
- What is the difference between SNMP GET, GETNEXT, and WALK?
- Explain OID and MIB.
- What is SNMPv3 security?
- How do you monitor network devices with SNMP?
Summary
Section titled “Summary”In this chapter, you learned:
- ✅ SNMP versions and security
- ✅ Common OIDs
- ✅ SNMP tools (snmpwalk, snmpget)
- ✅ SNMP configuration
- ✅ Network monitoring tools
Part 8 Summary
Section titled “Part 8 Summary”In this part, you learned:
- ✅ System logging (rsyslog, syslog-ng)
- ✅ Logrotate for log management
- ✅ System monitoring tools
- ✅ Prometheus and Grafana
- ✅ SNMP monitoring
Next Chapter
Section titled “Next Chapter”Chapter 42: Backup Strategies and Concepts
Last Updated: February 2026