madrisan / hashicorp-vault-monitor

:key: HashiCorp Vault Monitoring Tool
Mozilla Public License 2.0
24 stars 4 forks source link

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

Open s256 opened 3 years ago

s256 commented 3 years ago

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

madrisan commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Seem good to me. Thanks!