Skip to content

Instantly share code, notes, and snippets.

@alq666
alq666 / datadog-agent.diff
Created June 7, 2012 17:11
Fixing datadog-agent stop
diff --git a/packaging/datadog-agent-base/deb/datadog-agent.init b/packaging/datadog-agent-base/deb/datadog-agent.init
index 7dc0fa0..74c3e8e 100755
--- a/packaging/datadog-agent-base/deb/datadog-agent.init
+++ b/packaging/datadog-agent-base/deb/datadog-agent.init
@@ -54,8 +54,15 @@ case "$1" in
echo -n "Stopping $DESC: "
if [ -f $USE_SUPERVISOR ]; then
- echo -n "(using supervisorctl) "
- supervisorctl stop datadog-agent:*
require 'rubygems'
require 'dogapi'
datadog_api_key = "Find it at https://app.datadoghq.com/account/settings#api"
project_name = "Test"
msg = "Example of Aggregation of custom events (Support)"
host = "app.datadoghq.com"
dog = Dogapi::Client.new(datadog_api_key)
{'_all': {'indices': {'graylog2': {'primaries': {'docs': {'count': 5001,
'deleted': 0},
'get': {'current': 0,
'exists_time': '0s',
'exists_time_in_millis': 0,
'exists_total': 0,
'missing_time': '0s',
'missing_time_in_millis': 0,
'missing_total': 0,
'time': '0s',
@alq666
alq666 / 2.2.24.diff
Created June 11, 2012 20:15
dd-agent 2.2.24-2.2.25 diff
diff --git a/checks/common.py b/checks/common.py
index 6fa60de..70ce0c8 100644
--- a/checks/common.py
+++ b/checks/common.py
@@ -82,7 +82,7 @@ class checks:
self._io = IO()
self._load = Load(self.checksLogger)
self._memory = Memory(self.checksLogger)
- self._network = Network()
+ self._network = Network(self.checksLogger)
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdata
host_perfdata_file=/usr/local/nagios/var/host-perfdata
service_perfdata_file=/usr/local/nagios/var/service-perfdata
host_perfdata_file_template=[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
#host_perfdata_file_mode=a
#service_perfdata_file_mode=a
#host_perfdata_file_processing_interval=0
/
/account/integration
/account/login
/account/logout
/account/notifications
/account/profile/[email protected]
/account/settings
/account/startOpenId
/admin
/analytics/click
@alq666
alq666 / gist:2921435
Created June 13, 2012 02:24
Network trace from http to login
@alq666
alq666 / redirect-timing.py
Created June 13, 2012 17:59
Measure datadog latency using datadog
"""Measures redirect latency from http://app.datadoghq.com to login.
Use like this: curl -L -v http://app.datadoghq.com --trace-time 2>&1 | python redirect-timing.py
"""
import sys
from datetime import datetime, time
import time as t2
import re
from dogapi import dog_http_api
from ConfigParser import ConfigParser
@alq666
alq666 / pgsnap.py
Created June 18, 2012 03:52
xfs-freeze + ebs snapshots
import boto
import logging
import os
import time
import subprocess
import sys
import urllib2
logger = logging.getLogger("pgbackup")
logger.addHandler(level=logging.INFO, logging.handlers.SysLogHandler(facility=logging.handlers.SysLogHandler.LOG_LOCAL0))
@alq666
alq666 / system.py.diff
Created June 18, 2012 16:06
warmsys patch
Changes in HEAD
Modified checks/system.py
diff --git a/checks/system.py b/checks/system.py
index ba1828f..535aa13 100644
--- a/checks/system.py
+++ b/checks/system.py
@@ -574,6 +574,7 @@ class Cpu(object):
if sys.platform == 'linux2':
mpstat = subprocess.Popen(['mpstat', '1', '3'], stdout=subprocess.PIPE, close_fds=True).communicate()[0]