diff --git a/nagixsc/__init__.py b/nagixsc/__init__.py
index 827a104b26c849d855a4e919d3afcad22e342484..036fe7e16d33ce474909d327ef6782fece7b8510 100644 (file)
--- a/nagixsc/__init__.py
+++ b/nagixsc/__init__.py
import ConfigParser
import SocketServer
import base64
-import datetime
import libxml2
import mimetools
import os
import string
import subprocess
import sys
+import time
import urllib2
def debug(level, verb, string):
@@ -116,7 +116,7 @@ def exec_check(host_name, service_descr, cmdline, cmdprefix='', timeout=None, ti
except OSError:
pass
- check['timestamp'] = datetime.datetime.now().strftime('%s')
+ check['timestamp'] = str(long(time.time()))
return check
FORMAT_HOST = '[%s] PROCESS_HOST_CHECK_RESULT;%s;%s;%s'
FORMAT_SERVICE = '[%s] PROCESS_SERVICE_CHECK_RESULT;%s;%s;%s;%s'
count_services = 0
- now = datetime.datetime.now().strftime('%s')
+ now = str(long(time.time()))
# Prepare
if opt_verb <= 2:
count_failed = 0
list_failed = []
chars = string.letters + string.digits
- ctimestamp = datetime.datetime.now().ctime()
+ ctimestamp = time.ctime()
random.seed()
for check in checks:
def xml_to_dict(xmldoc, verb=0, hostfilter=None, servicefilter=None):
checks = []
- now = int(datetime.datetime.now().strftime('%s'))
+ now = long(time.time())
filetimestamp = reset_future_timestamp(xml_get_timestamp(xmldoc), now)
if hostfilter:
xmldoc = libxml2.newDoc('1.0')
xmlroot = xmldoc.newChild(None, 'nagixsc', None)
xmlroot.setProp('version', '1.0')
- xmltimestamp = xmlroot.newChild(None, 'timestamp', datetime.datetime.now().strftime('%s'))
+ xmltimestamp = xmlroot.newChild(None, 'timestamp', str(long(time.time())))
for entry in db:
check = entry[1]