Skip to content

Instantly share code, notes, and snippets.

@estib
Last active June 16, 2016 17:10
Show Gist options
  • Save estib/ef961dda896d9d1ab20aa2bcdc24232f to your computer and use it in GitHub Desktop.
Save estib/ef961dda896d9d1ab20aa2bcdc24232f to your computer and use it in GitHub Desktop.
from datadog import initialize, api
options = {
'api_key': 'api_key',
'app_key': 'app_key',
'thresholds': {'critical': 100, 'warning': 80}
}
initialize(**options)
resp = api.Monitor.create(
type="metric alert",
query="avg(last_1h):sum:system.net.bytes_rcvd{*} > 100",
name="Bytes received on host1",
message="We may need to add web hosts if this is consistently high.",
tags=['test'],
options=options
)
print resp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment