SNMP Questions

Discussion to talk about software related topics only.
Post Reply
sblair
Posts: 162
Joined: Mon Sep 12, 2011 1:54 pm

SNMP Questions

Post by sblair »

I'm new to SNMP and haven't done anything with it yet. It seems most everything to date with NB that I've seen with SNMP, including the SNMP library, revolves around it being a device agent.

I'm actually looking at using a Netburner to be the SNMP Manager side. i.e. the Netburner connects via SNMP to a number of L2/L3 network switches and does the configuration and management of them using SNMP.

Just wanted to get some feedback from those that are more experienced with SNMP. Am I completely mad for trying to do this? Has anyone else built an SNMP Manager before on Netburner or are there any existing modules available out there for it?

Thanks!
Scott
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: SNMP Questions

Post by pbreed »

Do you know enough about SNMP to understand the relationship between OID and textual MIBs?
If not do some study.....
At the machine level everything SNMP is Get/Set values that are named with OID's
Mibs are a text file that helps humans give these OID's human understandable names....

Generic manage anything, or do some well defined specific actions on a known set of hardware?

Do you have to parse text MIB's or can you work only in OID land?


Do specific actions against known hardware using OID's yes....

Generic management against random hardware using arbitrary mibs? ... a lot harder...
sblair
Posts: 162
Joined: Mon Sep 12, 2011 1:54 pm

Re: SNMP Questions

Post by sblair »

Thanks Paul. I clearly have a lot of research still to do. If you have any resources you can suggest that would be great. Also any free SNMP Managers out there that I could use just to play with a working SNMP system would be helpful too so I can wireshark it and see how it works. SNMP has always been an interest but never had a reason to dig into it until now.

I'll be working with known models of specific network switches to automate specific configuration tasks. So in that regard I don't think I need to be able to do contextual parsing of MIBs and could instead define the specific OID's I need to manipulate. I sounds like I can extract the OID info from the MIBs that I would need if I understand it right.

Thanks.
Scott
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: SNMP Questions

Post by pbreed »

Unfortunately I can't recommend a good SNMP book,
because in a past life I wrote SNMP management code for a living
and have not had a need for an overview book.

Basic outline...

Snmp packs everything into UDP packets using ASN1

There are basically four operations...
Get,Getnext,Set,Trap
You include something called a community string,basically a password that may
change what is or is not visible.... the default password for things people want to always be readable is usually "public"
IE if there is a router in the closet it makes sense that its technical contact person name should be accessible to all...
Internal settings and the ability to change things... probably not public... where you draw the line is an IT department choice...

The four actions in slightly more detail...

Get Get one or more OID values....
for instance one could request 1.3.6.1.2.1.1.1.0.
(In MIB-II is a variable called sysDescr (1.3.6.1.2.1.1.1.0.))
The system would return an ASN_typeString that was the value of that variable...

GetNext Very similar to Get, except it get the next logical value AFTER the one requested...
So a GetNext for 1.3.6.1.2.1.1.1.0
Would likely return 1.3.6.1.2.1.1.2.0. The variable sysObjectID that is type ASN_typeOID
Or if you walk off the end of the OID tree it will return an error...

GetBulk (A version of Getnext that basically does multiple GetNext's in one packet.. this is new since my time in the SNMP trenches..)


Set
This takes OID's and values and sets them
There can be multiple OID, value pairs (just like there an be multiple things in a get or getnext)
Internally this is a two pahse operation first the reciever makes sure that all the variable sets are valid as a set,
ie they are either ALL accepted or rejected....



Trap
This is an asyncornous event sent unsolicited from a device, usually due to an error or condition change.


Hope that at least gives some clues....

There are a number of open source SNMP tools you can play with...
SeeCwriter
Posts: 630
Joined: Mon May 12, 2008 10:55 am

Re: SNMP Questions

Post by SeeCwriter »

A couple of SNMP books to checkout would be:

SNMP MIB Handbook, by Larry Walsh, Wyndham Press.
Understanding SNMP MIBs, by David Perkins and Evan McGinnis, Prentice Hall.

Steve
Post Reply