[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"]
ansible 插件似乎没有安装在 plugins 目录中。
[user@host ~]$ ls /etc/sensu/plugins
check-apache.rb
尝试解决问题
尝试一
[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
尝试二
遵循建议,即you can run the sensu-install command again with --verbose for more info
先前的尝试导致:
[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"]
插件已安装并且检查是可执行的:
[user@host ~]$ /opt/sensu/embedded/bin/check-http.rb
CheckHttp UNKNOWN: No URL specified
简洁的
是的,使用 是有意义的
sensu-install
,因为:/etc/sensu/plugins
sensu-install
命令修改路径,以便 sensu 可以找到插件详细
尽管该命令将检查安装在与运行插件不需要的
sensu-install
目录不同的目录中。/etc/sensu/plugins
正如Sensu 插件文档所示:该
sensu-install
命令修改了,$PATH
以便 Sensu 可以通过定义检查来找到检查,例如,check-http.rb
而不是完整路径,例如/opt/sensu/embedded/bin/check-http.rb