mpounsett / nagiosplugin

A Python class library which helps with writing Nagios (Icinga) compatible plugins.
https://nagiosplugin.readthedocs.io/
Other
28 stars 14 forks source link

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

Open ypid-geberit opened 4 years ago

ypid-geberit commented 4 years ago

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?

mpounsett commented 4 years ago

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