Code

Changed license to GPL-2+ (from GPL-2only).
[nagixsc.git] / nagixsc_xml2nagios.py
index 3aee034cfbac0ade5d5ea0a499a4791d9afb2886..fae228ee3acd3fe4abced8b0a472fe281eb3d1ed 100755 (executable)
@@ -1,11 +1,29 @@
 #!/usr/bin/python
+#
+# Nag(ix)SC -- nagixsc_xml2nagios.py
+#
+# Copyright (C) 2009-2010 Sven Velt <sv@teamix.net>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 #import base64
-import datetime
 import libxml2
 import optparse
 import os
 import sys
+import time
 
 NAGIOSCMDs = [ '/usr/local/nagios/var/rw/nagios.cmd', '/var/lib/nagios3/rw/nagios.cmd', ]
 CHECKRESULTDIRs = [ '/usr/local/nagios/var/spool/checkresults', '/var/lib/nagios3/spool/checkresults', ]
@@ -93,7 +111,7 @@ elif options.mode == 'active':
 doc = read_xml(options)
 
 # Now timestamp AFTER getting the XML file
-now = int(datetime.datetime.now().strftime('%s'))
+now = long(time.time())
 
 
 # Check XML against DTD