Skip to content
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

Add degraded status for command 'script' #36

Merged
merged 1 commit into from
Dec 9, 2021

Conversation

brknkfr
Copy link
Contributor

@brknkfr brknkfr commented Dec 8, 2021

Notes

I wanted to monitor multiple websites (services) on one webserver (server). If one website is failing, the status of the item Websites should not be failing, but only degraded (exit returncode of script command has to be 80).

Now this is only possible with the script command.

Changes in this pull request:

  • add function check_degradetime
  • add function save_degradetime
  • add example script for checking multiple websites (check-websites.sh)
  • add example config status_website_list.txt

More minor changes in this pull request:

  • Changed operational, degraded and outage main message
  • Colours: green checks, orange status badges, blue degraded message

status.sh Outdated Show resolved Hide resolved
status.sh Outdated Show resolved Hide resolved
status.sh Outdated Show resolved Hide resolved
@Cyclenerd
Copy link
Owner

Thanks for your first GitHub pull. I repeat as I understand:

  • Besides up and down you introduce another state degrade.
  • This status is only given to script checks that return code 80.
  • Degraded counts as down for the sum (alert warning...)
  • Degraded is not displayed in the history

Have I understood this correctly?

Also, please take a look at my other comments. I do not agree with the color change. Also, please look at the return codes. Currently, everything other than 0 is a failure.

@brknkfr
Copy link
Contributor Author

brknkfr commented Dec 8, 2021

Thanks for your first GitHub pull. I repeat as I understand:

* Besides up and down you introduce another state `degrade`.

Yes, but only for the script command.

* This status is only given to script checks that return code `80`.

Yes. Actually, we could choose whatever exit code we want. There is no special reason for 80 (everything after 78 is not defined in sysexits.h)

* Degraded counts as down for the sum (alert warning...)

Yes.

* Degraded is not displayed in the history

Yes.

I'll probably change that later in a way you could see in the past incidents the reason of the failure (fail or degrade).

Have I understood this correctly?

You did.

Also, please take a look at my other comments. I do not agree with the color change. Also, please look at the return codes. Currently, everything other than 0 is a failure.

I'll be back with another force push ...

@brknkfr brknkfr force-pushed the degraded_script_status branch from 7a0b0f3 to a452c07 Compare December 8, 2021 20:42
@Cyclenerd
Copy link
Owner

Cool idea and implementation. Thank you very much. If you want, you can also customize the README with a new pull.

@Cyclenerd Cyclenerd merged commit d919a0a into Cyclenerd:master Dec 9, 2021
@brknkfr
Copy link
Contributor Author

brknkfr commented Dec 9, 2021

Cool idea and implementation. Thank you very much. If you want, you can also customize the README with a new pull.

And probably a test for test.sh ...

@brknkfr brknkfr deleted the degraded_script_status branch December 20, 2021 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants