To install, place datadog.py
in your callback plugins directory. If you don't yet have one, run:
mkdir -p plugins/callback
Then place the following in your ansible.cfg
file:
[defaults]
callback_plugins = ./plugins/callback
query_to_df <- function(api_key, application_key, query, from_t, to_t) { | |
res <- getForm('https://app.datadoghq.com/api/v1/query', api_key=api_key, application_key=application_key, from=from_t, to=to_t, query=query) | |
parsed <- fromJSON(res) | |
series <- parsed[['series']] | |
timeseries <- series[[1]] | |
pointlist <- timeseries[['pointlist']] | |
timestamps <- to_epoch(sapply(pointlist, '[', 1)) | |
values <- sapply(pointlist, '[', 2) | |
return(data.frame(timestamps, values)) | |
} |
Creating log file /Users/alq/.datadog-agent/ddagent-install.log.....Done | |
Operating System: Darwin | |
Setting up virtual environment..... % Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 26 112k 26 30857 0 0 155k 0 --:--:-- --:--:-- --:--:-- 155k 100 112k 100 112k 0 0 441k 0 --:--:-- --:--:-- --:--:-- 440k | |
New python executable in /Users/alq/.datadog-agent/venv/bin/python | |
Installing setuptools...............................done. | |
Installing pip.....................done. | |
Done | |
Installing tornado 2.4.1 using pip.....Wheel installs require setuptools >= 0.8 for dist-info support. |
#!/usr/bin/env python | |
""" | |
Nagios plugin to check PostgreSQL 9 streaming replication lag. | |
Requires psycopg2 and nagiosplugin (both installable with pip/easy_install). | |
MIT licensed: | |
Copyright (c) 2010 Jacob Kaplan-Moss. All rights reserved. |
SELECT nspname, | |
relname, | |
pg_size_pretty(pg_relation_size(C.oid)) AS "size" | |
FROM pg_class C | |
LEFT JOIN pg_namespace N | |
ON (N.oid = C.relnamespace) | |
WHERE nspname NOT IN ('pg_catalog', 'information_schema') | |
ORDER BY pg_relation_size(C.oid) DESC | |
LIMIT 40; |
{ | |
"events": [], | |
"requests": [ | |
{ | |
"q": "aws.elb.latency{host:elb_name}*sum:aws.elb.request_count{host:elb_name}" | |
} | |
], | |
"viz": "timeseries" | |
} |
RCfile for "top with windows" # shameless braggin' | |
Id:a, Mode_altscr=0, Mode_irixps=1, Delay_time=3.000, Curwin=0 | |
Def fieldscur=AEHIOQTWKNMbcdfgjplrsuvyzX | |
winflags=64441, sortindx=10, maxtasks=0 | |
summclr=1, msgsclr=1, headclr=3, taskclr=1 | |
Job fieldscur=ABcefgjlrstuvyzMKNHIWOPQDX | |
winflags=62777, sortindx=0, maxtasks=0 | |
summclr=6, msgsclr=6, headclr=7, taskclr=6 | |
Mem fieldscur=ANOPQRSTUVbcdefgjlmyzWHIKX | |
winflags=62777, sortindx=13, maxtasks=0 |
{% set pkgrepo = { | |
'Debian': { | |
"managed": True, | |
"humanname": "Datadog Agent", | |
"name": "deb http://apt.datadoghq.com/ unstable main", | |
"keyserver": "keyserver.ubuntu.com", | |
"keyid": "C7A7DA52", | |
"file": "/etc/apt/sources.list.d/datadog.list" | |
}, | |
'RedHat': { |
default_overrides({ | |
:datadog => { | |
:api_key => "...", | |
# ... | |
} | |
}) |