Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config specs #8096

Merged
merged 3 commits into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions openldap/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: OpenLDAP
files:
- name: openldap.yaml
options:
- template: init_config
options:
- template: init_config/default
- template: instances
options:
- name: url
description: |
Full URL of your LDAP server. Use `ldaps` or `ldap` to indicate whether to
use TLS or not, or `ldapi` to connect to a UNIX socket.
required: True
value:
example: ldaps://localhost:636
type: string
- name: username
description: The Distinguished Name of the user that can read the monitor database.
value:
type: string
example: <USER_DISTINGUISHED_NAME>
- name: password
description: Password associated with `username`
value:
type: string
- name: ssl_verify
description: Whether or not to perform server certificate validation.
value:
type: boolean
example: true
- name: ssl_key
description: Path to the client private key file, in PEM format.
value:
type: string
example: <KEY_PEM_PATH>
- name: ssl_cert
description: |
Path to the client certificate file in PEM format.
If you don't specify a key, the path is taken from the certificate file.
value:
type: string
example: <CLIENT_CERT_PATH>
- name: ssl_ca_certs
description: |
Path to a directory containing CA certificates,
or a file containing a bundle of certificates, in PEM format.
value:
type: string
example: <CA_CERT_PATH>
- name: custom_queries
description: |
Specifies custom search queries that are run by the check, which then sends the duration of
the query, and the number of results to Datadog.
Each custom query has the following parameters:
* `name` - string - required: A name to identify your query. Used to tag the metrics for this query.
* `search_base` - string - required: The search base for the query.
* `search_filter` - string - required: The search filter for your query.
* `search_scope` - string - optional - default: `subtree` : One of `base`, `level`, or `subtree`.
* `attributes` - list of strings - optional: List of attributes to query.
* `username` - string - optional: The user you want to bind to perform the query.
Don't specify this option if you want to use the same user as
for the monitor backend. Set to empty string `""` for an anonymous bind.
* `password` - string - optional: The password associated with `username`.
value:
type: array
items:
type: object
example:
- name: <CUSTOM_QUERY_NAME>
search_base: <SEARCH_BASE>
search_filter: (objectClass=*)
search_scope: subtree
attributes: []
username: <USER_DISTINGUISHED_NAME>
password: <PASSWORD>
- template: instances/default
- template: logs
example:
- type: file
path: /var/log/slapd.log
source: openldap
98 changes: 65 additions & 33 deletions openldap/datadog_checks/openldap/data/conf.yaml.example
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
## All options defined here are available to all instances.
#
init_config:

## List of instances describing your OpenLDAP servers to monitor.
## @param service - string - optional
## Attach the tag `service:<SERVICE>` to every metric, event, and service check emitted by this integration.
##
## Additionally, this sets the default `service` for every log source.
#
# service: <SERVICE>

## Every instance is scheduled independent of the others.
#
instances:

## @param url - string - required
## Full URL of your ldap server. Use `ldaps` or `ldap` as the scheme to
## Full URL of your LDAP server. Use `ldaps` or `ldap` to indicate whether to
## use TLS or not, or `ldapi` to connect to a UNIX socket.
#
- url: ldaps://localhost:636

## @param username - string - optional
## The DN of the user that can read the monitor database.
## The Distinguished Name of the user that can read the monitor database.
#
# username: <USER_DISTINGUISHED_NAME>

Expand All @@ -32,7 +41,7 @@ instances:

## @param ssl_cert - string - optional
## Path to the client certificate file in PEM format.
## If you don't specify key, it's taken from the certificate file.
## If you don't specify a key, the path is taken from the certificate file.
#
# ssl_cert: <CLIENT_CERT_PATH>

Expand All @@ -42,51 +51,74 @@ instances:
#
# ssl_ca_certs: <CA_CERT_PATH>

## @param tags - list of key:value elements - optional
## List of tags to attach to every metric, event, and service check emitted by this Integration.
##
## Learn more about tagging: https://docs.datadoghq.com/tagging/
#
# tags:
# - <KEY_1>:<VALUE_1>
# - <KEY_2>:<VALUE_2>

