Mautic Community Forums

When Cron not running - notify users

My idea is:
Our cron was out for some time. Users did not notice, campaigns were not sent.
This should be a highly critical error if cron is not running on Mautic, because important things will not work.
The idea is to add 1 task to the cron runner that writes a timestamp to a file or DB.

In the interface if admins or users then login a small check is done if the timestamp in this file is recent.
If this is longer than X minutes/hours/days(maybe configurable)
An error is shown to the user:
“There was an issue with the CRON jobs - please contact an administrator”.

I think these groups of people would benefit from this idea:
Everybody using Mautic with cronjobs installed.

Why I think they would benefit from this idea:

Any code or resources to support this idea:
The moment cron starts failing or tje jobs are accidentally disabled, users immediately know. No silent failing.

Are you willing to work on this idea?:

What skills and resources do you need to explore this further?
I know php, but have not enough familiarity with Mautic yet.
Some pointers would be helpful.
I think I would need to know

  • To save this timestamp in File or DB?
  • where cronjobs are defined
  • In the interface where it’s best to show this alert.
  • Do we make this configurable (the treshold)?

We simply save a timestamp as a json somehere every time the cron runs.
If the timestamp is old, another system picks it up.

In my opinion this falls into System Monitoring category. If you want to have a notification in case cronjob fails, you can easily achive tihs by putting all cronjobs in dedicates bash file. within that bash file you simply look at the output of each command and if its not normal output you send email to administrators.

Further more you can also use software like Monit alongside Mautic that can monitor much more then just cronjobs if properly configured.

I agree that would help but in the following case Mautic would still not send any campaigns (And that is accidentally what triggered me to create this feature request):
My operations person (or deployment platform) has accidentally installed cron (and monitoring) on wrong server .
I can use Mautic but no cron would be triggered and the application could detect that but now silently does not do “anything”.

This would already be great