nagiosplugin icon indicating copy to clipboard operation
nagiosplugin copied to clipboard

nagiosplugin.state.Warn vs. nagiosplugin.state.Warning (considering nagiosplugin.state.Critical)

Open ypid-geberit opened this issue 5 years ago • 1 comments

Hi,

I just stumbled across what I think is an inconsistency. Those states exist currently:

Ok
Warn
Critical
Unknown

I think this module should rather support Warning instead of Warn to comply with the exact wording used in the plugin API spec: https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/pluginapi.html

Backwards compatibility with existing checks should be provided by still supporting Warn.

For background, I am using a statement like this getattr(nagiosplugin.state, nagios_state_string, nagiosplugin.state.Unknown) to use an already existing Nagios state (nagios_state_string) in a custom Context class.

What do you think?

ypid-geberit avatar Jul 16 '20 16:07 ypid-geberit

That seems reasonable, and it would be a pretty simple change. I'll add it to the TODO list.

mpounsett avatar Aug 01 '20 20:08 mpounsett