Oracle_jobs and disabled jobs

CMK version: 2.0.0p33 (CRE)
OS version: SLES 15 SP4 64bit

The mk_oracle plugin supplies a check called oracle_jobs. The check checks all jobs listed in Oracles own job mechanism for their status. As far as I can see, the table queried is cdb_scheduler_jobs.

According to the documentation for the oracle_jobs check, it respects the “disabled” state:

"disabled": The state of a job is ignored when this parameter is True. This is the default behavior.

However, that is not what we are seeing. The state is queried by the SQL of the check, and even disabled checks generate a warning based on having no execution result listed in the table cdb_scheduler_job_run_details which catches the details of the last run.

However, the plugin does offer the option to react to the state of the job: Adding a rule via “parameters for this service” on a Oracle scheduler job type check offers the option Status of service in case of disabled job.

That means that we do have a workaround, but we find that listing disabled jobs with a WARN state because no logging information about their last execution was found seems nonsensical a this would be expected.

We can see multiple ways to improve the situation:

  • Not querying disabled jobs (ENABLED field in cdb_scheduler_jobs): There is no expectation of finding out any state of a non-running job
  • Having disabled jobs in the state of OK always, when and if there is no information about their last execution available from cdb_scheduler_job_run_details. If the job was executed at least once and has information logged in cdb_scheduler_job_run_details, but is now disabled, react to that information accordingly.

I’m interested in what you think is the way to go, and if this is perceived as a problem in general. If not, I’d be interested in how other Oracle users work around the problem, because a fresh installation of current Oracle versions shows the problem.

@Rendanic can you weigh in on this :)?

Hi @JacksonPollack

correct!

Both options sound valid and I can see why I would have a usecase for both.

For one customer we have now created a global rule for oracle_jobs which sets the CheckMK state to OK whenever encountering a disabled job. It now works as documented.

Hi,
sorry for long delay on my side. I was on vacation and sick after then…
I think, we should ignore missing logs, when disabled jobs are ignored.

Do not forget, that Oracle has jobs with interval longer then the default retention time for log data. That’s why logging data could be ignored, because we have to ignore them in this case.
Ignoring disabled jobs in SQL is not a good idea. This will lead to jobs with missing monitoring data, when an enabled job gets disabled which will create confusion, because you need to know that a disabled job will change to a job with missing monitoring data in checkmk.

Regards
Thorsten

Hi,

thanks for answering. We’re not sure what the result going forward is. We’ve posed that the behaviour and the documentation do not match, and to create the situation like it is documented needs a separate rule. Is that perceived as a problem? Will the behaviour be altered? Or is the workaround the intended way the situation needs to be resolved?

Best wishes.