Skip to content

Commit 6ebcf09

Browse files
committed
Updating the README
- add more example on how to configure a check - update the documentation for role variables
1 parent 21189d8 commit 6ebcf09

File tree

1 file changed

+54
-4
lines changed

1 file changed

+54
-4
lines changed

README.md

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ Role Variables
2222
- `datadog_api_key` - Your Datadog API key.
2323
- `datadog_agent_version` - The pinned version of the Agent to install (optional, but highly recommended)
2424
Examples: `1:6.0.0-1` on apt-based platforms, `6.0.0-1` on yum-based platforms
25-
- `datadog_checks` - YAML configuration for agent checks to drop into `/etc/dd-agent/conf.d`.
26-
- `datadog_config` - Settings to place in the `/etc/dd-agent/datadog.conf` INI file that go under the `[Main]` section.
27-
- `datadog_config_ex` - Extra INI sections to go in `/etc/dd-agent/datadog.conf` (optional).
25+
- `datadog_checks` - YAML configuration for agent checks to drop into:
26+
+ `/etc/datadog-agent/conf.d/<check_name>/conf.yaml` for agent6
27+
+ `/etc/dd-agent/conf.d` for agent5.
28+
- `datadog_config` - Settings to place in the main agent configuration file:
29+
+ `/etc/datadog-agent/datadog.yaml` for agent6
30+
+ `/etc/dd-agent/datadog.conf` for agent5 (under the `[Main]` section).
31+
- `datadog_config_ex` - Extra INI sections to go in `/etc/dd-agent/datadog.conf` (optional). Agent5 only.
2832
- `datadog_apt_repo` - Override default Datadog `apt` repository
2933
- `datadog_apt_cache_valid_time` - Override the default apt cache expiration time (default 1 hour)
3034
- `datadog_apt_key_url_new` - Override default url to Datadog `apt` key (key ID `382E94DE` ; the deprecated `datadog_apt_key_url` variable refers to an expired key that's been removed from the role)
@@ -56,8 +60,54 @@ Dependencies
5660
------------
5761
None
5862

63+
Configuring a check
64+
-------------------
65+
66+
To configure a check you need to add an entry to the `datadog_checks` section.
67+
The first level key is the name of the check and the value is the yaml payload
68+
to write the configuration file.
69+
70+
Example:
71+
72+
**Process check**
73+
74+
We define 2 instances for the `process` check.
75+
This will create:
76+
- for agent6: `/etc/datadog-agent/conf.d/process/conf.yaml`
77+
- for agent5: `/etc/datadog-agent/conf.d/process.yaml`
78+
79+
```yml
80+
datadog_checks:
81+
process:
82+
init_config:
83+
instances:
84+
- name: ssh
85+
search_string: ['ssh', 'sshd' ]
86+
- name: syslog
87+
search_string: ['rsyslog' ]
88+
cpu_check_interval: 0.2
89+
exact_match: true
90+
ignore_denied_access: true
91+
```
92+
93+
**custom check**
94+
95+
We define 1 instance for a custom check.
96+
97+
This will create:
98+
- for agent6: `/etc/datadog-agent/conf.d/my_custom_check/conf.yaml`
99+
- for agent5: `/etc/datadog-agent/conf.d/my_custom_check.yaml`
100+
101+
```yml
102+
datadog_checks:
103+
my_custom_check:
104+
init_config:
105+
instances:
106+
- some_data: true
107+
```
108+
59109
Example Playbooks
60-
-------------------------
110+
-----------------
61111
```yml
62112
- hosts: servers
63113
roles:

0 commit comments

Comments
 (0)