pschlan / cron-job.org

cron-job.org Open Source project
GNU General Public License v2.0
1.47k stars 254 forks source link

Mobile App / Webhooks for Notifications? #215

Open martin-braun opened 1 year ago

martin-braun commented 1 year ago

I want to get rid of my email client on my phone, it drains battery and I noticed I only installed it to get notifications from cron-job.org.

Now I could setup any of the many apps to monitor websites on my phone, but this will drain more battery as well and it would require me to copy and paste all my settings over.

What I wish to have is an app that monitors the cronjobs within cron-job.org. There seem to be an API for cron-job.org and I'm sure that is possible.

Did anybody already come up with anything and I'm just not good at searching?

martin-braun commented 1 year ago

Okay, I came up with a solution: https://github.com/martin-braun/cronmon

This is a proxy for cron-job.org. It allows to specify your API keys and exposes a simple endpoint that will evaluate lastStatus of all your jobs from the cron-job API. Now I can use any mobile app that tracks services being online. I keep it simple. If any job is lastStatus > 1 (indicating any kind of issue) it will return a HTTP status 504 instead of 200.

I can now use any monitor app. If the endpoint reports an issue, I will simply check what's going on by hand.

I can get rid of my heavy email client on my mobile now.

pschlan commented 1 year ago

Great stuff, thanks for sharing!

Sooner or later an app would be nice, I think, but it's quite some effort to get it right for Android + iOS and getting it through all the approvals.

Additionally, I've been thinking about adding support to add WebHook notifications. With those, you could easily integrate a "universal" app like Pushover or almost any other notification mechanism.

martin-braun commented 1 year ago

@pschlan Webhooks definitely would be a compromise, or any deep integration to a notification service, as long as it's open source. My solution works, but it's not perfect as even web monitor apps have limited options.