From 6a41af4a6028d8283e99980ba702dfa03a5c2319 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 16 Jul 2025 06:50:52 +0100 Subject: [PATCH] Change exit code from -1/255 to 3 to match Nagios plugin specs (#76) --- check_esxi_hardware.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_esxi_hardware.py b/check_esxi_hardware.py index dfa3223..b701c90 100755 --- a/check_esxi_hardware.py +++ b/check_esxi_hardware.py @@ -607,14 +607,14 @@ def getopts() : if len(sys.argv) < 2: print("no parameters specified\n") parser.print_help() - sys.exit(-1) + sys.exit(3) # if first argument starts with 'https://' we have old-style parameters, so handle in old way if re.match("https://",sys.argv[1]): # check input arguments if len(sys.argv) < 5: print("too few parameters\n") parser.print_help() - sys.exit(-1) + sys.exit(3) if len(sys.argv) > 5 : if sys.argv[5] == "verbose" : verbose = True @@ -632,7 +632,7 @@ def getopts() : if not options.__dict__[m]: print("mandatory option '" + m + "' not defined. read usage in help.\n") parser.print_help() - sys.exit(-1) + sys.exit(3) hostname=options.host.lower() # if user has put "https://" in front of hostname out of habit, do the right thing