Skip to content

Instantly share code, notes, and snippets.

View sarguru's full-sized avatar

Sarguru Nathan sarguru

View GitHub Profile
(tagged-all "test_app"
(where (service #"^app.handler.req.m1_rate")
(by :service (coalesce
(smap folds/sum
(with :host "testcoalesce"
prn))))))
@sarguru
sarguru / carbon.conf
Last active August 29, 2015 13:57
Carbon relay configuration
[cache:a]
LOCAL_DATA_DIR = /opt/graphite/storage/whisper/
USER =
MAX_CACHE_SIZE = inf
MAX_UPDATES_PER_SECOND = 1000
MAX_CREATES_PER_MINUTE = inf
LINE_RECEIVER_INTERFACE = 0.0.0.0
LINE_RECEIVER_PORT = 2103
@sarguru
sarguru / graphite
Created December 29, 2013 20:44
tag doesnt work
; (5556)
(let [host "0.0.0.0"]
(tcp-server :host host)
(udp-server :host host)
(ws-server :host host)
(graphite-server :host host))
(streams
@sarguru
sarguru / puppetparser.rb
Created November 30, 2012 03:49
puppetparser and stomp
#!/usr/bin/ruby
require 'yaml'
require 'puppet'
require 'json'
require 'stomp'
def empty_event
{ "name" => "puppet-report",
@sarguru
sarguru / config.json
Created November 26, 2012 14:55
mailer
"mailer": {
"type": "pipe",
"command": "/etc/sensu/handlers/mailer.rb"
}
{
"checks": {
"letshelp_check": {
"handlers": ["default","mailer"],
"command": "/etc/sensu/plugins/check-http.rb -u http://a.b.c/ -r",
"interval": 90,
"subscribers": [ "mailservers" ]
}
}
}
{
"checks": {
"letshelp_check": {
"handlers": ["default","mailer"],
"command": "/etc/sensu/plugins/check-http.rb -u http://a.b.c/ -r",
"interval": 90,
"subscribers": [ "mailservers" ]
}
}
}
{
"checks": {
"letshelp_check": {
"handlers": ["default","mailer"],
"command": "/etc/sensu/plugins/check-http.rb -u http://a.b.c/ -r",
"interval": 90,
"subscribers": [ "mailservers" ]
}
}
}
@sarguru
sarguru / ticket.pl
Created August 3, 2012 15:17
hubot-rt
#!/usr/bin/env perl
use Error qw(:try);
use RT::Client::REST;
my $id = $ARGV[0];
my $rt = RT::Client::REST->new(
server => 'http://RTURL',
timeout => 30,
);
@sarguru
sarguru / xml_hash.pl
Created July 16, 2012 05:50
xml hash
use XML::Simple;
use Data::Dumper;
sub trim($)
{
my $string = shift;
$string =~ s/^\s+//;
$string =~ s/\s+$//;
return $string;
}