GithubHelp home page GithubHelp logo

sensu / sensu-chef Goto Github PK

View Code? Open in Web Editor NEW
222.0 27.0 283.0 857 KB

Sensu Chef cookbook.

Home Page: https://supermarket.chef.io/cookbooks/sensu

License: Apache License 2.0

Ruby 98.64% HTML 1.36%
sensu chef-cookbook

sensu-chef's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sensu-chef's Issues

sensu_gem does not install sensu-plugin.rb gem

Am I using this wrong?
After installing sensu with LWRP sensu_gem, like so:

sensu_gem "rest-client"

or

sensu_gem "sensu-plugin" do
    version node["monitor"]["sensu_plugin_version"]
end

I can see these gems in the folder

/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems

But it is not found using

 gem list

and in my checks I keep getting errors about missing gms

{"timestamp":"2014-06-10T07:53:49.062045+0000","level":"info","message":"publishing check result",
"payload":{"client":"precise32","check":{"type":"metric","command":"rabbitmq-overview-metrics.rb",
"handlers":["metrics"],"standalone":true,"interval":30,
"name":"rabbitmq_overview_metrics","issued":1402386829,
"executed":1402386829,
"output":"/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 
cannot load such file -- sensu-plugin/metric/cli (LoadError)\n\tfrom /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'\n\tfrom /etc/sensu/plugins/rabbitmq-overview-metrics.rb:36:in `<main>'\n","status":1,"duration":0.039}}}

Without manually installing these gems my sensu checks don't work.

I use the default sensu cookbook installation parameters regarding embedded ruby:

 override["sensu"]["use_embedded_ruby"] = false

json_file issue on chef 0.10.10

I noticed this issue with json_file on chef 0.10.10 (Ruby 1.9.2). No issue with chef 0.10.8 on same VM.

[Thu, 17 May 2012 12:49:10 -0400] INFO: Processing json_file[/etc/sensu/config.json] action create (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/sensu/providers/config.rb line 19)
[Thu, 17 May 2012 12:49:10 -0400] ERROR: json_file[/etc/sensu/config.json] (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/sensu/providers/config.rb line 19) has had an error
[Thu, 17 May 2012 12:49:10 -0400] ERROR: json_file[/etc/sensu/config.json] (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/sensu/providers/config.rb:19:in `block in class_from_file') had an error:
json_file[/etc/sensu/config.json] (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/sensu/providers/config.rb line 19) had an error: TypeError: can't convert Mash into String
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/file.rb:148:in `digest'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/file.rb:148:in `hexdigest'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/file.rb:148:in `new_resource_content_checksum'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/file.rb:54:in `compare_content'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/file.rb:59:in `set_content'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/file.rb:74:in `action_create'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource.rb:454:in `run_action'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/runner.rb:49:in `run_action'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/runner.rb:85:in `block (2 levels) in converge'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/runner.rb:85:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/runner.rb:85:in `block in converge'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection.rb:94:in `block in execute_each_resource'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'

be able to specify a different apt repo mirror

Hi,

We currently mirror repos.sensuapp.org, but our cookbook still references the public site as there is no easy way to override the cookbook.

On occasions we get the below, which if we were able to point to our own mirror, we would be able to manage ourselves and avoid.

SocketError: apt_repository[sensu] (sensu::_linux line 28) had an error: SocketError: remote_file[/var/cache/chef/pubkey.gpg] (/var/cache/chef/cookbooks/apt/providers/repository.rb line 59) had an error: SocketError: Error connecting to http://repos.sensuapp.org/apt/pubkey.gpg - getaddrinfo: Name or service not known

Any reasons to not want people to be able to override the apt repo location?

gem 'pg' could not be installed

/opt/sensu/embedded/bin/gem install pg -q --no-rdoc --no-ri
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

    /opt/sensu/embedded/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/opt/sensu/embedded/bin/ruby
        --with-pg
        --without-pg
        --with-pg-config
        --without-pg-config
        --with-pg_config
        --without-pg_config
        --with-pg-dir
        --without-pg-dir
        --with-pg-include
        --without-pg-include=${pg-dir}/include
        --with-pg-lib
        --without-pg-lib=${pg-dir}/
        --with-pqlib
        --without-pqlib
        --with-libpqlib
        --without-libpqlib
        --with-ms/libpqlib
        --without-ms/libpqlib


Gem files will remain installed in /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/pg-0.17.1 for inspection.
Results logged to /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/pg-0.17.1/ext/gem_make.out

Socket Handler failing

Hello,

I am trying to use the graphite handler and its failing due to that the sensu_handler LWRP is writing the port as a string instead of a integer in the handler json config.

Error

{"timestamp":"2014-03-18T05:06:40.113019+0000","level":"fatal","message":"invalid settings","reason":"handler is missing socket port","handler":{"type":"tcp","socket":{"host":"graphite.domain.com","port":"2003"},"mutator":"graphite","name":"graphite_tcp"}

HANDLER JSON

{
"handlers": {
"graphite_tcp": {
"type": "tcp",
"socket": {
"host": "graphite.domain.com",
"port": "2003"
},
"mutator": "graphite"
}
}
}

=== My Handler ===
sensu_handler "graphite_tcp" do
type "tcp"
socket(
:host => graphite_address,
:port => graphite_port.to_i
)
mutator "only_check_ouput"
end

Handler config - under handler key, or as separate snippet?

Hi,

Up till the handler resource came to be, the practice was to put needed config for handlers in the "general namespace" of the config file/s, e.g. not under the handler. Not something I liked that much...

I see that additional attrs for a handlers are now put under the handler entry - might make more sense (especially if you don't share info between multiple handlers). I can of course add the config via a snippet resource to be backward-compatible, but it's not that clean.

So, what's the best-practice?

sensu_gem is not working properly with embedded ruby

If I set Sensu to use the embedded Ruby for checkers and handlers, I'd expect sensu_gem to install the gem (mail in my case) under /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/.

But Chef is actually installing it in /var/lib/gems/1.9.1:

* sensu_gem[mail] action install[2014-05-06T11:05:15-04:00] INFO: Processing sensu_gem[mail] action install (matterhorn::sensu_server line 17)
[2014-05-06T11:05:15-04:00] DEBUG: Platform ubuntu version 14.04 found
 (up to date)
Recipe: <Dynamically Defined Resource>
  * gem_package[mail] action install[2014-05-06T11:05:15-04:00] INFO: Processing gem_package[mail] action install (/home/matterhorn/provisioning/deployment-chef/cookbooks/sensu/providers/gem.rb line 2)
[2014-05-06T11:05:15-04:00] DEBUG: gem_package[mail] using gem '/opt/sensu/embedded/bin/gem'
/var/lib/gems/1.9.1:/opt/sensu/embedded/lib/ruby/gems/2.0.0
[2014-05-06T11:05:16-04:00] DEBUG: gem_package[mail] no installed version found for mail (>= 0)
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.14
  - RUBY VERSION: 2.0.0 (2013-11-22 patchlevel 353) [x86_64-linux]
  - INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
  - RUBY EXECUTABLE: /opt/sensu/embedded/bin/ruby
  - EXECUTABLE DIRECTORY: /var/lib/gems/1.9.1/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/1.9.1
     - /opt/sensu/embedded/lib/ruby/gems/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/

This is causing some weird issues since the service will preserve other gem paths and causing the handler to load the mail gem and a few others (like the json C-extension) from the system Ruby (1.9.3), causing segmentation fault issues in the Sensu log which are hard to track:

/var/lib/gems/1.9.1/gems/json-1.8.1/lib/json/common.rb:67: [BUG] Segmentation fault
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
...

I found this on sensu_service:

if [ "x$EMBEDDED_RUBY" = "xtrue" ]; then
        export PATH=/opt/sensu/embedded/bin:$PATH:$PLUGINS_DIR:$HANDLERS_DIR
        export GEM_PATH=/opt/sensu/embedded/lib/ruby/gems/2.0.0:$GEM_PATH
    else
        export PATH=$PATH:$PLUGINS_DIR:$HANDLERS_DIR
    fi

Why do you append :$GEM_PATH when embedded Ruby is set? This is dangerous.

Going from use_ssl == true to use_ssl == false; config.json still has ssl config info in it

If you run chef-client and have use_ssl true and then later set use_ssl false, the sensu_client config.json continues to have

    "ssl": {
      "cert_chain_file": "/etc/sensu/ssl/cert.pem",
      "private_key_file": "/etc/sensu/ssl/key.pem"
    },

in the rabbitmq section. It does set the port to the non-ssl port number, but the ssl cert files and the ssl key is still there.

It seems that if the ssl key with values is in the file, it still has the client try to use ssl which of course doesn't work.

I spent an entire evening trying to modify sensu_chef::default as well as a wrapper cookbook to delete or set to nil or {} the node.sensu.rabbitmq.ssl attribute.

Even tried some suggestions by Portertech from IRC and no matter what I did I couldn't get rid of the ssl key or values.

Now its possible it was due to lack of sleep, but I really tried.

The most complicate attempt was the one suggested by Portertech:

node.force_override['sensu']['rabbitmq'] = node.sensu.rabbitmq.to_hash.reject {|k,v| k == 'ssl'}

But also tried:

node.override['sensu']['rabbitmq']['ssl'] = nil
node.override['sensu']['rabbitmq']['ssl'] = {}

This shouldn't be so hard.

Am I doing something stupid? Or is this really an issue?

Thanks,
Rob

/bin/sh != /bin/bash .. or even sh

In https://github.com/sensu/sensu-chef/blob/master/examples/ssl/ssl_certs.sh you're using /bin/sh. As part of the usual "lets deviate from safe and standard practice" different distributions link /bin/sh to different shells. Just for fun and frolicks because cross-distro compatibility isn't hard enough already.

Ubuntu, for example, links /bin/sh to dash which isn't full bash, and so the script fails with:

./ssl_certs.sh: 2: ./ssl_certs.sh: function: not found
./ssl_certs.sh: 12: ./ssl_certs.sh: Syntax error: "}" unexpected

switching /bin/sh to /bin/bash in the first line fixed it. You might want to consider changing that first line rather than relying on an unreliable symlink.

Sensu client just exits if no server is available

The client currently just exits if it can't talk to a server. This makes it a bit harder to do local testing of plugins and LWRPs in Vagrant/Test-Kitchen (i.e. you need to remember to set up a local server first). It might be nicer if the Sensu client had retry logic so that the service kept trying to connect instead of just exiting (and causing Chef runs to fail) when it can't find a server.

service[redis-server] Error

I hit this snag (using ubuntu)

[2013-07-27T06:13:50+00:00] INFO: Processing service[redis-server] action restart (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/redis/providers/instance.rb line 151)

================================================================================

Error executing action `restart` on resource 'service[redis-server]'

================================================================================


Mixlib::ShellOut::ShellCommandFailed

------------------------------------

Expected process to exit with [0], but received '1'
---- Begin output of /etc/init.d/redis-server start ----
STDOUT: Starting Redis server...
STDERR: *** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 24
>>> 'zset-max-ziplist-entries 128'
Bad directive or wrong number of arguments
---- End output of /etc/init.d/redis-server start ----
Ran /etc/init.d/redis-server start returned 1


Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/redis/providers/instance.rb

151:   service redis_service do
152:     action [ :enable, :start ]
153:   end
154: end

Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/redis/providers/instance.rb:151:in `enable_service'

service("redis-server") do
  action [:enable, :start]
  supports {:restart=>false, :reload=>false, :status=>false}
  retries 0
  retry_delay 2
  service_name "redis-server"
  pattern "redis-server"
  startup_type :automatic
  cookbook_name :redis
end

[2013-07-27T06:13:51+00:00] ERROR: Running exception handlers
[2013-07-27T06:13:51+00:00] ERROR: Exception handlers complete
[2013-07-27T06:13:51+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-07-27T06:13:51+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: service[redis-server] (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/redis/providers/instance.rb line 151) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /etc/init.d/redis-server start ----
STDOUT: Starting Redis server...
STDERR: *** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 24
>>> 'zset-max-ziplist-entries 128'
Bad directive or wrong number of arguments
---- End output of /etc/init.d/redis-server start ----
Ran /etc/init.d/redis-server start returned 1
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

Warnings and Errors

Hi,

Using
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
Chef: 11.4.4
Vagrant version 1.2.3

After "vagrant up" get this warning and then dies with a different error:

% vagrant up                                                                                                                                                                                       โœน
There were warnings and/or errors while loading your Vagrantfile.
Your Vagrantfile was written for an earlier version of Vagrant,
and while Vagrant does the best it can to remain backwards
compatible, there are some cases where things have changed
significantly enough to warrant a message. These messages are
shown below.

Warnings:
* `config.vm.customize` calls are VirtualBox-specific. If you're
using any other provider, you'll have to use config.vm.provider in a
v2 configuration block.
Relevant File Content:
----------------------
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/run_context.rb:

  1:  #
  2:  # Author:: Adam Jacob (<[email protected]>)
  3:  # Author:: Christopher Walters (<[email protected]>)
  4:  # Author:: Tim Hinderliter (<[email protected]>)
  5:  # Copyright:: Copyright (c) 2008-2010 Opscode, Inc.
  6:  # License:: Apache License, Version 2.0
  7:  #
  8:  # Licensed under the Apache License, Version 2.0 (the "License");
  9:  # you may not use this file except in compliance with the License.

[2013-07-27T05:08:48+00:00] ERROR: Running exception handlers
[2013-07-27T05:08:48+00:00] ERROR: Exception handlers complete
[2013-07-27T05:08:48+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-07-27T05:08:48+00:00] FATAL: SyntaxError: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/discovery/libraries/search.rb:67: syntax error, unexpected ')', expecting '='
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/discovery/libraries/search.rb:106: syntax error, unexpected kEND, expecting $end
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

sensu_check name with spaces

If the name of a sensu_check definition contains spaces, the daemons crash and the chef run fails. "check name cannot contain spaces or special characters"

The name should be validated against those "special characters".

RabbitMQ restart at end of run causing sensu-api/server restart to fail

I've been seeing this issue happen very often now. RabbitMQ gets a delayed :restart action from template modifications and the few seconds it takes for RabbitMQ to restart are enough to throw sensu-server or sensu-api (it varies) into the ground.

Test-Kitchen's log (relevant part):

[2014-07-04T01:55:45+00:00] INFO: template[/etc/rabbitmq/rabbitmq-env.conf] sending restart action to service[rabbitmq-server] (delayed)
Recipe: rabbitmq::default
 * service[rabbitmq-server] action restart
 [2014-07-04T01:55:45+00:00] INFO: Processing service[rabbitmq-server] action restart (rabbitmq::default line 86)

[2014-07-04T01:55:46+00:00] INFO: service[rabbitmq-server] restarted

   - restart service service[rabbitmq-server]


[2014-07-04T01:55:46+00:00] INFO: package[sensu] sending create action to ruby_block[sensu_service_trigger] (delayed)
Recipe: sensu::default
 * ruby_block[sensu_service_trigger] action create
 [2014-07-04T01:55:46+00:00] INFO: Processing ruby_block[sensu_service_trigger] action create (sensu::default line 20)

[2014-07-04T01:55:46+00:00] INFO: ruby_block[sensu_service_trigger] called

   - execute the ruby block sensu_service_trigger


[2014-07-04T01:55:46+00:00] INFO: ruby_block[sensu_service_trigger] sending restart action to service[sensu-server] (delayed)
Recipe: <Dynamically Defined Resource>       
  * service[sensu-server] action restart       
  [2014-07-04T01:55:46+00:00] INFO: Processing service[sensu-server] action restart (/tmp/kitchen/cache/cookbooks/sensu/providers/service.rb line 46)

================================================================================       
Error executing action `restart` on resource 'service[sensu-server]'       
================================================================================       



Mixlib::ShellOut::ShellCommandFailed       
------------------------------------       
       Expected process to exit with [0], but received '1'
       ---- Begin output of /etc/init.d/sensu-server restart ----
       STDOUT: * Stopping sensu-server
          ...done.
        * Starting sensu-server
          ...fail!
       STDERR: 
       ---- End output of /etc/init.d/sensu-server restart ----
       Ran /etc/init.d/sensu-server restart returned 1




Resource Declaration:       
---------------------       
       # In /tmp/kitchen/cache/cookbooks/sensu/providers/service.rb

        46:     service new_resource.service do
        47:       provider service_provider
        48:       supports :status => true, :restart => true
        49:       action :nothing
        50:       subscribes :restart, resources("ruby_block[sensu_service_trigger]"), :delayed
        51:     end
        52:   when "runit"





Compiled Resource:       
------------------       
       # Declared in /tmp/kitchen/cache/cookbooks/sensu/providers/service.rb:46:in `load_current_resource'

       service("sensu-server") do
         provider Chef::Provider::Service::Debian
         action [:nothing]
         updated true
         supports {:status=>true, :restart=>true}
         retries 0
         retry_delay 2
         guard_interpreter :default
         service_name "sensu-server"
         enabled true
         running true
         pattern "sensu-server"
         cookbook_name "sensu"
       end






       [2014-07-04T01:55:52+00:00] INFO: ruby_block[sensu_service_trigger] sending restart action to service[sensu-api] (delayed)
  * service[sensu-api] action restart       
  [2014-07-04T01:55:52+00:00] INFO: Processing service[sensu-api] action restart (/tmp/kitchen/cache/cookbooks/sensu/providers/service.rb line 46)

================================================================================       
Error executing action `restart` on resource 'service[sensu-api]'       
================================================================================       



Mixlib::ShellOut::ShellCommandFailed       
------------------------------------       
       Expected process to exit with [0], but received '1'
       ---- Begin output of /etc/init.d/sensu-api restart ----
       STDOUT: * Stopping sensu-api
          ...done.
        * Starting sensu-api
          ...fail!
       STDERR: 
       ---- End output of /etc/init.d/sensu-api restart ----
       Ran /etc/init.d/sensu-api restart returned 1




Resource Declaration:       
---------------------       
       # In /tmp/kitchen/cache/cookbooks/sensu/providers/service.rb

        46:     service new_resource.service do
        47:       provider service_provider
        48:       supports :status => true, :restart => true
        49:       action :nothing
        50:       subscribes :restart, resources("ruby_block[sensu_service_trigger]"), :delayed
        51:     end
        52:   when "runit"





Compiled Resource:       
------------------       
       # Declared in /tmp/kitchen/cache/cookbooks/sensu/providers/service.rb:46:in `load_current_resource'

       service("sensu-api") do
         provider Chef::Provider::Service::Debian
         action [:nothing]
         updated true
         supports {:status=>true, :restart=>true}
         retries 0
         retry_delay 2
         guard_interpreter :default
         service_name "sensu-api"
         enabled true
         running true
         pattern "sensu-api"
         cookbook_name "sensu"
       end

/var/log/sensu/sensu-server.log:

{"timestamp":"2014-07-04T01:55:03.554734+0000","level":"info","message":"loaded extension","type":"mutator","name":"only_check_output","description":"returns check output"}
{"timestamp":"2014-07-04T01:55:03.558862+0000","level":"info","message":"loaded extension","type":"handler","name":"debug","description":"outputs json event data"}
{"timestamp":"2014-07-04T01:55:03.900048+0000","level":"info","message":"i am the master"}
{"timestamp":"2014-07-04T01:55:23.900905+0000","level":"info","message":"pruning aggregations"}
{"timestamp":"2014-07-04T01:55:33.901350+0000","level":"info","message":"determining stale clients"}
{"timestamp":"2014-07-04T01:55:43.910271+0000","level":"info","message":"pruning aggregations"}
{"timestamp":"2014-07-04T01:55:48.076224+0000","level":"warn","message":"received signal","signal":"TERM"}
{"timestamp":"2014-07-04T01:55:48.076473+0000","level":"warn","message":"stopping"}
{"timestamp":"2014-07-04T01:55:48.076563+0000","level":"warn","message":"unsubscribing from keepalive and result queues"}
{"timestamp":"2014-07-04T01:55:48.077108+0000","level":"warn","message":"resigning as master"}
{"timestamp":"2014-07-04T01:55:48.080591+0000","level":"info","message":"removed master lock"}
{"timestamp":"2014-07-04T01:55:48.468637+0000","level":"warn","message":"reconnecting to rabbitmq"}
{"timestamp":"2014-07-04T01:55:48.577569+0000","level":"info","message":"completing handlers in progress","handlers_in_progress_count":0}
{"timestamp":"2014-07-04T01:55:49.078405+0000","level":"warn","message":"stopping reactor"}
{"timestamp":"2014-07-04T01:55:51.154317+0000","level":"warn","message":"config file applied changes","config_file":"/etc/sensu/conf.d/client.json","changes":{"client":[null,{"name":"default-ubuntu-1204","address":"172.31.28.165","subscriptions":["all"]}]}}
{"timestamp":"2014-07-04T01:55:51.205003+0000","level":"info","message":"loaded extension","type":"mutator","name":"only_check_output","description":"returns check output"}
{"timestamp":"2014-07-04T01:55:51.235572+0000","level":"info","message":"loaded extension","type":"handler","name":"debug","description":"outputs json event data"}
{"timestamp":"2014-07-04T01:55:51.581060+0000","level":"error","message":"[amqp] Detected TCP connection failure"}
{"timestamp":"2014-07-04T01:55:51.581413+0000","level":"fatal","message":"rabbitmq connection error","error":"failed to connect"}
{"timestamp":"2014-07-04T01:55:51.581485+0000","level":"warn","message":"stopping"}
{"timestamp":"2014-07-04T01:55:51.581580+0000","level":"warn","message":"unsubscribing from keepalive and result queues"}
{"timestamp":"2014-07-04T01:55:51.581696+0000","level":"info","message":"completing handlers in progress","handlers_in_progress_count":0}
{"timestamp":"2014-07-04T01:55:51.582518+0000","level":"info","message":"i am the master"}
{"timestamp":"2014-07-04T01:55:52.148504+0000","level":"warn","message":"stopping reactor"}

My .kitchen.yml is as follows:

---
driver:
  name: vagrant

provisioner:
  name: chef_zero

platforms:
  - name: ubuntu-12.04

suites:
  - name: default
    run_list:
      - recipe[sensu::rabbitmq]
      - recipe[sensu::redis]
      - recipe[sensu::default]
      - recipe[sensu::server_service]
      - recipe[sensu::api_service]
      - recipe[sensu::dashboard_service]
      - recipe[sensu::client_service]

I have tried to manually set rabbitmq-server to restart immediately following the template modifications (using resource rewinding) but that causes the rabbitmq cookbook to break in other places.

I'm at a loss as to what to do to fix this. Any ideas? I'm happy to submit a pull request once I get an idea of where to start.

chef-solo (opsworks) failures: missing data bag path and service failure

Somewhere between version 0.6.0 and the latest, I've run into the following issues running chef-solo in an opsworks environment:

  1. invalid data bag path. creating the directory makes the error go away.
[2014-01-01T00:17:31+00:00] DEBUG: Re-raising exception: Chef::Exceptions::InvalidDataBagPath - sensu_base_configbastion1.localdomain had an error: Chef::Exceptions::InvalidDataBagPath: Data bag path '/var/chef/data_bags' is invalid
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/data_bag.rb:100:in load'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/data_bag_item.rb:146:inload'
/opt/aws/opsworks/releases/20131125133823_214/site-cookbooks/sensu/libraries/sensu_helpers.rb:34:in data_bag_item'
/opt/aws/opsworks/releases/20131125133823_214/site-cookbooks/sensu/providers/base_config.rb:7:inclass_from_file'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/provider/lwrp_base.rb:138:in instance_eval'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/provider/lwrp_base.rb:138:inaction_create'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:118:in send'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:118:inrun_action'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource.rb:617:in run_action'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:50:inrun_action'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in converge'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:ineach'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in converge'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:94:inexecute_each_resource'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in call'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall_iterator_block'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in step'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:initerate'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in each_with_index'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:92:inexecute_each_resource'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:81:in converge'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:404:inconverge'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:469:in do_run'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:200:inrun'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:190:in run_chef_client'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:239:inrun_application'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in loop'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:inrun_application'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:73:in run'
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/chef-solo:25
/opt/aws/opsworks/current/bin/chef-solo:16:inload'
/opt/aws/opsworks/current/bin/chef-solo:16
  1. sensu::client_service failure:
[2014-01-01T02:23:33+00:00] DEBUG: Re-raising exception: Chef::Exceptions::ValidationFailed - sensu_service[sensu-client] (sensu::client_service line 20) had an error: Chef::Exceptions::ValidationFailed: Required argument service is missing!
/opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:113:in `_pv_required'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:69:in `send'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:69:in `validate'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:66:in `each'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:66:in `validate'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:56:in `each'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:56:in `validate'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:88:in `set_or_return'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource/lwrp_base.rb:86:in `_set_or_return_service'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource/lwrp_base.rb:80:in `service'
  /opt/aws/opsworks/releases/20131125133823_214/site-cookbooks/sensu/providers/service.rb:46:in `load_current_resource'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:97:in `run_action'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource.rb:617:in `run_action'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:50:in `run_action'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `each'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:81:in `converge'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:404:in `converge'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:469:in `do_run'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:200:in `run'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:190:in `run_chef_client'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:239:in `run_application'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `loop'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `run_application'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:73:in `run'
  /opt/aws/opsworks/releases/20131125133823_214/vendor/gems/chef-11.4.4/bin/chef-solo:25
  /opt/aws/opsworks/current/bin/chef-solo:16:in `load'
  /opt/aws/opsworks/current/bin/chef-solo:16

apt-get upgrade breaks the Sensu recipe

apt-cache policy rabbitmq-server 
rabbitmq-server:
  Installed: 3.1.5-1
  Candidate: 3.2.4-1
  Version table:
     3.2.4-1 0
        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
 *** 3.1.5-1 0
        100 /var/lib/dpkg/status

That means that upgrading my server will break my Chef recipe since it requires a specific version (3.1.5) which fails to be downgraded after 3.2.4 is installed by apt-get upgrade.

If this recipe depends on this specific rabbitmq-server package version it should also set the proper pin settings to prevent apt-get upgrade to try to upgrade the rabbitmq-server package.

These dependency constraints are dumb

Don't do this:

`depends "redisio", ">= 1.7.0"``

This will blow up when redisio releases a breaking change (e.g. version 2.0).

Do this instead:

`depends "redisio", "~> 1.7"``

Now you'll get all the non-breaking updates in the 1.x series, but you won't get bit by breaking changes, or this bug that was apparently just introduced in the 2.0 series:

SyntaxError
       -----------
       /tmp/kitchen/cookbooks/redisio/providers/PaxHeader/configure.rb:1: syntax error, unexpected tIDENTIFIER, expecting $end
       16 gid=72107521

runit setup failing for sensu-[server,api,dashboard]

In the process of converting existing sysvinit installations to runit, all my sensu-client setups were dealt with appropriately. However, sensu-api, dashboard, server proc runit setups failed.

The /opt/sensu/service links are not created for those services, and the chef run fails with the below error. If I manually create the correct symlinks, I can start the services via embedded runit successfully.

[2013-11-03T02:32:43+00:00] DEBUG: Chef::Exceptions::ValidationFailed: sensu_service[sensu-server] (sensu::server_service line 20) had an error: Chef::Exceptions::ValidationFailed: Required argument service is missing!
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:113:in `_pv_required'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:69:in `send'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:69:in `validate'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:66:in `each'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:66:in `validate'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:56:in `each'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:56:in `validate'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:88:in `set_or_return'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource/lwrp_base.rb:86:in `_set_or_return_service'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource/lwrp_base.rb:80:in `service'
/opt/aws/opsworks/releases/20131015111601_209/site-cookbooks/sensu/providers/service.rb:36:in `load_current_resource'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:97:in `run_action'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource.rb:617:in `run_action'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:50:in `run_action'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `each'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:81:in `converge'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:404:in `converge'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:469:in `do_run'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:200:in `run'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:190:in `run_chef_client'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:239:in `run_application'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `loop'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `run_application'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:73:in `run'
/opt/aws/opsworks/releases/20131015111601_209/vendor/gems/chef-11.4.4/bin/chef-solo:25
/opt/aws/opsworks/current/bin/chef-solo:16:in `load'
/opt/aws/opsworks/current/bin/chef-solo:16
[2013-11-03T02:32:43+00:00] FATAL: Chef::Exceptions::ValidationFailed: sensu_service[sensu-server] (sensu::server_service line 20) had an error: Chef::Exceptions::ValidationFailed: Required argument service is missing!

I could not knife bootstrap to real server.

I want use this cookbook on real server not Vagrant VM.
I updated cookbooks, roles, data bag (sense/ssl) to chef server and executed knife bootstrap. but I could not bootstrap sensu server.

my role is this.

% cat roles/sensuserver.rb
name "sensuserver"
description "role applied to sensu server."
run_list "recipe[monitor::master]",
  "recipe[monitor::redis]",
  "recipe[monitor::rabbitmq]",
  "recipe[chef-client::service]"

I changed master_address to sensu server's ip address.

% ${EDITOR} cookbooks/monitor/attributes/default.rb
default["monitor"]["master_address"] = xxx.xxx.xxx.xxx

executed 'knife bootstrap'

% knife bootstrap 10.200.9.223 -N sensuserver02.cpi.ad.jp -r 'role[sensuserver]' -x root -i ~/chef-repo-11/novakey01

I got these errors.

Any help ? Thanks.

10.200.9.223 Recipe Compile Error in /var/chef/cache/cookbooks/monitor/recipes/master.rb
10.200.9.223
10.200.9.223 ================================================================================
10.200.9.223
10.200.9.223
10.200.9.223
10.200.9.223
10.200.9.223 Net::HTTPServerException
10.200.9.223
10.200.9.223 ------------------------
10.200.9.223
10.200.9.223 404 "Not Found"
10.200.9.223
10.200.9.223
10.200.9.223
10.200.9.223
10.200.9.223 Cookbook Trace:
10.200.9.223
10.200.9.223 ---------------
10.200.9.223
10.200.9.223   /var/chef/cache/cookbooks/monitor/recipes/_worker.rb:50:in `from_file'
10.200.9.223
10.200.9.223   /var/chef/cache/cookbooks/monitor/recipes/master.rb:23:in `from_file'
10.200.9.223
10.200.9.223
10.200.9.223
10.200.9.223
10.200.9.223 Relevant File Content:
10.200.9.223
10.200.9.223 ----------------------
10.200.9.223
10.200.9.223 /var/chef/cache/cookbooks/monitor/recipes/_worker.rb:
10.200.9.223
10.200.9.223
10.200.9.223  43:
10.200.9.223
10.200.9.223  44:  check_definitions = case
10.200.9.223
10.200.9.223  45:  when Chef::Config[:solo]
10.200.9.223
10.200.9.223  46:    data_bag("sensu_checks").map do |item|
10.200.9.223
10.200.9.223  47:      data_bag_item("sensu_checks", item)
10.200.9.223
10.200.9.223  48:    end
10.200.9.223
10.200.9.223  49:  else
10.200.9.223
10.200.9.223  50>>   search(:sensu_checks, "*:*")
10.200.9.223
10.200.9.223  51:  end
10.200.9.223
10.200.9.223  52:
10.200.9.223
10.200.9.223  53:  check_definitions.each do |check|
10.200.9.223
10.200.9.223  54:    sensu_check check["id"] do
10.200.9.223
10.200.9.223  55:      type check["type"]
10.200.9.223
10.200.9.223  56:      command check["command"]
10.200.9.223
10.200.9.223  57:      subscribers check["subscribers"]
10.200.9.223
10.200.9.223  58:      interval check["interval"]
10.200.9.223
10.200.9.223  59:      handlers check["handlers"]

Sensu::Helpers.random_password does not meet password complexity requirements

ArgumentError

The password does not meet the password policy requirements. Check the minimum p
assword length, password complexity and password history requirements.

Resource Declaration:

In c:/chef/cache/cookbooks/sensu/recipes/_windows.rb

22: user "sensu" do
23: password Sensu::Helpers.random_password
24: end
25:
๏ฟฝ
๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ

too restrictive directory permissions

I find that setting the permissions of directories such as /etc/sensu/ and subdirectories as well as /var/log/sensu/ to 0750 to be too restrictive and impractical. The effect is that a lot of debugging ends up happening as root, which isn't good. I see reasons for keeping the contents of (some) files not readable by everyone, but hiding the existence of files doesn't seem useful. What is the reason for this? Could this be changed? Should an attribute be added to be able to override this?

RabbitMQ setup fails in Ubuntu 12.04 because of errant Apt repo

Sensu::rabbitmq sets up an apt repository which maybe works for Ubuntu 11, but the package installed for Ubuntu 12 won't startup, giving an error that a dot is missing at the end of /etc/rabbitmq/rabbitmq.config (The dot is not missing). Deleting the apt repo, running apt-get update, and installing from Ubuntu's repo makes a lot more sense, and works without error.

redis cookbook, name conflict and re-usability

I already have redis cookbook, but sensu depends on some other.
I'd really like to use your resources/providers but i can't obviously because of this dependency on redis. It introduces name conflict.
This highlights an underlying problem, that this cookbook is not really reusable, unless you use all this specific dependencies.
Splitting this cookbook in two would do the trick. Where first one contains only resources/providers, and the second installs redis/rabbitmq etc. That way i can take resources/providers from the first book in my custom application cookbook.
Currently the only alternative is to fork and remove dependencies which i don't want to.
What everybody think?

base_config recipe fails due to missing data bag item

On a fresh install (setting up on the the SSL key in the data bag, as described), the default recipe fails due to the base_config provider failing.

This is failing because the "data_bag_item" helper method doesn't rescue a Net::HTTPServerException for when the item isn't found (404)...

Most other Net::HTTPServerException classes raised should fail the chef run (unauthorized, etc), so we should investigate the reason why this exception was raised (and return nil if missing_ok and if the response .is_a? Net::HTTPNotFound)

/etc/sensu/conf.d/client.json Incorrect Group Permission Set On Bootstrap

Using the latest version of the Sensu cookbook (0.5.5). When I bootstrap a new node and apply the sensu::client_service recipe, it is creating the /etc/sensu/conf.d/client.json file but is not correctly setting the group permissions.

Instead of being like this...

-rw-r----- 1 root sensu 115 Aug  2 15:57 client.json

Its group is set to root instead...

-rw-r----- 1 root root 115 Aug  2 15:57 client.json

My bootstrap then fails.

default.rb recipe throwing SystemStackError

There's a good chance that I'm just doing something stupid, but someone else mentioned in the #chef IRC room that they were having the same problem.

When I include the sensu::default recipe from within a wrapped cookbook without ssl enabled I get the following error.

SystemStackError
----------------
stack level too deep

Cookbook Trace:
---------------
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.16.2/lib/chef/mixin/from_file.rb:31

Relevant File Content:
----------------------
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.16.2/lib/chef/mixin/from_file.rb:

24:        # Loads a given ruby file, and runs instance_eval against it in the context of the current 
25:        # object.  
26:        #
27:        # Raises an IOError if the file cannot be found, or is not readable.
28:        def from_file(filename)
29:          if File.exists?(filename) && File.readable?(filename)
30>>           self.instance_eval(IO.read(filename), filename, 1)
31:          else
32:            raise IOError, "Cannot open or read #{filename}!"
33:          end
34:        end
35:  
36:        # Loads a given ruby file, and runs class_eval against it in the context of the current 
37:        # object.
38:        #
39:        # Raises an IOError if the file cannot be found, or is not readable.

sensu::client_service failure when cookbook > 0.6.0 (opsworks)

So sometime after the cookbook rev'd past 0.6.0, I started seeing the stack trace below.

I managed to track down the problem to this commit: 720fa2e
Having reverted it, sensu::client_service runs without issue.

[2014-01-26T12:17:12+00:00] DEBUG: Re-raising exception: Chef::Exceptions::ValidationFailed - sensu_service[sensu-client] (sensu::client_service line 20) had an error: Chef::Exceptions::ValidationFailed: Required argument service is missing!
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:113:in `_pv_required'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:69:in `send'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:69:in `validate'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:66:in `each'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:66:in `validate'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:56:in `each'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:56:in `validate'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:88:in `set_or_return'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource/lwrp_base.rb:86:in `_set_or_return_service'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource/lwrp_base.rb:80:in `service'
  /opt/aws/opsworks/releases/20131222191101_216/site-cookbooks/sensu/providers/service.rb:33:in `load_current_resource'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:97:in `run_action'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource.rb:617:in `run_action'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:50:in `run_action'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `each'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:81:in `converge'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:404:in `converge'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:469:in `do_run'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:200:in `run'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:190:in `run_chef_client'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:239:in `run_application'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `loop'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `run_application'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:73:in `run'
  /opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/chef-solo:25
  /opt/aws/opsworks/current/bin/chef-solo:16:in `load'
  /opt/aws/opsworks/current/bin/chef-solo:16
[2014-01-26T12:17:12+00:00] ERROR: Running exception handlers
[2014-01-26T12:17:12+00:00] ERROR: Exception handlers complete
[2014-01-26T12:17:12+00:00] FATAL: Stacktrace dumped to /opt/aws/opsworks/releases/20131222191101_216/chef-stacktrace.out
[2014-01-26T12:17:12+00:00] DEBUG: Chef::Exceptions::ValidationFailed: sensu_service[sensu-client] (sensu::client_service line 20) had an error: Chef::Exceptions::ValidationFailed: Required argument service is missing!
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:113:in `_pv_required'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:69:in `send'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:69:in `validate'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:66:in `each'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:66:in `validate'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:56:in `each'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:56:in `validate'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/params_validate.rb:88:in `set_or_return'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource/lwrp_base.rb:86:in `_set_or_return_service'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource/lwrp_base.rb:80:in `service'
/opt/aws/opsworks/releases/20131222191101_216/site-cookbooks/sensu/providers/service.rb:33:in `load_current_resource'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:97:in `run_action'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource.rb:617:in `run_action'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:50:in `run_action'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `each'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:81:in `converge'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:404:in `converge'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:469:in `do_run'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:200:in `run'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:190:in `run_chef_client'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:239:in `run_application'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `loop'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `run_application'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:73:in `run'
/opt/aws/opsworks/releases/20131222191101_216/vendor/gems/chef-11.4.4/bin/chef-solo:25
/opt/aws/opsworks/current/bin/chef-solo:16:in `load'
/opt/aws/opsworks/current/bin/chef-solo:16
[2014-01-26T12:17:12+00:00] FATAL: Chef::Exceptions::ValidationFailed: sensu_service[sensu-client] (sensu::client_service line 20) had an error: Chef::Exceptions::ValidationFailed: Required argument service is missing!
pid 25125 exited with status 256, exit code: 1 (time=11 sec)
[2014-01-26 12:17:12] ERROR [opsworks-agent (25122)] Chef run failed with exitcode 1

Sensu 0.13 Handler Change

I'm not sure, but I think the sensu_handler resource needs a change for the new 0.13 version of sensu. I have this handler...

sensu_handler 'graphite' do
  type 'transport'
  exchange(type: 'topic', name: 'metrics', durable: 'true')
  mutator 'only_check_output'
end

Which creates this json file in /etc/sensu/conf.d/handlers/graphite.json

{
  "handlers": {
    "graphite": {
      "type": "transport",
      "exchange": {
        "type": "topic",
        "name": "metrics",
        "durable": "true"
      },
      "mutator": "only_check_output"
    }
  }
}

Sensu server fails to start however because of this error...

{"timestamp":"2014-08-06T08:47:26.466889-0500","level":"fatal","message":"handler transport pipe must be a hash","object":{"type":"transport","exchange":{"type":"topic","name":"metrics","durable":"true"},"mutator":"only_check_output","name":"graphite"}}

I went and looked at the Sensu 0.13 Docs for handlers and I think instead of "exchange", it needs to be "pipe"....maybe? When I change it by hand in the json file (from exchange to pipe) then the Sensu server process will start. However, the sensu_handler resource doesn't accept pipe as an attribute like this...

sensu_handler 'graphite' do
  type 'transport'
  pipe(type: 'topic', name: 'metrics', durable: 'true')
  mutator 'only_check_output'
end

....and I don't know if exchange still needs to be accepted as an attribute either.

I don't know if this is the problem or not, that's why I haven't changed this myself and sent a pull request. But it doesn't currently work the way the new handler in Sensu 0.13 is supposed to.

Thanks,
Matt

SSL directory needs explicit permissions

I am getting indeterminate results of the permissions on /etc/sensu/ssl. The directory resource needs to have explicit permissions set in recipes/default.rb.

directory File.join(node.sensu.directory, "ssl") do
owner "root"
group "sensu"
recursive true
mode 0750
end

Error during sensu-server restart on Debian Squeeze / Ubuntu 12.04

Hey guys,

this has a problem on my Debian Squeeze and Ubuntu 12.04 vagrant boxes (and, I'm guessing, on other systems using init).

It shows itself as:

[2012-08-12T22:13:25+02:00] INFO: Processing sensu_config[sensu-server] action updated (sensu::default line 104)
[2012-08-12T22:13:25+02:00] INFO: sensu_config[sensu-server] sending restart action to service[sensu-server] (delayed)
[2012-08-12T22:13:25+02:00] INFO: Processing service[sensu-server] action restart (sensu::server line 26)
[2012-08-12T22:13:36+02:00] ERROR: service[sensu-server] (sensu::server line 26) has had an error
[2012-08-12T22:13:36+02:00] ERROR: Running exception handlers
[2012-08-12T22:13:57+02:00] ERROR: Report handler Chef::Handler::ErrorReport raised #<RegexpError: Stack overflow in regexp matcher: /\A\s*(?:\[.*\]|\{.*\})\s*\Z/m>
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/json-1.6.1/lib/json/common.rb:278:in `match'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/json-1.6.1/lib/json/common.rb:278:in `generate'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/json-1.6.1/lib/json/common.rb:278:in `pretty_generate'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/json_compat.rb:49:in `to_json_pretty'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/handler/error_report.rb:27:in `report'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/handler.rb:218:in `run_report_unsafe'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/handler.rb:206:in `run_report_safely'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/handler.rb:112:in `run_exception_handlers'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/handler.rb:111:in `each'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/handler.rb:111:in `run_exception_handlers'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/handler.rb:119
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/client.rb:111:in `call'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/client.rb:111:in `run_failed'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/client.rb:110:in `each'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/client.rb:110:in `run_failed'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/client.rb:173:in `run'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/application/client.rb:254:in `run_application'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/application/client.rb:241:in `loop'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/application/client.rb:241:in `run_application'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/../lib/chef/application.rb:70:in `run'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/gems/chef-10.12.0/bin/chef-client:26
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/bin/chef-client:19:in `load'
[2012-08-12T22:13:57+02:00] ERROR: /var/lib/gems/1.8/bin/chef-client:19
[2012-08-12T22:13:57+02:00] ERROR: Exception handlers complete
[2012-08-12T22:13:57+02:00] FATAL: Stacktrace dumped to /var/cache/chef/chef-stacktrace.out
[2012-08-12T22:13:57+02:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: service[sensu-server] (sensu::server line 26) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /etc/init.d/sensu-server restart ----
STDOUT: Stopping sensu-server:.
Timed out waiting for sensu-server to stop ... failed!
STDERR:
---- End output of /etc/init.d/sensu-server restart ----
Ran /etc/init.d/sensu-server restart returned 1

I don't know what the RegExp thing is all about.

I thought this error happened because the sensu-server isn't running when restart is called, but when I ssh into the vm, the process is running and everything works as expected.
All further runs of chef complete without any trouble at all.

Please let me know if you need any further data, seems I can reproduce this at will.

P.S.: Using the example Vagrantfile supplied with this cookbook, I do no get this error.

redis install fails

ran vagrant up:

....
[2014-02-07T21:37:50+00:00] INFO: Installing Redis 2.6.14 from source
[2014-02-07T21:37:50+00:00] INFO: Downloading redis tarball from https://redis.googlecode.com/files/r
edis-2.6.14.tar.gz

================================================================================
Error executing action `run` on resource 'redisio_install[redis-servers]'
================================================================================


ArgumentError
-------------
You must supply a name when declaring a file resource

....

Method assert_enclosing_directory_exists! has been removed from Chef 10.14.0

As the title says, the assert_enclosing_directory_exists! method was removed from Chef in 10.14.0 so chef runs on the newer version throw a cookbook error from this line:

https://github.com/sensu/sensu-chef/blob/master/libraries/json_file.rb#L24

This originated from the recognizer cookbook, but its using the sensu-chef cookbook library.

Stack trace of the error (with private info removed)

[2012-09-08T22:42:20+00:00] INFO: Processing json_file[/etc/recognizer/config.json] action create (/var/cache/chef/cookbooks/recognizer/providers/config.rb line 32)

================================================================================
Error executing action `create` on resource 'json_file[/etc/recognizer/config.json]'
================================================================================

NameError
---------
Cannot find a resource for assert_enclosing_directory_exists! on ubuntu version 12.04

Cookbook Trace:
---------------
/var/cache/chef/cookbooks/sensu/libraries/json_file.rb:24:in `action_create'

Resource Declaration:
---------------------
# In /var/cache/chef/cookbooks/recognizer/providers/config.rb

 31:   config_resource = @new_resource
 32:   json_file ::File.join(node.recognizer.directory, "config.json") do
 33:     content config
 34:     mode 0644
 35:     notifies :updated, config_resource
 36:   end
 37: end

Compiled Resource:
------------------
# Declared in /var/cache/chef/cookbooks/recognizer/providers/config.rb:32:in `block in class_from_file'

json_file("/etc/recognizer/config.json") do
  provider Chef::Provider::JsonFile
  action "create"
  retries 0
  retry_delay 2
  path "/etc/recognizer/config.json"
  backup 5
  cookbook_name "recognizer"
  content {"librato"=>{"email"=>"********", "api_key"=>"**************", "flush_interval"=>60, "metric_source"=>"recognizer"}, "tcp"=>{"port"=>2003, "threads"=>20}, "amqp"=>{"ssl"=>false, "exchange"=>{"name"=>"metrics", "type"=>"topic"}, "pass"=>"password", "user"=>"sensu", "vhost"=>"/sensu"}}
  mode 420
end

[2012-09-08T22:42:20+00:00] ERROR: Running exception handlers
[2012-09-08T22:42:20+00:00] FATAL: Saving node information to /var/cache/chef/failed-run-data.json
[2012-09-08T22:42:20+00:00] ERROR: Exception handlers complete
[2012-09-08T22:42:20+00:00] FATAL: Stacktrace dumped to /var/cache/chef/chef-stacktrace.out
[2012-09-08T22:42:20+00:00] FATAL: NameError: json_file[/etc/recognizer/config.json] (/var/cache/chef/cookbooks/recognizer/providers/config.rb line 32) had an error: NameError: Cannot find a resource for assert_enclosing_directory_exists! on ubuntu version 12.04

Idempotency seems broken for second run

When running a recipe like below on a centos64 box, the first run results in /etc/sensu/conf.d with sensu:sensu ownership. The second run changes that ownership to root:sensu. Then subsequent runs are idempotent leaving root:sensu ownership alone.

Sample recipe:


include_recipe "sensu::default"

sensu_client node.name do
address "127.0.0.1"
subscriptions ["all"]
end


The generated config.json has string values for 'port's

eg,

...
  "redis": {
    "host": "localhost",
    "port": "6379"
  },
...

This causes (at least) client-api to fail to start.

The cause, as best I can tell, is in base_config.rb. When we pass 'node.sensu' to 'Sensu::Helpers.select_attributes' the port values are already of type string.

(pull request coming, but the solution is a bit of hack)

Yum 3.0.0

When yum 3.0.0 came out, my chef runs started failing in the _linux recipe when the sensu package is installed. It is complaining that the rpm is unsigned. This seems to be because the yum repos are now defaulting to gpgcheck=1. By pegging yum to 2.4.4, this issue goes away.

Uses rabbitmq group before user/group is created

Commit 85b7574 sets the group for the rabbitmq ssl directory to rabbitmq. This seems fine, however, the group doesn't necessarily exist until after rabbitmq is actually installed causing chef to throw an exception for failing to find the gid for rabbitmq.

Is there a reason for not putting 'include_recipe "rabbitmq"' to the top of the rabbitmq recipe? That seems to have resolved it for me so far.

redis install not working perfectly

Took it to investigate after confirming that it happens to another user.
Scenario is installing sensu via @portertech/monitor, all on one machine.

If you notice, the Redis install during that run uses the default configuration of the system package instead of the cookbook. I think it was hard to notice because if you leave the master_address as-is (localhost) then every component can find the other, since Redis default config binds on local.

The way out of it is by opting in the source install

force_override["redis"]["install_type"] = "source"

Which sets off a chain reaction through monitor -> sensu-chef -> miah/redis which ends up in a source install and the right config.

The package issue is upstream here https://github.com/miah/chef-redis/issues/29

I think the override here forces me to use force_override (no pun intended)
4f2cbed

Tag for 0.3.x?

Hi @portertech! (hope you're getting used to the new seat ;-)

Up till now I've used a forked version of this cookbook, based on an older version.
I'd like to make the upgrade & standardize, for using the extension stuff, seeing what's needed for Suse repos and more...
Alas, there's no official 0.3.0 tag - I prefer to work with an "official" tag so I later know exactly what I used.

I'd like to ask if you plan to release a 0.3.1 for 0.9.10 soon, so I can work on the latest stuff (incl. settings passed to extension classes). If not, then at least a 0.3.0 tag pretty please ;-)

Hopefully with the new cookbook the amount of forking needed would be minimal, then we can see what can be contributed/made configurable.

Cheers,
Elad

Run fails when setting rabbitmq permissions for sensu

I'm including the following recipes in a Chef run of a new monitoring server:

recipe[sensu::default]
recipe[sensu::rabbitmq]
recipe[sensu::redis]
recipe[sensu::server_service]
recipe[sensu::api_service]
recipe[sensu::dashboard_service]

When sensu tries to create the rabbitmq permissions, it errors because the command is invalid. Trying to run it manually also fails.

I've fixed this by changing line 66 of rabbitmq.rb
from
permissions "\".*\" \".*\" \".*\""
to
permissions '\".*\" \".*\" \".*\"'

I'd be happy to fix this and submit a pull request, but I wanted to see if the cause was something else, and/or if there is a better suggested fix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.