This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# chkconfig: 2345 20 80 | |
# description: sensu-api | |
. /lib/lsb/init-functions | |
start() { | |
source "/usr/local/rvm/scripts/rvm" | |
rvm use ruby-1.9.2-p290\@sensu | |
nohup sensu-api & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sensu-server -vconfiguration valid -- running server | |
/usr/local/rvm/gems/ruby-1.9.2-p290@sensu/gems/amqp-0.7.4/lib/amqp/channel.rb:833:in `block (3 levels) in send': The channel 1 was closed, you can't use it anymore! (AMQP::ChannelClosedError) | |
from /usr/local/rvm/gems/ruby-1.9.2-p290@sensu/gems/amqp-0.7.4/lib/amqp/channel.rb:826:in `each' | |
from /usr/local/rvm/gems/ruby-1.9.2-p290@sensu/gems/amqp-0.7.4/lib/amqp/channel.rb:826:in `block (2 levels) in send' | |
from <internal:prelude>:10:in `synchronize' | |
from /usr/local/rvm/gems/ruby-1.9.2-p290@sensu/gems/amqp-0.7.4/lib/amqp/channel.rb:825:in `block in send' | |
from /usr/local/rvm/gems/ruby-1.9.2-p290@sensu/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:48:in `call' | |
from /usr/local/rvm/gems/ruby-1.9.2-p290@sensu/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:48:in `callback' | |
from /usr/local/rvm/gems/ruby-1.9.2-p290@sensu/gems/amqp-0.7.4/lib/amqp/channel.rb:824:in `send' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"checks": { | |
"graphite_test1": { | |
"type": "metric", | |
"command": "/etc/sensu/plugins/graphite_test1.rb", | |
"subscribers": [ "role_sensu_server" ], | |
"interval": 10, | |
"handlers": ["graphite"] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@natty:/# sensu-server -h | |
Usage: sensu-server [options] | |
-h, --help Display this screen | |
-w, --worker Only consume jobs, no check publishing (default: false) | |
-c, --config FILE Sensu JSON config FILE (default: /etc/sensu/config.json) | |
-d, --config_dir DIR Directory for supplemental Sensu JSON config files (default: /etc/sensu/conf.d/) | |
-l, --log FILE Sensu log FILE (default: /tmp/sensu.log) | |
-v, --verbose Enable verbose logging (default: false) | |
-b, --background Fork into backgaround (daemon) (default: false) | |
-p, --pid_file FILE Sensu PID FILE (default: /tmp/sensu.log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/var/lib/gems/1.8/gems/sensu-0.8.19/lib/sensu/helpers/redis.rb:5:in `unpack_sockaddr_in': can't convert nil into String (TypeError) | |
from /var/lib/gems/1.8/gems/sensu-0.8.19/lib/sensu/helpers/redis.rb:5:in `connection_completed' | |
from /var/lib/gems/1.8/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine' | |
from /var/lib/gems/1.8/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run' | |
from /var/lib/gems/1.8/gems/sensu-0.8.19/lib/sensu/server.rb:15:in `run' | |
from /var/lib/gems/1.8/gems/sensu-0.8.19/bin/sensu-server:16 | |
from /var/lib/gems/1.8/bin/sensu-server:19:in `load' | |
from /var/lib/gems/1.8/bin/sensu-server:19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'daemons/daemonize' | |
module Sensu | |
VERSION = "0.8.19" | |
def self.write_pid(pid_file) | |
File.open(pid_file, 'w') { |f| f.write(Process.pid.to_s + "\n") } | |
end | |
def self.daemonize(log_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEFAULT_OPTIONS = { | |
:log_file => '/tmp/sensu.log', | |
:config_file => '/etc/sensu/config.json', | |
:config_dir => '/etc/sensu/conf.d', | |
:pid_file => '/tmp/' + $0.split('/').last + '.pid' | |
:validate => true, | |
:daemonize => false, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intro | |
- Ruby-based, messaging-oriented, modern monitoring system | |
- based around rabbitmq | |
- goal, lightweight, small, low LOC (<1200 ?) | |
- "the monitoring router" | |
Concepts | |
- sensu-server | |
- handlers | |
- subscriptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lastlog: | |
05:59 <HardPhuck> Hey everyone, just wanted to announce we are setting a freenode-wide karma bot so be generous with | |
karma! Although no registration is possible for about a week you can already check some stats here | |
http://carmivore.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### install rabbitmq | |
We will use the rabbit install guide from: http://www.rabbitmq.com/install-rpm.html | |
The EPEL-5 yum repo contains the older R12B version of Erlang which would work fine ok with rabbit except we wouldn't have access to some of the nice management plugins nor SSL. Thus, we'll be installing a newer Erlang from the `epel-erlang` repo. We still need the EPEL-5 repo for some dependencies so we will install both repos. | |
sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm | |
sudo wget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo | |
sudo yum install erlang | |
Download rabbitmq rpm from rabbitmq and install: |