Hi Team,
We are using nagios 5.2.2
I would like to know how can we monitor cron jobs ran by oracle user in a particular time interval like between 8am and 11am. I believe this can be done with exit code results. i would like to know how this can be achieved and is there any plugin available.
Your suggestions would be helpful
Monitoring Cron jobs
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Monitoring Cron jobs
Hello, @inas.labib. Looks like someone wrote a plugin for that:
And here's the manual on how to set it up:
You'd open the crontab and find all the crons that are supposed to be run by the oracle user. Then you change:
To some other file that is going to be dedicated to the Oracle entries:
Also, add:
Finally, run the plugin with:
That should do it.
Code: Select all
https://github.com/bbuchalter/check_exit_codeCode: Select all
https://arkit.co.in/monitor-cronjob-execution-status-using-nagios/This is more than 24 hours. Did you mean to say 11 pm? Either way, consider creating a custom time period for this check: Now, as far as filtering outbetween 8am and 11am
Consider this example:cron jobs ran by oracle user
Code: Select all
2>&1 > /var/log/cronjobname.log; echo "Exit code: $?" >> /var/log/cronjobname.logCode: Select all
>> /var/log/cronjobname.logCode: Select all
>> /var/log/oracleentries.logTo the each oracle cron.echo "Exit code: $?"
Finally, run the plugin with:
Code: Select all
-f /var/log/oracleentries.logYou do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.