Skip to content

Instantly share code, notes, and snippets.

View marianogg9's full-sized avatar

marianogg9

View GitHub Profile
{"timestamp":"2014-02-06T17:18:41.237559+0000","level":"info","message":"handling event","event":{"client":{"name":"host","address":"ip","subscriptions":["aws","monitoring_server"],"load":{"warn":"3","crit":"4"},"disk_free":{"warn":"15%","crit":"10%"},"mem_used":{"warn":"90","crit":"95"},"list_count":{"warn":"9000","crit":"10000"},"redis_key":{"value":"logstash"},"timestamp":1391707113},"check":{"name":"check_respawn","output":"Redis-commander service respawned","status":2,"issued":1391707121,"history":["0","2","0","2","2","0","2","0","2","0","2","2","2","0","2","2","0","2","0","2","2"]},"occurrences":2,"action":"create"},"handler":{"type":"pipe","command":"true","name":"default"}}
# Rackspace NewRelic plugin
# This script keeps this service running.
start on runlevel [2345]
stop on runlevel [016]
script
pushd /opt/turner/services/newrelic/newrelic_rs_dfw
# redis-commander
#
# This service maintains redis-commander service up and running.
# Redis-commander is the Redis web console (redis.cloud-turner.com.ar).
respawn
env SSL_CERT_FILE=/etc/sensu/handlers/cacert.pem
pre-start script
"check":{
"output":"HTTP CRITICAL: HTTP/1.1 503 Service Temporarily Unavailable - pattern not found - 593 bytes in 0.001 second response time |time=0.000500s;;;0.000000 size=593B;;;0\n",
bla bla
I need to get the first text before the "|". Tried this:
def foo
@event['check']['output'].split(' | ').first
end
# Rackspace NewRelic plugin
start on runlevel [2345]
stop on runlevel [016]
pre-start script
echo '{"name": "check_respawn", "output": "newrelic_rs_dfw service respawned", "status": 2, "handlers": ["twitter"], "subscribers": "aws"}' | nc localhost 3030
end script
respawn
Feb 11 18:59:14 ip- init: newrelic_rs_dfw_test goal changed from stop to start
Feb 11 18:59:14 ip- init: newrelic_rs_dfw_test state changed from waiting to starting
Feb 11 18:59:14 ip- init: Handling starting event
Feb 11 18:59:14 ip- init: newrelic_rs_dfw_test state changed from starting to pre-start
Feb 11 18:59:14 ip- init: newrelic_rs_dfw_test pre-start process (29024)
Feb 11 18:59:14 ip- init: newrelic_rs_dfw_test pre-start process (29024) exited normally
Feb 11 18:59:14 ip- init: newrelic_rs_dfw_test state changed from pre-start to spawned
Feb 11 18:59:14 ip- init: newrelic_rs_dfw_test main process (29027)
Feb 11 18:59:14 ip- init: newrelic_rs_dfw_test state changed from spawned to post-start
Feb 11 18:59:14 ip- init: newrelic_rs_dfw_test state changed from post-start to running
Check failed to run: Connection reset by peer
tail -f /var/log/rabbitmq/rabbit\@rabbitmqserver.log
=ERROR REPORT==== 11-Feb-2014::19:46:57 ===
closing AMQP connection <0.13440.2> (my_ip -> rabbitmq_server_ip:5672):
{bad_header,<<"GET /api">>}
{
"checks": {
"check_redis-ML": {
"handlers": [ "twitter" ],
"command": "/etc/sensu/plugins/check_redis.rb -c 20 -w 10 -h redis_server -k logstash-ML",
"interval": 60,
"refresh": 120,
"flapping": false,
"subscribers": [ "server_name" ]
}
{
"handlers": {
"twitter": {
"type": "pipe",
"command": "/etc/sensu/handlers/twitter.rb"
}
}
}
{
"timestamp": "2014-02-12T14:21:39.059281+0000",
"level": "info",
"message": "handling event",
"event": {
"client": {
"name": "server",
"address": "server_ip",
"subscriptions": [
"foo",