Thursday, 29 January 2015

Installing SNMP Service in Linux Environment

Installing SNMP Service in RHEL 5/6
SNMP ( Simple Network Management Protocol (SNMP) agent ) will help us to monitor the system from management utilities. 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.

Configure yum repository using RHEL 6 media

1)    Create and configure yum configuration file as below using vi editor.
             # vi /etc/yum.repos.d/repo.repo
             [repo]
             Name= RHEL 6
             baseurl=file:///repo
             enabled=1
             gpgcheck=0

2) Create a mount point and mount the RHEL 6 media [mount point name is specified in the yum configuration file]
            # mkdir /repo
            # mount /dev/cdrom /repo/

                mount: block device /dev/sr1 is write-protected, mounting read-only

Configuring SNMP service

1) Install the SNMP packages as listed below.
            # yum install net-snmp-utils net-snmp-libs net-snmp
            # rpm -qa| grep snmp
             net-snmp-utils-5.5-31.el6.x86_64
             net-snmp-libs-5.5-31.el6.x86_64
             net-snmp-5.5-31.el6.x86_64
2) Start the services and make sure that it is running.
           # service snmpd start
           Starting snmpd:                                              [  OK  ]
           # service snmptrapd start
           Starting snmptrapd:                                        [  OK  ]
           # service snmpd status
           snmpd (pid  4923) is running...
           # service snmptrapd status
           snmptrapd (pid  5401) is running...
3)  Configure the service to start automatically with system boot.
           # chkconfig snmpd on
           # chkconfig snmptrapd on
           # chkconfig --list | grep snmp
           snmpd             0:off   1:off   2:on    3:on    4:on    5:on    6:off
           snmptrapd       0:off   1:off   2:on    3:on    4:on    5:on    6:off

4)  Edit the SNMP configuration file and add entries as per customer requirement. Below is as a example.
               # vi /etc/snmp/snmpd.conf
               rwcommunity kummitha
5) Reload the services.
               # service snmpd reload
               Reloading snmpd:                                            [  OK  ]
               # service snmptrapd reload
               Stopping snmptrapd:                                        [  OK  ]
               Starting snmptrapd:                                          [  OK  ]

Note:

We can check the snmp service functionality using the snmpwalk utility.
# snmpwalk -v2c -c kummitha 192.168.1.2 system
SNMPv2-MIB::sysDescr.0 = STRING: Linux kummitha.com 2.6.32-71.el6.i686 #1 SMP Wed Sep 1 01:26:34 EDT 2010 i686
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::org
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (489394930) 56 days, 15:25:49.30
SNMPv2-MIB::sysContact.0 = STRING: Srinivasulu Kummitha <sreenu.vas2004@gmail.com>
SNMPv2-MIB::sysName.0 = STRING: kummitha.com


No comments:

Post a Comment