diff --git a/nagixsc_http2nagios.py b/nagixsc_http2nagios.py
index 4c23fe50d908cf549b6df4e25cfaab5a5bf82956..ad86b65eba536feb843e40198c1f06af8a55a11d 100755 (executable)
--- a/nagixsc_http2nagios.py
+++ b/nagixsc_http2nagios.py
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')
self.wfile.write('Wrote %s check results, %s failed' % (count_services, count_failed))
return
else:
- http_error(500, 'Could not write all %s check results' % count_services)
+ self.http_error(501, 'Could not write all %s check results' % count_services)
return
else:
- http_error(500, 'Nag(IX)SC - No data received')
+ self.http_error(502, 'Nag(IX)SC - No data received')
return
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)