Loading README.rst +4 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,8 @@ Usage .. code:: shell usage: mnpw [-h] [-v] [-V] [-d] [-q] [-w] [-u] [-e] [-t TIMEOUT] command [arguments ...] usage: mnpw [-h] [-v] [-V] [-c] [-d] [-q] [-w] [-u] [-e] [-t TIMEOUT] command [arguments ...] My Nagios plugin wrapper. Loading @@ -31,6 +32,8 @@ Usage -h, --help show this help message and exit -v, --verbose Verbose output -V, --version show program's version number and exit -c, --chain Echo the check output and exit with the same exit code, allow for chaining with plugin handlers. -d, --dry-run Dry-run, don't notify -q, --quiet, --silent No output, except for errors. Loading mnpw/__init__.py +12 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ __version__ = "0.1.2" import argparse import logging import socket import sys import requests Loading Loading @@ -41,6 +42,12 @@ def main(): # noqa: MC0001 action="version", version=f"mnpw version {__version__}", ) parser.add_argument( "-c", "--chain", help="Echo the check output and exit with the same exit code, allow for chaining with plugin handlers.", # noqa: E501 action="store_true", ) parser.add_argument( "-d", "--dry-run", help="Dry-run, don't notify", action="store_true" ) Loading Loading @@ -77,6 +84,7 @@ def main(): # noqa: MC0001 default=nagios.DEFAULT_TIMEOUT, ) args = parser.parse_args() log_level = logging.WARNING # Default level. if args.verbose and args.quiet: parser.error("Can't specify verbose and quiet output together.") Loading Loading @@ -115,6 +123,10 @@ def main(): # noqa: MC0001 if args.errors: notify(f"Check {args.command} on {HOSTNAME} status is invalid.") if args.chain: print(check._stdout) # pylint: disable=protected-access sys.exit(check.ExitCode) if __name__ == "__main__": main() Loading
README.rst +4 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,8 @@ Usage .. code:: shell usage: mnpw [-h] [-v] [-V] [-d] [-q] [-w] [-u] [-e] [-t TIMEOUT] command [arguments ...] usage: mnpw [-h] [-v] [-V] [-c] [-d] [-q] [-w] [-u] [-e] [-t TIMEOUT] command [arguments ...] My Nagios plugin wrapper. Loading @@ -31,6 +32,8 @@ Usage -h, --help show this help message and exit -v, --verbose Verbose output -V, --version show program's version number and exit -c, --chain Echo the check output and exit with the same exit code, allow for chaining with plugin handlers. -d, --dry-run Dry-run, don't notify -q, --quiet, --silent No output, except for errors. Loading
mnpw/__init__.py +12 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ __version__ = "0.1.2" import argparse import logging import socket import sys import requests Loading Loading @@ -41,6 +42,12 @@ def main(): # noqa: MC0001 action="version", version=f"mnpw version {__version__}", ) parser.add_argument( "-c", "--chain", help="Echo the check output and exit with the same exit code, allow for chaining with plugin handlers.", # noqa: E501 action="store_true", ) parser.add_argument( "-d", "--dry-run", help="Dry-run, don't notify", action="store_true" ) Loading Loading @@ -77,6 +84,7 @@ def main(): # noqa: MC0001 default=nagios.DEFAULT_TIMEOUT, ) args = parser.parse_args() log_level = logging.WARNING # Default level. if args.verbose and args.quiet: parser.error("Can't specify verbose and quiet output together.") Loading Loading @@ -115,6 +123,10 @@ def main(): # noqa: MC0001 if args.errors: notify(f"Check {args.command} on {HOSTNAME} status is invalid.") if args.chain: print(check._stdout) # pylint: disable=protected-access sys.exit(check.ExitCode) if __name__ == "__main__": main()