-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapache_create_timeboard_api.py
30 lines (21 loc) · 1.3 KB
/
apache_create_timeboard_api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from datadog import initialize, api
options = {
'api_key': API_KEY,
'app_key': APP_KEY
}
initialize(**options)
title = "Apache Demo Test"
description = "Generated Via The API for My first Hack Day!!"
graphs = [{"definition": { "events": [], "requests": [{"q": "avg:apache.net.bytes_per_s{*}"}], "viz": "timeseries"}, "title": "Average Apache Bytes Served Per Second"},
{"definition": { "events": [], "requests": [{"q": "avg:apache.conns_total{*}"}], "viz": "timeseries"}, "title": "Average Apache Conns Total"},
{"definition": { "events": [], "requests": [{"q": "avg:apache.performance.cpu_load{*}"}], "viz": "timeseries"}, "title": "Average Apache CPU Performance Load"},
{"definition": { "events": [], "requests": [{"q": "avg:apache.performance.uptime{*}"}], "viz": "timeseries"}, "title": "Average Apache Performance Uptime"},
{"definition": { "events": [], "requests": [{"q": "avg:apache.net.request_per_s{*}", "type":"area"}], "viz": "timeseries"}, "title": "Average Apache Requests Performed Per Second"}
]
template_variables = [{
"name": "host1",
"prefix": "host",
"default": "host:my-host"
}]
read_only = True
api.Timeboard.create(title=title, description=description, graphs=graphs, template_variables=template_variables, read_only=read_only)