0
[user@host ~]$ sudo sensu-install -p ansible
[SENSU-INSTALL] installing Sensu plugins ...
[SENSU-INSTALL] determining if Sensu plugin gem 'sensu-plugins-ansible' is already installed ...
false
[SENSU-INSTALL] Sensu plugin gems to be installed: ["sensu-plugins-ansible"]
[SENSU-INSTALL] installing Sensu plugin gem 'sensu-plugins-ansible'
Fetching: sensu-plugins-ansible-0.0.4.gem (100%)
You can use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu
Successfully installed sensu-plugins-ansible-0.0.4
1 gem installed
[SENSU-INSTALL] successfully installed Sensu plugins: ["ansible"]

The ansible plugin does not seem to be installed in the plugins directory.

[user@host ~]$ ls /etc/sensu/plugins
check-apache.rb

Attempts to solve the issue

Attempt one

[user@host ~]$ sudo -u sensu sensu-install -p ssl
[SENSU-INSTALL] installing Sensu plugins ...
[SENSU-INSTALL] determining if Sensu plugin gem 'sensu-plugins-ssl' is already installed ...
false
[SENSU-INSTALL] Sensu plugin gems to be installed: ["sensu-plugins-ssl"]
[SENSU-INSTALL] installing Sensu plugin gem 'sensu-plugins-ssl'
Fetching: unf_ext-0.0.7.2.gem (100%)
ERROR:  While executing gem ... (Errno::ENOENT)
    No such file or directory @ rb_sysopen - /opt/sensu/.gem/ruby/2.3.0/cache/unf_ext-0.0.7.2.gem
[SENSU-INSTALL] failed to install Sensu plugin gem 'sensu-plugins-ssl'
[SENSU-INSTALL] you can run the sensu-install command again with --verbose for more info
[SENSU-INSTALL] please take note of any failure messages above
[SENSU-INSTALL] make sure you have build tools installed (e.g. gcc)
[SENSU-INSTALL] trying to determine the Sensu plugin homepage for sensu-plugins-ssl ...
homepage: https://github.com/sensu-plugins/sensu-plugins-ssl

Attempt two

Following the advice, i.e. you can run the sensu-install command again with --verbose for more info from the previous attempt resulted in:

[user@host ~]$ sudo sensu-install -p http --verbose
[SENSU-INSTALL] installing Sensu plugins ...
[SENSU-INSTALL] provided Sensu plugins: ["http"]
[SENSU-INSTALL] compiled Sensu plugin gems: ["sensu-plugins-http"]
[SENSU-INSTALL] determining if Sensu plugin gem 'sensu-plugins-http' is already installed ...
[SENSU-INSTALL] gem list -i sensu-plugins-http
false
[SENSU-INSTALL] Sensu plugin gem 'sensu-plugins-http' has not been installed
[SENSU-INSTALL] Sensu plugin gems to be installed: ["sensu-plugins-http"]
[SENSU-INSTALL] installing Sensu plugin gem 'sensu-plugins-http'
[SENSU-INSTALL] gem install sensu-plugins-http --no-ri --no-rdoc --verbose
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
...
/opt/sensu/embedded/bin/metrics-http-json-deep.rb
/opt/sensu/embedded/bin/check-http-json.rb
/opt/sensu/embedded/bin/metrics-curl.rb
/opt/sensu/embedded/bin/check-last-modified.rb
/opt/sensu/embedded/bin/check-https-cert.rb
/opt/sensu/embedded/bin/check-http-cors.rb
/opt/sensu/embedded/bin/check-head-redirect.rb
/opt/sensu/embedded/bin/metrics-http-json.rb
/opt/sensu/embedded/bin/check-http.rb
You can use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu
Successfully installed sensu-plugins-http-1.0.0
13 gems installed
[SENSU-INSTALL] successfully installed Sensu plugins: ["http"]

Plugins are installed and the checks are executable:

[user@host ~]$ /opt/sensu/embedded/bin/check-http.rb
CheckHttp UNKNOWN: No URL specified

1 Answer 1

0

Concise

Yes, it makes sense to use sensu-install, because:

  1. No git clone and copy statements required to deploy the checks in the /etc/sensu/plugins
  2. The sensu-install command modifies the path so that the plugins can be found by sensu

Verbose

Although the sensu-install command installs the checks in a different directory than /etc/sensu/plugins it is not required in order to run plugins. As the Sensu Plugin documentation indicates:

NOTE: By default, the Sensu installer packages will modify the system $PATH for the Sensu processes to include /etc/sensu/plugins. As a result, executable scripts (e.g. plugins) located in /etc/sensu/plugins will be valid commands. This allows command attributes to use “relative paths” for Sensu plugin commands;

e.g.: "command": "check-http.rb -u https://sensuapp.org"

the sensu-install command modifies the $PATH so that the check could be found by Sensu by defining the check, e.g. check-http.rb instead of the full path, e.g. /opt/sensu/embedded/bin/check-http.rb

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .