Monitoring Health and Welfare Network Management with SNMP

SNMP(Simple Network Management Protocol) is a standard TCP/IP protocol for network management. Network administrators use SNMP to monitor and map network availability, performance, and error rates.

Using SNMP

To work with SNMP, network devices utilize a distributed data store called the Management Information Base (MIB). All SNMP compliant devices contain a MIB which supplies the pertinent attributes of a device. Some attributes are fixed (hard-coded) in the MIB while others are dynamic values calculated by agent software running on the device.

Enterprise network management software, such as Tivoli and HP OpenView, uses SNMP commands to read and write data in each device MIB. ‘Get’ commands typically retrieve data values, while ‘Set’ commands typically initiate some action on the device. For example, a system reboot script is often implemented in management software by defining a particular MIB attribute and issuing an SNMP Set from the manager software that writes a “reboot” value into that attribute.

SNMP Standards

Developed in the 1980s, the original version of SNMP, SNMPv1, lacked some important functionality and only worked with TCP/IP networks. An improved specification for SNMP, SNMPv2, was developed in 1992. SNMP suffers from various flaws of its own, so many networks remained on the SNMPv1 standard while others adopted SNMPv2.
More recently, the SNMPv3 specification was completed in an attempt to address the problems with SNMPv1 and SNMPv2 and allow administrators to move to one common SNMP standard.

Net-SNMP is a suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6. The suite includes :

  • Command-line applications to:
    • retrieve information from an SNMP-capable device, either using single requests (snmpget, snmpgetnext), or multiple requests (snmpwalk, snmptable, snmpdelta).
    • manipulate configuration information on an SNMP-capable device (snmpset).
    • retrieve a fixed collection of information from an SNMP-capable device (snmpdf, snmpnetstat, snmpstatus).
    • convert between numerical and textual forms of MIB OIDs, and display MIB content and structure (snmptranslate).
  • A graphical MIB browser (tkmib), using Tk/perl.
  • A daemon application for receiving SNMP notifications (snmptrapd). Selected notifications can be logged (to syslog, the NT Event Log, or a plain text file), forwarded to another SNMP management system, or passed to an external application.
  • An extensible agent for responding to SNMP queries for management information (snmpd). This includes built-in support for a wide range of MIB information modules, and can be extended using dynamically loaded modules, external scripts and commands, and both the SNMP multiplexing (SMUX) and Agent Extensibility (AgentX) protocols.
  • A library for developing new SNMP applications, with both C and perl APIs

How to install Net-SNMP

Install net-snmp from ports

# cd /usr/ports/net-mgmt/net-snmp
# make install clean

SNMP Basic Configurations

Copy the default configuration file to the right location.

# cp /usr/local/share/snmp/snmpd.conf.example /usr/local/etc/snmpd.conf

Open /usr/local/etc/snmpd.conf and set up the community and network access.

Click here to download an example configuration file.

Open /etc/rc.conf in your favorite editor and make sure snmpd is enabled:

snmpd_enable="YES"
snmpd_conffile="/usr/local/etc/snmpd.conf"

Type the following command to start snmpd:

# /usr/local/etc/rc.d/snmpd start

At this point you should be able to snmpwalk your host

# snmpwalk -v1 -c public 127.0.0.1

This will get you up and running with a basic snmp configuration. Next, we’ll use snmpconf utility to set up an advanced configration. The next step is optional.

Application Command Line NET-SNMP

Nearly all the example commands in these tutorials works if you try it yourself, as they’re all examples that talk to our online Net-SNMP test agent.

snmpwalk

snmpwalk – retrieve a subtree of management values using SNMP GETNEXT requests.

# snmpwalk -v 2c -c demopublic test.net-snmp.org system
SNMPv2-MIB::sysDescr.0 = STRING: test.net-snmp.org
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (68601291) 7 days, 22:33:32.91
SNMPv2-MIB::sysContact.0 = STRING: Net-SNMP Coders <net-snmp-coders@lists.source forge.net>
SNMPv2-MIB::sysName.0 = STRING: test.net-snmp.org
SNMPv2-MIB::sysLocation.0 = STRING: Undisclosed
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (4) 0:00:00.04
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.2 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.3 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.4 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.5 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.2 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORDescr.3 = STRING: The MIB for Message Processing and Dispatchin g.
SNMPv2-MIB::sysORDescr.4 = STRING: The management information definitions for th e SNMP User-based Security Model.
SNMPv2-MIB::sysORDescr.5 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (2) 0:00:00.02
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (4) 0:00:00.04
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (4) 0:00:00.04
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (4) 0:00:00.04

Source : http://blog.up-link.ro/freebsd-how-to-install-and-configure-snmp-in-freebsd/

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s