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

Override "Unknown" Status as "Critical" for status check with cli switch #17

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

s256
Copy link

@s256 s256 commented Aug 12, 2021

  • adds another CLI switch for the status switch -unknown-as-critical to treat UNKNOWN errors as CRITICAL.

#15

madrisan and others added 30 commits April 27, 2020 23:36
This is required because, as pointed out by unix196, Nagios shows
an empty output in case of warning and error messages.

Signed-off-by: Davide Madrisan <[email protected]>
Send all the messages to stdout and with no colours when the Nagios outputter is selected
Signed-off-by: Davide Madrisan <[email protected]>
The configuration for circleci is currently bloken.
Revove the badge for now.

Signed-off-by: Davide Madrisan <[email protected]>
Signed-off-by: Davide Madrisan <[email protected]>
Signed-off-by: Davide Madrisan <[email protected]>
Use go modules to fix the CI configurations
Signed-off-by: Davide Madrisan <[email protected]>
Include the error message in output when reading the environment variables.
Build and run tests also with go 1.14.

Signed-off-by: Davide Madrisan <[email protected]>
Build and run tests also with go 1.14.

Signed-off-by: Davide Madrisan <[email protected]>
Signed-off-by: Davide Madrisan <[email protected]>
@madrisan
Copy link
Owner

Why did you marked as (only relevant for output="nagios") in the help message?
The return code is relevant in both the the default and the nagios output.

@madrisan
Copy link
Owner

madrisan commented Aug 12, 2021

Also the help message (exit status) should be updated.

--- a/command/status.go
+++ b/command/status.go
@@ -50,7 +50,7 @@ Usage: hashicorp-vault-monitor status [options]
        Specify an output format. Can be 'default' or 'nagios'.
 
     -unknown-as-critical
-       Every unknown error is treated as critical(only relevant for output="nagios").
+       Every unknown error is treated as critical.
 
   The exit code reflects the seal status:
 
@@ -58,6 +58,8 @@ Usage: hashicorp-vault-monitor status [options]
       - %d - the vault node is sealed
       - %d - an error occurred
 
+  The last case will be merged into the second one if -unknown-as-critical is selected.
+
   For a full list of examples, please see the online documentation.
 `
        return fmt.Sprintf(helpText,

@madrisan
Copy link
Owner

Seem good to me. Thanks!

@madrisan madrisan force-pushed the master branch 4 times, most recently from dbc1d33 to 76c354b Compare November 27, 2021 17:41
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.

Nagios output state is "unknown" on "Connection Refused" e.g. stopped service
3 participants