display timezone in header
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/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)
|
# Wait for heartbeat messages and act on them (or their absence)
|
||||||
#
|
#
|
||||||
import time, os, string, sys, socket, atexit, select, SocketServer, getopt, signal, cPickle
|
import time, os, string, sys, socket, atexit, select, SocketServer, getopt, signal, cPickle
|
||||||
@@ -387,6 +387,7 @@ class HtmlHandler(SocketServer.BaseRequestHandler):
|
|||||||
else:
|
else:
|
||||||
code=200
|
code=200
|
||||||
cause="OK"
|
cause="OK"
|
||||||
|
|
||||||
self.request.send("HTTP/1.0 %s %s\r\n" % (code, cause))
|
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("Date: %s\r\n" % time.strftime("%a, %d %b %Y %H:%M:%S GMT",time.gmtime(now)))
|
||||||
self.request.send("Server: hbd\r\n")
|
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("<meta http-equiv=Refresh content=%d>\n" % 60)
|
||||||
res.append("</head>")
|
res.append("</head>")
|
||||||
res.append('<body BGCOLOR="#FFFFFF" LINK="#008000" VLINK="#008000" BACKGROUND="/~andreas/images/tile.marble.gif">')
|
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("<table>")
|
||||||
res.append("<tr><th>Host</th><th>State</th><th>IP Addr</th><th>Res</th><th>Last change</th></tr>\n" )
|
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()
|
hosts_sorted=hosts.keys()
|
||||||
|
|||||||
Reference in New Issue
Block a user