rename the main daemon

This commit is contained in:
andreas
2005-07-14 19:26:01 +00:00
parent e72c52b00f
commit ca0fe3b5a8
+1 -36
View File
@@ -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("<html>")
f.write("<head>")
f.write("<meta http-equiv=Refresh content=%d>\n" % 10)
f.write("</head>")
f.write('<body BGCOLOR="#FFFFFF" LINK="#008000" VLINK="#008000" BACKGROUND="/~andreas/images/tile.marble.gif">')
f.write("<H2>Heartbeat status at %s</H2>" % time.strftime("%H:%M:%S", time.localtime(now)))
f.write("<table>")
f.write("<tr><th>Host</th><th>State</th><th>IP Addr</th><th>Res</th><th>Last change</th></tr>\n" )
for h in hosts:
f.write("<tr><td>%-24s</td><td>%-7s</td><td>%-16s</td><td>%-3s</td><td>%-17s</td></tr>\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("</table>")
f.write("<P>")
for m in msgs[len(msgs)-30:]:
f.write("%s<BR>" % 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("<P>")
for m in msgs[len(msgs)-30:]:
res.append("%s<BR>" % 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)