Skip to content

Instantly share code, notes, and snippets.

@faja
faja / gist:8517649
Created January 20, 2014 09:58
bash: paste last line from previous command output
get_last_line() { READLINE_LINE+=$(fc -s | tail -n1); READLINE_POINT=$;}
bind -x '"\C-x\C-k":get_last_line'
@faja
faja / README.md
Last active December 14, 2015 21:48

##SENSU ###How to use one script for 'metric' and 'standard' check.

I want to use one script for metric and standard 'OK/CRITICAL' check. check.rb prints metric and additional 'OK/CRITICAL' info. Metric handler before sending data to graphite remove all "o:.*" lines, and notification handler remove all 'metric' lines from check output.

Check of course have to be 'type':'metric'.

And for escalation notification i'm using:https://github.com/faja/sensu-community-plugins/tree/master/handlers/escalation

@faja
faja / README.md
Created March 11, 2013 09:34
sensu-status.rb

sensu-status.rb prints 'nagios' like list of all hosts and checks with status, like on screenshot below: sensu-status.rb

required gems:

  • json
  • redis
  • rainbow
@faja
faja / RESULTS.md
Last active December 14, 2015 04:49 — forked from jordansissel/RESULTS.md

logstash queries graphed with graphite.

My version of function logstashHits() for graphite. Original: https://gist.github.com/jordansissel/3760225

My fix is needed if you have values = 0 between start and end time.

E.g: nginx access log, and for certain period of time there aren't any request: wrong should be: