1

I'm trying to find a good plugin to alert chef clients in my environment that have not checked into the Chef server, even if the clients are not in the pem file.

I found this, https://github.com/sensu-plugins/sensu-plugins-chef/blob/master/bin/check-chef-nodes.rb

I'm getting this error and I'm not sure if its something I'm missing (I've installed the required gems, I believe) or if its a bug.

Check failed to run: uninitialized constant Chef::REST
/etc/sensu/plugins/check-chef-nodes.rb:99:in `chef_api_connection'
/etc/sensu/plugins/check-chef-nodes.rb:69:in `connection'
/etc/sensu/plugins/check-chef-nodes.rb:73:in `nodes_last_seen'
/etc/sensu/plugins/check-chef-nodes.rb:103:in `any_node_stuck?'
/etc/sensu/plugins/check-chef-nodes.rb:86:in `run'
/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.2/lib/sensu-plugin/cli.rb:58:in `block in <class:CLI>'

Let me know your thoughts.. maybe there is a different way to do this.

Draco Ater
  • 20,820
  • 8
  • 62
  • 86
Devon
  • 307
  • 3
  • 13

1 Answers1

0

Sensu uses embedded ruby and thus gems too. To install gems in a way, that Sensu sees them you should do it through:

/opt/sensu/embedded/bin/gem install <gem_name>
Draco Ater
  • 20,820
  • 8
  • 62
  • 86
  • I added the gems and still have the same error.. I tried changing the cli.rb to executable.. still the same issue. – Devon Jan 26 '17 at 01:30