Code

obsses: Debug output, typo
authorSven Velt <sven@velt.de>
Fri, 15 Oct 2010 08:33:40 +0000 (10:33 +0200)
committerSven Velt <sven@velt.de>
Fri, 15 Oct 2010 08:33:40 +0000 (10:33 +0200)
Signed-off-by: Sven Velt <sven@velt.de>
obsess_daemon.py

index 01021a4ce8a736f0c3e15f4c252a164cf3dd3a6a..06da3fe51108a529e8f53ed6cf527aa401d238cb 100755 (executable)
@@ -28,6 +28,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 +42,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 +53,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)