nagios-herald icon indicating copy to clipboard operation
nagios-herald copied to clipboard

Only works with chef

Open hco opened this issue 10 years ago • 5 comments

From what I understand (and I don't understand ruby ;)) this currently kinda depends on chef, as https://github.com/etsy/nagios-herald/blob/master/lib/nagios-herald/helpers/ganglia_graph.rb#L1 includes some chef code.

This should be clarified in the documentation or changed.

Without chef being installed it results in the following:

3G icinga@icinga err: 130 ~ # /opt/nagios-herald/bin/nagios-herald  --help
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- chef/search/query (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/nagios-herald/lib/nagios-herald/helpers/ganglia_graph.rb:1:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/nagios-herald/lib/nagios-herald/helpers.rb:1:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/nagios-herald/lib/nagios-herald.rb:7:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/nagios-herald/bin/nagios-herald:3:in `<main>'

hco avatar Jun 16 '14 13:06 hco

Also, after installing chef (gem install chef), it doesnt work because of mismatched gem versions

/usr/lib/ruby/1.9.1/rubygems/specification.rb:1637:in `raise_if_conflicts': Unable to activate chef-11.12.8, because mime-types-2.3 conflicts with mime-types (~> 1.16) (Gem::LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/specification.rb:746:in `activate'
    from /usr/lib/ruby/1.9.1/rubygems.rb:212:in `rescue in try_activate'
    from /usr/lib/ruby/1.9.1/rubygems.rb:209:in `try_activate'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /home/bernard/nagios-herald/lib/nagios-herald/helpers/ganglia_graph.rb:1:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/bernard/nagios-herald/lib/nagios-herald/helpers.rb:1:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/bernard/nagios-herald/lib/nagios-herald.rb:7:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from ./nagios-herald:3:in `<main>'

bond-os avatar Jun 17 '14 07:06 bond-os

Hmm, this is a vestige of some internal bits I'd mostly culled. I can remove the Chef dependency and replace it with something more generic that others can build on. Also, if you have any code you'd like to submit that does that, I'd love to see it.

RyanFrantz avatar Jun 17 '14 20:06 RyanFrantz

I guess one can comment out 'unneeded' helpers in lib/nagios-herald/helpers.rb, right ?

kargig avatar Jun 23 '14 16:06 kargig

Per #22, I'll modify this helper to be smarter about requiring Chef support and fall back to a simpler mechanism to look up the cluster name.

RyanFrantz avatar Jul 02 '14 01:07 RyanFrantz

@RyanFrantz I ran into similar issues whereby I did not install the chef gem (that requires ruby 2.0 btw which I did not want to muck on) - one of the commit in https://github.com/etsy/nagios-herald/pull/36 fixes the import issue, but not the underlying mechanism of the ganglia_graph helper. I also have not removed the dependency in the gemspec - I am not sure yet what would be the best approach to manage that gem since it could be an optional gem based on every user situation.

nkammah avatar Oct 07 '15 02:10 nkammah