-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command based monitors via local execution and ssh #2609
Comments
In terms of the exit codes, the way this sort of thing generally works in other monitoring software (nagios, zenoss, sensu, etc...) is that the exit code from the command corresponds to different severities. exit 0 = clear This would allow us to create a script with something like this in it, and run it from uptime kuma each cycle...
Which would produce a critical alert/event. Obviously a monitoring script would be a bit more sophisticated than the above example but this is a really common functionality to have in monitoring software and would significantly increase the flexibility of what we'd be able to monitor with uptime kuma. I like the monitors which are included so far, some of them are absolutely fantastic such as the ping, docker, and http/https checks, but having the ability to easily implement checks with custom written scripts like this on local and remote hosts would be huge. Thanks. |
This is already handled by the push monitor type. |
Using the push monitor type puts the responsibility of actually running the check script on something else like crontab instead of having uptime kuma run it, which isn't ideal in all situations, but for my own personal use case I could make a push style implementation work. I'd still like to see the type of implementation that I'm proposing considered. It would be nice to be able to throw some bash code together in to a text field in a "Command" style monitor and have it run and get the status based on the exit code, rather than having to code a script that has to talk to the API via http or https every time it runs. |
This will be great for all the different random things sometimes we want to check. |
This might also cover the needs of #2431. |
Sorry for the @louislam but I'm wondering if this is something that would be possible to implement, I'm sure it there's a few people that would sponsor it. |
Hi boys, i would request such a feature either.
However, if Uptime Kuma, could execute over ssh (with ssh keys) a command, this would solve my issue, as i could simply write a script that exits with 0 or 3 and inside the script i can do my ping6 or whatever i want.... Thanks! |
@rmatte |
Sounds fine. |
🏷️ Feature Request Type
New Monitor
🔖 Feature description
It would be great to be able to create command based monitors/checks with commands that can be executed locally on the host/container where uptime kuma is running or executed remotely via ssh.
✔️ Solution
Status of pass or fail would be based on the exit code of the command. Exit 0 would be a clear, exiting with anything other than 0 would be a failure. This would allow for a lot more flexibility with the checks. Have it so the user can specify a command for the check, then run the check locally or remotely via ssh and gather the exit code then pass or fail the check/monitor based on the exit code value for the command.
❓ Alternatives
No response
📝 Additional Context
No response
The text was updated successfully, but these errors were encountered: