hashicorp-vault-monitor icon indicating copy to clipboard operation
hashicorp-vault-monitor copied to clipboard

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

Open s256 opened this issue 2 years ago • 3 comments

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

https://github.com/madrisan/hashicorp-vault-monitor/issues/15

s256 avatar Aug 12 '21 15:08 s256

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 avatar Aug 12 '21 16:08 madrisan

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 avatar Aug 12 '21 16:08 madrisan

Seem good to me. Thanks!

madrisan avatar Aug 13 '21 12:08 madrisan