sensu / sensu-chef

Sensu Chef cookbook.
https://supermarket.chef.io/cookbooks/sensu
Apache License 2.0
221 stars 280 forks source link

Use sensu-install #404

Closed runningman84 closed 6 years ago

runningman84 commented 8 years ago

https://sensuapp.org/docs/0.21/plugins It might make sense to provide a lwrp for sensu-install which would collect all needed plugins and calls the sensu-install script only once with all plugins. I hope that such approach would reduce download times.

majormoses commented 8 years ago

link is now a 404 here is an updated link: https://sensuapp.org/docs/0.25/reference/plugins.html#use-sensu-install-to-install-sensu-plugins

sekrett commented 7 years ago

There is one called sensu_plugin, but it is not documented. I wonder why it cannot do a simple sensu-install -p, instead it is trying to find a local cookbook file.

majormoses commented 7 years ago

You can also use sensu_gem like this:

default['cc']['sensu']['plugins'] = {
  ## pretty much all checks rely on this
  'sensu-plugin' => '2.1.0',
  ## check consul
  'sensu-plugins-consul' => '1.4.1',
  ## check cpu
  'sensu-plugins-cpu-checks' => '1.1.2',
  ## check disks
  'sensu-plugins-disk-checks' => '2.4.0',
  ## check disks
  'sensu-plugins-http' => '2.6.0',
  ## check elasticsearch
  'sensu-plugins-elasticsearch' => '1.5.1',
  ## check load
  'sensu-plugins-load-checks' => '3.0.0',
  ## check memory
  'sensu-plugins-memory-checks' => '3.0.2',
  ## check network
  'sensu-plugins-network-checks' => '2.0.1',
  ## check processes
  'sensu-plugins-process-checks' => '2.4.0',
  ## check rabbitmq
  'sensu-plugins-rabbitmq' => '3.2.0',
  ## check redis
  'sensu-plugins-redis' => '2.0.0',
  ## check chef
  'sensu-plugins-chef' => '3.0.2',
  'hashie' => '3.5.6',
  ## check nginx
  'sensu-plugins-nginx' => '2.2.0',
  ## check executables
  'mimemagic' => '0.3.2'
}

node['cc']['sensu']['plugins'].each do |plugin, version|
  sensu_gem plugin do
    version version
  end
end

I can probably add some documentation on how to use this. As in 2.x it is unclear how the asset pipeline will work for ruby I am hesitant to invest in using sensu-install (which will likely be replaced with some sub command of sensuctl) when it essentially does the same thing that sensu_gem already does (installs plugin into embedded ruby). Also I would argue that it's better than sensu-install since it can be used to install any arbitrary gem.

majormoses commented 7 years ago

@sekrett I have created a PR to show an example of managing sensu-plugins using sensu_gem the way I do (and recommend) it.

sekrett commented 7 years ago

Thanks, sensu_gem is exactly what I was looking for.

majormoses commented 6 years ago

I am hesitant to support switching to sensu-install as this is just a fancy wrapper around existing functionality. I spent a bunch of time troubleshooting issues and the result was this report https://github.com/sensu/sensu-puppet/issues/876 which basically means that sensu-install does not account for multiple rubies installed properly while the battle tested solutions continue to work.

majormoses commented 6 years ago

In light of this and the fact that the way that sensu 2 will install plugins very differently I can't see myself investing the time to use this. For the sake of keeping the issues on this repo fresh I am gonna close this out.