我在3台机器上安装了sudo gem install net-ping
,设置相同。但是一台服务器只是拒绝接受安装了net-ping
。我错过了什么?
我正在尝试配置使用check-ping.rb
以下是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
答案 0 :(得分:2)
您可以使用“gem environment”找出宝石的安装路径:
# /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 /".
中的二进制文件