Skip to content

Instantly share code, notes, and snippets.

View sacreman's full-sized avatar
💭
Adding tremendous value

Steven Acreman sacreman

💭
Adding tremendous value
  • ThunderOps
  • United Kingdom
View GitHub Profile
#!/usr/bin/env python
import requests
import xmltodict
from datetime import datetime
USER = ''
PASSWORD = ''
TIME = 3600 # age metric defaults to hours. set to 60 for minutes
#! /usr/bin/env ruby
require 'main'
require 'yaml'
require 'httparty'
Main {
option('execute'){
argument :optional
description 'execute the check'
}
@sacreman
sacreman / nginx.py
Created February 9, 2016 10:21
much simpler nginx.py
#!/usr/bin/env python
import os
import re
from datetime import datetime
import sys
LOGFILE = '/var/log/nginx/access.log'
combined = '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"'
timed_combined = '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$request_time"'
#!/usr/bin/env python
import sys
import time
import yaml
import json
import requests
url = 'https://app.dataloop.io'
api_key = 'redacted'
org = 'organisation'
@sacreman
sacreman / requirements.txt
Created March 15, 2016 15:41
Dataloop Agent requirements.txt
###
# Core Agent dependencies. These are require for the Agent to run
###
APScheduler==3.0.3
netifaces==0.10.4
nose==1.3.7
psutil==3.2.2
pytz==2015.2
PyYAML==3.11
requests==2.7.0
@sacreman
sacreman / plugin_requirements.txt
Created March 15, 2016 15:42
Dataloop Agent plugin_requirements.txt
##
# Plugin dependencies. These are required to run the out of the box plugins
##
backports.ssl-match-hostname==3.4.0.2
BeautifulSoup==3.2.1
boto==2.23.0
cffi==0.8.6
cryptography==0.6.1
docker-py==1.4.0
futures==2.2.0
Steven-MacPro:dalmatiner-docker sacreman$ docker logs b5cd325303fd
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 7
2016/03/29 12:06:33 [I] Starting Grafana
2016/03/29 12:06:33 [I] Version: 2.6.0, Commit: v2.6.0, Build date: 2015-12-14 14:18:01 +0000 UTC
2016/03/29 12:06:33 [I] Configuration Info
Config files:
[0]: /usr/share/grafana/conf/defaults.ini
#!/usr/bin/env python
from gevent import monkey, socket
monkey.patch_all()
from gevent.pool import Pool
import requests
import uuid
settings = {
'url': 'https://app.dataloop.io/api/v1',
'org': '',
#!/usr/bin/env python
from gevent import monkey
monkey.patch_all()
from gevent.pool import Pool
import requests
import uuid
settings = {
'url': 'https://app.dataloop.io/api/v1',
'org': 'yolo',
#!/usr/bin/env python
import sys
from dlcli import api
# need to set the org, account and key
settings = {
'url': 'https://app.dataloop.io/api/v1',
'org': '',
'account': '',
'key': ''