Code

Added --nossl to HTTP daemons
[nagixsc.git] / nagixsc_http2nagios.py
index b0e6fd266e3522e07136c7158d1078cbad5410df..ad86b65eba536feb843e40198c1f06af8a55a11d 100755 (executable)
@@ -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)