mirror of
https://github.com/Napsty/check_esxi_hardware.git
synced 2026-02-06 15:15:20 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f3e202c5f | ||
|
|
6a41af4a60 |
@@ -36,7 +36,7 @@
|
||||
# Copyright (c) 2015 Andreas Gottwald
|
||||
# Copyright (c) 2015 Stanislav German-Evtushenko
|
||||
# Copyright (c) 2015 Stefan Roos
|
||||
# Copyright (c) 2018 Peter Newman
|
||||
# Copyright (c) 2018,2025 Peter Newman
|
||||
# Copyright (c) 2020 Luca Berra
|
||||
# Copyright (c) 2022 Marco Markgraf
|
||||
#
|
||||
@@ -50,7 +50,7 @@
|
||||
# https://www.claudiokuenzler.com/monitoring-plugins/check_esxi_hardware.php
|
||||
#
|
||||
#@---------------------------------------------------
|
||||
#@ History
|
||||
#@ History / ChangeLog
|
||||
#@---------------------------------------------------
|
||||
#@ Date : 20080820
|
||||
#@ Author : David Ligeret
|
||||
@@ -303,6 +303,10 @@
|
||||
#@ Reason : Update to newer pywbem exception call, catch HTTPError
|
||||
#@ Attn : Requires 'packaging' Python module from now on!
|
||||
#@---------------------------------------------------
|
||||
#@ Date : 20250716
|
||||
#@ Author : Peter Newman
|
||||
#@ Reason : Adjust exit code -1 to 3 (Nagios UNKNOWN)
|
||||
#@---------------------------------------------------
|
||||
|
||||
import sys
|
||||
import time
|
||||
@@ -312,7 +316,7 @@ import json
|
||||
from optparse import OptionParser,OptionGroup
|
||||
from packaging.version import Version
|
||||
|
||||
version = '20250221'
|
||||
version = '20250716'
|
||||
|
||||
NS = 'root/cimv2'
|
||||
hosturl = ''
|
||||
@@ -607,14 +611,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 +636,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
|
||||
|
||||
Reference in New Issue
Block a user