1
0
mirror of https://github.com/Napsty/check_esxi_hardware.git synced 2026-02-06 15:15:20 +01:00

2 Commits

Author SHA1 Message Date
Claudio Kuenzler
d8f9fa1c82 Fix reported issues #47 and #48 (#49) 2020-07-10 07:30:43 +02:00
Claudio Kuenzler
274dceee74 Allow to overwrite system defaults for SSL protocol (#46)
* Add parameter (-S) for custom SSL/TLS protocol version

* Add parameter (-S) for custom SSL/TLS protocol version

* Add parameter (-S) for custom SSL/TLS protocol version
2020-06-05 16:12:13 +02:00

View File

@@ -275,6 +275,11 @@
#@ Author : Claudio Kuenzler
#@ Reason : Add parameter (-S) for custom SSL/TLS protocol version
#@---------------------------------------------------
#@ Date : 20200710
#@ Author : Claudio Kuenzler
#@ Reason : Improve missing mandatory parameter error text (issue #47)
#@ Delete temporary openssl config file after use (issue #48)
#@---------------------------------------------------
from __future__ import print_function
import sys
@@ -284,7 +289,7 @@ import re
import pkg_resources
from optparse import OptionParser,OptionGroup
version = '20200605'
version = '20200710'
NS = 'root/cimv2'
hosturl = ''
@@ -585,7 +590,7 @@ def getopts() :
mandatories = ['host', 'user', 'password']
for m in mandatories:
if not options.__dict__[m]:
print("mandatory parameter '--" + m + "' is missing\n")
print("mandatory option '" + m + "' not defined. read usage in help.\n")
parser.print_help()
sys.exit(-1)
@@ -1013,6 +1018,10 @@ if perfdata:
if perf == '|':
perf = ''
# Cleanup temporary openssl config
if sslproto:
os.remove(sslconfpath)
if GlobalStatus == ExitOK :
print("OK - Server: %s %s %s%s" % (server_info, SerialNumber, bios_info, perf))