sensu 0.8.0-x86-mswin32 → 0.8.4-x86-mswin32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/.travis.yml +12 -0
- data/Gemfile.lock +20 -15
- data/README.org +16 -9
- data/bin/sensu-client +1 -0
- data/lib/sensu.rb +1 -1
- data/lib/sensu/client.rb +30 -24
- data/lib/sensu/config.rb +55 -12
- data/sensu.gemspec +4 -6
- data/sensu.windows +3 -3
- metadata +13 -10
    
        data/.gitignore
    CHANGED
    
    
    
        data/.travis.yml
    ADDED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,11 +1,11 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                sensu (0.8. | 
| 4 | 
            +
                sensu (0.8.3)
         | 
| 5 5 | 
             
                  amqp (= 0.7.4)
         | 
| 6 6 | 
             
                  async_sinatra
         | 
| 7 | 
            +
                  cabin (= 0.1.7)
         | 
| 7 8 | 
             
                  em-hiredis
         | 
| 8 | 
            -
                  em-syslog
         | 
| 9 9 | 
             
                  hashie
         | 
| 10 10 | 
             
                  json
         | 
| 11 11 | 
             
                  rack (~> 1.3.4)
         | 
| @@ -20,32 +20,39 @@ GEM | |
| 20 20 | 
             
                async_sinatra (0.5.0)
         | 
| 21 21 | 
             
                  rack (>= 1.2.1)
         | 
| 22 22 | 
             
                  sinatra (>= 1.0)
         | 
| 23 | 
            -
                 | 
| 24 | 
            -
             | 
| 23 | 
            +
                bacon (1.1.0)
         | 
| 24 | 
            +
                cabin (0.1.7)
         | 
| 25 | 
            +
                  json
         | 
| 25 26 | 
             
                daemons (1.1.4)
         | 
| 27 | 
            +
                diff-lcs (1.1.3)
         | 
| 26 28 | 
             
                em-hiredis (0.1.0)
         | 
| 27 29 | 
             
                  hiredis (~> 0.3.0)
         | 
| 28 | 
            -
                em- | 
| 29 | 
            -
                   | 
| 30 | 
            -
                em-ventually (0.1.2)
         | 
| 31 | 
            -
                  callsite (~> 0.0.5)
         | 
| 30 | 
            +
                em-spec (0.2.5)
         | 
| 31 | 
            +
                  bacon
         | 
| 32 32 | 
             
                  eventmachine
         | 
| 33 | 
            +
                  rspec (~> 2.6.0)
         | 
| 34 | 
            +
                  test-unit
         | 
| 33 35 | 
             
                eventmachine (0.12.10)
         | 
| 34 36 | 
             
                hashie (1.2.0)
         | 
| 35 37 | 
             
                hiredis (0.3.2)
         | 
| 36 38 | 
             
                json (1.6.1)
         | 
| 37 | 
            -
                mime-types (1.16)
         | 
| 38 | 
            -
                minitest (2.7.0)
         | 
| 39 39 | 
             
                rack (1.3.5)
         | 
| 40 40 | 
             
                rack-protection (1.1.4)
         | 
| 41 41 | 
             
                  rack
         | 
| 42 42 | 
             
                rake (0.9.2)
         | 
| 43 | 
            -
                 | 
| 44 | 
            -
                   | 
| 43 | 
            +
                rspec (2.6.0)
         | 
| 44 | 
            +
                  rspec-core (~> 2.6.0)
         | 
| 45 | 
            +
                  rspec-expectations (~> 2.6.0)
         | 
| 46 | 
            +
                  rspec-mocks (~> 2.6.0)
         | 
| 47 | 
            +
                rspec-core (2.6.4)
         | 
| 48 | 
            +
                rspec-expectations (2.6.0)
         | 
| 49 | 
            +
                  diff-lcs (~> 1.1.2)
         | 
| 50 | 
            +
                rspec-mocks (2.6.0)
         | 
| 45 51 | 
             
                sinatra (1.3.1)
         | 
| 46 52 | 
             
                  rack (~> 1.3, >= 1.3.4)
         | 
| 47 53 | 
             
                  rack-protection (~> 1.1, >= 1.1.2)
         | 
| 48 54 | 
             
                  tilt (~> 1.3, >= 1.3.3)
         | 
| 55 | 
            +
                test-unit (2.4.0)
         | 
| 49 56 | 
             
                thin (1.2.11)
         | 
| 50 57 | 
             
                  daemons (>= 1.0.9)
         | 
| 51 58 | 
             
                  eventmachine (>= 0.12.6)
         | 
| @@ -57,8 +64,6 @@ PLATFORMS | |
| 57 64 | 
             
              ruby
         | 
| 58 65 |  | 
| 59 66 | 
             
            DEPENDENCIES
         | 
| 60 | 
            -
              em- | 
| 61 | 
            -
              minitest (~> 2.7.0)
         | 
| 67 | 
            +
              em-spec
         | 
| 62 68 | 
             
              rake
         | 
| 63 | 
            -
              rest-client
         | 
| 64 69 | 
             
              sensu!
         | 
    
        data/README.org
    CHANGED
    
    | @@ -1,28 +1,35 @@ | |
| 1 1 | 
             
            * Welcome to Sensu
         | 
| 2 | 
            -
              Sensu  | 
| 2 | 
            +
              Sensu, a monitoring framework that aims to be simple, malleable, and scalable.
         | 
| 3 3 |  | 
| 4 4 | 
             
              [[https://github.com/sonian/sensu/raw/master/sensu-logo.png]]
         | 
| 5 5 |  | 
| 6 | 
            -
               | 
| 6 | 
            +
              [[http://portertech.ca/2011/11/01/sensu-a-monitoring-framework][Blog post]]
         | 
| 7 7 |  | 
| 8 | 
            -
               | 
| 8 | 
            +
              [[http://www.sonian.com/cloud-tools/cloud-monitoring-sensu/][Homepage]]
         | 
| 9 9 | 
             
            * Documentation
         | 
| 10 | 
            -
               | 
| 10 | 
            +
              Find it [[https://github.com/sonian/sensu/wiki][HERE]].
         | 
| 11 | 
            +
            * Other Projects
         | 
| 12 | 
            +
              - [[https://github.com/sonian/sensu-plugins][Sensu Community Plugins]]
         | 
| 13 | 
            +
              - [[https://github.com/sonian/sensu-dashboard][Sensu Dashboard]]
         | 
| 11 14 | 
             
            * License
         | 
| 12 15 | 
             
              Sensu is released under the [[https://github.com/sonian/sensu/blob/master/MIT-LICENSE.txt][MIT license]].
         | 
| 13 16 | 
             
            * Contributing
         | 
| 14 | 
            -
              - [[http://help.github.com/fork-a-repo/][Fork]]  | 
| 17 | 
            +
              - [[http://help.github.com/fork-a-repo/][Fork]] Sensu
         | 
| 15 18 | 
             
              - Use a [[https://github.com/dchelimsky/rspec/wiki/Topic-Branches][topic branch]]
         | 
| 16 19 | 
             
              - Create a [[http://help.github.com/send-pull-requests/][pull request]]
         | 
| 17 20 |  | 
| 18 21 | 
             
              Keep it simple.
         | 
| 19 22 | 
             
            ** Testing
         | 
| 20 | 
            -
            ***  | 
| 23 | 
            +
            *** Travis CI
         | 
| 24 | 
            +
              [[https://secure.travis-ci.org/sonian/sensu.png]]
         | 
| 25 | 
            +
            *** System Dependencies
         | 
| 26 | 
            +
              - Ruby (MRI) & Rubygems
         | 
| 21 27 | 
             
              - RabbitMQ
         | 
| 22 28 | 
             
              - Redis
         | 
| 23 29 | 
             
            *** Running
         | 
| 24 30 | 
             
              : bundle install
         | 
| 25 | 
            -
              : rake | 
| 31 | 
            +
              : rake
         | 
| 26 32 | 
             
            * Contributors
         | 
| 27 | 
            -
              -  | 
| 28 | 
            -
              -  | 
| 33 | 
            +
              - [[http://twitter.com/portertech][Sean Porter]]
         | 
| 34 | 
            +
              - [[http://twitter.com/amdprophet][Justin Kolberg]]
         | 
| 35 | 
            +
              - [[http://twitter.com/kartar][James Turnbull]]
         | 
    
        data/bin/sensu-client
    CHANGED
    
    
    
        data/lib/sensu.rb
    CHANGED
    
    
    
        data/lib/sensu/client.rb
    CHANGED
    
    | @@ -13,34 +13,39 @@ module Sensu | |
| 13 13 |  | 
| 14 14 | 
             
                    %w[INT TERM].each do |signal|
         | 
| 15 15 | 
             
                      Signal.trap(signal) do
         | 
| 16 | 
            -
                         | 
| 17 | 
            -
                        EM.add_timer(1) do
         | 
| 18 | 
            -
                          EM.stop
         | 
| 19 | 
            -
                        end
         | 
| 16 | 
            +
                        client.stop(signal)
         | 
| 20 17 | 
             
                      end
         | 
| 21 18 | 
             
                    end
         | 
| 22 19 | 
             
                  end
         | 
| 23 20 | 
             
                end
         | 
| 24 21 |  | 
| 25 22 | 
             
                def initialize(options={})
         | 
| 26 | 
            -
                  config = Sensu::Config.new( | 
| 23 | 
            +
                  config = Sensu::Config.new(options)
         | 
| 27 24 | 
             
                  @settings = config.settings
         | 
| 28 | 
            -
                   | 
| 25 | 
            +
                  @logger = config.logger
         | 
| 26 | 
            +
                end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                def stop(signal)
         | 
| 29 | 
            +
                  @logger.warn('[process] -- ' + signal + ' -- stopping sensu client')
         | 
| 30 | 
            +
                  EM.add_timer(1) do
         | 
| 31 | 
            +
                    EM.stop
         | 
| 32 | 
            +
                  end
         | 
| 29 33 | 
             
                end
         | 
| 30 34 |  | 
| 31 35 | 
             
                def setup_amqp
         | 
| 32 | 
            -
                   | 
| 36 | 
            +
                  @logger.debug('[amqp] -- connecting to rabbitmq')
         | 
| 33 37 | 
             
                  connection = AMQP.connect(@settings.rabbitmq.to_hash.symbolize_keys)
         | 
| 34 38 | 
             
                  @amq = MQ.new(connection)
         | 
| 35 39 | 
             
                end
         | 
| 36 40 |  | 
| 37 41 | 
             
                def publish_keepalive
         | 
| 38 | 
            -
                   | 
| 42 | 
            +
                  @logger.debug('[keepalive] -- publishing keepalive -- ' + @settings.client.timestamp.to_s)
         | 
| 39 43 | 
             
                  @keepalive_queue ||= @amq.queue('keepalives')
         | 
| 40 44 | 
             
                  @keepalive_queue.publish(@settings.client.to_json)
         | 
| 41 45 | 
             
                end
         | 
| 42 46 |  | 
| 43 47 | 
             
                def setup_keepalives
         | 
| 48 | 
            +
                  @logger.debug('[keepalive] -- setup keepalives')
         | 
| 44 49 | 
             
                  @settings.client.timestamp = Time.now.to_i
         | 
| 45 50 | 
             
                  publish_keepalive
         | 
| 46 51 | 
             
                  EM.add_periodic_timer(30) do
         | 
| @@ -50,7 +55,7 @@ module Sensu | |
| 50 55 | 
             
                end
         | 
| 51 56 |  | 
| 52 57 | 
             
                def publish_result(check)
         | 
| 53 | 
            -
                   | 
| 58 | 
            +
                  @logger.info('[result] -- publishing check result -- ' + check.name)
         | 
| 54 59 | 
             
                  @result_queue ||= @amq.queue('results')
         | 
| 55 60 | 
             
                  @result_queue.publish({
         | 
| 56 61 | 
             
                    :client => @settings.client.name,
         | 
| @@ -59,6 +64,7 @@ module Sensu | |
| 59 64 | 
             
                end
         | 
| 60 65 |  | 
| 61 66 | 
             
                def execute_check(check)
         | 
| 67 | 
            +
                  @logger.debug('[execute] -- executing check -- ' + check.name)
         | 
| 62 68 | 
             
                  @checks_in_progress ||= Array.new
         | 
| 63 69 | 
             
                  if @settings.checks.key?(check.name)
         | 
| 64 70 | 
             
                    unless @checks_in_progress.include?(check.name)
         | 
| @@ -82,7 +88,7 @@ module Sensu | |
| 82 88 | 
             
                        end
         | 
| 83 89 | 
             
                        EM.defer(execute, publish)
         | 
| 84 90 | 
             
                      else
         | 
| 85 | 
            -
                         | 
| 91 | 
            +
                        @logger.warn('[execute] -- missing client attributes -- ' + unmatched_tokens.join(', ') + ' -- ' + check.name)
         | 
| 86 92 | 
             
                        check.status = 3
         | 
| 87 93 | 
             
                        check.output = 'Missing client attributes: ' + unmatched_tokens.join(', ')
         | 
| 88 94 | 
             
                        check.internal = true
         | 
| @@ -91,7 +97,7 @@ module Sensu | |
| 91 97 | 
             
                      end
         | 
| 92 98 | 
             
                    end
         | 
| 93 99 | 
             
                  else
         | 
| 94 | 
            -
                     | 
| 100 | 
            +
                    @logger.warn('[execute] -- unkown check -- ' + check.name)
         | 
| 95 101 | 
             
                    check.status = 3
         | 
| 96 102 | 
             
                    check.output = 'Unknown check'
         | 
| 97 103 | 
             
                    check.internal = true
         | 
| @@ -101,22 +107,24 @@ module Sensu | |
| 101 107 | 
             
                end
         | 
| 102 108 |  | 
| 103 109 | 
             
                def setup_subscriptions
         | 
| 110 | 
            +
                  @logger.debug('[subscribe] -- setup subscriptions')
         | 
| 104 111 | 
             
                  @check_queue = @amq.queue(UUIDTools::UUID.random_create.to_s, :exclusive => true)
         | 
| 105 112 | 
             
                  @settings.client.subscriptions.each do |exchange|
         | 
| 106 | 
            -
                     | 
| 113 | 
            +
                    @logger.debug('[subscribe] -- queue binding to exchange -- ' + exchange)
         | 
| 107 114 | 
             
                    @check_queue.bind(@amq.fanout(exchange))
         | 
| 108 115 | 
             
                  end
         | 
| 109 116 | 
             
                  @check_queue.subscribe do |check_json|
         | 
| 110 117 | 
             
                    check = Hashie::Mash.new(JSON.parse(check_json))
         | 
| 111 | 
            -
                     | 
| 118 | 
            +
                    @logger.info('[subscribe] -- received check -- ' + check.name)
         | 
| 112 119 | 
             
                    execute_check(check)
         | 
| 113 120 | 
             
                  end
         | 
| 114 121 | 
             
                end
         | 
| 115 122 |  | 
| 116 123 | 
             
                def setup_queue_monitor
         | 
| 124 | 
            +
                  @logger.debug('[monitor] -- setup queue monitor')
         | 
| 117 125 | 
             
                  EM.add_periodic_timer(5) do
         | 
| 118 126 | 
             
                    unless @check_queue.subscribed?
         | 
| 119 | 
            -
                       | 
| 127 | 
            +
                      @logger.warn('[monitor] -- reconnecting to rabbitmq')
         | 
| 120 128 | 
             
                      @check_queue.delete
         | 
| 121 129 | 
             
                      EM.add_timer(1) do
         | 
| 122 130 | 
             
                        setup_subscriptions
         | 
| @@ -126,8 +134,9 @@ module Sensu | |
| 126 134 | 
             
                end
         | 
| 127 135 |  | 
| 128 136 | 
             
                def setup_socket
         | 
| 129 | 
            -
                   | 
| 137 | 
            +
                  @logger.debug('[socket] -- starting up socket server')
         | 
| 130 138 | 
             
                  EM.start_server('127.0.0.1', 3030, ClientSocket) do |socket|
         | 
| 139 | 
            +
                    socket.logger = @logger
         | 
| 131 140 | 
             
                    socket.client_name = @settings.client.name
         | 
| 132 141 | 
             
                    socket.result_queue = @amq.queue('results')
         | 
| 133 142 | 
             
                  end
         | 
| @@ -135,35 +144,32 @@ module Sensu | |
| 135 144 | 
             
              end
         | 
| 136 145 |  | 
| 137 146 | 
             
              class ClientSocket < EM::Connection
         | 
| 138 | 
            -
                attr_accessor :client_name, :result_queue
         | 
| 139 | 
            -
             | 
| 140 | 
            -
                def post_init
         | 
| 141 | 
            -
                  EM.debug('[socket] -- client connected')
         | 
| 142 | 
            -
                end
         | 
| 147 | 
            +
                attr_accessor :logger, :client_name, :result_queue
         | 
| 143 148 |  | 
| 144 149 | 
             
                def receive_data(data)
         | 
| 150 | 
            +
                  @logger.debug('[socket] -- client connected')
         | 
| 145 151 | 
             
                  begin
         | 
| 146 152 | 
             
                    check = Hashie::Mash.new(JSON.parse(data))
         | 
| 147 153 | 
             
                    validates = %w[name status output].all? do |key|
         | 
| 148 154 | 
             
                      check.key?(key)
         | 
| 149 155 | 
             
                    end
         | 
| 150 156 | 
             
                    if validates
         | 
| 151 | 
            -
                       | 
| 157 | 
            +
                      @logger.info('[socket] -- publishing check result -- ' + check.name)
         | 
| 152 158 | 
             
                      @result_queue.publish({
         | 
| 153 159 | 
             
                        :client => @client_name,
         | 
| 154 160 | 
             
                        :check => check.to_hash
         | 
| 155 161 | 
             
                      }.to_json)
         | 
| 156 162 | 
             
                    else
         | 
| 157 | 
            -
                       | 
| 163 | 
            +
                      @logger.warn('[socket] -- a check name, exit status, and output are required -- e.g. {name: x, status: 0, output: "y"}')
         | 
| 158 164 | 
             
                    end
         | 
| 159 165 | 
             
                  rescue JSON::ParserError
         | 
| 160 | 
            -
                     | 
| 166 | 
            +
                    @logger.warn('[socket] -- could not parse check result -- expecting JSON')
         | 
| 161 167 | 
             
                  end
         | 
| 162 168 | 
             
                  close_connection
         | 
| 163 169 | 
             
                end
         | 
| 164 170 |  | 
| 165 171 | 
             
                def unbind
         | 
| 166 | 
            -
                   | 
| 172 | 
            +
                  @logger.debug('[socket] -- client disconnected')
         | 
| 167 173 | 
             
                end
         | 
| 168 174 | 
             
              end
         | 
| 169 175 | 
             
            end
         | 
    
        data/lib/sensu/config.rb
    CHANGED
    
    | @@ -4,42 +4,83 @@ require 'json' | |
| 4 4 | 
             
            require 'hashie'
         | 
| 5 5 | 
             
            require 'uuidtools'
         | 
| 6 6 | 
             
            require 'amqp'
         | 
| 7 | 
            -
            require ' | 
| 7 | 
            +
            require 'cabin'
         | 
| 8 | 
            +
            require 'cabin/outputs/em-stdlib-logger'
         | 
| 8 9 | 
             
            require File.join(File.dirname(__FILE__), 'helpers')
         | 
| 9 10 |  | 
| 10 11 | 
             
            module Sensu
         | 
| 11 12 | 
             
              class Config
         | 
| 12 | 
            -
                attr_accessor :settings
         | 
| 13 | 
            +
                attr_accessor :settings, :logger
         | 
| 13 14 |  | 
| 14 15 | 
             
                def initialize(options={})
         | 
| 15 16 | 
             
                  config_file = options[:config_file] || '/etc/sensu/config.json'
         | 
| 16 | 
            -
                   | 
| 17 | 
            -
             | 
| 17 | 
            +
                  if File.readable?(config_file)
         | 
| 18 | 
            +
                    begin
         | 
| 19 | 
            +
                      @settings = Hashie::Mash.new(JSON.parse(File.open(config_file, 'r').read))
         | 
| 20 | 
            +
                    rescue JSON::ParserError => e
         | 
| 21 | 
            +
                      invalid_config('configuration file must be valid JSON: ' + e)
         | 
| 22 | 
            +
                    end
         | 
| 23 | 
            +
                  else
         | 
| 24 | 
            +
                    invalid_config('configuration file does not exist or is not readable: ' + config_file)
         | 
| 25 | 
            +
                  end
         | 
| 26 | 
            +
                  @logger = Cabin::Channel.new
         | 
| 27 | 
            +
                  log_dir = File.writable?('/var/log') ? '/var/log' : '/tmp'
         | 
| 28 | 
            +
                  ruby_logger = Logger.new(File.join(log_dir, 'sensu.log'))
         | 
| 29 | 
            +
                  @logger.subscribe(Cabin::Outputs::EmStdlibLogger.new(ruby_logger))
         | 
| 30 | 
            +
                  @logger.level = options[:verbose] ? 'debug' : 'info'
         | 
| 31 | 
            +
                  validate_config(options['type'])
         | 
| 18 32 | 
             
                end
         | 
| 19 33 |  | 
| 20 | 
            -
                def validate_config
         | 
| 34 | 
            +
                def validate_config(type)
         | 
| 35 | 
            +
                  @logger.debug('[config] -- validating configuration')
         | 
| 36 | 
            +
                  has_keys(%w[rabbitmq])
         | 
| 37 | 
            +
                  case type
         | 
| 38 | 
            +
                  when 'server'
         | 
| 39 | 
            +
                    has_keys(%w[redis handlers checks])
         | 
| 40 | 
            +
                  when 'api'
         | 
| 41 | 
            +
                    has_keys(%w[redis api])
         | 
| 42 | 
            +
                  when 'client'
         | 
| 43 | 
            +
                    has_keys(%w[client checks])
         | 
| 44 | 
            +
                  end
         | 
| 21 45 | 
             
                  @settings.checks.each do |name, details|
         | 
| 22 46 | 
             
                    unless details.interval.is_a?(Integer) && details.interval > 0
         | 
| 23 | 
            -
                       | 
| 47 | 
            +
                      invalid_config('missing interval for check ' + name)
         | 
| 24 48 | 
             
                    end
         | 
| 25 49 | 
             
                    unless details.command.is_a?(String)
         | 
| 26 | 
            -
                       | 
| 50 | 
            +
                      invalid_config('missing command for check ' + name)
         | 
| 27 51 | 
             
                    end
         | 
| 28 52 | 
             
                    unless details.subscribers.is_a?(Array) && details.subscribers.count > 0
         | 
| 29 | 
            -
                       | 
| 53 | 
            +
                      invalid_config('missing subscribers for check ' + name)
         | 
| 30 54 | 
             
                    end
         | 
| 31 55 | 
             
                  end
         | 
| 32 56 | 
             
                  unless @settings.client.name.is_a?(String)
         | 
| 33 | 
            -
                     | 
| 57 | 
            +
                    invalid_config('client must have a name')
         | 
| 34 58 | 
             
                  end
         | 
| 35 59 | 
             
                  unless @settings.client.address.is_a?(String)
         | 
| 36 | 
            -
                     | 
| 60 | 
            +
                    invalid_config('client must have an address (ip or hostname)')
         | 
| 37 61 | 
             
                  end
         | 
| 38 62 | 
             
                  unless @settings.client.subscriptions.is_a?(Array) && @settings.client.subscriptions.count > 0
         | 
| 39 | 
            -
                     | 
| 63 | 
            +
                    invalid_config('client must have subscriptions')
         | 
| 64 | 
            +
                  end
         | 
| 65 | 
            +
                  if type
         | 
| 66 | 
            +
                    @logger.debug('[config] -- configuration valid -- running ' + type)
         | 
| 67 | 
            +
                    puts 'configuration valid -- running ' + type
         | 
| 40 68 | 
             
                  end
         | 
| 41 69 | 
             
                end
         | 
| 42 70 |  | 
| 71 | 
            +
                def has_keys(keys)
         | 
| 72 | 
            +
                  keys.each do |key|
         | 
| 73 | 
            +
                    unless @settings.key?(key)
         | 
| 74 | 
            +
                      invalid_config('missing the following key: ' + key)
         | 
| 75 | 
            +
                    end
         | 
| 76 | 
            +
                  end
         | 
| 77 | 
            +
                end
         | 
| 78 | 
            +
             | 
| 79 | 
            +
                def invalid_config(message)
         | 
| 80 | 
            +
                  @logger.error('[config] -- configuration invalid -- ' + message)
         | 
| 81 | 
            +
                  raise 'configuration invalid, ' + message
         | 
| 82 | 
            +
                end
         | 
| 83 | 
            +
             | 
| 43 84 | 
             
                def self.read_arguments(arguments)
         | 
| 44 85 | 
             
                  options = Hash.new
         | 
| 45 86 | 
             
                  optparse = OptionParser.new do |opts|
         | 
| @@ -54,10 +95,12 @@ module Sensu | |
| 54 95 | 
             
                        options[:worker] = true
         | 
| 55 96 | 
             
                      end
         | 
| 56 97 | 
             
                    end
         | 
| 57 | 
            -
                    options[:config_file] = nil
         | 
| 58 98 | 
             
                    opts.on('-c', '--config FILE', 'Sensu JSON config FILE (default: /etc/sensu/config.json)') do |file|
         | 
| 59 99 | 
             
                      options[:config_file] = file
         | 
| 60 100 | 
             
                    end
         | 
| 101 | 
            +
                    opts.on('-v', '--verbose', 'Enable verbose logging') do
         | 
| 102 | 
            +
                      options[:verbose] = true
         | 
| 103 | 
            +
                    end
         | 
| 61 104 | 
             
                  end
         | 
| 62 105 | 
             
                  optparse.parse!(arguments)
         | 
| 63 106 | 
             
                  options
         | 
    
        data/sensu.gemspec
    CHANGED
    
    | @@ -7,8 +7,8 @@ Gem::Specification.new do |s| | |
| 7 7 | 
             
              s.authors     = ["Sean Porter", "Justin Kolberg"]
         | 
| 8 8 | 
             
              s.email       = ["sean.porter@sonian.net", "justin.kolberg@sonian.net"]
         | 
| 9 9 | 
             
              s.homepage    = "https://github.com/sonian/sensu"
         | 
| 10 | 
            -
              s.summary     = %q{A  | 
| 11 | 
            -
              s.description = %q{A  | 
| 10 | 
            +
              s.summary     = %q{A monitoring framework}
         | 
| 11 | 
            +
              s.description = %q{A monitoring framework that aims to be simple, malleable, and scalable. Uses the publish/subscribe model.}
         | 
| 12 12 | 
             
              s.license     = "MIT"
         | 
| 13 13 | 
             
              s.has_rdoc    = false
         | 
| 14 14 |  | 
| @@ -16,16 +16,14 @@ Gem::Specification.new do |s| | |
| 16 16 | 
             
              s.add_dependency("json")
         | 
| 17 17 | 
             
              s.add_dependency("hashie")
         | 
| 18 18 | 
             
              s.add_dependency("uuidtools")
         | 
| 19 | 
            -
              s.add_dependency(" | 
| 19 | 
            +
              s.add_dependency("cabin", "0.1.7")
         | 
| 20 20 | 
             
              s.add_dependency("em-hiredis")
         | 
| 21 21 | 
             
              s.add_dependency("rack", "~> 1.3.4")
         | 
| 22 22 | 
             
              s.add_dependency("async_sinatra")
         | 
| 23 23 | 
             
              s.add_dependency("thin")
         | 
| 24 24 |  | 
| 25 25 | 
             
              s.add_development_dependency("rake")
         | 
| 26 | 
            -
              s.add_development_dependency(" | 
| 27 | 
            -
              s.add_development_dependency("em-ventually")
         | 
| 28 | 
            -
              s.add_development_dependency("rest-client")
         | 
| 26 | 
            +
              s.add_development_dependency("em-spec")
         | 
| 29 27 |  | 
| 30 28 | 
             
              s.files         = `git ls-files`.split("\n").reject {|f| f =~ /(dist|test|png)/}
         | 
| 31 29 | 
             
              s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
         | 
    
        data/sensu.windows
    CHANGED
    
    | @@ -6,8 +6,8 @@ Gem::Specification.new do |s| | |
| 6 6 | 
             
              s.authors     = ["Sean Porter", "Justin Kolberg"]
         | 
| 7 7 | 
             
              s.email       = ["sean.porter@sonian.net", "justin.kolberg@sonian.net"]
         | 
| 8 8 | 
             
              s.homepage    = "https://github.com/sonian/sensu"
         | 
| 9 | 
            -
              s.summary     = %q{A  | 
| 10 | 
            -
              s.description = %q{A  | 
| 9 | 
            +
              s.summary     = %q{A monitoring framework}
         | 
| 10 | 
            +
              s.description = %q{A monitoring framework that aims to be simple, malleable, and scalable. Uses the publish/subscribe model.}
         | 
| 11 11 | 
             
              s.license     = "MIT"
         | 
| 12 12 | 
             
              s.has_rdoc    = false
         | 
| 13 13 |  | 
| @@ -23,7 +23,7 @@ Gem::Specification.new do |s| | |
| 23 23 | 
             
              s.add_dependency("json")
         | 
| 24 24 | 
             
              s.add_dependency("hashie")
         | 
| 25 25 | 
             
              s.add_dependency("uuidtools")
         | 
| 26 | 
            -
              s.add_dependency(" | 
| 26 | 
            +
              s.add_dependency("cabin", "0.1.7")
         | 
| 27 27 |  | 
| 28 28 | 
             
              s.files         = `git ls-files`.split("\n").reject {|f| f =~ /(dist|test|server|api|png)/}
         | 
| 29 29 | 
             
              s.executables   = "sensu-client"
         | 
    
        metadata
    CHANGED
    
    | @@ -1,13 +1,13 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: sensu
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              hash:  | 
| 4 | 
            +
              hash: 55
         | 
| 5 5 | 
             
              prerelease: false
         | 
| 6 6 | 
             
              segments: 
         | 
| 7 7 | 
             
              - 0
         | 
| 8 8 | 
             
              - 8
         | 
| 9 | 
            -
              -  | 
| 10 | 
            -
              version: 0.8. | 
| 9 | 
            +
              - 4
         | 
| 10 | 
            +
              version: 0.8.4
         | 
| 11 11 | 
             
            platform: x86-mswin32
         | 
| 12 12 | 
             
            authors: 
         | 
| 13 13 | 
             
            - Sean Porter
         | 
| @@ -16,7 +16,7 @@ autorequire: | |
| 16 16 | 
             
            bindir: bin
         | 
| 17 17 | 
             
            cert_chain: []
         | 
| 18 18 |  | 
| 19 | 
            -
            date: 2011- | 
| 19 | 
            +
            date: 2011-11-09 00:00:00 -08:00
         | 
| 20 20 | 
             
            default_executable: 
         | 
| 21 21 | 
             
            dependencies: 
         | 
| 22 22 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -97,20 +97,22 @@ dependencies: | |
| 97 97 | 
             
              type: :runtime
         | 
| 98 98 | 
             
              version_requirements: *id005
         | 
| 99 99 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 100 | 
            -
              name:  | 
| 100 | 
            +
              name: cabin
         | 
| 101 101 | 
             
              prerelease: false
         | 
| 102 102 | 
             
              requirement: &id006 !ruby/object:Gem::Requirement 
         | 
| 103 103 | 
             
                none: false
         | 
| 104 104 | 
             
                requirements: 
         | 
| 105 | 
            -
                - - " | 
| 105 | 
            +
                - - "="
         | 
| 106 106 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 107 | 
            -
                    hash:  | 
| 107 | 
            +
                    hash: 21
         | 
| 108 108 | 
             
                    segments: 
         | 
| 109 109 | 
             
                    - 0
         | 
| 110 | 
            -
                     | 
| 110 | 
            +
                    - 1
         | 
| 111 | 
            +
                    - 7
         | 
| 112 | 
            +
                    version: 0.1.7
         | 
| 111 113 | 
             
              type: :runtime
         | 
| 112 114 | 
             
              version_requirements: *id006
         | 
| 113 | 
            -
            description: A  | 
| 115 | 
            +
            description: A monitoring framework that aims to be simple, malleable, and scalable. Uses the publish/subscribe model.
         | 
| 114 116 | 
             
            email: 
         | 
| 115 117 | 
             
            - sean.porter@sonian.net
         | 
| 116 118 | 
             
            - justin.kolberg@sonian.net
         | 
| @@ -122,6 +124,7 @@ extra_rdoc_files: [] | |
| 122 124 |  | 
| 123 125 | 
             
            files: 
         | 
| 124 126 | 
             
            - .gitignore
         | 
| 127 | 
            +
            - .travis.yml
         | 
| 125 128 | 
             
            - Gemfile
         | 
| 126 129 | 
             
            - Gemfile.lock
         | 
| 127 130 | 
             
            - MIT-LICENSE.txt
         | 
| @@ -167,6 +170,6 @@ rubyforge_project: | |
| 167 170 | 
             
            rubygems_version: 1.3.7
         | 
| 168 171 | 
             
            signing_key: 
         | 
| 169 172 | 
             
            specification_version: 3
         | 
| 170 | 
            -
            summary: A  | 
| 173 | 
            +
            summary: A monitoring framework
         | 
| 171 174 | 
             
            test_files: []
         | 
| 172 175 |  |