This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init_config: | |
instances: | |
- name: My service | |
host: datadog.com | |
port: 8080 | |
window: 5 | |
threshold: 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from checks import AgentCheck | |
import re | |
import psutil | |
class CheckProcessNotRunning(AgentCheck): | |
def check(self, instance): | |
search = instance['search'] | |
running_names = [p.name().strip() for p in psutil.process_iter()] | |
matched = len([n for n in running_names if re.match(search, n)]) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init_config: | |
instances: | |
- search: top |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"expvar" | |
"github.com/paulbellamy/ratecounter" | |
"io" | |
"net/http" | |
"strconv" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# use webtest.sh <url to visit> | |
zmodload -i zsh/mathfunc | |
for i in {1..1000} | |
do | |
sleep $(( rand48()*2 )) | |
curl $1 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init_config: | |
instances: | |
# Most memstats metrics are exported by default | |
# See http://godoc.org/runtime#MemStats for their explanation | |
- expvar_url: http://localhost:8000/debug/vars | |
tags: | |
- "application_name:myapp" | |
- "optionaltag2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dcomp(){ | |
local bdout=$(boot2docker status) 2>/dev/null | |
if [ $bdout = 'poweroff' ]; then | |
boot2docker up && $(boot2docker shellinit) | |
fi | |
docker-compose $* | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# set cron to run this every couple of minutes and it will shutdown boot2docker | |
# when its been running with no processes for maxminutes | |
maxminutes=10 | |
local bdout | |
local dpqout | |
bdout=$(boot2docker status) 2>/dev/null | |
if [[ $bdout = "running" ]]; then | |
echo "boot2docker running" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dogapi import dog_http_api as api | |
import console | |
import json | |
from StringIO import StringIO | |
api.api_key = 'apikey' | |
api.application_key = 'appkey' | |
board_id = console.input_alert('enter screenboard id') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Go to https://github.com/jkbrzt/httpie to get the full instructions on its use | |
2) Install it: brew install httpie | |
3) If you are on a Mac and have not upgraded your Python version install other stuff: | |
pip install --upgrade pyopenssl pyasn1 ndg-httpsclient | |
(I have the new 15" MBP with force touch trackpad so its as new as they get and I had to install this) | |
4) Use it.... | |
If trying to use this to look at Docker Stats API, the command to use is going to be: |