Skip to content

Instantly share code, notes, and snippets.

@alq666
alq666 / gist:1613275
Created January 14, 2012 23:01 — forked from olidb2/gist:1613224
cassandra config
# Cassandra YAML generated from previous config
# Configuration wiki: http://wiki.apache.org/cassandra/StorageConfiguration
authenticator: org.apache.cassandra.auth.AllowAllAuthenticator
authority: org.apache.cassandra.auth.AllowAllAuthority
auto_bootstrap: true
binary_memtable_throughput_in_mb: 32
cluster_name: DataDog Cluster
column_index_size_in_kb: 64
commitlog_directory: /usr/local/var/lib/cassandra/commitlog
commitlog_rotation_threshold_in_mb: 32
@alq666
alq666 / system.py.diff
Created February 17, 2012 16:47
Support for lenny
diff --git a/checks/system.py b/checks/system.py
index 40c7afe..9ad9926 100644
--- a/checks/system.py
+++ b/checks/system.py
@@ -639,7 +639,7 @@ class Cpu(object):
return float(data[legend.index(name)])
else:
# FIXME return a float or False, would trigger type error if not python
- logger.warn("Cannot extract cpu value %s from %s (%s)" % (name, data, legend))
+ logger.debug("Cannot extract cpu value %s from %s (%s)" % (name, data, legend))
@alq666
alq666 / demo.clj
Created February 28, 2012 05:26 — forked from cgrand/demo.clj
;; this file is a walkthrough of Moustache features, a web framework for Clojure
;; http://github.com/cgrand/moustache/tree/master
;; Moustache allows to declare routes, apply middlewares and dispatch on http methods.
;; Moustache is compatible with all frameworks built on Ring, including Compojure
(ns demo
(:use net.cgrand.moustache)
(:use [ring.adapter.jetty :only [run-jetty]])) ;; hmmm Ring without servlets
@alq666
alq666 / cloudwatch.awk
Created March 5, 2012 20:52
aws crawler stats
BEGIN {
skipped = 0;
processed = 0;
}
/Skipped/ {
skipped++;
}
/Saving/ {
@alq666
alq666 / datadog.py
Created March 27, 2012 22:54
DogStreams
def check(self, agentConfig, move_end=True):
if not self.dogstreams:
return {}
output = {}
for dogstream in self.dogstreams:
try:
result = dogstream.check(agentConfig, move_end)
# result contains {"dogstream": [...]}
if "dogstream" in result and "dogstream" in output:
@alq666
alq666 / hack.sh
Created April 1, 2012 01:44 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@alq666
alq666 / gist:2422980
Created April 19, 2012 18:53
Using rrdtool & datadog
rrdtool fetch localhost_load_1min_5.rrd AVERAGE --start -15min

             load_1min           load_5min          load_15min

1334860500: 6.0133333333e-02 1.3013333333e-01 1.2003333333e-01
1334860800: 1.0983333333e-01 1.0010000000e-01 9.0100000000e-02
1334861100: 7.0133333333e-02 1.0000000000e-01 9.0000000000e-02
1334861400: -nan -nan -nan

Extract time stamp & first column

@alq666
alq666 / git-post-receive-hook
Created May 23, 2012 16:06
Chaining git-post-receive hooks to Datadog
#!/bin/bash
# This file was placed here by Gitlab. It makes sure that your pushed commits
# will be processed properly.
while read oldrev newrev ref
do
# For every branch or tag that was pushed, create a Resque job in redis.
pwd=`pwd`
reponame=`basename "$pwd" | cut -d. -f1`
diff --git a/checks/db/mongo.py b/checks/db/mongo.py
index 98bcc3c..aedc311 100644
--- a/checks/db/mongo.py
+++ b/checks/db/mongo.py
@@ -4,6 +4,11 @@ from datetime import datetime
from checks import *
+# When running with pymongo < 2.0
+# Not the full spec for mongo URIs
@alq666
alq666 / datadog.py.diff
Created June 5, 2012 18:53
Nagios perf data debug
diff --git a/checks/datadog.py b/checks/datadog.py
index 39e4435..2870b93 100644
--- a/checks/datadog.py
+++ b/checks/datadog.py
@@ -305,7 +305,9 @@ class NagiosPerfData(object):
nagios_perf_config = config.get('nagiosPerfCfg', None)
parsers = []
if nagios_perf_config:
+ logger.debug("Nagios: perf_data_config=%s" % nagios_perf_config)
nagios_config = cls.parse_nagios_config(nagios_perf_config)