import cgi
import cgitb
import os
+import re
import sys
import resource
import time
if not os.environ.has_key('HTTP_USER_AGENT'):
os.environ['HTTP_USER_AGENT'] = 'NONE'
+# Get the cache server name
+if os.environ.has_key('HTTP_VIA'):
+ cache_server = re.search('[a-z0-9-]+\.openstreetmap\.org', os.environ['HTTP_VIA']).group(0)
+else:
+ cache_server = None
+
# Get the load average
loadavg = float(open("/proc/loadavg").readline().split(" ")[0])
print "<body>"
print "<h1>tile.openstreetmap.org debug</h1>"
print "<h2>Server Stats</h2>"
+if cache_server:
+ print "<p><b>Cache Server</b>: %s</p>" % cache_server
print "<p>"
print "<b>Render Server</b>: <%= node['fqdn'] %><br />"
print "<b>Load Average</b>: %s</p>" % loadavg
file = "/srv/tile.openstreetmap.org/data/#{File.basename(url)}"
file_basename = File.basename(url)
-%>
-print "<b>%s</b> last modified: %s" % (<%= file_basename %>, time.ctime(os.path.getmtime(<%= file %>)))
+print "<b>%s</b> last modified: %s<br />" % ("<%= file_basename %>", time.ctime(os.path.getmtime("<%= file %>")))
<%
end
-%>