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

added cronjob check #38

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

added cronjob check #38

wants to merge 6 commits into from

Conversation

yzapf
Copy link

@yzapf yzapf commented Oct 18, 2022

Added a cronjob check to monitor whether a cronjob ran inside of its defined timeframe.
To make this possible I also wrote a helper script "convert_cron_schedule.py" to convert the cron schedule into a timeframe.
For that I used the "croniter" package, which is mandatory for that script.
This timeframe will then be compared with the elapsed time between now and the last run of the cronjob.
If the timeframe is bigger than the elapsed time everything is fine, else the check responds with a corresponding error code.
The cronjob state is also being checked.

@Napsty
Copy link
Owner

Napsty commented Oct 24, 2022

Hello @yzapf and thank you for the PR. Can you please elaborate what the cronjob is for? The plugin was created to be run as a monitoring plugin for Nagios, Icinga2 and other monitoring solutions. Is this some other software or running standalone? Can you show some use case?

@yzapf
Copy link
Author

yzapf commented Oct 26, 2022 via email

@Napsty
Copy link
Owner

Napsty commented Oct 27, 2022

state of cronjobs running in a Kubernetes/rancher environment

ah, I misunderstood the initial request, sorry. Got it :) Will test.

@Napsty Napsty self-assigned this Jan 6, 2023
@Napsty Napsty added the enhancement New feature or request label Jan 6, 2023
@Napsty
Copy link
Owner

Napsty commented Jan 6, 2023

I finally took some time to test the cron check type. The idea is great and helpful, thanks!
However the additional Python dependency could be causing issues. Is there any way we can do this without the Python script and forcing the users to install Python (and the croniter module)?
As far as I can tell, the Python script is only here to create a run time interval?

It would be great if we could stick with the plugin to Shell requirement only.

@yzapf
Copy link
Author

yzapf commented Jan 18, 2023 via email

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

Successfully merging this pull request may close these issues.

None yet

2 participants