-
Notifications
You must be signed in to change notification settings - Fork 11
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 CLI flag to override exit code if API is unreachable #99
Conversation
@RincewindsHat Not sure about the flag's name yet. Ideas? |
I'd like to have a generic CLI flag name so that we can re-use it in different plugins |
|
e4d9c08
to
1d9f971
Compare
Would be nice to have an pflag Enum Type, but that's currently not available. Our go-check module fortunately is clever enough to handle things other than 0,1,2,3 |
Would be really nice to be able to use "2", "Critical", "critical" or "CRITICAL" equally. |
But then we would have to have a StringVarP, and then validate if it's an "accepted" (warn, crit, unknown) string, then map the string to an int... I don't see any added value to that? |
Usability? How many people do actually know how the statuses map to integers? |
I'd assume that people in the monitoring plugins ecosystem are at least familiar with exit codes and their meaning. I would prefer to keep the code simple and people can read up on stuff IF they need this feature at all Also - and I realize that this point is far fetched - but what if another monitoring plugin system does not use the same "warning" "critical" "unkown" mapping that Icinga does. |
ALL the nagios decendents use the same mapping to my knowledge. If you change that you can just stop using these monitoring plugins at all. But this option can be expanded in the future without breaking the API to the user, so I would say we go for it now with numerical codes only. I would request a enhancement of the help text for the option though to make it clearer what the |
722106c
to
f8e63c1
Compare
f8e63c1
to
a45255a
Compare
Updated the help text and README |
Fixes #98
TODO