Installing SNMP Service in RHEL 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]
[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 ]
# 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
Starting snmptrapd: [ OK ]
# service snmpd status
snmpd
(pid 4035) is running...
#
service snmptrapd status
snmptrapd
(pid 4049) is running...
3) Configure the service to start automatically with system boot.
# chkconfig snmpd on
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 STRING
5) Reload the services.
# service snmpd reload
Reloading snmpd: [ OK ]
# 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 STRING
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 STRING 10.30.32.207 system
SNMPv2-MIB::sysDescr.0
= STRING: Linux node1.erc.com 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10
15:42:40 EDT 2011 x86_64
SNMPv2-MIB::sysObjectID.0
= OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance
= Timeticks: (48233) 0:08:02.33
SNMPv2-MIB::sysContact.0
= STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
SNMPv2-MIB::sysName.0
= STRING: node1.erc.com
0 comments:
Post a Comment