14.3. Configuring the Subagent

14.3. Configuring the Subagent

The Directory Server SNMP subagent is located in installed with the Directory Server tools. On Red Hat Enterprise Linux and Solaris, this is in /usr/bin/ldap-agent. On HP-UX, this is in /opt/dirsrv/bin/ldap-agent.

14.3.1. Subagent Configuration File

To use the subagent, first create a subagent configuration file. This file can be named and located wherever you like. This configuration file is used to specify how to communicate with your master agent, logfile location, and which Directory Server instances to monitor.

14.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 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 hostname and port number. For example:

agentx-master localhost:705

14.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.

Make sure that the user as whom your subagent is running has write permission to this directory.

14.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

14.3.2. Starting the Subagent

Once your master agent is running and you have created your subagent configuration file, start the subagent. To start your subagent, run the ldap-agent program, specifying the absolute path to the subagent configuration file as an argument. For example:

ldap-agent /etc/dirsrv/config/ldap-agent.conf

To enable extra debug logging, specify the -D option during startup:

ldap-agent -D /etc/dirsrv/config/ldap-agent.conf

NOTE

The Directory Server does not have to be started for the subagent to be started.

To stop your subagent, you must use the kill command against its process ID. Your subagent will print its process ID in its logfile, or you can run ps -ef | grep ldap-agent to find the process ID.

14.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-ds.mib, is located in /usr/share/dirsrv/mibs on Red Hat Enterprise Linux and Solaris and in /opt/dirsrv/share/mibs on HP-UX. 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 refer to 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.


Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.