Skip to content

SNMP Daemon Setup

Mark Feit edited this page Oct 6, 2017 · 4 revisions

Installing and Configuring SNMPD on RHEL and Derivatives

# yum -y install snmpd

Edit /etc/snmp/snmpd.conf. Replace the section where views are configured so it reads as follows:

# Third, create a view for us to let the group have rights to:
#       name           incl/excl     subtree         mask(optional)                                                                 
view    systemview     included   .1.3.6.1.2.1
#view    systemview    included   .1.3.6.1.2.1.25.1.1

Enable and restart the daemon (EL7 shown):

# systemctl enable snmpd
# systemctl start snmpd

Testing the Daemon

% snmpget -v 1 localhost -c public system.sysDescr.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux dev7 3.10.0-514.21.1.el7.x86_64 #1 SMP Thu May 25 17:04:51 UTC 2017 x86_64

Finding OIDs

Walk the entire tree:

% snmpwalk -v 1 localhost -c public | less
SNMPv2-MIB::sysDescr.0 = STRING: Linux dev7 3.10.0-514.21.1.el7.x86_64 #1 SMP Thu May 25 17:04:51 UTC 2017 x86_64
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (3001972) 8:20:19.72
SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
SNMPv2-MIB::sysName.0 = STRING: dev7
SNMPv2-MIB::sysLocation.0 = STRING: Unknown (edit /etc/snmp/snmpd.conf)
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (2) 0:00:00.02
...

Interesting and Useful OIDs

Name OID Type Description Sample Value
SNMPv2-MIB::sysName.0 .1.3.6.1.2.1.1.5.0 STRING System Name dev7
IF-MIB::ifInOctets.1 .1.3.6.1.2.1.2.2.1.10.1 Counter32 Input octets on first interface 2644507396