Sensu server failing to check checks on sensu client for MONGODB


#1

Hi,

I had sensu server and client running on different machines and are properly communicating as I had few checks are working .

When I installed mongodb plugin fron github (https://github.com/sensu-plugins/sensu-plugins-mongodb) and I can execute ruby script manually from client .But from sensu server is not executing the script and throwing the below error:

{“timestamp”:“2015-12-07T06:25:56.325382+0000”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“internal._dev0.sensuclient.2”,“check”:{“name”:“Mongodb_Metrics”,“issued”:1449469525,“command”:"/usr/bin/env /etc/sensu/plugins/metrics-mongodb.rb",“executed”:1449469555,“duration”:0.571,“output”:"/opt/sensu/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- mongo (LoadError)\n\tfrom /opt/sensu/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:inrequire’\n\tfrom /etc/sensu/plugins/metrics-mongodb.rb:33:in `’\nSensu::Plugin::CLI: [“Not implemented! You should override Sensu::Plugin::CLI#run.”]\n",“status”:3}}}

I tried all the possibilities but could not resolve it,Please help me out

Thanks in advance


#2

"/opt/sensu/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in
`require': cannot load such file -- mongo (LoadError)
Sounds like you need to install the mongo rubygem:"

This is a dependency of this gem:

I recommend plugins using /opt/sensu/embedded/gem install sensu-plugins-mongodb
to ensure that gem installs a plugin with all its dependencies if
using the embedded ruby like that.

···

On Sun, Dec 6, 2015 at 10:54 PM, kumar kittu <dvrkittu@gmail.com> wrote:

Hi,

I had sensu server and client running on different machines and are properly
communicating as I had few checks are working .

When I installed mongodb plugin fron github
(https://github.com/sensu-plugins/sensu-plugins-mongodb) and I can execute
ruby script manually from client .But from sensu server is not executing
the script and throwing the below error:

{"timestamp":"2015-12-07T06:25:56.325382+0000","level":"info","message":"publishing
check
result","payload":{"client":"internal._dev0.sensuclient.2","check":{"name":"Mongodb_Metrics","issued":1449469525,"command":"/usr/bin/env
/etc/sensu/plugins/metrics-mongodb.rb","executed":1449469555,"duration":0.571,"output":"/opt/sensu/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in
`require': cannot load such file -- mongo (LoadError)\n\tfrom
/opt/sensu/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in
`require'\n\tfrom /etc/sensu/plugins/metrics-mongodb.rb:33:in
`<main>'\nSensu::Plugin::CLI: [\"Not implemented! You should override
Sensu::Plugin::CLI#run.\"]\n","status":3}}}

I tried all the possibilities but could not resolve it,Please help me out

Thanks in advance


#3

Thanks Anderson

···

On Monday, December 7, 2015 at 9:31:54 PM UTC+5:30, Kyle Anderson wrote:

“/opt/sensu/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in
`require’: cannot load such file – mongo (LoadError)
Sounds like you need to install the mongo rubygem:”
https://github.com/sensu-plugins/sensu-plugins-mongodb/blob/d3bdd8c3d1b0524685404230caf85a5fd9784424/bin/metrics-mongodb.rb#L32

This is a dependency of this gem:
https://github.com/sensu-plugins/sensu-plugins-mongodb/blob/d3bdd8c3d1b0524685404230caf85a5fd9784424/sensu-plugins-mongodb.gemspec#L47

I recommend plugins using /opt/sensu/embedded/gem install sensu-plugins-mongodb
to ensure that gem installs a plugin with all its dependencies if
using the embedded ruby like that.

On Sun, Dec 6, 2015 at 10:54 PM, kumar kittu dvrk...@gmail.com wrote:

Hi,

I had sensu server and client running on different machines and are properly
communicating as I had few checks are working .

When I installed mongodb plugin fron github
(https://github.com/sensu-plugins/sensu-plugins-mongodb) and I can execute
ruby script manually from client .But from sensu server is not executing
the script and throwing the below error:

{“timestamp”:“2015-12-07T06:25:56.325382+0000”,“level”:“info”,“message”:“publishing
check
result”,“payload”:{“client”:“internal._dev0.sensuclient.2”,“check”:{“name”:“Mongodb_Metrics”,“issued”:1449469525,“command”:"/usr/bin/env
/etc/sensu/plugins/metrics-mongodb.rb",“executed”:1449469555,“duration”:0.571,“output”:"/opt/sensu/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in
require': cannot load such file -- mongo (LoadError)\n\tfrom /opt/sensu/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:inrequire’\n\tfrom /etc/sensu/plugins/metrics-mongodb.rb:33:in
`’\nSensu::Plugin::CLI: [“Not implemented! You should override
Sensu::Plugin::CLI#run.”]\n",“status”:3}}}

I tried all the possibilities but could not resolve it,Please help me out

Thanks in advance