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 spec #6551

Merged
merged 3 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
75 changes: 75 additions & 0 deletions cacti/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Cacti
files:
- name: cacti.yaml
options:
- template: init_config
- template: instances
options:
- name: mysql_host
required: true
description: URL of your MySQL database
value:
example: localhost
type: string
- name: mysql_port
description: Port of your MySQL database
value:
example: 3306
type: integer
- name: mysql_user
required: true
description: User to use to connect to MySQL in order to gather metrics
mgarabed marked this conversation as resolved.
Show resolved Hide resolved
value:
type: string
- name: mysql_password
required: true
description: Password to use to connect to MySQL in order to gather metrics
mgarabed marked this conversation as resolved.
Show resolved Hide resolved
value:
type: string
- name: rrd_path
required: true
description: |
The Cacti checks requires access to the Cacti DB in MySQL and to the RRD
files that contain the metrics tracked in Cacti.
In almost all cases, you'll only need one instance pointing to the Cacti
database.
The `rrd_path` will probably be `/var/lib/cacti/rra` on Ubuntu
or `/var/www/html/cacti/rra` on any other machines.
value:
example: <CACTI_RRA_PATH>
type: string
- name: field_names
description: |
The `field_names` specifies which field_names should be used
to determine if a device is a real device. You can let it commented
out as the default values should satisfy your needs.
You can run the following query to determine your field names:
SELECT
h.hostname as hostname,
hsc.field_value as device_name,
dt.data_source_path as rrd_path,
hsc.field_name as field_name
FROM data_local dl
JOIN host h on dl.host_id = h.id
JOIN data_template_data dt on dt.local_data_id = dl.id
LEFT JOIN host_snmp_cache hsc on h.id = hsc.host_id
AND dl.snmp_index = hsc.snmp_index
WHERE dt.data_source_path IS NOT NULL
AND dt.data_source_path != ''
value:
example:
- ifName
- dskDevice
- ifIndex
type: array
items:
type: string
- name: rrd_whitelist
description: |
The `rrd_whitelist` is a path to a text file that has a list of file patterns,
one per line, that should be fetched. If no whitelist is specified, all
metrics are fetched.
value:
example: <RRD_WHITELIST_FILE_PATH>
type: string
- template: instances/tags
18 changes: 11 additions & 7 deletions cacti/datadog_checks/cacti/data/conf.yaml.example
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
init_config:
## All options defined here are available to all instances.
#
# init_config: {}

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

## @param mysql_host - string - required
## url of your MySQL database
## URL of your MySQL database
#
- mysql_host: localhost

## @param mysql_port - integer - optional - default: 3306
## port of your MySQL database
## Port of your MySQL database
#
# mysql_port: 3306

Expand All @@ -32,7 +36,7 @@ instances:
#
rrd_path: <CACTI_RRA_PATH>

## @param field_names - list of string - optional
## @param field_names - list of strings - optional
## The `field_names` specifies which field_names should be used
## to determine if a device is a real device. You can let it commented
## out as the default values should satisfy your needs.
Expand Down Expand Up @@ -62,10 +66,10 @@ instances:
#
# rrd_whitelist: <RRD_WHITELIST_FILE_PATH>

## @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
## 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>
Expand Down
3 changes: 3 additions & 0 deletions cacti/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"type": "check",
"integration_id": "cacti",
"assets": {
"configuration": {
"spec": "assets/configuration/spec.yaml"
},
"monitors": {},
"dashboards": {},
"service_checks": "assets/service_checks.json"
Expand Down