SNMP

From CLONWiki
Jump to navigation Jump to search

SNMP

The simple network management protocol (SNMP) forms part of the internet protocol suite as defined by the Internet Engineering Task Force (IETF). SNMP is used by network management systems to monitor network-attached devices for conditions that warrant administrative attention. It consists of a set of standards for network management, including an Application Layer protocol, a database schema, and a set of data objects.

SNMP exposes management data in the form of variables on the managed systems, which describe the system configuration. These variables can then be queried (and sometimes set) by managing applications.

NetSNMP

NetSNMP is an open source SNMP program, see http://net-snmp.sourceforge.net/.

MIB

A management information base (MIB) stems from the OSI/ISO Network management model and is a type of database used to manage the devices in a communications network. It comprises a collection of objects in a (virtual) database used to manage entities (such as routers and switches) in a network. Objects in the MIB are defined using a subset of Abstract Syntax Notation One (ASN.1) called "Structure of Management Information Version 2 (SMIv2)" RFC 2578.The software that performs the parsing is an MIB compiler.

The database is hierarchical (tree structured) and entries are addressed through object identifiers. Internet documentation RFCs discuss MIBs, notably RFC 1155, "Structure and Identification of Management Information for TCP/IP based internets", and its two companions, RFC 1213, "Management Information Base for Network Management of TCP/IP-based internets", and RFC 1157, "A Simple Network Management Protocol".

SNMP, a communication protocol between management stations (consoles, for example) and managed objects, (such as routers, gateways, and switches) makes use of MIBs. Components controlled by the management console need a so-called SNMP agent -- a software module that can communicate with the SNMP manager.

SNMP uses a specified set of commands and queries. An MIB should contain information on these commands and on the target objects (controllable entities or potential sources of status information) with a view to tuning the network transport to the current needs.

Examples of MIB objects include:

   * output queue length, which has the name ifOutQLen
   * Address Translation table (like ARP tables) called atTable.

RFC 1213 defines these as mandatory: if an environment does not use the atTable (as in the case of DDN-X.25 units) then the atTable simply remains empty. The table object includes, of course, definitions of table entries, atEntry and information about interfaces (if) for each atEntry, etc.

MIBs are periodically updated to add new functionality, remove ambiguities and to fix defects. These changes are made in conformance to section 10 of RFC 2578. An example of an MIB that has been updated many times is the important set of objects that was originally defined in RFC 1213 "MIB-II". This MIB has since been split up and can be found in MIBs such as RFC 4293 "Management Information Base for the Internet Protocol (IP)", RFC 4022 "Management Information Base for the Transmission Control Protocol (TCP)", RFC 4113 "Management Information Base for the User Datagram Protocol (UDP)", RFC 2863 "The Interfaces Group MIB" and RFC 3418 "Management Information Base (MIB) for the Simple Network Management Protocol (SNMP)".

MIBs index:

   * SNMP - SMI:RFC 1155 - Defines the Structure of Management Information (SMI)
   * MIB-I: RFC 1156 - Historically used with CMOT , not to be used with SNMP
   * SNMPv2-SMI: RFC 2578 - Structure of Management Information Version 2 (SMIv2)
   * MIB-II: RFC 1213 - Management Information Base for Network Management of TCP/IP-based internets
   * SNMPv2-MIB: RFC 3418 - Management Information Base (MIB) for the Simple Network Management Protocol (SNMP)
   * TCP-MIB: RFC 4022 - Management Information Base for the Transmission Control Protocol (TCP)
   * UDP-MIB: RFC 4113 - Management Information Base for the User Datagram Protocol (UDP)
   * IP-MIB: RFC 4293 - Management Information Base for the Internet Protocol (IP)
   * IF-MIB: RFC 2863 - The Interfaces Group MIB
   * ENTITY-MIB: RFC 4133 - Entity MIB (Version 3)
   * ENTITY-STATE-MIB: RFC 4268 - Entity State MIB
   * ALARM-MIB: RFC 3877 - Alarm Management Information Base (MIB)
   * Fibre Channel
         o FC-MGMT-MIB: RFC 4044 Fibre Channel Management MIB
         o FIBRE-CHANNEL-FE-MIB: RFC 2837 Definitions of Managed Objects for the Fabric Element in Fibre Channel Standard
   * Bridge
         o P-BRIDGE-MIB: RFC 2674-1999, proposed standard, Definitions of Managed Objects for Bridges with Traffic Classes,
           Multicast Filtering and Virtual LAN Extensions
         o SBRIDGEMIB: RFC 1525-1993, proposed standard, Definitions of Managed Objects for Source Routing Bridges
         o BRIDGEMIB: RFC 1493-1993, draft standard, Definitions of Managed Objects for Bridges
   * HPR-IP-MIB: RFC 2584 - Definitions of Managed Objects for APPN/HPR in IP Networks

UNIX commands

  • snmpwalk is an SNMP application that uses SNMP GETNEXT requests to query a network entity for a tree of information. An object identifier (OID) may be given on the command line. This OID specifies which portion of the object identifier space will be searched using GETNEXT requests. All variables in the subtree below the given OID are queried and their values presented to the user. Each variable name is given in the format specified in variables. If no OID argument is present, snmpwalk will search MIB-2. If the network entity has an error processing the request packet, an error packet will be returned and a message will be shown, helping to pinpoint why the request was malformed. If the tree search causes attempts to search beyond the end of the MIB, the message "End of MIB" will be displayed.

Examples:

  • WIENER VME crate (see WIENER for details)
snmpwalk -Os -c public -v 1 129.57.69.30 system
   sysDescr.0 = STRING: WIENER Crate (UEP6000 2.16,UEL6000 4.08)
   sysObjectID.0 = OID: enterprises.19947.1.1.1.0
   sysUpTimeInstance = Timeticks: (19879341) 2 days, 7:13:13.41
   sysContact.0 = STRING:
   sysName.0 = STRING:
   sysLocation.0 = STRING:
   sysServices.0 = INTEGER: 79
  • BigIron switch
snmpwalk -Os -c 2re^dIT -v 1 129.57.68.100
snmpwalk -Os -c 2re^dIT -v 1 129.57.167.99 | grep Ethernet
snmpwalk -Os -c 2re^dIT -v 1 129.57.68.100 > zzz
snmpget -c 2re^dIT -v 1 129.57.68.100 ifDescr.321
IF-MIB::ifDescr.321 = STRING: GigabitEthernet6/1
snmpget -c 2re^dIT -v 1 129.57.68.100 ifInUcastPkts.7
IF-MIB::ifInUcastPkts.7 = Counter32: 2642870515
snmpget -c 2re^dIT -v 1 129.57.68.100 ifOutUcastPkts.7
IF-MIB::ifOutUcastPkts.7 = Counter32: 3474418515
snmpget -c 2re^dIT -v 1 129.57.68.100 ifOutOctets.7
IF-MIB::ifOutOctets.7 = Counter32: 1286067998
snmpget -c 2re^dIT -v 1 129.57.68.100 ifInOctets.7
IF-MIB::ifInOctets.7 = Counter32: 537008199

Known SNMP objects.

SNMP as device support in EPICS (downloaded from [1] on October 10, 2007)

presentation1

presentation2

devSNMP source code

DESY startup directory for softIOC with a set of MIB-oriented DB-files