Code

Correct timestamps of passive service
authorSven Velt <sven@velt.de>
Fri, 19 Nov 2010 10:39:17 +0000 (11:39 +0100)
committerSven Velt <sven@velt.de>
Fri, 19 Nov 2010 10:39:17 +0000 (11:39 +0100)
Old: Use "now"
New: Use timestamp of service or xml file

Signed-off-by: Sven Velt <sven@velt.de>
nagixsc/__init__.py

index c58f54dd3e9c435f24e979ccc96f1b0cdf23c088..f3797658573c36000aa1541e0310bf09a5e09eff 100644 (file)
@@ -198,10 +198,10 @@ def dict2out_passive(checks, xmltimestamp, opt_pipe, opt_verb=0):
 
                if check['service_description'] == None or check['service_description'] == '':
                        # Host check
-                       line = FORMAT_HOST % (now, check['host_name'], check['returncode'], check['output'].replace('\n', '\\n'))
+                       line = FORMAT_HOST % (timestamp, check['host_name'], check['returncode'], check['output'].replace('\n', '\\n'))
                else:
                        # Service check
-                       line =  FORMAT_SERVICE % (now, check['host_name'], check['service_description'], check['returncode'], check['output'].replace('\n', '\\n'))
+                       line =  FORMAT_SERVICE % (timestamp, check['host_name'], check['service_description'], check['returncode'], check['output'].replace('\n', '\\n'))
 
                if pipe:
                        pipe.write(line + '\n')
@@ -541,7 +541,7 @@ def daemonize(pidfile=None, stdin='/dev/null', stdout='/dev/null', stderr='/dev/
 
 ##############################################################################
 
-class MyHTTPServer(SocketServer.ForkingMixIn, BaseHTTPServer.HTTPServer):
+class MyHTTPServer(BaseHTTPServer.HTTPServer):
        def __init__(self, server_address, HandlerClass, ssl=False, sslpemfile=None):
                if ssl:
                        # FIXME: SSL is in Py2.6