Admins eHow SysAdmin Tips & Tricks

November 18, 2010

Install SNMP on Centos/RHEL

Filed under: CentOS,linux — Tags: , , , — admin @ 4:13 pm

The following easy steps will install snmp daemon on your CentOS/RHEL server :

yum install net-snmp net-snmp-utils

now snmpd simple configuration ( change SECRET_NAME to a complex string ) :

echo rocommunity SECRET_NAME > /etc/snmp/snmpd.conf

start snmpd :

service snmpd restart

also make sure it starts on boot :

chkconfig snmpd on

last step to check snmpd is working ( change SECRET_NAME to the string you have chose before ) :

snmpwalk -v 1 -c SECRET_NAME -O e 127.0.0.1

you should get an output like below :

SNMPv2-MIB::sysDescr.0 = STRING: Linux 2.6.18-194.11.4.el5xen #1 SMP Tue Sep 21 05:40:24 EDT 201
0 x86_64
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (242211) 0:40:22.11
SNMPv2-MIB::sysContact.0 = STRING: root@localhost
SNMPv2-MIB::sysName.0 = STRING: 
SNMPv2-MIB::sysLocation.0 = STRING: Unknown
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (2) 0:00:00.02
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.2 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.3 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.4 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.5 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.6 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.7 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.8 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
.
.
.
.
  • Ttran_10170

    I follow your procedure. However, I could not get the same result when i did snmpwalk.

    [root@ts snmp]# service snmpd restart
    Stopping snmpd:                                            [  OK  ]
    Starting snmpd:                                            [  OK  ]
    [root@ts snmp]# snmpwalk -v 1 -c puplic -O e 127.0.0.1
    Timeout: No Response from 127.0.0.1
    [root@ts snmp]#

  • Anonymous

    I guess it should be public , not puplic

  • Kamil

    show iside of your cnpd.conf  file   and  netstat -nul  see that if  port open for snmp ?

  • Sanathkumaraw

    Thanks a lot

  • lobos

    This is great – thanks! For polling from outside resources, if IP Tables is in use, it may be necessary to add a firewall rule to allow connectivity from an appropriate address space on UDP port 161.

  • lx24

    bind localhost to IP 127.0.0.1 in /etc/hosts/

  • Pingback: Centos Snmp Server | Kuplux's()

Powered by WordPress