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
| #!/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
| 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
| 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
| #!/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
| 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
| 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
| 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: | |
| - 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 dogapi import dog_http_api as api | |
| api.api_key = 'YOUR_API_KEY' | |
| api.application_key = 'YOUR_APPLICATION_KEY' | |
| # Submit a single point with a timestamp of `now` | |
| api.metric('page.views', 1000) | |
| #see more examples here: http://docs.datadoghq.com/api/ |