Check Rundeck Job Status

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
sspence
Posts: 1
Joined: Mon May 22, 2023 6:41 am

Check Rundeck Job Status

Post by sspence »

I created a python script that checks the status of a rundeck job. I created a second script that gets a list of scheduled jobs (there are many, hence the config file instead of creating each one in the GUI manually). It creates a config file for Nagios, so that Nagios can report the status of daily rundeck jobs (running, completed, failed). The issue I'm having is working out the syntax of the config file so that there is an entry for each scheduled job (done) and calls the status script with a job ID, which will return the execution code. There are no hosts or host addresses to pass, just the job ID which I have in my created config file. Any guidance? I've looked at https://www.tutorialspoint.com/nagios/n ... rvices.htm and gleaned no guidance.
kg2857
Posts: 234
Joined: Wed Apr 12, 2023 5:48 pm

Re: Check Rundeck Job Status

Post by kg2857 »

Why not combine the two scripts ino one and then there's no need for a config file.
Aliyaa
Posts: 4
Joined: Wed Jun 21, 2023 10:38 am
Location: India
Contact:

Re: Check Rundeck Job Status

Post by Aliyaa »

Merging the two scripts into one eliminates the need for a separate configuration file, simplifying the code and enhancing ease of use.Nrega Job Card List
pipendo
Posts: 1
Joined: Wed Nov 08, 2023 8:26 pm

Re: Check Rundeck Job Status

Post by pipendo »

You may set service checks in your geometry dash meltdown Nagios configuration file for each scheduled Rundeck task. This allows you to construct a file that uses a custom Python script to verify the status of numerous jobs. You may construct unique service checks for each task by iterating over the job IDs that are included in your built config file.
User avatar
swolf
Developer
Posts: 294
Joined: Tue Jun 06, 2017 9:48 am

Re: Check Rundeck Job Status

Post by swolf »

sspence wrote: Mon May 22, 2023 6:52 am I created a python script that checks the status of a rundeck job. I created a second script that gets a list of scheduled jobs (there are many, hence the config file instead of creating each one in the GUI manually). It creates a config file for Nagios, so that Nagios can report the status of daily rundeck jobs (running, completed, failed). The issue I'm having is working out the syntax of the config file so that there is an entry for each scheduled job (done) and calls the status script with a job ID, which will return the execution code. There are no hosts or host addresses to pass, just the job ID which I have in my created config file. Any guidance? I've looked at https://www.tutorialspoint.com/nagios/n ... rvices.htm and gleaned no guidance.
Hi @sspence, thanks for reaching out.

There are a lot of different ways to achieve this, but I would probably do something like the following:

Code: Select all

define host {
        host_name rundeck_jobs
        alias Rundeck Jobs
        use generic-host
        active_checks_enabled 0
        passive_checks_enabled 0
        ; Other configuration items as needed
}

define service {
        host_name rundeck_jobs
        service_description job_name1
        use generic-service
        check_command check_rundeck_job!1234
        ; Other configuration items as needed
}


define service {
        host_name rundeck_jobs
        service_description job_name2
        use generic-service
        check_command check_rundeck_job!2345
        ; Other configuration items as needed
}

define command {
    command_name    check_rundeck_job
    command_line    $USER1$/check_rundeck_job $ARG1$
}
This would create two services named job_name1 and job_name2 which run the script at /usr/local/nagios/libexec/check_rundeck_job. job_name1 would check the rundeck job with id 1234 and job_name2 would check the rundeck job with id 2345.

This configuration probably won't work out of the box, but it should be enough to get you started. Best of luck with your tasks.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy
sayani40
Posts: 1
Joined: Tue Nov 28, 2023 9:02 am

Re: Check Rundeck Job Status

Post by sayani40 »

Checking Rundeck job status prompts thoughts of efficiency and control. The person might be focused on ensuring tasks run smoothly, contemplating potential issues, or anticipating successful completions. Monitoring job status reflects a proactive approach to managing workflows and maintaining a sense of command over the operational landscape. mp bhulekh
Post Reply