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

Issue with Folder Names in Jenkins #27

Open sassyn opened 6 years ago

sassyn commented 6 years ago

Hi,

I have setup a Folder in jenkins with this plugin (https://wiki.jenkins.io/display/JENKINS/CloudBees+Folders+Plugin)

I used this as I have many many jobs in my system (more than 400).

When jobs is inside a folder, the sensu plugin seems to have issues in finding them.

./check-jenkins-job-status.rb -u http://Jenkins:8080 -j 'FolderName/JobName' -U user -p pass E, [2017-09-03T21:24:00.774338 #26436] ERROR -- : JenkinsApi::Exceptions::NotFound: Requested component is not found on the Jenkins CI server. JenkinsJobChecker CRITICAL: Error looking up Jenkins job: FolderName/JobName

I look at the code, but didn't manage to solve it. Can we sort it out somehow?

Thank You

majormoses commented 6 years ago

@sassyn thanks for reporting, I have only used views to organize jenkins jobs and have never used folders, I would guess this to either be a config or upstream problem as we are just calling an api here: https://github.com/sensu-plugins/sensu-plugins-jenkins/blob/1.3.0/bin/check-jenkins-job-status.rb#L110 from what I can tell here: https://github.com/arangamani/jenkins_api_client/blob/master/lib/jenkins_api_client/job.rb#L760 it looks like there should probably not be anything special to make this work you just need to pass the right job name here...I wonder if you can drop the folder, have you tried that?