From d63478b4854e27065f25f71d5ee9262d62678adb Mon Sep 17 00:00:00 2001 From: Sven Rebhan <36194019+srebhan@users.noreply.github.com> Date: Thu, 12 Oct 2023 16:47:27 +0200 Subject: [PATCH] feat(inputs.ldap): Collect additional fields (#14092) --- plugins/inputs/ldap/README.md | 2 +- plugins/inputs/ldap/ldap_test.go | 8 ++++++++ plugins/inputs/ldap/openldap.go | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/inputs/ldap/README.md b/plugins/inputs/ldap/README.md index 3aa38d49cfe39..3633d29ee0e88 100644 --- a/plugins/inputs/ldap/README.md +++ b/plugins/inputs/ldap/README.md @@ -71,7 +71,7 @@ are usually named according to the selected dialect. Using the `openldap` dialect ```text -openldap,server=localhost,port=389 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 +openldap,server=localhost,port=389 operations_completed=63i,operations_initiated=98i,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 ``` Using the `389ds` dialect diff --git a/plugins/inputs/ldap/ldap_test.go b/plugins/inputs/ldap/ldap_test.go index fb4ad777af122..ee01123868843 100644 --- a/plugins/inputs/ldap/ldap_test.go +++ b/plugins/inputs/ldap/ldap_test.go @@ -153,6 +153,8 @@ func TestOpenLDAPIntegration(t *testing.T) { "modrdn_operations_completed": int64(0), "modrdn_operations_initiated": int64(0), "open_threads": int64(0), + "operations_completed": int64(0), + "operations_initiated": int64(0), "pdu_statistics": int64(0), "pending_threads": int64(0), "read_waiters": int64(0), @@ -223,6 +225,8 @@ func TestOpenLDAPReverseDNIntegration(t *testing.T) { "connections_current": int64(0), "operations_bind_initiated": int64(0), "operations_bind_completed": int64(0), + "operations_completed": int64(0), + "operations_initiated": int64(0), "operations_unbind_initiated": int64(0), "operations_unbind_completed": int64(0), "operations_search_initiated": int64(0), @@ -349,6 +353,8 @@ func TestOpenLDAPStartTLSIntegration(t *testing.T) { "modrdn_operations_completed": int64(0), "modrdn_operations_initiated": int64(0), "open_threads": int64(0), + "operations_completed": int64(0), + "operations_initiated": int64(0), "pdu_statistics": int64(0), "pending_threads": int64(0), "read_waiters": int64(0), @@ -454,6 +460,8 @@ func TestOpenLDAPLDAPSIntegration(t *testing.T) { "modrdn_operations_completed": int64(0), "modrdn_operations_initiated": int64(0), "open_threads": int64(0), + "operations_completed": int64(0), + "operations_initiated": int64(0), "pdu_statistics": int64(0), "pending_threads": int64(0), "read_waiters": int64(0), diff --git a/plugins/inputs/ldap/openldap.go b/plugins/inputs/ldap/openldap.go index eb94d92455270..f8176c1223d54 100644 --- a/plugins/inputs/ldap/openldap.go +++ b/plugins/inputs/ldap/openldap.go @@ -31,7 +31,7 @@ func (l *LDAP) newOpenLDAPConfig() []request { 0, 0, false, - "(|(objectClass=monitorCounterObject)(objectClass=monitorOperation)(objectClass=monitoredObject))", + "(|(objectClass=monitorCounterObject)(objectClass=monitorOperation)(objectClass=monitoredObject)(objectClass=monitorContainer))", []string{"monitorCounter", "monitorOpInitiated", "monitorOpCompleted", "monitoredInfo"}, nil, )