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

Support for extra-opts #33

Closed rpv-tomsk closed 2 years ago

rpv-tomsk commented 3 years ago

It would be nice to provide common/standart solution for plugins to support "Extra-Opts", like done in C and Perl plugins: https://nagios-plugins.org/doc/extra-opts.html.

That highly required to hide passwords from command line arguments and for other tasks too. I think this library is a very good place to provide such a solution, as it used as a base for plugins.

My proposal is to add common/standart solution for this task into library, which already has 'ArgumentParser' part. That part should become smart to properly handle the --extra-opts option and support reading options from a given configuration file. Then any of Python plugins that use this library will be able to handle arguments defined in file without (or with minor) code changes.

I'm not a Python developer, so I can't suggest an implementation. Thanks for your project.

mpounsett commented 2 years ago

Duplicate of #32