X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=obsess_daemon.py;h=5df8916822b5e85661c41a1933cf8587124398c0;hb=700904cb0a254d0230fb829f7c0dacfe84676f6d;hp=01021a4ce8a736f0c3e15f4c252a164cf3dd3a6a;hpb=58b960f25d3c2b883057fcab8be70fa86c474817;p=nagixsc.git diff --git a/obsess_daemon.py b/obsess_daemon.py index 01021a4..5df8916 100755 --- a/obsess_daemon.py +++ b/obsess_daemon.py @@ -1,4 +1,21 @@ #!/usr/bin/python +# +# Nag(ix)SC -- obsess_daemon.py +# +# Copyright (C) 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 os import re @@ -28,6 +45,7 @@ def read_obsess_file(filename): checks = [] f = open(filename) print 'Read ' + filename + count_lines = 0 for line in f: if line.startswith('LASTSERVICECHECK'): @@ -41,7 +59,9 @@ def read_obsess_file(filename): checks.append({'host_name':m.group(2), 'service_description':None, 'returncode':m.group(3), 'output':'\n'.join(m.group(4,5)), 'timestamp':m.group(1)}) else: print 'FAIL: ' + line + count_lines += 1 + print "Read %s lines" % count_lines f.close() return checks @@ -50,7 +70,7 @@ def read_obsess_file(filename): if len(sys.argv) != 4: print 'Please call script as: "%s http://SERVER:PORT/ username password"\n' % sys.argv[0] - print '... with "http://SERVER:PORT/" your conf2http-URL' + print '... with "http://SERVER:PORT/" your http2nagios-URL' print '... and "username"/"password" authentication data for it' sys.exit(1)