X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/c62ce789e4954af1586ca4ae6c8e45da7117492e..aad00cd68c41d392875a7d458ebe04cbf9796673:/cookbooks/tile/templates/default/debug.erb diff --git a/cookbooks/tile/templates/default/debug.erb b/cookbooks/tile/templates/default/debug.erb index 3da30dfeb..03af6549f 100755 --- a/cookbooks/tile/templates/default/debug.erb +++ b/cookbooks/tile/templates/default/debug.erb @@ -4,6 +4,7 @@ import cgi import cgitb import os +import re import sys import resource import time @@ -48,6 +49,12 @@ def output_error(message): 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]) @@ -59,6 +66,8 @@ print "" print "" print "

tile.openstreetmap.org debug

" print "

Server Stats

" +if cache_server: + print "

Cache Server: %s

" % cache_server print "

" print "Render Server: <%= node['fqdn'] %>
" print "Load Average: %s

" % loadavg