From ca0fe3b5a87abab2f8855611419c788939dbbfad Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 14 Jul 2005 19:26:01 +0000 Subject: [PATCH] rename the main daemon --- watcharnsberg => hbd | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) rename watcharnsberg => hbd (87%) diff --git a/watcharnsberg b/hbd similarity index 87% rename from watcharnsberg rename to hbd index c787226..5c61c32 100755 --- a/watcharnsberg +++ b/hbd @@ -1,5 +1,5 @@ #!/usr/bin/env python -# $Id: watcharnsberg,v 1.5 2005/05/06 14:39:27 andreas Exp $ +# $Id: hbd,v 1.1 2005/07/14 19:26:01 andreas Exp $ # Wait for heartbeat messages and act on them (or their absence) # import time, os, string, sys, socket, curses, atexit, select, SocketServer @@ -304,34 +304,6 @@ def updatestats(): # # # -def genhtml(now): - f=open("/home/andreas/public_html/private/watcharnsberg.html","w") - f.write("") - f.write("") - f.write("\n" % 10) - f.write("") - f.write('') - f.write("

Heartbeat status at %s

" % time.strftime("%H:%M:%S", time.localtime(now))) - f.write("") - f.write("\n" ) - for h in hosts: - f.write("\n" % (h, hosts[h].state, hosts[h].addr, hosts[h].uppercent, time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(hosts[h].statetime)))) - f.write("
HostStateIP AddrResLast change
%-24s%-7s%-16s%-3s%-17s
") - f.write("

") - for m in msgs[len(msgs)-30:]: - f.write("%s
" % m) - os.environ['SCRIPT_FILENAME']="/home/andreas/bin/watcharnsberg" - g=os.popen("/home/andreas/cgi-bin/trailer.py", "r") - o=g.readlines() - g.close() - f.write(string.join(o,"")) - f.close() - -# -# -# - - def initcurses(): global stdscr stdscr = curses.initscr() @@ -400,11 +372,6 @@ class HtmlHandler(SocketServer.BaseRequestHandler): res.append("

") for m in msgs[len(msgs)-30:]: res.append("%s
" % m) -# os.environ['SCRIPT_FILENAME']="/home/andreas/bin/watcharnsberg" -# g=os.popen("/home/andreas/cgi-bin/trailer.py", "r") -# o=g.readlines() -# g.close() -# res.append(string.join(o,"")) try: self.request.send(string.join(res,"\n")) @@ -476,8 +443,6 @@ while 1: next=now+1 if int(now) % INTERVAL == startsec: updatestats() -## if int(now) % 60 == 0: -## genhtml(now) checkoverdue() if visual: stdscr.move(1 , 0)