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

3 Commits

Author SHA1 Message Date
Napsty
3186d26184 Add parameter (-S) for custom SSL/TLS protocol version 2020-06-05 14:50:32 +02:00
Napsty
a52c6a0b6c Add parameter (-S) for custom SSL/TLS protocol version 2020-06-05 14:48:39 +02:00
Napsty
ca6858ab22 Add parameter (-S) for custom SSL/TLS protocol version 2020-06-05 14:20:36 +02:00

View File

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