saltstack-formulas / sensu-formula

Salt Stack formula to manage Sensu.
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
23 stars 78 forks source link

Any reason to not use `sensu-install` to install plugins? #45

Open snadorp opened 7 years ago

snadorp commented 7 years ago

We are currently looking into a reliable way of installing plugins on the clients. Currently we are using

sensu:
  client:
    embedded_ruby: true
    install_gems:
      - sensu-plugins-http

This seems to be unreliable in a the way that the build of native extensions seem to break.

We are working around the issue by adding this line to the hosts salt (and removing the installation of the gem in the pillar above):

install_sensu_plugins:
  cmd.run:
    - name: sensu-install -p http

This seems to work fine for us, would be great to have an option to specify the plugins in the pillar which would be installed the sensu-install way.

powellchristoph commented 7 years ago

@snadorp Sounds like a good idea. PR's are welcome.

snadorp commented 7 years ago

Don't think I'll find time to implement this in a proper PR way in near future, so if someone likes to grab it, please do. The reason installation of gems might fail is, that native dependencies might be missing. We solved this in the end by doing this:

install_sensu_http_plugin_deps:
  pkg.installed:
    - pkgs:
      - g++

install_sensu_http_check_plugin:
  cmd.run:
    - name: sensu-install -p http
    - require:
      - pkg: install_sensu_http_plugin_deps