## @param custom_queries - object - optional
## @param custom_queries - list of mappings - optional
## Specifies custom search queries that are run by the check, which then sends the duration of
## the query, and the number of results to Datadog.
## Each custom queries have the following parameters:
## * `name` - string - required: A name to identify your query. It's used to tag the metrics for this query.
## * `search_base` - string - required: The search base for the query.
## * `search_filter` - string - required: The search filter for your query.
## * `search_scope` - string - optional - default: subtree : One of `base`, `level`, `subtree`.
## * `attributes` - list of strings - optional: List of attributes to query.
## * `username` - string - optional: The user you want to bind to perform the query.
## Don't specify the option if you want to use the same user as
## for the monitor backend. Set to empty string `""` for an anonymous bind.
## * `password` - string - optional: The password associated with `username`.
## Each custom query has the following parameters:
## * `name` - string - required: A name to identify your query. Used to tag the metrics for this query.
## * `search_base` - string - required: The search base for the query.
## * `search_filter` - string - required: The search filter for your query.
## * `search_scope` - string - optional - default: `subtree` : One of `base`, `level`, or `subtree`.
## * `attributes` - list of strings - optional: List of attributes to query.
## * `username` - string - optional: The user you want to bind to perform the query.
## Don't specify this option if you want to use the same user as
## for the monitor backend. Set to empty string `""` for an anonymous bind.
## * `password` - string - optional: The password associated with `username`.
#
# custom_queries:
# - name: <CUSTOM_QUERY_NAME>
# search_base: <SEARCH_BASE>
# search_filter: (objectClass=*)
# search_scope: subtree
# attributes:
# - *
# attributes: []
# username: <USER_DISTINGUISHED_NAME>
# password: <PASSWORD>

## Log Section (Available for Agent >=6.0)
## @param tags - list of strings - optional
## A list of tags to attach to every metric and service check emitted by this instance.
##
## Learn more about tagging at https://docs.datadoghq.com/tagging
#
# tags:
# - <KEY_1>:<VALUE_1>
# - <KEY_2>:<VALUE_2>

## @param service - string - optional
## Attach the tag `service:<SERVICE>` to every metric, event, and service check emitted by this integration.
##
## Overrides any `service` defined in the `init_config` section.
#
# service: <SERVICE>

## @param min_collection_interval - number - optional - default: 15
## This changes the collection interval of the check. For more information, see:
## https://docs.datadoghq.com/developers/write_agent_check/#collection-interval
#
# min_collection_interval: 15

## @param empty_default_hostname - boolean - optional - default: false
## This forces the check to send metrics with no hostname.
##
## This is useful for cluster-level checks.
#
# empty_default_hostname: false

## Log Section
##
## type - mandatory - Type of log input source (tcp / udp / file / windows_event)
## port / path / channel_path - mandatory - Set port if type is tcp or udp. Set path if type is file. Set channel_path if type is windows_event
## service - mandatory - Name of the service that generated the log
## source - mandatory - Attribute that defines which Integration sent the logs
## tags: - optional - Add tags to the collected logs
## type - required - Type of log input source (tcp / udp / file / windows_event)
## port / path / channel_path - required - Set port if type is tcp or udp.
## Set path if type is file.
## Set channel_path if type is windows_event.
## source - required - Attribute that defines which Integration sent the logs.
## encoding - optional - For file specifies the file encoding, default is utf-8, other
## possible values are utf-16-le and utf-16-be.
## service - optional - The name of the service that generates the log.
## Overrides any `service` defined in the `init_config` section.
## tags - optional - Add tags to the collected logs.
##
## Discover Datadog log collection: https://docs.datadoghq.com/logs/log_collection/
#
# logs:
# - type: file
# path: /var/log/slapd.log
# source: openldap
# service: <SERVICE_NAME>
3 changes: 3 additions & 0 deletions openldap/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"type": "check",
"integration_id": "openldap",
"assets": {
"configuration": {
"spec": "assets/configuration/spec.yaml"
},
"monitors": {},
"dashboards": {},
"service_checks": "assets/service_checks.json",
Expand Down
2 changes: 1 addition & 1 deletion openldap/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_dependencies():
return f.readlines()


CHECKS_BASE_REQ = 'datadog-checks-base>=4.2.0'
CHECKS_BASE_REQ = 'datadog-checks-base>=11.0.0'

setup(
name='datadog-openldap',
Expand Down