Skip to content

Instantly share code, notes, and snippets.

ports:
- containerPort: 8125
hostPort: 8125
name: dogstatsdport
protocol: UDP
@estib
estib / setup_1.ps1
Last active September 7, 2019 03:17
powershell install dd-agent on wiindows
Write-Host "Provisioning!"
Write-Host "Downlaoding DD-agent installation immage."
$image_url = "https://s3.amazonaws.com/ddagent-windows-stable/ddagent-cli-latest.msi"
$destin = ".\ddagent-cli-latest.msi"
(New-Object System.Net.WebClient).DownloadFile($image_url, $destin)
# find time for installation schedule, one minute from now
$nowp = (Get-Date).AddMinutes(1)
# This is a tool for removing AWS host-level tags from your infrastructure in
# datadog. It is intended for users who have removed their EC2 instances from
# their AWS integration and if they no longer want to see AWS tags associated
# with the hosts that still run datadog-agents.
# 3rd Party
import json
import requests
@estib
estib / queryvalue_how_many_agents
Created October 5, 2016 18:04
JSON for a query value widget that will count the number of agents reporting and also provide coloring options.
{
"viz": "query_value",
"requests": [
{
"q": "count_not_null(avg:system.cpu.system{*} by {host})",
"conditional_formats": [
{
"comparator": "<=",
"value": "1",
"palette": "white_on_red"
Code I ran:
# queried the last week's worth of events from a test account
resp = api.Event.query(start=start_t, end=end_t, priority="normal")
for each in resp['events']:
print each
print '\n\n\n'
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(