[GH-ISSUE #429] Suggestion: report exit status #319

Closed
opened 2026-02-25 23:42:01 +03:00 by kerem · 5 comments
Owner

Originally created by @piramiday on GitHub (Sep 17, 2020).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/429

it would be useful to be able to report success or failure using only the exit status:

bash my-script.sh
curl https://hc-ping.com/xxxyyyzzz/$?

so that:

  • https://hc-ping.com/xxxyyyzzz/0 means success,
  • https://hc-ping.com/xxxyyyzzz/1 and other numbers mean failure.

this would make scripts shorter and would help to avoid the uglier if checks on the exit status.
ideally, it could be useful to store and show to the user the actual exit code $?, but that's another matter because it requires changing a lot more.

Originally created by @piramiday on GitHub (Sep 17, 2020). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/429 it would be useful to be able to report success or failure using only the exit status: ``` bash my-script.sh curl https://hc-ping.com/xxxyyyzzz/$? ``` so that: - `https://hc-ping.com/xxxyyyzzz/0` means success, - `https://hc-ping.com/xxxyyyzzz/1` and other numbers mean failure. this would make scripts shorter and would help to avoid the uglier `if` checks on the exit status. ideally, it could be useful to store and show to the user the actual exit code `$?`, but that's another matter because it requires changing a lot more.
kerem closed this issue 2026-02-25 23:42:01 +03:00
Author
Owner

@cuu508 commented on GitHub (Sep 28, 2020):

That's a great suggestion, much cleaner than if logic.
I'm planning on implementing it.

<!-- gh-comment-id:700196414 --> @cuu508 commented on GitHub (Sep 28, 2020): That's a great suggestion, much cleaner than `if` logic. I'm planning on implementing it.
Author
Owner

@cuu508 commented on GitHub (Oct 28, 2020):

This now implemented, deployed and ready for testing. Any and all feedback welcome!

<!-- gh-comment-id:717917310 --> @cuu508 commented on GitHub (Oct 28, 2020): This now implemented, deployed and ready for testing. Any and all feedback welcome!
Author
Owner

@piramiday commented on GitHub (Oct 28, 2020):

happy to help! 🎉

<!-- gh-comment-id:717988953 --> @piramiday commented on GitHub (Oct 28, 2020): happy to help! :tada:
Author
Owner

@piramiday commented on GitHub (Nov 26, 2020):

just got my first failure of a check for which I use the curl https://hc-ping.com/xxxyyyzzz/$? feature.
from the dasboard I can read a message like "Ping #XX (received via the /fail endpoint)" -- that mentions the /fail endpoint incorrectly -- and I see no mention of the reported exit status, which would help in debugging.

should I open up another issue with the feature suggestion of making the reported exit statuses transparent to the user?
IMHO even reporting the correct endpoint invoked by my curl would help, e.g. /2 endpoint, no need to change graphics or add labels.

<!-- gh-comment-id:734379799 --> @piramiday commented on GitHub (Nov 26, 2020): just got my first failure of a check for which I use the `curl https://hc-ping.com/xxxyyyzzz/$?` feature. from the dasboard I can read a message like "Ping #XX (received via the /fail endpoint)" -- that mentions the `/fail` endpoint incorrectly -- and I see no mention of the reported exit status, which would help in debugging. should I open up another issue with the feature suggestion of making the reported exit statuses transparent to the user? IMHO even reporting the correct endpoint invoked by my curl would help, e.g. `/2 endpoint`, no need to change graphics or add labels.
Author
Owner

@cuu508 commented on GitHub (Nov 27, 2020):

Thanks for the report @piramiday. There's a recent issue (#455) also about exposing the exit status, tlet's track this there.

<!-- gh-comment-id:734881922 --> @cuu508 commented on GitHub (Nov 27, 2020): Thanks for the report @piramiday. There's a recent issue (#455) also about exposing the exit status, tlet's track this there.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#319
No description provided.