diff --git a/obsess_daemon.py b/obsess_daemon.py
index 01021a4ce8a736f0c3e15f4c252a164cf3dd3a6a..72236e0596606968a186ebcbe00dcefc213b5d0a 100755 (executable)
--- a/obsess_daemon.py
+++ b/obsess_daemon.py
#!/usr/bin/python
+#
+# Nag(ix)SC -- obsess_daemon.py
+#
+# Copyright (C) 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 os
import re
checks = []
f = open(filename)
print 'Read ' + filename
+ count_lines = 0
for line in f:
if line.startswith('LASTSERVICECHECK'):
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
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)