sensu-plugins / sensu-plugins-graphite

This plugin provides native Graphite instrumentation for monitoring, including: replication status, various Graphite data queries, mutators, and handlers
http://sensu-plugins.io
MIT License
22 stars 45 forks source link

Wrong version of JSON loaded. #61

Closed madelaney closed 6 years ago

madelaney commented 6 years ago

When I try to run the command mutator-graphite.rb, I get the following error:

/opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:2278:in `check_version_conflict': can't activate json-1.8.6, already activated json-2.0.2 (Gem::LoadError)
    from /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:1404:in `activate'
    from /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:89:in `block in require'
    from /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:88:in `each'
    from /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:88:in `require'
    from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-graphite-2.3.0/bin/mutator-graphite.rb:35:in `<top (required)>'
    from /opt/sensu/embedded/bin/mutator-graphite.rb:22:in `load'
    from /opt/sensu/embedded/bin/mutator-graphite.rb:22:in `<main>'
Exit 1

I've attached the output of gem env and gem list for completeness. sensu-gem-env.txt sensu-gem-list.txt

majormoses commented 6 years ago

@madelaney thanks for reporting this, any chance you have the time to create a PR to fix this? I solved this in another plugin that you can pretty much likely just copy/paste: https://github.com/sensu-plugins/sensu-plugins-docker/pull/57

madelaney commented 6 years ago

@majormoses Happy to help.

I'll work on the fix. Did you want me to port over the README / CHANGELOG changes as well, or just the gemspec change?

majormoses commented 6 years ago

Yes, we require CHANGELOG updates on the PR under ## [Unreleased] and post merge we version it appropriately before it is released. Also we require a testing artifact if you need help with that the easiest thing to test a mutator is to write out an sample event payload and then just cat the file and pipe it to the mutator like this: cat sample_event.json | my_mutator.rb and show the output.

majormoses commented 6 years ago

closed via #62