Log in Go to the main page Page Discussion History Go to the file list Go to the site toolbox

Net-snmp Masterclass

From NetworkStuff



Tutorials here: http://net-snmp.sourceforge.net/wiki/index.php/Tutorials

Download here: http://www.net-snmp.org/download.html

Contents

Get

Use the snmpget and snmptable commands to retrieve device information available via SNMP

The snmpwalk command can also be used to display a device's MIB tree and all it's OIDs and their values, from the point you specify. This can remove the need for multiple snmpget commands but should be used with caution as a huge amount of information may be returned.

Set

Use the snmpset command to modify a device's configuration or SNMP parameters via SNMP

Status

Use the snmpstatus command to quickly ascertain what a device is and if it is operational

For example; snmpstatus -v 2c -c public 1.2.3.4

[UDP: [1.2.3.4]:161]=>[Cisco Internetwork Operating System Software
IOS (tm) Catalyst 4000 L3 Switch Software (cat4000-I5K91S-M), Version 12.2(18)EW, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1)
TAC Support: http://www.cisco.com/tac
Copyright (c) 1986-2004 by cisco Systems, Inc.] Up: 461 days, 17:06:40.26
Interfaces: 114, Recv/Trans packets: 200669671/-1218540833 | IP: 1268005101/359369154
45 interfaces are down!

Walk

Use the snmpwalk command to view a device's MIB tree and OIDs and their values

Using Non-Standard MIBs Temporarily

Windows

Place the MIB file in this existing sub-directory of the net-snmp installation directory: ..\share\snmp\mibs

Linux:

Place the MIB file in this existing sub-directory of the net-snmp installation directory: /usr/local/share/snmp/mibs or the existing sub-directory of the user home directory: ../.snmp/mibs

Using Non-Standard MIBs Permanently

Windows

  • Place the MIB file in this existing sub-directory of the net-snmp installation directory: ..\share\snmp\mibs
  • Edit the snmp.conf file found in this existing sub-directory of the net-snmp installation directory: ..\etc\snmp
  • Add these lines to the end of the configuration file (never enter the file name extension such as .txt or .my:)
mibs +name-of-mib-file-one
mibs +name-of-mib-file-two
mibs +name-of-mib-file-three

Linux:

  • Place the MIB file in this existing sub-directory of the net-snmp installation directory: /usr/local/share/snmp/mibs or the existing sub-directory of the user home directory: ../.snmp/mibs
  • Edit the snmp.conf file found in this existing sub-directory of the net-snmp installation directory: /usr/local/share or the existing sub-directory of the user home directory: ../.snmp
  • Add these lines to the end of the configuration file (never enter the file name extension such as .txt or .my:)
mibs +name-of-mib-file-one
mibs +name-of-mib-file-two
mibs +name-of-mib-file-three

MIB Issues

MIBs downloaded from the Cisco website tend to have copyright information inserted at the top of them. If you are having issues when attempting to use Cisco MIBs, edit the MIB file and remove any text or 'white space' present before the line containing; DEFINITIONS ::= BEGIN which should be on the first line of the file.

Image:accessories-text-editor-v2-medium.png Usage Notes

Image:icemon-medium.png Related Articles

For details of useful MIBs and OIDs you might use with this program suite, see the SNMP MIB & OID Guide article.


Site Toolbox:

Personal tools
This page was last modified on 7 August 2008, at 20:49. - Disclaimers - About NetworkStuff
Powered by MediaWiki