SNMP Tutorial: CPEN 1331 Chapter 3
SNMP Tutorial: CPEN 1331 Chapter 3
Ethernet
Frame IP CRC
Packet
UDP
SNMP Message
Datagram
Syntax examples:
-- two dashes is a comment -- The C equivalent is written in the comment
MostSevereAlarm ::= INTEGER -- typedef MostSevereAlarm int;
circuitAlarms MostSevereAlarm ::= 3 -- MostSevereAlarm circuitAlarms = 3;
MostSevereAlarm ::= INTEGER (1..5) -- specify a valid range
ErrorCounts ::= SEQUENCE {
circuitID OCTET STRING,
erroredSeconds INTEGER,
unavailableSeconds INTEGER
} -- data structures are defined using the SEQUENCE keyword
Simple Data Types
RED items defined by
•INTEGER -- signed 32-bit integer ASN.1
•OCTET STRING Blue items defined by
•OBJECT IDENTIFIER (OID) RFC 1155
sysUpTime OBJECT-TYPE
- OBJECT-TYPE SYNTAX Time-Ticks
- String that describes the MIB object.
- Object IDentifier (OID).
ACCESS read-only
- SYNTAX STATUS mandatory
- Defines what kind of info is stored in the DESCRIPTION
MIB object. “Time since the
- ACCESS network management
- READ-ONLY, READ-WRITE. portion of the system
- STATUS was last re-initialised.
- State of object in regards the SNMP
community. ::= {system 3}
- DESCRIPTION
- Reason why the MIB object exists.
MIB – Management Information Base
org(3)
3
- Example .1.3.6.1.2.1.1
dod(6)
6
- iso(1) org(3) dod(6) internet(1) internet(1)
mgmt(2) 1 private(4)
mib-2(1) directory(1) 4
system(1) 1
mgmt(2) experimental(3)
2 3
Note: mib-2(1)
- .1.3.6.1 ~100% present. 1 tcp(6)
- mgmt and private most common. system(1)
6
- MIB-2 successor to original MIB. 1
- STATUS ‘mandatory’, All or nothing in group interfaces(2) ip(4)
2 4
MIB – Management Information Base
SNMP Instances
- Each MIB object can have an instance.
- A MIB for a router’s (entity) interface information…
iso(1) org(3) dod(6) internet(1) mgmt(2) mib-2(1) interfaces(2) ifTable(2) ifEntry(1) ifType(3)
GetRequest [Get]
- Most common PDU.
- Used to ask SNMP agent for value of a particular MIB
agent.
- NMS sends out 1 Get PDU for each instance, which is a
unique OID string.
- What happens if you don’t know how many instances
of a MIB object exist?
SNMP Commands [GetNext]
GetNextRequest [GetNext]
- NMS application uses GetNext to ‘walk’ down a table
within a MIB.
- Designed to ask for the OID and value of the MIB
instance that comes after the one asked for.
- Once the agent responds the NMS application can
increment its count and generate a GetNext.
- This can continue until the NMS application detects
that the OID has changed, i.e. it has reached the end of
the table.
SNMP Commands [GetResponse]
GetResponse [Response]
- Simply a response to a Get, GetNext or Set.
- SNMP agent responds to all requests or commands via
this PDU.
SNMP Commands [SetRequest]
SetRequest [Set]
- Issued by an NMS application to change a MIB
instance to the variable within the Set PDU.
- For example, you could issue a
- GetRequest against a KDEG server asking for
sysLocation.0 and may get ‘ORI’ as the response.
- Then, if the server was moved, you could issue a Set against
that KDEG server to change its location to ‘INS’.
- You must have the correct permissions when using the
set PDU.
SNMP Commands [Trap]
Trap
- Asynchronous notification.
- SNMP agents can be programmed to send a trap when
a certain set of circumstances arise.
- Circumstances can be view as thresholds, i.e. a trap
may be sent when the temperature of the core breaches
a predefined level.
SNMP Security
Initial set-up... java -Xmx384m -jar “XYZ\lib\browser.jar” (where XYZ = your specific path)
Breakdown…
- LHS is the
SNMP MIB
structure.
- Lower LHS
has details of
MIB structure.
- RHS will
present MIB
values.
SNMP – MIB Browser (2)
Discovery…
- Subnet: 134.XXX.XXX.*
Start
Note IP Address.
Stop
SNMP – MIB Browser (3)
Navigation…
- MIB Tree
System
sysUpTime
- Notice OID
SNMP – MIB Browser (4)
SNMP PDU’s…
(1) Get
- Select ‘Go’
‘Get’
- OID – Value
SNMP – MIB Browser (5)
SNMP PDU’s…
(2) GetNext
-Returned value:
(.1.3.6.1.2.1.1.6)
or
“DSG, O’Reilly Institute,
F.35”
SNMP – MIB Browser (6)
SNMP…
(3) Get SubTree
-Position of MIB:
.1.3.6.1.2.1.1
(a.k.a. system)
-RHS values:
Returns all values
below system.
SNMP – MIB Browser (7)
SNMP…
(4) Walk
-MIB Location:
.1.3.6.1.2.1
(a.k.a. mib-2)
- Returns *ALL*
values under mib-2
SNMP – MIB Browser (8)
Tables…
- MIB Location:
.1.3.6.1.2.1.2.2
(or interfaces)
- Select ifTable,
Go, then Table
View.
- Refresh/Poll
SNMP – MIB Browser (9)
SNMP…
- Graph
- Select a value
from the RHS,
say sysUpTime
- Highlight and
select ‘Go’,
then ‘Graph’.
- Interval = 1s
set.