Skip to content

Instantly share code, notes, and snippets.

View marianogg9's full-sized avatar

marianogg9

View GitHub Profile
# Rackspace NewRelic plugin
# This script keeps this service running.
respawn
script
exec chdir /path_to_plugin_installation_directory/newrelic_rs_dfw
exec bundle exec ./bin/newrelic_rs
end script
#!/usr/bin/env ruby
require 'newrelic_plugin'
require 'getoptlong'
unless $:.include?(File.dirname(__FILE__) + '/../lib/')
$: << File.dirname(__FILE__) + '/../lib'
end
def usage
Feb 5 15:53:10 ip-172-30-1-9 init: newrelic_rs main process (7672) terminated with status 127
Feb 5 15:53:10 ip-172-30-1-9 init: newrelic_rs main process ended, respawning
Feb 5 15:53:10 ip-172-30-1-9 init: newrelic_rs state changed from running to stopping
Feb 5 15:53:10 ip-172-30-1-9 init: Handling stopping event
Feb 5 15:53:10 ip-172-30-1-9 init: newrelic_rs state changed from stopping to killed
Feb 5 15:53:10 ip-172-30-1-9 init: newrelic_rs state changed from killed to post-stop
Feb 5 15:53:10 ip-172-30-1-9 init: newrelic_rs state changed from post-stop to starting
Feb 5 15:53:10 ip-172-30-1-9 init: Handling starting event
Feb 5 15:53:10 ip-172-30-1-9 init: newrelic_rs state changed from starting to pre-start
Feb 5 15:53:10 ip-172-30-1-9 init: newrelic_rs state changed from pre-start to spawned
/path/sensu-handler.rb:88:in `+': no implicit conversion of nil into String (TypeError)
from /path/sensu-handler.rb:88:in `filter_silenced'
from /path/sensu-handler.rb:22:in `filter'
from /path/sensu-handler.rb:40:in `block in <class:Handler>'
{
"timestamp": "2014-02-05T20:12:53.694593+0000",
"level": "info",
"message": "publishing check result",
"payload": {
"client": "server",
"check": {
"name": "check_load",
"issued": 1391631173,
"command": "/path/check_load -w :::c :::load.crit:::",
#!/usr/bin/env /path/ruby
#
# Sensu Twitter Handler
# ===
#
# This handler reports alerts to a configured twitter handler.
# Map a twitter handle to a sensusub value in the twitter.json to get going!
# sensusub == subscription in the client object, not check..
# see twitter.json for required values
#
# Rackspace NewRelic plugin
# This script keeps this service running.
expect fork
start on runlevel [2345]
stop on runlevel [016]
pre-start script
echo '{"name": "service_respawned", "output": "newrelic_rs_dfw service respawned", "status": 2}' | nc localhost 3030
Feb 6 12:06:22 ip-172-30-1-9 init: newrelic_rs_dfw_1 state changed from starting to pre-start
Feb 6 12:06:22 ip-172-30-1-9 init: newrelic_rs_dfw_1 state changed from pre-start to spawned
Feb 6 12:06:22 ip-172-30-1-9 init: newrelic_rs_dfw_1 main process (28341)
Feb 6 12:06:22 ip-172-30-1-9 init: newrelic_rs_dfw_1 main process (28341) executable changed
Feb 6 12:06:22 ip-172-30-1-9 init: newrelic_rs_dfw_1 main process (28341) executable changed
Feb 6 12:06:22 ip-172-30-1-9 init: newrelic_rs_dfw_1 main process (28341) terminated with status 1
Feb 6 12:06:22 ip-172-30-1-9 init: newrelic_rs_dfw_1 main process ended, respawning
Feb 6 12:06:22 ip-172-30-1-9 init: newrelic_rs_dfw_1 state changed from spawned to post-start
Feb 6 12:06:22 ip-172-30-1-9 init: newrelic_rs_dfw_1 state changed from post-start to running
Feb 6 12:06:22 ip-172-30-1-9 init: Handling started event
{
"checks": {
"check_respawn": {
"handlers": "twitter",
"standalone": true,
"suscribers": "aws"
}
}
}
# Rackspace NewRelic plugin
start on runlevel [2345]
stop on runlevel [016]
#script
#chdir /path/newrelic/newrelic_rs_dfw
#echo "DEBUG: `set`" >> /tmp/myjob.log