Open talonx opened 7 years ago
Sensu > 0.29 is not yet officially supported by the plugins yet due to incompatibilities, if you are looking for something safe and stable I would go 0.28 until we have have completed all the work to get all of these working with ruby 2.4. You can read more about this here: https://blog.sensuapp.org/community-maintenance-mode-d109e75bcbc4
Did you try executing the commands it gave you?
Ignoring ffi-1.9.18 because its extensions are not built. Try: gem pristine ffi --version 1.9.18
Ignoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6
Ignoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6
Ignoring json-1.8.6 because its extensions are not built. Try: gem pristine json --version 1.8.6
If I had to guess I would say that is it due to conflicting gem requirements on sensu-plugins
2.x which is included with sensu 1.x while this plugin still requires https://github.com/sensu-plugins/sensu-plugins-disk-checks/blob/2.3.0/sensu-plugins-disk-checks.gemspec#L34 leading to this situation. Almost all the of gems have at this point gone through install time testing (a few that unfortunately we don't have a viable upgrade path for yet). We will be starting with runtime testing shortly and will be making 2.x a requirement.
@talonx sorry getting back around to look at some of these issues.
check-disk plugin installed using "sudo gem install sensu-plugins-disk-checks"
If you are not giving the path to the embedded ruby gem such as sudo /opt/sensu/embedded/bin/gem install sensu-plugins-disk-checks
it will install it in the system wide ruby you installed which is 2.3.1.
Can you please confirm whether sensu is intending to use it's embedded gems by running this? grep EMBEDDED_RUBY /etc/default/sensu
and pasting the output.
Assuming that you are intending to use embedded gems and install it into the same embedded ruby I think you will likely run into the same issue and what we need to do is to bump the dependency on json
and sensu-plugin
gems most likely. Let me know as I was unable to quickly replicate here.
Testing with ruby 2.2.5:
$ ruby --version
ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-linux]
$ bundle exec ./bin/check-disk-usage.rb
CheckDisk OK: All disk usage under 85% and inode usage under 85%
Testing with ruby 2.4.1:
$ rbenv local 2.4.1
$ ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
$ bundle
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/.
Using rake 10.5.0
Using json 1.8.6
Using mixlib-cli 1.7.0
Using ffi 1.9.18
Using docile 1.1.5
Fetching simplecov-html 0.10.2
Installing simplecov-html 0.10.2
Using github-markup 1.6.1
Using coderay 1.1.1
Using method_source 0.8.2
Using slop 3.6.0
Using redcarpet 3.4.0
Using rspec-support 3.6.0
Using diff-lcs 1.3
Using ast 2.3.0
Using powerpack 0.1.1
Using ruby-progressbar 1.8.1
Using unicode-display_width 1.3.0
Using yard 0.9.9
Using bundler 1.15.1
Using rainbow 2.2.2
Using sensu-plugin 1.4.5
Using sys-filesystem 1.1.7
Fetching simplecov 0.15.0
Installing simplecov 0.15.0
Using pry 0.10.4
Using rspec-core 3.6.0
Using rspec-expectations 3.6.0
Using rspec-mocks 3.6.0
Using parser 2.4.0.0
Using sensu-plugins-disk-checks 2.5.0 from source at `.`
Using codeclimate-test-reporter 0.6.0
Using rspec 3.6.0
Using rubocop 0.40.0
Bundle complete! 10 Gemfile dependencies, 32 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
The latest bundler is 1.15.4, but you are currently running 1.15.1.
To update, run `gem install bundler`
$ bundle exec ./bin/check-disk-usage.rb
CheckDisk OK: All disk usage under 85% and inode usage under 85%
I can put together a PR and have you test bumping the version of sensu-plugins
and see if that solves your issue.
OS: Ubuntu 16.04.2 LTS
Ruby : ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu] - installed via apt-get, so this is the default for this Ubuntu version
Sensu : Installed via sensu_1.0.0-1_amd64.deb
check-disk plugin installed using "sudo gem install sensu-plugins-disk-checks"
When this plugin is invoked by Sensu, the following error comes in the output