Skip to content

Commit

Permalink
feat(inputs.ldap): Collect additional fields (#14092)
Browse files Browse the repository at this point in the history
  • Loading branch information
srebhan authored Oct 12, 2023
1 parent 0e1f3f8 commit d63478b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/inputs/ldap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions plugins/inputs/ldap/ldap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/ldap/openldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit d63478b

Please sign in to comment.