search
top

Configure SNMP for RHEL 6

SNMP is a very powerful and useful tool to add to your Linux system. It is great for sending alerts to different monitoring systems like Nagios and many other great products. But first it needs to be installed and configured before you can put this under rated tool to work.

Install SNMP using yum, you will need net-snmp-utils, net-snmp, net-snmp-libs.

$ sudo yum install –y net-snmp-utils net-snmp net-snmp-libs

Now that we have snmp it is time to configure SNMP.

Edit file /etc/snmp/snmpd.conf using your favorite text editor, mine just happens to be vi.

$ sudo vi /etc/snmp/snmpd.conf

Change/Modify line(s) as follows:

Find following Line:

com2sec notConfigUser  default       public

Replace with (make sure you replace 192.168.0.0/24 replace with your network IPs) following lines:

com2sec local     localhost           public
com2sec mynet 192.168.1.0/24      public

Find and change the lines.

group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser

Replace with:

group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
group MyROGroup v1         mynet
group MyROGroup v2c        mynet
group MyROGroup usm        mynet

Locate and change the following line.

view    systemview     included      system

Replace with.

view all    included  .1                               80

Locate and change the following line.

access  notConfigGroup “”      any       noauth    exact  systemview none none

Replace with.

access MyROGroup “”      any       noauth    exact  all    none   none
access MyRWGroup “”      any       noauth    exact  all    all    none

Locate and change the following lines.

syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root  (configure /etc/snmp/snmp.local.conf)

Replace with your credentials.

syslocation RHEL 6, Linux Server.
syscontact sysadmin <root@localhost>

Now let’s start your snmp server and test it.

Set the snmpd service to start on reboot or system start.

$ sudo  chkconfig snmpd on

Fire it up !!

$ sudo  service snmpd start

Test your snmp server

# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex

4 Responses to “Configure SNMP for RHEL 6”

  1. Prodip says:

    Very Nice Article ….

  2. Narinder Singh says:

    Dear sir

    How to get email alert on using snmp trap

    • newlife007 says:

      That is generally handled by the application or process generating the snmp traps. Like HP Insight manager or Dell OpenMange. They rely on snmp bieng configured correctly for their product, then alerting and email is handled.

  3. Narinder Singh says:

    How to send email particular device using snmp

Leave a Reply

Your email address will not be published. Required fields are marked *

top