Video: Use SNMP to Query Select Device Settings - Bits and Dots -
Video: Use SNMP to Query Select Device Settings

The Simple Network Management Protocol (SNMP) is used in many network appliances like switches, routers, printers, IP console KVMs, etc.  While most network administrators would be directed to use tools like HP Web Jetadmin to do the work for them, for various reasons some administrators may prefer to query devices directly.  I put together this simple video to show how you can use a simple tool like Net-SNMP to walk the list of OIDs, hunt for a particular value to find its corresponding OID to use in specific SNMP get queries admins may choose to build into their own scripts, programs etc.

Use SNMP to Query Select Device Settings:
Serial Number & MAC Address Example

Click Here to launch the video

Please note that clicking the link above will
redirect you towards my personal website
(a non-HP website) where the video I have
created is hosted.

Firstly a caution.  Not all objects are enumerated in SNMP.  Examples of objects which typically are in SNMP include low-level objects like serial numbers, mac addresses, system location, system contact, etc.  Examples of objects which are not typically found in SNMP include high-level objects used in functions like digital sending such as the type of authentication used and servers jobs are sent to.  I may cover a little about scripting and HTTP in the future, but that gets a little more interesting, so mining that from HP Web Jetadmin (or exporting it in a CSV format) might be the easiest.

Secondly, not all devices behave the same way.  As you dip into the more consumer oriented devices, SNMP objects may not be as consistent.  I don't have specific examples, but don't automatically assume because you can find the object in one device that it will be there for all.  There's a good chance it will be but double-check to be sure.

And finally, this is only one technique used to accomplish the goal of looking for an OID and them mining that OID from various devices using Net-SNMP (http://sourceforge.net/projects/net-snmp/).  Other approaches could be to navigate a MIB if you're comfortable navigating the trees in tools like iReasoning's MIB Browser (www.ireasoning.com).  If you're looking for HP specific MIBs, get them from the "Public SDK's" section on HP's developer website (www.hpdevelopersolutions.com).

Here are some resources for those interested in taking SNMP to the next level in their scripting and programming:

  • For those managing their own BAT or PERL scripts, "Net-SNMP" is great (http://sourceforge.net/projects/net-snmp/)
  • I'm fond of "#SNMP for C#" as it's the only set of libraries I was able to use for free with my C# (C-Sharp) programming hobbies (http://lextm.blogspot.com/search/label/%23SNMP).  There's many other commercial libraries out there, but as a hobbiest I liked this one since I could play without paying money.
  • I haven't done much with Java or PHP or C++ or VisualBasic (VB, VBA, VBS), if anyone has any freebie recommendations out there they'd like me to reference, write in your comments.

Take care everyone. B, out.


Posted 07-08-2009 5:59 AM by Brian R. Kneebone
Powered by Community Server (Non-Commercial Edition), by Telligent Systems