louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
55.94k stars 5.03k forks source link

execute script notificiation provider #2363

Open MrBlue90 opened 1 year ago

MrBlue90 commented 1 year ago

⚠️ Please verify that this feature request has NOT been suggested before.

🏷️ Feature Request Type

UI Feature, Other

🔖 Feature description

I really appreciate this project since it gives me a clear indication of the status of my homelab. The thing I'm missing though is to trigger an action when a system appears to be down. This way, the system could make an attempt of restoring the issue once it's detected.

✔️ Solution

Being able to run an action (script or webhook) when an issue is detected.

Examples: A docker container stopped unexpectedly -> Uptime Kuma detects it's down -> Sends a docker restart command A device on the network seems unresponsive -> Uptime Kuma detects it's down -> Triggers webhook of domotics system -> Turns power of device off and back on

❓ Alternatives

No response

📝 Additional Context

There's another project which makes you able to create a webpage with big buttons to do similar stuff, but it's a manual action. Might be useful for inspiration? https://github.com/OliveTin/OliveTin

rezzorix commented 1 year ago

You can run a webhooks already.

Set it up under “Notifications”.

MrBlue90 commented 1 year ago

Thanks! I missed that one!

In that case running some code would still be useful in case I'm unable to trigger such thing over a webhook.

Edit: I found out that Portainer also supports webhooks in order to manager Docker containers, though keep in mind it's a licensed feature! (https://www.portainer.io/features?section=commonFeatures&tab=automaticStackUpdates&from=container-webhook) Still, you can request a license for free here: https://www.portainer.io/take-5

Update: It appears that the webhook functionality of Portainer only supports recreating the container, while I'm just looking for (re)starting the existing one. If anyone has any idea how to move forward, I'm keen to hear suggestions!