---
title: Telegraf Documentation
description: Telegraf plugin for collecting metrics from OpenLDAP
url: https://docs.influxdata.com/telegraf/v1/input-plugins/openldap/
estimated_tokens: 1960
product: Telegraf
version: v1
---

-   Telegraf v1.4.0+

# OpenLDAP Input Plugin

This plugin gathers metrics from [OpenLDAP](https://www.openldap.org/)’s `cn=Monitor` backend. To use this plugin you must enable the [slapd monitoring](https://www.openldap.org/devel/admin/monitoringslapd.html) backend.

It is recommended to use the newer [`ldap` input plugin](/telegraf/v1/plugins/#input-ldap) instead.

**Introduced in:** Telegraf v1.4.0 **Tags:** server, network **OS support:** all

## Global configuration options

Plugins support additional global and plugin configuration settings for tasks such as modifying metrics, tags, and fields, creating aliases, and configuring plugin ordering. See [CONFIGURATION.md](/telegraf/v1/configuration/#plugins) for more details.

## Configuration

```toml
# OpenLDAP cn=Monitor plugin
[[inputs.openldap]]
  host = "localhost"
  port = 389

  # ldaps, starttls, or no encryption. default is an empty string, disabling all encryption.
  # note that port will likely need to be changed to 636 for ldaps
  # valid options: "" | "starttls" | "ldaps"
  tls = ""

  # skip peer certificate verification. Default is false.
  insecure_skip_verify = false

  # Path to PEM-encoded Root certificate to use to verify server certificate
  tls_ca = "/etc/ssl/certs.pem"

  # dn/password to bind with. If bind_dn is empty, an anonymous bind is performed.
  bind_dn = ""
  bind_password = ""

  # reverse metric names so they sort more naturally
  # Defaults to false if unset, but is set to true when generating a new config
  reverse_metric_names = true
```

## Metrics

All `monitorCounter`, `monitoredInfo`, `monitorOpInitiated`, and `monitorOpCompleted` attributes are gathered based on this LDAP query:

```text
(|(objectClass=monitorCounterObject)(objectClass=monitorOperation)(objectClass=monitoredObject))
```

Metric names are based on their entry DN with the cn=Monitor base removed. If `reverse_metric_names` is not set, metrics are based on their DN. If `reverse_metric_names` is set to `true`, the names are reversed. This is recommended as it allows the names to sort more naturally.

Metrics for the `monitorOp*` attributes have `_initiated` and `_completed` added to the base name as appropriate.

An OpenLDAP 2.4 server will provide these metrics:

-   openldap
    -   tags:
        -   server
        -   port
    -   fields:
        -   connections\_current
        -   connections\_max\_file\_descriptors
        -   connections\_total
        -   operations\_abandon\_completed
        -   operations\_abandon\_initiated
        -   operations\_add\_completed
        -   operations\_add\_initiated
        -   operations\_bind\_completed
        -   operations\_bind\_initiated
        -   operations\_compare\_completed
        -   operations\_compare\_initiated
        -   operations\_delete\_completed
        -   operations\_delete\_initiated
        -   operations\_extended\_completed
        -   operations\_extended\_initiated
        -   operations\_modify\_completed
        -   operations\_modify\_initiated
        -   operations\_modrdn\_completed
        -   operations\_modrdn\_initiated
        -   operations\_search\_completed
        -   operations\_search\_initiated
        -   operations\_unbind\_completed
        -   operations\_unbind\_initiated
        -   statistics\_bytes
        -   statistics\_entries
        -   statistics\_pdu
        -   statistics\_referrals
        -   threads\_active
        -   threads\_backload
        -   threads\_max
        -   threads\_max\_pending
        -   threads\_open
        -   threads\_pending
        -   threads\_starting
        -   time\_uptime
        -   waiters\_read
        -   waiters\_write

## Example Output

```text
openldap,server=localhost,port=389,host=niska.ait.psu.edu operations_bind_initiated=10i,operations_unbind_initiated=6i,operations_modrdn_completed=0i,operations_delete_initiated=0i,operations_add_completed=2i,operations_delete_completed=0i,operations_abandon_completed=0i,statistics_entries=1516i,threads_open=2i,threads_active=1i,waiters_read=1i,operations_modify_completed=0i,operations_extended_initiated=4i,threads_pending=0i,operations_search_initiated=36i,operations_compare_initiated=0i,connections_max_file_descriptors=4096i,operations_modify_initiated=0i,operations_modrdn_initiated=0i,threads_max=16i,time_uptime=6017i,connections_total=1037i,connections_current=1i,operations_add_initiated=2i,statistics_bytes=162071i,operations_unbind_completed=6i,operations_abandon_initiated=0i,statistics_pdu=1566i,threads_max_pending=0i,threads_backload=1i,waiters_write=0i,operations_bind_completed=10i,operations_search_completed=35i,operations_compare_completed=0i,operations_extended_completed=4i,statistics_referrals=0i,threads_starting=0i 1516912070000000000
```

#### Related

-   [Configure plugins](/telegraf/v1/configure_plugins/)
-   [OpenLDAP Plugin Source](https://github.com/influxdata/telegraf/tree/v1.38.4/plugins/inputs/openldap/README.md)
