display timezone in header

This commit is contained in:
andreas
2010-08-21 14:19:32 +00:00
parent 6d8ef8fec9
commit 60ba32f1c7
+3 -2
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# $Id: hbd,v 1.23 2010/08/21 14:07:17 andreas Exp $
# $Id: hbd,v 1.24 2010/08/21 14:19:32 andreas Exp $
# Wait for heartbeat messages and act on them (or their absence)
#
import time, os, string, sys, socket, atexit, select, SocketServer, getopt, signal, cPickle
@@ -387,6 +387,7 @@ class HtmlHandler(SocketServer.BaseRequestHandler):
else:
code=200
cause="OK"
self.request.send("HTTP/1.0 %s %s\r\n" % (code, cause))
self.request.send("Date: %s\r\n" % time.strftime("%a, %d %b %Y %H:%M:%S GMT",time.gmtime(now)))
self.request.send("Server: hbd\r\n")
@@ -414,7 +415,7 @@ class HtmlHandler(SocketServer.BaseRequestHandler):
res.append("<meta http-equiv=Refresh content=%d>\n" % 60)
res.append("</head>")
res.append('<body BGCOLOR="#FFFFFF" LINK="#008000" VLINK="#008000" BACKGROUND="/~andreas/images/tile.marble.gif">')
res.append("<H2>Heartbeat status at %s</H2>" % time.strftime("%H:%M:%S", time.localtime(now)))
res.append("<H2>Heartbeat status at %s (%s)</H2>" % time.strftime("%H:%M:%S", time.localtime(now)), os.environ.get('TZ','Europe/Berlin'))
res.append("<table>")
res.append("<tr><th>Host</th><th>State</th><th>IP Addr</th><th>Res</th><th>Last change</th></tr>\n" )
hosts_sorted=hosts.keys()