Pages

Wednesday, 12 February 2014

SNMP and its linux command

SNMP basic components and its functions:

    The SNMP architecture consists of
    The SNMP Manager
    A managed device
    An SNMP Agent
    Management Information Databases (otherwise known as Management Information Bases or MIBs)

    The SNMP Manager - (Usually the Network Management System - NMS) communicates with the multiple SNMP Agents implemented in the network.

    A managed device - or the network element is a part of the network that requires some form of monitoring and management e.g. routers, switches, servers, workstations, printers, UPSs, etc..

    An SNMP Agent - is a program that is bundled within the managed device. Enabling this agent allows it to collect the Management Information Database from the device locally to make it available to the SNMP Manager on request. These Agents could be standard (e.g. Net-SNMP) or specific to a vendor. (e.g. HP Insight Agent). The agent listens at port 161. TODO: UDP or TCP?

    Management Information Base / database - The commonly shared database between the Agent and the Manager is called Management Information Base (MIB). In short, MIB files are the set of questions that the SNMP Manager can ask the Agent. The Agent collects these data locally and stores it, as defined in the MIB.

    The MIBs contain a standard set of statistical and control values defined for the managed devices on a network. The SNMP protocol also allows the extension of these standard values with values specific to a particular Agent through the use of private MIBs. So the SNMP Manager should be aware of these standard and private questions for every type of Agent.
     
     
     

Linux Command 

One can simply issue one snmpwalk request on the root node of the sub-tree and the command gets the value of every node in the sub-tree.

[root@localhost ~]# snmpwalk -v 2c 169.254.0.8 -c FortiManager | grep OID
...
SNMPv2-SMI::mib-2.47.1.2.1.1.3.1 = OID: SNMPv2-SMI::enterprises.12356
...
[root@localhost ~]# snmpwalk -v 2c 169.254.0.8 -c FortiManager SNMPv2-SMI::enterprises.12356
...
SNMPv2-SMI::enterprises.12356.101.4.1.6.0 = Gauge32: 0
SNMPv2-SMI::enterprises.12356.101.4.1.7.0 = Gauge32: 0
SNMPv2-SMI::enterprises.12356.101.4.1.8.0 = Gauge32: 9
SNMPv2-SMI::enterprises.12356.101.4.1.9.0 = Gauge32: 80
SNMPv2-SMI::enterprises.12356.101.4.1.10.0 = Gauge32: 254764
SNMPv2-SMI::enterprises.12356.101.4.1.11.0 = Gauge32: 0
SNMPv2-SMI::enterprises.12356.101.4.1.12.0 = Gauge32: 0
SNMPv2-SMI::enterprises.12356.101.4.1.13.0 = Gauge32: 0
SNMPv2-SMI::enterprises.12356.101.4.1.14.0 = Gauge32: 0
...

[root@localhost ~]# snmpget -v 2c 169.254.0.8 -c FortiManager SNMPv2-SMI::enterprises.12356.101.4.1.8.0
SNMPv2-SMI::enterprises.12356.101.4.1.8.0 = Gauge32: 11


No comments:

Post a Comment