sensu-plugins / sensu-plugins-jenkins

This plugin provides native Jenkins instrumentation for monitoring and metrics collection, including: health, job status, metrics via `JQS`, and others.
http://sensu-plugins.io
MIT License
9 stars 18 forks source link

Update to latest sensu-plugins version (2.5) #37

Closed CoRfr closed 5 years ago

CoRfr commented 6 years ago

Some other plugins are starting to use newer versions of sensu-plugin, which is resulting in the following error because this plugin also ends up using 2.5:

Check failed to run: undefined method parse' for Sensu::Plugin::Metric::CLI::JSON:Class, ["/usr/local/bundle/bin/metrics-jenkins.rb:117:inrun'", "/usr/local/bundle/gems/sensu-plugin-2.5.0/lib/sensu-plugin/cli.rb:57:in `block in '"]

Pull Request Checklist

Is this in reference to an existing issue?

General

New Plugins

Purpose

Known Compatibility Issues

CoRfr commented 6 years ago

Tests with upgraded version:

$ bundle exec bin/metrics-jenkins.rb -S 10.107.129.7 -s test
test.gauges.jenkins.executor.count.value.value 92 1527519680
test.gauges.jenkins.executor.free.value.value 29 1527519680
test.gauges.jenkins.executor.in-use.value.value 63 1527519680
test.gauges.jenkins.health-check.count.value 4 1527519680
test.gauges.jenkins.health-check.inverse-score.value 0.25 1527519680
test.gauges.jenkins.health-check.score.value 0.75 1527519680
test.gauges.jenkins.job.averageDepth.value 1.0 1527519680
...

$ bundle exec bin/check-jenkins-build-time.rb -u http://10.107.129.7:8080/ -j Farm-Scale=10m
JenkinsBuildTime CRITICAL: 1 failure(s): Farm-Scale: last built at 2018-05-28 07:43:51 -0700 (7 mins 58 secs), not within allowed time: 10m
$ bundle exec bin/check-jenkins-build-time.rb -u http://10.107.129.7:8080/ -j Farm-Scale=60m
JenkinsBuildTime OK: 1 job(s) had successful builds within allowed times

$ bundle exec bin/check-jenkins-health.rb -s 10.107.129.7 -p 8080
JenkinsMetricsHealthChecker CRITICAL: Jenkins health check 'plugins' reported unhealthy state. Message: There are 4 failed plugins: job-dsl.hpi; leastload; docker-plugin; Exclusion

$ bundle exec bin/check-jenkins.rb -s 10.107.129.7 -p 8080                           
JenkinsMetricsPingPongChecker OK: Jenkins Service is up

$ bundle exec bin/metrics-jenkins-jqs.rb -S 10.107.129.7
Check failed to run: 404 Not Found,
# Unable to run this as I do not have the plugin install and plugin seems unmaintained since 2013.
majormoses commented 5 years ago

any chance you plan on coming back and getting this over the line?

CoRfr commented 5 years ago

@majormoses , sorry addressing the request a bit late but change should be good to go :)

majormoses commented 5 years ago

released: https://rubygems.org/gems/sensu-plugins-jenkins/versions/2.0.0

I had to manually release because we have clogged up travis by enabling https://dependabot.com to help us with a lot of the maintenance work involved in keeping this project working so I can spend more time adding features and fixing bugs.