Remove Python OpenLDAP implementation (#18626)
Fotis Voutsas committed
Sep 30, 2024 at 14:41 UTC
ee2e1e0a88839c7535518561a97259446940de17
7 files changed
+1
-769
CMakeLists.txt
-2
@@ -2937,7 +2937,6 @@ if(ENABLE_PLUGIN_PYTHON)
2937
src/collectors/python.d.plugin/am2320/am2320.conf
2938
src/collectors/python.d.plugin/go_expvar/go_expvar.conf
2939
src/collectors/python.d.plugin/haproxy/haproxy.conf
2940
- src/collectors/python.d.plugin/openldap/openldap.conf
2940
src/collectors/python.d.plugin/oracledb/oracledb.conf
2941
src/collectors/python.d.plugin/pandas/pandas.conf
2942
src/collectors/python.d.plugin/spigotmc/spigotmc.conf
@@ -2950,7 +2949,6 @@ if(ENABLE_PLUGIN_PYTHON)
2949
src/collectors/python.d.plugin/am2320/am2320.chart.py
2950
src/collectors/python.d.plugin/go_expvar/go_expvar.chart.py
2951
src/collectors/python.d.plugin/haproxy/haproxy.chart.py
2953
- src/collectors/python.d.plugin/openldap/openldap.chart.py
2952
src/collectors/python.d.plugin/oracledb/oracledb.chart.py
2953
src/collectors/python.d.plugin/pandas/pandas.chart.py
2954
src/collectors/python.d.plugin/spigotmc/spigotmc.chart.py
src/collectors/python.d.plugin/openldap/README.md
deleted
-1
@@ -1 +0,0 @@
1
-integrations/openldap.md
\ No newline at end of file
src/collectors/python.d.plugin/openldap/integrations/openldap.md
deleted
-249
@@ -1,249 +0,0 @@
1
-<!--startmeta
2
-custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/openldap/README.md"
3
-meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/openldap/metadata.yaml"
4
-sidebar_label: "OpenLDAP"
5
-learn_status: "Published"
6
-learn_rel_path: "Collecting Metrics/Authentication and Authorization"
7
-most_popular: False
8
-message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
9
-endmeta-->
10
-
11
-# OpenLDAP
12
-
13
-
14
-<img src="https://netdata.cloud/img/statsd.png" width="150"/>
15
-
16
-
17
-Plugin: python.d.plugin
18
-Module: openldap
19
-
20
-<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
21
-
22
-## Overview
23
-
24
-This collector monitors OpenLDAP metrics about connections, operations, referrals and more.
25
-
26
-Statistics are taken from the monitoring interface of a openLDAP (slapd) server
27
-
28
-
29
-This collector is supported on all platforms.
30
-
31
-This collector only supports collecting metrics from a single instance of this integration.
32
-
33
-
34
-### Default Behavior
35
-
36
-#### Auto-Detection
37
-
38
-This collector doesn't work until all the prerequisites are checked.
39
-
40
-
41
-#### Limits
42
-
43
-The default configuration for this integration does not impose any limits on data collection.
44
-
45
-#### Performance Impact
46
-
47
-The default configuration for this integration is not expected to impose a significant performance impact on the system.
48
-
49
-
50
-## Metrics
51
-
52
-Metrics grouped by *scope*.
53
-
54
-The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
55
-
56
-
57
-
58
-### Per OpenLDAP instance
59
-
60
-These metrics refer to the entire monitored application.
61
-
62
-This scope has no labels.
63
-
64
-Metrics:
65
-
66
-| Metric | Dimensions | Unit |
67
-|:------|:----------|:----|
68
-| openldap.total_connections | connections | connections/s |
69
-| openldap.traffic_stats | sent | KiB/s |
70
-| openldap.operations_status | completed, initiated | ops/s |
71
-| openldap.referrals | sent | referrals/s |
72
-| openldap.entries | sent | entries/s |
73
-| openldap.ldap_operations | bind, search, unbind, add, delete, modify, compare | ops/s |
74
-| openldap.waiters | write, read | waiters/s |
75
-
76
-
77
-
78
-## Alerts
79
-
80
-There are no alerts configured by default for this integration.
81
-
82
-
83
-## Setup
84
-
85
-### Prerequisites
86
-
87
-#### Configure the openLDAP server to expose metrics to monitor it.
88
-
89
-Follow instructions from https://www.openldap.org/doc/admin24/monitoringslapd.html to activate monitoring interface.
90
-
91
-
92
-#### Install python-ldap module
93
-
94
-Install python ldap module
95
-
96
-1. From pip package manager
97
-
98
-```bash
99
-pip install ldap
100
-```
101
-
102
-2. With apt package manager (in most deb based distros)
103
-
104
-
105
-```bash
106
-apt-get install python-ldap
107
-```
108
-
109
-
110
-3. With yum package manager (in most rpm based distros)
111
-
112
-
113
-```bash
114
-yum install python-ldap
115
-```
116
-
117
-
118
-#### Insert credentials for Netdata to access openLDAP server
119
-
120
-Use the `ldappasswd` utility to set a password for the username you will use.
121
-
122
-
123
-
124
-### Configuration
125
-
126
-#### File
127
-
128
-The configuration file name for this integration is `python.d/openldap.conf`.
129
-
130
-
131
-You can edit the configuration file using the `edit-config` script from the
132
-Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).
133
-
134
-```bash
135
-cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
136
-sudo ./edit-config python.d/openldap.conf
137
-```
138
-#### Options
139
-
140
-There are 2 sections:
141
-
142
-* Global variables
143
-* One or more JOBS that can define multiple different instances to monitor.
144
-
145
-The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
146
-
147
-Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
148
-
149
-Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
150
-
151
-
152
-<details open><summary>Config options</summary>
153
-
154
-| Name | Description | Default | Required |
155
-|:----|:-----------|:-------|:--------:|
156
-| update_every | Sets the default data collection frequency. | 5 | no |
157
-| priority | Controls the order of charts at the netdata dashboard. | 60000 | no |
158
-| autodetection_retry | Sets the job re-check interval in seconds. | 0 | no |
159
-| penalty | Indicates whether to apply penalty to update_every in case of failures. | yes | no |
160
-| name | Job name. This value will overwrite the `job_name` value. JOBS with the same name are mutually exclusive. Only one of them will be allowed running at any time. This allows autodetection to try several alternatives and pick the one that works. | | no |
161
-| username | The bind user with right to access monitor statistics | | yes |
162
-| password | The password for the binded user | | yes |
163
-| server | The listening address of the LDAP server. In case of TLS, use the hostname which the certificate is published for. | | yes |
164
-| port | The listening port of the LDAP server. Change to 636 port in case of TLS connection. | 389 | yes |
165
-| use_tls | Make True if a TLS connection is used over ldaps:// | no | no |
166
-| use_start_tls | Make True if a TLS connection is used over ldap:// | no | no |
167
-| cert_check | False if you want to ignore certificate check | True | yes |
168
-| timeout | Seconds to timeout if no connection exist | | yes |
169
-
170
-</details>
171
-
172
-#### Examples
173
-
174
-##### Basic
175
-
176
-A basic example configuration.
177
-
178
-```yaml
179
-username: "cn=admin"
180
-password: "pass"
181
-server: "localhost"
182
-port: "389"
183
-check_cert: True
184
-timeout: 1
185
-
186
-```
187
-
188
-
189
-## Troubleshooting
190
-
191
-### Debug Mode
192
-
193
-
194
-To troubleshoot issues with the `openldap` collector, run the `python.d.plugin` with the debug option enabled. The output
195
-should give you clues as to why the collector isn't working.
196
-
197
-- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
198
- your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
199
-
200
- ```bash
201
- cd /usr/libexec/netdata/plugins.d/
202
- ```
203
-
204
-- Switch to the `netdata` user.
205
-
206
- ```bash
207
- sudo -u netdata -s
208
- ```
209
-
210
-- Run the `python.d.plugin` to debug the collector:
211
-
212
- ```bash
213
- ./python.d.plugin openldap debug trace
214
- ```
215
-
216
-### Getting Logs
217
-
218
-If you're encountering problems with the `openldap` collector, follow these steps to retrieve logs and identify potential issues:
219
-
220
-- **Run the command** specific to your system (systemd, non-systemd, or Docker container).
221
-- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.
222
-
223
-#### System with systemd
224
-
225
-Use the following command to view logs generated since the last Netdata service restart:
226
-
227
-```bash
228
-journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep openldap
229
-```
230
-
231
-#### System without systemd
232
-
233
-Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name:
234
-
235
-```bash
236
-grep openldap /var/log/netdata/collector.log
237
-```
238
-
239
-**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues.
240
-
241
-#### Docker Container
242
-
243
-If your Netdata runs in a Docker container named "netdata" (replace if different), use this command:
244
-
245
-```bash
246
-docker logs netdata 2>&1 | grep openldap
247
-```
248
-
249
-
src/collectors/python.d.plugin/openldap/metadata.yaml
deleted
-225
@@ -1,225 +0,0 @@
1
-plugin_name: python.d.plugin
2
-modules:
3
- - meta:
4
- plugin_name: python.d.plugin
5
- module_name: openldap
6
- monitored_instance:
7
- name: OpenLDAP
8
- link: "https://www.openldap.org/"
9
- categories:
10
- - data-collection.authentication-and-authorization
11
- icon_filename: "statsd.png"
12
- related_resources:
13
- integrations:
14
- list: []
15
- info_provided_to_referring_integrations:
16
- description: ""
17
- keywords:
18
- - openldap
19
- - RBAC
20
- - Directory access
21
- most_popular: false
22
- overview:
23
- data_collection:
24
- metrics_description: "This collector monitors OpenLDAP metrics about connections, operations, referrals and more."
25
- method_description: |
26
- Statistics are taken from the monitoring interface of a openLDAP (slapd) server
27
- supported_platforms:
28
- include: []
29
- exclude: []
30
- multi_instance: false
31
- additional_permissions:
32
- description: ""
33
- default_behavior:
34
- auto_detection:
35
- description: |
36
- This collector doesn't work until all the prerequisites are checked.
37
- limits:
38
- description: ""
39
- performance_impact:
40
- description: ""
41
- setup:
42
- prerequisites:
43
- list:
44
- - title: Configure the openLDAP server to expose metrics to monitor it.
45
- description: |
46
- Follow instructions from https://www.openldap.org/doc/admin24/monitoringslapd.html to activate monitoring interface.
47
- - title: Install python-ldap module
48
- description: |
49
- Install python ldap module
50
-
51
- 1. From pip package manager
52
-
53
- ```bash
54
- pip install ldap
55
- ```
56
-
57
- 2. With apt package manager (in most deb based distros)
58
-
59
-
60
- ```bash
61
- apt-get install python-ldap
62
- ```
63
-
64
-
65
- 3. With yum package manager (in most rpm based distros)
66
-
67
-
68
- ```bash
69
- yum install python-ldap
70
- ```
71
- - title: Insert credentials for Netdata to access openLDAP server
72
- description: |
73
- Use the `ldappasswd` utility to set a password for the username you will use.
74
- configuration:
75
- file:
76
- name: "python.d/openldap.conf"
77
- options:
78
- description: |
79
- There are 2 sections:
80
-
81
- * Global variables
82
- * One or more JOBS that can define multiple different instances to monitor.
83
-
84
- The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
85
-
86
- Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
87
-
88
- Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
89
- folding:
90
- title: "Config options"
91
- enabled: true
92
- list:
93
- - name: update_every
94
- description: Sets the default data collection frequency.
95
- default_value: 5
96
- required: false
97
- - name: priority
98
- description: Controls the order of charts at the netdata dashboard.
99
- default_value: 60000
100
- required: false
101
- - name: autodetection_retry
102
- description: Sets the job re-check interval in seconds.
103
- default_value: 0
104
- required: false
105
- - name: penalty
106
- description: Indicates whether to apply penalty to update_every in case of failures.
107
- default_value: yes
108
- required: false
109
- - name: name
110
- description: Job name. This value will overwrite the `job_name` value. JOBS with the same name are mutually exclusive. Only one of them will be allowed running at any time. This allows autodetection to try several alternatives and pick the one that works.
111
- default_value: ""
112
- required: false
113
- - name: username
114
- description: The bind user with right to access monitor statistics
115
- default_value: ""
116
- required: true
117
- - name: password
118
- description: The password for the binded user
119
- default_value: ""
120
- required: true
121
- - name: server
122
- description: The listening address of the LDAP server. In case of TLS, use the hostname which the certificate is published for.
123
- default_value: ""
124
- required: true
125
- - name: port
126
- description: The listening port of the LDAP server. Change to 636 port in case of TLS connection.
127
- default_value: "389"
128
- required: true
129
- - name: use_tls
130
- description: Make True if a TLS connection is used over ldaps://
131
- default_value: False
132
- required: false
133
- - name: use_start_tls
134
- description: Make True if a TLS connection is used over ldap://
135
- default_value: False
136
- required: false
137
- - name: cert_check
138
- description: False if you want to ignore certificate check
139
- default_value: "True"
140
- required: true
141
- - name: timeout
142
- description: Seconds to timeout if no connection exist
143
- default_value: ""
144
- required: true
145
- examples:
146
- folding:
147
- enabled: true
148
- title: "Config"
149
- list:
150
- - name: Basic
151
- description: A basic example configuration.
152
- folding:
153
- enabled: false
154
- config: |
155
- username: "cn=admin"
156
- password: "pass"
157
- server: "localhost"
158
- port: "389"
159
- check_cert: True
160
- timeout: 1
161
- troubleshooting:
162
- problems:
163
- list: []
164
- alerts: []
165
- metrics:
166
- folding:
167
- title: Metrics
168
- enabled: false
169
- description: ""
170
- availability: []
171
- scopes:
172
- - name: global
173
- description: "These metrics refer to the entire monitored application."
174
- labels: []
175
- metrics:
176
- - name: openldap.total_connections
177
- description: Total Connections
178
- unit: "connections/s"
179
- chart_type: line
180
- dimensions:
181
- - name: connections
182
- - name: openldap.traffic_stats
183
- description: Traffic
184
- unit: "KiB/s"
185
- chart_type: line
186
- dimensions:
187
- - name: sent
188
- - name: openldap.operations_status
189
- description: Operations Status
190
- unit: "ops/s"
191
- chart_type: line
192
- dimensions:
193
- - name: completed
194
- - name: initiated
195
- - name: openldap.referrals
196
- description: Referrals
197
- unit: "referrals/s"
198
- chart_type: line
199
- dimensions:
200
- - name: sent
201
- - name: openldap.entries
202
- description: Entries
203
- unit: "entries/s"
204
- chart_type: line
205
- dimensions:
206
- - name: sent
207
- - name: openldap.ldap_operations
208
- description: Operations
209
- unit: "ops/s"
210
- chart_type: line
211
- dimensions:
212
- - name: bind
213
- - name: search
214
- - name: unbind
215
- - name: add
216
- - name: delete
217
- - name: modify
218
- - name: compare
219
- - name: openldap.waiters
220
- description: Waiters
221
- unit: "waiters/s"
222
- chart_type: line
223
- dimensions:
224
- - name: write
225
- - name: read
src/collectors/python.d.plugin/openldap/openldap.chart.py
deleted
-216
@@ -1,216 +0,0 @@
1
-# -*- coding: utf-8 -*-
2
-# Description: openldap netdata python.d module
3
-# Author: Manolis Kartsonakis (ekartsonakis)
4
-# SPDX-License-Identifier: GPL-3.0+
5
-
6
-try:
7
- import ldap
8
-
9
- HAS_LDAP = True
10
-except ImportError:
11
- HAS_LDAP = False
12
-
13
-from bases.FrameworkServices.SimpleService import SimpleService
14
-
15
-DEFAULT_SERVER = 'localhost'
16
-DEFAULT_PORT = '389'
17
-DEFAULT_TLS = False
18
-DEFAULT_CERT_CHECK = True
19
-DEFAULT_TIMEOUT = 1
20
-DEFAULT_START_TLS = False
21
-
22
-ORDER = [
23
- 'total_connections',
24
- 'bytes_sent',
25
- 'operations',
26
- 'referrals_sent',
27
- 'entries_sent',
28
- 'ldap_operations',
29
- 'waiters'
30
-]
31
-
32
-CHARTS = {
33
- 'total_connections': {
34
- 'options': [None, 'Total Connections', 'connections/s', 'ldap', 'openldap.total_connections', 'line'],
35
- 'lines': [
36
- ['total_connections', 'connections', 'incremental']
37
- ]
38
- },
39
- 'bytes_sent': {
40
- 'options': [None, 'Traffic', 'KiB/s', 'ldap', 'openldap.traffic_stats', 'line'],
41
- 'lines': [
42
- ['bytes_sent', 'sent', 'incremental', 1, 1024]
43
- ]
44
- },
45
- 'operations': {
46
- 'options': [None, 'Operations Status', 'ops/s', 'ldap', 'openldap.operations_status', 'line'],
47
- 'lines': [
48
- ['completed_operations', 'completed', 'incremental'],
49
- ['initiated_operations', 'initiated', 'incremental']
50
- ]
51
- },
52
- 'referrals_sent': {
53
- 'options': [None, 'Referrals', 'referrals/s', 'ldap', 'openldap.referrals', 'line'],
54
- 'lines': [
55
- ['referrals_sent', 'sent', 'incremental']
56
- ]
57
- },
58
- 'entries_sent': {
59
- 'options': [None, 'Entries', 'entries/s', 'ldap', 'openldap.entries', 'line'],
60
- 'lines': [
61
- ['entries_sent', 'sent', 'incremental']
62
- ]
63
- },
64
- 'ldap_operations': {
65
- 'options': [None, 'Operations', 'ops/s', 'ldap', 'openldap.ldap_operations', 'line'],
66
- 'lines': [
67
- ['bind_operations', 'bind', 'incremental'],
68
- ['search_operations', 'search', 'incremental'],
69
- ['unbind_operations', 'unbind', 'incremental'],
70
- ['add_operations', 'add', 'incremental'],
71
- ['delete_operations', 'delete', 'incremental'],
72
- ['modify_operations', 'modify', 'incremental'],
73
- ['compare_operations', 'compare', 'incremental']
74
- ]
75
- },
76
- 'waiters': {
77
- 'options': [None, 'Waiters', 'waiters/s', 'ldap', 'openldap.waiters', 'line'],
78
- 'lines': [
79
- ['write_waiters', 'write', 'incremental'],
80
- ['read_waiters', 'read', 'incremental']
81
- ]
82
- },
83
-}
84
-
85
-# Stuff to gather - make tuples of DN dn and attrib to get
86
-SEARCH_LIST = {
87
- 'total_connections': (
88
- 'cn=Total,cn=Connections,cn=Monitor', 'monitorCounter',
89
- ),
90
- 'bytes_sent': (
91
- 'cn=Bytes,cn=Statistics,cn=Monitor', 'monitorCounter',
92
- ),
93
- 'completed_operations': (
94
- 'cn=Operations,cn=Monitor', 'monitorOpCompleted',
95
- ),
96
- 'initiated_operations': (
97
- 'cn=Operations,cn=Monitor', 'monitorOpInitiated',
98
- ),
99
- 'referrals_sent': (
100
- 'cn=Referrals,cn=Statistics,cn=Monitor', 'monitorCounter',
101
- ),
102
- 'entries_sent': (
103
- 'cn=Entries,cn=Statistics,cn=Monitor', 'monitorCounter',
104
- ),
105
- 'bind_operations': (
106
- 'cn=Bind,cn=Operations,cn=Monitor', 'monitorOpCompleted',
107
- ),
108
- 'unbind_operations': (
109
- 'cn=Unbind,cn=Operations,cn=Monitor', 'monitorOpCompleted',
110
- ),
111
- 'add_operations': (
112
- 'cn=Add,cn=Operations,cn=Monitor', 'monitorOpInitiated',
113
- ),
114
- 'delete_operations': (
115
- 'cn=Delete,cn=Operations,cn=Monitor', 'monitorOpCompleted',
116
- ),
117
- 'modify_operations': (
118
- 'cn=Modify,cn=Operations,cn=Monitor', 'monitorOpCompleted',
119
- ),
120
- 'compare_operations': (
121
- 'cn=Compare,cn=Operations,cn=Monitor', 'monitorOpCompleted',
122
- ),
123
- 'search_operations': (
124
- 'cn=Search,cn=Operations,cn=Monitor', 'monitorOpCompleted',
125
- ),
126
- 'write_waiters': (
127
- 'cn=Write,cn=Waiters,cn=Monitor', 'monitorCounter',
128
- ),
129
- 'read_waiters': (
130
- 'cn=Read,cn=Waiters,cn=Monitor', 'monitorCounter',
131
- ),
132
-}
133
-
134
-
135
-class Service(SimpleService):
136
- def __init__(self, configuration=None, name=None):
137
- SimpleService.__init__(self, configuration=configuration, name=name)
138
- self.order = ORDER
139
- self.definitions = CHARTS
140
- self.server = configuration.get('server', DEFAULT_SERVER)
141
- self.port = configuration.get('port', DEFAULT_PORT)
142
- self.username = configuration.get('username')
143
- self.password = configuration.get('password')
144
- self.timeout = configuration.get('timeout', DEFAULT_TIMEOUT)
145
- self.use_tls = configuration.get('use_tls', DEFAULT_TLS)
146
- self.cert_check = configuration.get('cert_check', DEFAULT_CERT_CHECK)
147
- self.use_start_tls = configuration.get('use_start_tls', DEFAULT_START_TLS)
148
- self.alive = False
149
- self.conn = None
150
-
151
- def disconnect(self):
152
- if self.conn:
153
- self.conn.unbind()
154
- self.conn = None
155
- self.alive = False
156
-
157
- def connect(self):
158
- try:
159
- if self.use_tls:
160
- self.conn = ldap.initialize('ldaps://%s:%s' % (self.server, self.port))
161
- else:
162
- self.conn = ldap.initialize('ldap://%s:%s' % (self.server, self.port))
163
- self.conn.set_option(ldap.OPT_NETWORK_TIMEOUT, self.timeout)
164
- if (self.use_tls or self.use_start_tls) and not self.cert_check:
165
- self.conn.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
166
- if self.use_start_tls or self.use_tls:
167
- self.conn.set_option(ldap.OPT_X_TLS_NEWCTX, 0)
168
- if self.use_start_tls:
169
- self.conn.protocol_version = ldap.VERSION3
170
- self.conn.start_tls_s()
171
- if self.username and self.password:
172
- self.conn.simple_bind(self.username, self.password)
173
- except ldap.LDAPError as error:
174
- self.error(error)
175
- return False
176
-
177
- self.alive = True
178
- return True
179
-
180
- def reconnect(self):
181
- self.disconnect()
182
- return self.connect()
183
-
184
- def check(self):
185
- if not HAS_LDAP:
186
- self.error("'python-ldap' package is needed")
187
- return None
188
-
189
- return self.connect() and self.get_data()
190
-
191
- def get_data(self):
192
- if not self.alive and not self.reconnect():
193
- return None
194
-
195
- data = dict()
196
- for key in SEARCH_LIST:
197
- dn = SEARCH_LIST[key][0]
198
- attr = SEARCH_LIST[key][1]
199
- try:
200
- num = self.conn.search(dn, ldap.SCOPE_BASE, 'objectClass=*', [attr, ])
201
- result_type, result_data = self.conn.result(num, 1)
202
- except ldap.LDAPError as error:
203
- self.error("Empty result. Check bind username/password. Message: ", error)
204
- self.alive = False
205
- return None
206
-
207
- if result_type != 101:
208
- continue
209
-
210
- try:
211
- data[key] = int(list(result_data[0][1].values())[0][0])
212
- except (ValueError, IndexError) as error:
213
- self.debug(error)
214
- continue
215
-
216
- return data
src/collectors/python.d.plugin/openldap/openldap.conf
deleted
-75
@@ -1,75 +0,0 @@
1
-# netdata python.d.plugin configuration for openldap
2
-#
3
-# This file is in YaML format. Generally the format is:
4
-#
5
-# name: value
6
-#
7
-# There are 2 sections:
8
-# - global variables
9
-# - one or more JOBS
10
-#
11
-# JOBS allow you to collect values from multiple sources.
12
-# Each source will have its own set of charts.
13
-#
14
-# JOB parameters have to be indented (using spaces only, example below).
15
-
16
-# ----------------------------------------------------------------------
17
-# Global Variables
18
-# These variables set the defaults for all JOBs, however each JOB
19
-# may define its own, overriding the defaults.
20
-
21
-# update_every sets the default data collection frequency.
22
-# If unset, the python.d.plugin default is used.
23
-# postfix is slow, so once every 10 seconds
24
-update_every: 10
25
-
26
-# priority controls the order of charts at the netdata dashboard.
27
-# Lower numbers move the charts towards the top of the page.
28
-# If unset, the default for python.d.plugin is used.
29
-# priority: 60000
30
-
31
-# penalty indicates whether to apply penalty to update_every in case of failures.
32
-# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
33
-# penalty: yes
34
-
35
-# autodetection_retry sets the job re-check interval in seconds.
36
-# The job is not deleted if check fails.
37
-# Attempts to start the job are made once every autodetection_retry.
38
-# This feature is disabled by default.
39
-# autodetection_retry: 0
40
-
41
-# ----------------------------------------------------------------------
42
-# JOBS (data collection sources)
43
-#
44
-# The default JOBS share the same *name*. JOBS with the same name
45
-# are mutually exclusive. Only one of them will be allowed running at
46
-# any time. This allows autodetection to try several alternatives and
47
-# pick the one that works.
48
-#
49
-# Any number of jobs is supported.
50
-#
51
-# All python.d.plugin JOBS (for all its modules) support a set of
52
-# predefined parameters. These are:
53
-#
54
-# job_name:
55
-# name: myname # the JOB's name as it will appear at the
56
-# # dashboard (by default is the job_name)
57
-# # JOBs sharing a name are mutually exclusive
58
-# update_every: 1 # the JOB's data collection frequency
59
-# priority: 60000 # the JOB's order on the dashboard
60
-# penalty: yes # the JOB's penalty
61
-# autodetection_retry: 0 # the JOB's re-check interval in seconds
62
-#
63
-# ----------------------------------------------------------------------
64
-# OPENLDAP EXTRA PARAMETERS
65
-
66
-# Set here your LDAP connection settings
67
-
68
-#username : "cn=admin,dc=example,dc=com" # The bind user with right to access monitor statistics
69
-#password : "yourpass" # The password for the binded user
70
-#server : 'localhost' # The listening address of the LDAP server. In case of TLS, use the hostname which the certificate is published for.
71
-#port : 389 # The listening port of the LDAP server. Change to 636 port in case of TLS connection
72
-#use_tls : False # Make True if a TLS connection is used over ldaps://
73
-#use_start_tls: False # Make True if a TLS connection is used over ldap://
74
-#cert_check : True # False if you want to ignore certificate check
75
-#timeout : 1 # Seconds to timeout if no connection exi
src/collectors/python.d.plugin/python.d.conf
+1
-1
@@ -29,7 +29,6 @@ gc_interval: 300
29
# this is just an example
30
go_expvar: no
31
# haproxy: yes
32
-# openldap: yes
32
# oracledb: yes
33
# pandas: yes
34
# retroshare: yes
@@ -65,6 +64,7 @@ mysql: no # Removed (replaced with go.d/mysql).
64
nginx: no # Removed (replaced with go.d/nginx).
65
nsd: no # Removed (replaced with go.d/nsd).
66
nvidia_smi: no # Removed (replaced with go.d/nvidia_smi).
67
+openldap: no # Removed (replaced with go.d/openldap).
68
postfix: no # Removed (replaced with go.d/postfix).
69
postgres: no # Removed (replaced with go.d/postgres).
70
proxysql: no # Removed (replaced with go.d/proxysql).