Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
6Activity
0 of .
Results for:
No results containing your search query
P. 1
Snmp Guide

Snmp Guide

Ratings:

4.0

(1)
|Views: 226|Likes:
Published by api-3709710

More info:

Published by: api-3709710 on Oct 14, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

The Net-SNMP Programming Guide
Ben Rockwood
Updated: Nov 17th, 2004
Contents
1 Introduction to SNMP
2
1.1 GeneralOverview. . . . . . . . . . . . . . . . . . . . . . . . . . .
2
1.2 Three Flavors of SNMP. . . . . . . . . . . . . . . . . . . . . . .
4
1.3 What we won\u2019t discuss. . . . . . . . . . . . . . . . . . . . . . . .
4
2 MIBs & OIDs
5
2.1 OIDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
2.2 MIBs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6
2.3 OIDDataTypes. . . . . . . . . . . . . . . . . . . . . . . . . . . .
8
2.4 MIB-II. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
2.5 Adding MIBs to Net-SNMP. . . . . . . . . . . . . . . . . . . . . 10
3 The Net-SNMP CLI
11

3.1 Probing a device: SNMP WALKs. . . . . . . . . . . . . . . . . . 11 3.2 Polling Individual OIDs: SNMP GETs. . . . . . . . . . . . . . . 13 3.3 Net-SNMP CLI Tool Options. . . . . . . . . . . . . . . . . . . . 13

4 Polling Applications
15
4.1 Simple Polling with PERL. . . . . . . . . . . . . . . . . . . . . . 15
4.2 The Net-SNMP PERL Module. . . . . . . . . . . . . . . . . . . 16
5 Trap Handlers
19

5.1 The Trap Daemon Con\ufb01guration. . . . . . . . . . . . . . . . . . 19 5.2 A Simple Trap Handler. . . . . . . . . . . . . . . . . . . . . . . 20 5.3 Starting the Trap Daemon. . . . . . . . . . . . . . . . . . . . . . 21

6 The Net-SNMP C API
23

6.1 SNMPInternals. . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6.2 Watching SNMP on the wire. . . . . . . . . . . . . . . . . . . . 24 6.3 A simple example. . . . . . . . . . . . . . . . . . . . . . . . . . . 27 6.4 ClosingThoughts. . . . . . . . . . . . . . . . . . . . . . . . . . . 29

1
Chapter 1
Introduction to SNMP
1.1 General Overview

Simple Network Management Protocol is asimple method of interacting with networked devices. The standard was de\ufb01ned by IETF RFC 1157 in May of 1990. SNMPcan often seem quite confusing and overly complicated, its available APIs tend to put alot of wrapping around what should be very simple. The available books on the topic tend to only complicate the subject, not demystify it.

SNMP is extremely easy for any programmer to understand. A gross over
simpli\ufb01cation can explain the system simply. A network device runs an SNMP
agentas a daemon process which answers requests fromthe network. The agent

provides a large number ofObject Identi\ufb01ers (OIDs). An OID is a unique key- value pair. The agent populates these values and makes them available. An SNMPmanager (client) can then query the agents key-value pairs for speci\ufb01c information. From a programming standpoint it\u2019s not much di\ufb00erent than im- porting a ton of global variables. SNMP OIDs can be read or written. While writing information to an SNMP device is fairly rare, it is a method used by several management applications to control devices (such as an administrative GUI for your switches). A basic authentication scheme exists in SNMP, allowing the manager to send acommunity name (think cleartext password) to autho- rize reading or writing of OIDs. Most devices use the insecure community name \u201dpublic\u201d. SNMP communication is preformed via UDP on ports 161 and 162.

Notice that I didn\u2019t mention MIBs yet! The importance of MIBs aregreatly overrated. MIBs look complicated at \ufb01rst, but they are extremely simple. OIDs are numerical and global. An OID looks similar to an IPv6 address and di\ufb00erent vendors have di\ufb00erent pre\ufb01xes and so forth. The OIDs are long enough that it\u2019s complicated for a human to remember or make sense of them, so a method was devised for translating a numeric OID into a human readable form. This translation mapping is kept in a portable \ufb02at text \ufb01le called aManagement

Information Baseor MIB. You do notneed a MIB to use SNMP or query
2

Activity (6)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
kogelvis liked this
kawadh liked this
Fernando Diaz liked this
Slamet Riyadi liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->