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 / 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 / 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
#

Here are simple steps to install Datadog's agent on FC17. These steps are meant to be work-arounds until we officially support Fedora Core.

Steps

If you have /etc/yum.repos.d/datadog.repo, delete that file and run sudo yum makecache

Install python-tornado from FC repositories

sudo yum install python-tornado-2.2.1-1.fc17

Linux System Metrics

CPU

  • system.cpu.idle: % Idle CPU
  • system.cpu.system: % System CPU
  • system.cpu.user: % User CPU

Disk

Linux System Metrics

CPU

  • system.cpu.idle: % Idle CPU
  • system.cpu.system: % System CPU
  • system.cpu.user: % User CPU

Disk

# Create the datadog user with select only permissions:
# CREATE USER datadog WITH PASSWORD '<complex_password>';
#
# Grant select permissions on a table or view that you want to monitor:
# GRANT SELECT ON <schema>.<table> TO datadog;
#
# Grant permissions for a specific column on a table or view that you want to monitor:
# GRANT SELECT (id, name) ON <schema>.<table> TO datadog;
#
# Let non-superusers look at pg_stat_activity in a read-only fashon.

The Challenge

  1. Sign up for Datadog, get the agent reporting metrics from your local machine. Bonus question- what is the agent?

  2. Submit an event via the API.

  3. Get an event to appear in your email inbox (the email address you signed up for the account with)

@alq666
alq666 / README.md
Created October 26, 2013 02:10 — forked from alekstorm/README.md

Installation

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

#!/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.