[GH-ISSUE #754] Reverse fail signal bit #533

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

Originally created by @c0nfus3d on GitHub (Dec 17, 2022).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/754

I have a webserver that runs the webmin control panel. This server does a weekly backup.

In the backup settings, I can specify a "Command to run after backup"

It gives me variable options, such as the status of the backup.

BACKUP_STATUS
Set to 1 if the backup succeeded, 0 if not.

So I could set this command as curl --retry 3 https://hc-ping.com/{GUID}/BACKUP_STATUS to update my healthcheck.

However, this variable's value is the opposite of what Healthchecks.io is looking for-- "Healthchecks.io will interpret exit status 0 as success and all non-zero values as failures"

Is there a way that I can set this check to look for the reverse value, so it would interpret the 1 as a success instead of a fail and then interpret a 0 as a fail instead of success?

Originally created by @c0nfus3d on GitHub (Dec 17, 2022). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/754 I have a webserver that runs the webmin control panel. This server does a weekly backup. In the backup settings, I can specify a "Command to run after backup" It gives me variable options, such as the status of the backup. > BACKUP_STATUS > Set to 1 if the backup succeeded, 0 if not. So I could set this command as `curl --retry 3 https://hc-ping.com/{GUID}/BACKUP_STATUS` to update my healthcheck. However, this variable's value is the opposite of what Healthchecks.io is looking for-- "Healthchecks.io will interpret exit status 0 as success and all non-zero values as failures" Is there a way that I can set this check to look for the reverse value, so it would interpret the **1** as a **success** instead of a fail and then interpret a **0** as a **fail** instead of success?
kerem closed this issue 2026-02-25 23:42:47 +03:00
Author
Owner

@cuu508 commented on GitHub (Dec 18, 2022):

The /{status} endpoint is for reporting the exit status of a process. On POSIX systems 0 is success and 1-255 is failure.

Is there a way that I can set this check to look for the reverse value, so it would interpret the 1 as a success instead of a fail and then interpret a 0 as a fail instead of success?

You can write a wrapper script which reverses the BACKUP_STATUS and calls curl. And specify the wrapper script as the command to run after backup.

<!-- gh-comment-id:1356756738 --> @cuu508 commented on GitHub (Dec 18, 2022): The `/{status}` endpoint is for reporting the exit status of a process. On POSIX systems 0 is success and 1-255 is failure. > Is there a way that I can set this check to look for the reverse value, so it would interpret the 1 as a success instead of a fail and then interpret a 0 as a fail instead of success? You can write a wrapper script which reverses the BACKUP_STATUS and calls curl. And specify the wrapper script as the command to run after backup.
Author
Owner

@c0nfus3d commented on GitHub (Dec 18, 2022):

I like the idea @cuu508! Thanks! Closing this issue.

<!-- gh-comment-id:1356865850 --> @c0nfus3d commented on GitHub (Dec 18, 2022): I like the idea @cuu508! Thanks! Closing this issue.
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#533
No description provided.