Install SNMP on Centos/RHEL

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

.

.

.

.

Leave a comment