SNMP - PPT - Brian Candler
SNMP - PPT - Brian Candler
Monitoring
Introduction to SNMP
These materials are licensed under the Creative Commons Attribution-Noncommercial 3.0 Unported license
(http://creativecommons.org/licenses/by-nc/3.0/)
Overview
• What is SNMP?
• OIDs
• MIBs
• Polling and querying
• Traps
• SNMPv3 (Optional)
What is SNMP?
SNMP – Simple Network Management Protocol
– Industry standard, hundreds of tools exist to exploit it
– Present on any decent network equipment
Query – response based: GET / SET
– GET is mostly used for monitoring
Tree hierarchy
– Query for ”Object Identifiers” (OIDs)
Concept of MIBs (Management Information Base)
– Standard and vendor-specific (Enterprise)
What is SNMP?
Terminology:
– Manager (the monitoring ”client”)
– Agent (running on the equipment/server)
What is SNMP?
Typical queries
– Bytes In/Out on an interface, errors
– CPU load
– Uptime
– Temperature or other vendor specific OIDs
For hosts (servers or workstations)
– Disk space
– Installed software
– Running processes
– ...
Windows and UNIX have SNMP agents
How does it work?
Basic commands
– GET (manager -> agent)
• Query for a value
– GET-NEXT (manager -> agent)
• Get next value (list of values for a table)
– GET-RESPONSE (agent -> manager)
• Response to GET/SET, or error
– SET (manager -> agent)
• Set a value, or perform action
– TRAP (agent -> manager)
• Spontaneous notification from equipment (line down,
temperature above threshold, ...)
The MIB Tree
root
org(3)
dod(6)
1.3.6.1
internet(1)
mib-2(1) enterprises(1)
org(3) ciscoMgmt(9)
dod(6) ciscoEnvMonMIB(13)
1.3.6.1
internet(1) ciscoEnvMonObjects(1)
mib-2(1) ciscoEnvMonTemperatureStatusEntry(1)
enterprises(1)
ciscoEnvMonTemperatureStatusValue(3)
cisco(9)
system(1) snmp(11)
interfaces(2) ip(4) ...
If Email
E-mailAdresses
addresses
were
were
OIDs
OIDs...
user@nsrc.org
would have been something like:
user@nsrc.enterprises.private.internet.dod.org.iso
user@99999.1.4.1.6.3.1
except that we write the top-most part at the left:
1.3.6.1.4.1.99999.117.115.101.114
sysUpTime OBJECT-TYPE
This defines the object called sysUpTime.
SYNTAX TimeTicks
"This object is of the type TimeTicks. Object types are specified in the SMI we mentioned a moment ago.
ACCESS read-only
This object can only be read via SNMP (i.e., get-request); it cannot be changed (i.e., set-request).
STATUS mandatory
This object must be implemented in any SNMP agent.
DESCRIPTION
A description of the object
::= { system 3 }
The sysUpTime object is the third branch off of the system object group tree.
MIBs - SAMPLE
CiscoEnvMonState ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"Represents the state of a device being monitored.
Valid values are:
Syntax:
snmpXXX -c community -v1 host [oid]
snmpXXX -c community -v2c host [oid]
Querying SNMP agent
SNMP Version 3
SNMP and Security
• Components
– Dispatcher
– Message processing subsystem
– Security subsystem
– Access control subsystem
SNMP version 3 (SNMPv3)
noAuthPriv
– No authentication, no privacy
authNoPriv
– Authentication with no privacy
authPriv
– Authentication with privacy
Cisco SNMPv3 configuration
snmp-server view vista-ro internet included
snmp-server group ReadGroup v3 auth read vista-ro
snmp-server user admin ReadGroup v3 auth md5 xk122r56
Or alternatively: