I have installed sudo gem install net-ping
on 3 machines, same setup. But one server just refuses to accept that net-ping
is installed. What am I missing ?
I am trying to configure sensu that uses check-ping.rb
Here is what sensu reports
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
You can use "gem environment" to find out the installation path for your 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
In this case is /opt/sensu/embedded/lib/ruby/gems/2.0.0. Then you can search in there if you have "net-ping", and verify the permissions.
# 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
Don't forget to use the binaries inside "/opt/sensu/embedded/bin/".