Go to All Forums

Cron job end status

For the cron monitor but it would be really good if we could optionally return an exit status with the end ping.

Currently on cron job failure we have to wait for the monitor to time out.

Something like the following would be ideal.

plus.site24x7.com/cron/{api key}/{monitor display name/device key}/end?status=XXXX&message=YYYYYY

 

Like (2) Reply
Replies (4)

Hi,

You can be notified on cron script failures in the ping URL itself. If a failure occurs inside the script and you want to be notified with a status change (down, Trouble, Critical) in the cron monitor, use the new "/event" endpoint.

To mark the cron monitor as Trouble:

"https://plus.site24x7.com/cron/<apikey>/<monitor name>/event?status=2&msg=some message or reason"

To mark the cron monitor as Down:

"https://plus.site24x7.com/cron/<apikey>/<monitor name>/event?status=0&msg=some message or reason"

To mark the cron monitor as Critical:

"https://plus.site24x7.com/cron/<apikey>/<monitor name>/event?status=3&msg=some message or reason"

Once the script fails, you will also get email alerts for the monitor status change with the error reason that you send in the "msg" param. The "/event" endpoint will send the email alerts.

Hope this helps. Let us know for further questions, if any, in the below thread.

 

Regards

Mathangi

Like (0) Reply

Fantastic, just what I needed. 

Like (0) Reply

Is that there in the documentation?

Like (0) Reply

Hi,

Yes, we have included this in our documentation.

Like (0) Reply

Was this post helpful?