From: Sven Velt Date: Thu, 18 Feb 2010 12:08:43 +0000 (+0100) Subject: Added --nossl to HTTP daemons X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e49ca957f7c364fe2352f04e10c2529194c322da;p=nagixsc.git Added --nossl to HTTP daemons Disable SSL on command line even if it's activated in cfg file. Signed-off-by: Sven Velt --- diff --git a/nagixsc_conf2http.py b/nagixsc_conf2http.py index d296bff..abeed4e 100755 --- a/nagixsc_conf2http.py +++ b/nagixsc_conf2http.py @@ -22,6 +22,7 @@ from nagixsc import * parser = optparse.OptionParser() parser.add_option('-c', '', dest='cfgfile', help='Config file') +parser.add_option('', '--nossl', action='store_true', dest='nossl', help='Disable SSL (overwrites config file)') parser.set_defaults(cfgfile='conf2http.cfg') @@ -124,6 +125,9 @@ class Conf2HTTPHandler(MyHTTPRequestHandler): def main(): + if options.nossl: + config['ssl'] = False + if config['ssl'] and not os.path.isfile(config['cert']): print 'SSL certificate "%s" not found!' % config['cert'] sys.exit(127) diff --git a/nagixsc_http2nagios.py b/nagixsc_http2nagios.py index b0e6fd2..ad86b65 100755 --- a/nagixsc_http2nagios.py +++ b/nagixsc_http2nagios.py @@ -22,6 +22,7 @@ from nagixsc import * parser = optparse.OptionParser() parser.add_option('-c', '', dest='cfgfile', help='Config file') +parser.add_option('', '--nossl', action='store_true', dest='nossl', help='Disable SSL (overwrites config file)') parser.set_defaults(cfgfile='http2nagios.cfg') @@ -121,6 +122,9 @@ class HTTP2NagiosHandler(MyHTTPRequestHandler): def main(): + if options.nossl: + config['ssl'] = False + if config['ssl'] and not os.path.isfile(config['cert']): print 'SSL certificate "%s" not found!' % config['cert'] sys.exit(127)