Sensu 报告“要求”:无法加载此类文件 -- net/ping

Sensu Reports `require': cannot load such file -- net/ping

我已经在 3 台机器上安装了 sudo gem install net-ping,设置相同。但是一台服务器拒绝接受 net-ping 安装。我错过了什么?

我正在尝试配置使用 check-ping.rb

的 sensu

这是 sensu 的报道

commandcheck-ping.rb -h <IPAddress> -C 0
duration0.109
executed2016-10-10 15:15:28
interval20
issued2016-10-10 15:15:28
namecheck_ping_to_web_admin
output/opt/sensu/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- net/ping (LoadError) from /opt/sensu/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /etc/sensu/plugins/check-ping.rb:30:in `<main>' 
standalonetrue
status3
subscriberstest
typestandard
history3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3

您可以使用 "gem environment" 找出您的 gems 的安装路径:

# /opt/sensu/embedded/bin/gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.14
  - RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645) [x86_64-linux]
  - INSTALLATION DIRECTORY: /opt/sensu/embedded/lib/ruby/gems/2.0.0
  - RUBY EXECUTABLE: /opt/sensu/embedded/bin/ruby
  - EXECUTABLE DIRECTORY: /opt/sensu/embedded/bin

在本例中是 /opt/sensu/embedded/lib/ruby/gems/2.0.0。 如果你有"net-ping",然后你可以在那里搜索,并验证权限。

# ls -1 /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/ | head -3
amqp-1.5.0
amq-protocol-1.9.2
amq-protocol-2.0.1

不要忘记使用“/opt/sensu/embedded/bin/”中的二进制文件。