• CentOS
  • How To's
  • How to configured SNMP Service/Daemon on CentOS 6

    In this guide I’ll discuss how to install and configured SNMP service on CentOS5/6 or other linux system.
    Simple Network Management Protocol (SNMP) is a popular protocol for network management. It is used for collecting information from, and configuring, network devices, such as servers, printers, hubs, switches, and routers on an Internet Protocol (IP) network.
    1. To install net-snmp in CentOS run the following command.

    yum install net-snmp-utils

    Output would be:

    [root@pir8g33k ~]# yum install net-snmp-utils
    Loading "fastestmirror" plugin
    Loading "dellsysidplugin" plugin
    ...
    ...
    Dependencies Resolved
    =============================================================================
     Package                 Arch       Version          Repository        Size
    =============================================================================
    Installing:
     net-snmp-utils          i386       1:5.3.1-24.el5_2.2  updates           182 k
    Installing for dependencies:
     net-snmp                i386       1:5.3.1-24.el5_2.2  updates           698 k
    Transaction Summary
    =============================================================================
    Install      2 Package(s)
    Update       0 Package(s)
    Remove       0 Package(s)
    Total download size: 879 k
    Is this ok [y/N]: y
    Answer y
    Downloading Packages:
    (1/2): net-snmp-utils-5.3 100% |=========================| 182 kB    00:02
    (2/2): net-snmp-5.3.1-24. 100% |=========================| 698 kB    00:06
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
     Installing: net-snmp                     ######################### [1/2]
      Installing: net-snmp-utils               ######################### [2/2]
    Installed: net-snmp-utils.i386 1:5.3.1-24.el5_2.2
    Dependency Installed: net-snmp.i386 1:5.3.1-24.el5_2.2
    Complete!
    

    2. After install snmp, reate a simple SNMP configuration and dont forget to backup the original config with the following command.

    mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org
    

    Create a new config file to /etc/snmp/snmpd.conf :
    vim /etc/snmp/snmpd.conf

    rocommunity public
    syslocation “pir8g33k DataCenter”
    syscontact [email protected]
    3. Start the SNMP service:

    chkconfig snmpd on
    /etc/init.d/snmpd start
    

    4. Test if the snmp service working fine by the following command.

    snmpwalk -v 1 -c public -O e 127.0.0.1

    or

    snmpwalk -v 2c -c public 127.0.0.1
    

    5. Make sure to add snmpd to auto-start on reboot:

    chkconfig snmpd on
    

    Note: replace the 127.0.0.1 by the server ip address.
    Enjoy…cya

    Leave a Reply

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

    2 mins