21.3. Setting up an SNMP Agent for Directory Server

To query information from Directory Server using the SNMP protocol, set up an SNMP agent:
  1. Install the 389-ds-base-snmp and net-snmp packages:
    # yum install 389-ds-base-snmp net-snmp
  2. To configure the SNMP master agent, edit the /etc/snmp/snmpd.conf file, adding the following entry to enable the agent extensibility (AgentX) protocol:
    master agentx
    For further details about the AgentX protocol, see RFC 2741.
  3. To configure the SNMP subagent, edit the /etc/dirsrv/config/ldap-agent.conf file, adding a server parameter for each Directory Server instance you want to monitor. For example:
    server slapd-instance_name
  4. Optionally, create an SNMP user account:
    1. Stop the snmpd service:
      # systemctl stop snmpd
    2. Create the SNMP user account. For example:
      # net-snmp-create-v3-user -A authentication_password -a SHA \
           -X private_password -x AES user_name
      For details about the parameters used in the command, see the net-snmp-create-v3-user(1) man page.
    3. Start the snmpd service:
      # systemctl start snmpd
  5. Optionally, set the Directory Server descriptive properties. For details, see Section 21.2, “Configuring the Directory Server for SNMP”.
  6. Start the dirsrv-snmp service:
    # systemctl start dirsrv-snmp
  7. Optionally, to verify the configuration:
    1. Install the net-snmp-utils package:
      # yum install net-snmp-utils
    2. Query the Directory Server Object Identifiers (OID). For example:
      # snmpwalk -v3 -u user_name -M /usr/share/snmp/mibs:/usr/share/dirsrv/mibs/ \
           -l AuthPriv -m +RHDS-MIB -A authentication_password -a SHA
           -X private_password -x AES server.example.com .1.3.6.1.4.1.2312.6.1.1
For further details about SNMP, see the Monitoring Performance with Net-SNMP section in the Red Hat System Administrator's Guide.