X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=nagixsc_xml2nagios.py;h=15ec5a17222303d6bd8121fd54f1265ce7c1d2e2;hb=50a45b3c9cb2a105931bf62c08775cab3c220d06;hp=3aee034cfbac0ade5d5ea0a499a4791d9afb2886;hpb=37db4aca3919bd1abd55a4eecccce70f814acad5;p=nagixsc.git diff --git a/nagixsc_xml2nagios.py b/nagixsc_xml2nagios.py index 3aee034..15ec5a1 100755 --- a/nagixsc_xml2nagios.py +++ b/nagixsc_xml2nagios.py @@ -1,11 +1,28 @@ #!/usr/bin/python +# +# Nag(ix)SC -- nagixsc_xml2nagios.py +# +# Copyright (C) 2009-2010 Sven Velt +# +# 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; only version 2 of the License is applicable. +# +# 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 +110,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