16.3. Configuring the Subagent

The Directory Server SNMP subagent is installed as a service on the Red Hat Enterprise Linux host machine, the same as the Directory Server and Admin Server processes.

16.3.1. Creating the Subagent Configuration File

The subagent is configured in a .conf configuration file. This file must be created manually. It can be named and located wherever you want, but it is strongly recommended that you use the default location. The default location is /etc/dirsrv/config/ldap-agent.conf. This file, as installed, is a template for the SNMP subagent service. The ldap-agent.conf file should be modified to fit the specific network environment.
This configuration file specifies the connection information for the master agent, logfile location, and which Directory Server instances to monitor.

16.3.1.1. agentx-master

The agentx-master setting tells the subagent how to communicate with the SNMP master agent. If this setting is not specified, the subagent tries to communicate the master agent through the Unix domain socket /var/agentx/master. This is also where the Net-SNMP master agent listens for AgentX communications by default. If you configured your master agent to listen on a different Unix domain socket, you must use the agentx-master setting for your subagent to communicate with your master agent by setting the new path for the agentx-master parameter. For example:
agentx-master /var/snmp/agentx
Make sure that the user as whom you are running the subagent has the appropriate permissions to write to this socket.
If the master agent is listening for AgentX communications on a TCP port, the agentx-master setting has the host name and port number for the master agent. For example:
agentx-master localhost:705

16.3.1.2. agent-logdir

The agent-logdir setting specifies the directory where the subagent will write its logfile. For example:
agent-logdir /var/log
If this parameter is not specified, the agent will write its logfile to the same location as your subagent configuration file. The logfile will be named ldap-agent.log.
The default log directory as specified in the ldap-agent.conf template is /var/log/dirsrv/. This is the same directory where instance log files are stored, but the SNMP aubagent log files are not instance-specific. It is recommended that you use the default location.
Make sure that the user as whom your subagent is running has write permission to this directory.

16.3.1.3. server

The server setting specifies a Directory Server instance that you want to monitor. You must use one server setting for each Directory Server instance. The subagent requires at least one server setting to be specified in its configuration file. The server setting should be set to the name of the Directory Server instance you would like to monitor. For example:
server slapd-phonebook
To monitor multiple Directory Server instances, an additional server parameter in the subagent configuration file for each instance.
server slapd-phonebook
server slapd-example
server slapd-directory

16.3.2. Starting the Subagent

Once your master agent is running and you have created your subagent configuration file, start the subagent.

Note

The Directory Server does not have to be started for the subagent to be started.
The subagent is started and runs as a separate process than the Red Hat Directory Server or Admin Server processes. To start or stop the subagent, use the service system tools.
service dirsrv-snmp {start|stop|restart}
The status of the subagent can also be checked with the service tool.
service dirsrv-snmp status
dirsrv-snmp is stopped

16.3.3. Testing the Subagent

To test your subagent, use any SNMP client tools to query the master agent. Net-SNMP contains simple command-line utilities such as snmpwalk and snmpget. In order for these tools to use variable names for queries, configure them to load the Directory Server's MIB file. The Directory Server's MIB file, redhat-directory.mib, is located in /usr/share/dirsrv/mibs on Red Hat Enterprise Linux 6 (64-bit). There are some additional common required MIB files in this mibs directory if you do not already have them with your MIB tools.
The MIB file is not needed for the subagent to operate; it is only required for any SNMP client application to use variable names instead of numeric OIDs to see the monitored information provided by the subagent.
Each monitored server instance uses its port number as an index to identify that particular Directory Server instance. For example, querying for the dsEntityName.389 SNMP variable returns the variable value for a server running on port 389, assuming that instance exists and is being monitored by the subagent.
For details on configuring and using the Net-SNMP command-line tools, check out the Net-SNMP website, http://www.net-snmp.org.