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 to active_directory #5762

Merged
merged 14 commits into from
Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from 10 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
17 changes: 17 additions & 0 deletions active_directory/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Active Directory
files:
- name: active_directory.yaml
options:
- template: instances
options:
- template: instances/pdh
hithwen marked this conversation as resolved.
Show resolved Hide resolved
overrides:
host.required: true
- template: instances/tags
- template: instances/global
- template: logs
example:
- type: file
path: /path/to/active_directory/file.log
source: ruby
service: <SERVICE_NAME>
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
init_config:

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

## @param host - string - required
## Host that the Datadog active directory check connects to.
## The host the Datadog Active Directory check connects to.
## "." means the current host
#
- host: .

## @param username - string - optional
## Username from the credentials needed to connect to the host.
## The username from the credentials needed to connect to the host.
#
# username: <USER_NAME>
# username: <USERNAME>

## @param password - string - optional
## Password from the credentials needed to connect to the host.
## The password from the credentials needed to connect to the host.
#
# password: <PASSWORD>

Expand All @@ -24,46 +24,68 @@ instances:
##
## ['<COUNTERSET_NAME>', <COUNTER_INSTANCE_NAME>, '<COUNTER_NAME>', <METRIC_NAME>, <METRIC_TYPE>]
##
## <COUNTERSET_NAME> is the name of the PDH Counter Set (the name of the counter)
## <COUNTERSET_NAME> is the name of the PDH counter set (the name of the counter).
## <COUNTER_INSTANCE_NAME> is the specific counter instance to collect, for example
## "Default Web Site". Specify 'none' For all instances of
## the counter.
## <COUNTER_NAME> is the individual counter to report
## <METRIC_NAME> is the name you want to show up in Datadog
## <METRIC_TYPE> is from the standard choices for all agent checks, such as gauge,
## rate, histogram or counter
## "Default Web Site". Specify 'none' for all instances of
## the counter.
## <COUNTER_NAME> is the individual counter to report.
## <METRIC_NAME> is the name that displays in Datadog.
## <METRIC_TYPE> is from the standard choices for all Agent checks, such as gauge,
## rate, histogram, or count.
#
# additional_metrics:
# - ['NTDS', none, 'DS % Writes from LDAP', active_directory.ds.writes_from_ldap, gauge]
# - - NTDS
ofek marked this conversation as resolved.
Show resolved Hide resolved
# - none
# - DS % Writes from LDAP
# - active_directory.ds.writes_from_ldap
# - gauge

## @param counter_data_types - list of strings - optional
## counter_data_types is a list of <METRIC_NAME>,<DATA_TYPE> element that
## allows the precision with which counters are queried on a per metric basis
## <METRIC_NAME>: Name of your metric
## <DATA_TYPE> : Type of your metric, can be int, float
## counter_data_types is a list of <METRIC_NAME>,<DATA_TYPE> elements that
## allow the precision in which counters are queried on a per metric basis.
## <METRIC_NAME>: The name of your metric
## <DATA_TYPE> : The type of your metric (int or float)
#
# counter_data_types:
# - <METRIC_NAME>,<DATA_TYPE>
# - active_directory.dra.inbound.bytes.total,int
# - active_directory.ldap.bind_time,float
# - - <METRIC_NAME>
ofek marked this conversation as resolved.
Show resolved Hide resolved
# - <DATA_TYPE>
# - - active_directory.dra.inbound.bytes.total
# - int
# - - active_directory.ldap.bind_time
# - float

## @param tags - list of key:value element - optional
## List of tags to attach to every metric, event and service check emitted by this integration.
## @param tags - list of strings - optional
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A way to include the key:value on the description?

## A list of tags to attach to every metric and service check emitted by this instance.
##
## Learn more about tagging: https://docs.datadoghq.com/tagging/
## Learn more about tagging at https://docs.datadoghq.com/tagging
#
# tags:
# - <KEY_1>:<VALUE_1>
# - <KEY_2>:<VALUE_2>

## Log Section (Available for Agent >=6.0)
## @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
## 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.
## service - required - Name of the service that generated the log
## source - required - Attribute that defines which Integration sent the logs
## sourcecategory - optional - Multiple value attribute. Used to refine the source attribute
## tags: - optional - Add tags to the collected logs
## tags - optional - Add tags to the collected logs
##
## Discover Datadog log collection: https://docs.datadoghq.com/logs/log_collection/
#
Expand Down
3 changes: 3 additions & 0 deletions active_directory/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"type": "check",
"integration_id": "active-directory",
"assets": {
"configuration": {
"spec": "assets/configuration/spec.yaml"
},
"monitors": {},
"dashboards": {},
"service_checks": "assets/service_checks.json"
Expand Down
2 changes: 1 addition & 1 deletion active_directory/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_requirements(fpath):
return f.readlines()


CHECKS_BASE_REQ = 'datadog_checks_base'
CHECKS_BASE_REQ = 'datadog_checks_base>=11.0.0'

setup(
name='datadog-active_directory',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
- name: host
required: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
required: false

description: |
The host the Datadog Active Directory check connects to.
"." means the current host
value:
example: .
type: string
- name: username
required: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
required: false

description: The username from the credentials needed to connect to the host.
value:
type: string
- name: password
required: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
required: false
secret: true

description: The password from the credentials needed to connect to the host.
value:
type: string
- name: additional_metrics
required: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
required: false

description: |
The additional metrics is a list of items that represent additional counters to collect.
Each item is a list of strings, formatted as follows:

['<COUNTERSET_NAME>', <COUNTER_INSTANCE_NAME>, '<COUNTER_NAME>', <METRIC_NAME>, <METRIC_TYPE>]

<COUNTERSET_NAME> is the name of the PDH counter set (the name of the counter).
<COUNTER_INSTANCE_NAME> is the specific counter instance to collect, for example
"Default Web Site". Specify 'none' for all instances of
the counter.
<COUNTER_NAME> is the individual counter to report.
<METRIC_NAME> is the name that displays in Datadog.
<METRIC_TYPE> is from the standard choices for all Agent checks, such as gauge,
rate, histogram, or count.
value:
example:
- ['NTDS', none, 'DS % Writes from LDAP', active_directory.ds.writes_from_ldap, gauge]
hithwen marked this conversation as resolved.
Show resolved Hide resolved
type: array
items:
type: array
items:
type: string
- name: counter_data_types
required: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
required: false

description: |
counter_data_types is a list of <METRIC_NAME>,<DATA_TYPE> elements that
allow the precision in which counters are queried on a per metric basis.
<METRIC_NAME>: The name of your metric
<DATA_TYPE> : The type of your metric (int or float)
value:
example:
- [<METRIC_NAME>, <DATA_TYPE>]
- [active_directory.dra.inbound.bytes.total, int]
- [active_directory.ldap.bind_time, float]
type: array
items:
type: string