I was wondering if there is an option in Magento ver. to get an email if cron is not running or more important if a cronjob fails. I didn't find any configuration in backend nor any information here on StackExchange.

If I do not miss anything and there is no setting for it, how can I achieve it? Probably by writing an extension, but is there any kind of event what gets triggered when a cronjob fails? Thank you.


3 Answers 3


Its not native, but its totally possible to implement. On MageStack we use a cron wrapper to secure the cron process, provide support for Aoe_Scheduler and allow error capture.

Whilst I won't copy the source code here, the basic concept is pretty simple. You iterate over the different task types and capture the output from stderr - then send an email if it fails.

EMAIL_RECIPIENT="[email protected]"
CRON_ARGS=( "-mdefault 1" "-malways 1" )

for ARGS in "${CRON_ARGS[@]}"; do
  php cron.php $ARGS >> $LOG_FILE 2>&1
  [ $RES -ne 0 ] && RES=$?

if [ $RES -ne 0 ] && [[ ! "$EMAIL_RECIPIENT" == "" ]]; then
  echo "Something went wrong with the cron, see attached" | mutt -s "Cron error" -a "$LOG_FILE" -- $EMAIL_RECIPIENT
  • Very interesting approach/solution. Thanks for that!
    – Xavin
    Mar 21, 2016 at 18:46

No, there is nothing built in like that, you'll need to implement your own monitoring. And don't try to do it with a Magento observer, since it won't be able to catch a non-running or crashed cronjob.

As a simple service just for cronjob monitoring I can recommend https://healthchecks.io/ - you add a ping to your cronjobs and can configure notifications when there was no ping for a certain time.


The same thing happened to a client of mine. They wanted to be notified not just of failures but they wanted to know how long jobs were taking to run and get notified of errors. I couldn't find something that fit what they wanted so I ended up building a small (free) notification service that checks to make sure that schedules are running on time, but also captures elapsed times and graphs them out nicely for you. It's the Job Heath Data Vault, has Magento 1 and Magento 2 adapters and is free to use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.