Check Rundeck Job Status
Check Rundeck Job Status
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.
Re: Check Rundeck Job Status
Why not combine the two scripts ino one and then there's no need for a config file.
Re: Check Rundeck Job Status
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
Re: Check Rundeck Job Status
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.
Re: Check Rundeck Job Status
Hi @sspence, thanks for reaching out.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.
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 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
Re: Check Rundeck Job Status
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