I'm attempting to configure SNMP to expose several processes on a Linux (RHEL 7) box for monitoring purposes. I've added the appropriate proc
directives to snmp.conf
and done both a reload and restart for snmpd
to attempt to get this to work, but the information for those processes isn't visible.
I am not the one who did the base snmpd
configuration, and I'm not extremely familiar with the "how-to" of snmpd
configuration, but it appears to me that the snmpd.conf
is pretty much the default config file, so I suspect I'm missing something simple that I need to add.
Here's a sanitized version of snmpd.conf
:
###############################################################################
#
# snmpd.conf:
#
###############################################################################
#
# Many more configuration directives exist than are mentioned in this file.
# For full details, see the snmpd.conf(5) manual page.
#
# All lines beginning with a '#' are comments and are intended for you
# to read. All other lines are configuration commands for the agent.
###############################################################################
# Access Control
###############################################################################
# As shipped, the snmpd demon will only respond to queries on the
# system mib group until this file is replaced or modified for
# security purposes.
####
# First, map the community name "changeme" into a "security name"
# sec.name source community
com2sec notConfigUser default changeme
####
# Second, map the security name into a group name:
# groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
####
# Third, create a view for us to let the group have rights to:
# Make at least snmpwalk -v 1 localhost -c public system fast again.
# name incl/excl subtree mask(optional)
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
####
# Finally, grant the group read-only access to the systemview view.
# group context sec.model sec.level prefix read write notif
access notConfigGroup "" any noauth exact systemview none none
###############################################################################
###########################################################################
# SECTION: Monitor Various Aspects of the Running Host
#
# The following check up on various aspects of a host.
# proc: Check for processes that should be running.
# proc NAME [MAX=0] [MIN=0]
#
# NAME: the name of the process to check for. It must match
# exactly (ie, http will not find httpd processes).
# MAX: the maximum number allowed to be running. Defaults to 0.
# MIN: the minimum number to be running. Defaults to 0.
#
# The results are reported in the prTable section of the UCD-SNMP-MIB tree
# Special Case: When the min and max numbers are both 0, it assumes
# you want a max of infinity and a min of 1.
proc httpd
Here's the sanitized output from snmptable
:
[user@host ~]$ snmptable -v1 -Ci -Cb -c changeme localhost .1.3.6.1.4.1.2021.2
End of MIB
UCD-SNMP-MIB::ucdavis: No entries
[user@host ~]$
It turns out that I was missing the following in the snmpd.conf
:
# UCD Process & Disk Tables.
view systemview included .1.3.6.1.4.1.2021.2
view systemview included .1.3.6.1.4.1.2021.9
Once that was added, the following command yielded the following results:
[user@host ~]$ snmptable -v1 -Ci -Cb -c changeme localhost .1.3.6.1.4.1.2021.2
End of MIB
SNMP table: UCD-SNMP-MIB::prTable
index Index Names Min Max Count ErrorFlag ErrMessage ErrFix ErrFixCmd
1 1 httpd 1 0 10 noError noError
[user@host ~]$