Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reconsider job_name "syntax" for icinga2 and foldered Jobs #22

Open
donfranio opened this issue Mar 1, 2017 · 0 comments
Open

reconsider job_name "syntax" for icinga2 and foldered Jobs #22

donfranio opened this issue Mar 1, 2017 · 0 comments

Comments

@donfranio
Copy link

Hi,

atm ( after Pullrequest #21 ) you can configure icinga2 with something like

object CheckCommand "jenkins-job-check-anon" {
     import "ipv4-or-ipv6"
     command = [ CustomPluginDir + "/check_jenkins_job_extended.pl" ]
     arguments = {
         "url" = {
             skip_key = true
             value = "$url$"
             order = 1
         }
         "job_name" = {
             skip_key = true
             value = "$job_name$"
             order = 2
         }
         "concurrent_fails_threshold" = {
             skip_key = true
             value = "$concurrent_fails_threshold$"
             order = 3
         }
        <asf>

and

apply Service for (jenkins_job => config in host.vars.jenkins_jobs_anon) {
     import "generic-service"
     check_command = "jenkins-job-check-anon"
     action_url = config.url+"/job/"+config.job_path
     vars += config
}

with

object Host {
    ...
    vars.jenkins_jobs_anon [ "Jenkins: jobname" ] = {
        url="https://jenkins.domain.tld",
        job_name="folder/jobname",
        concurrent_fails_threshold = 1,
        job_path="folder/job/jobname"
    }
}

... in a very nice and generic way (only have to add a jenkins-job-line for every job directly to the host).

But if the plugin is changed to require the exact path-part of the URL leading to the Jenkins-Job itself (e.g. folder/job/jobname) instead of folder/jobname, one could also create the action_url more nicely, right?
e.g.

    vars.jenkins_jobs_anon [ "Jenkins: jobname" ] = {
        url="https://jenkins.domain.tld",
        job_name="folder/job/jobname",
        concurrent_fails_threshold = 1,
    }

in the Host-Object (saving one parameter) and

     action_url = config.url+"/"+config.job_path

this should also work for multiple folder-Levels, not?

What's your opinion about that?

cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant