1 #!{{ python_executable }}
10 command = ["{{ monitor_bin }}", "-a"]
11 subprocess.call(command)
13 cgitb.enable(display=0, logdir="/tmp/cgi.log")
14 form = cgi.FieldStorage()
16 json_file = "{{ json_file }}"
18 if not os.path.exists(json_file) or "refresh" in form:
21 if not os.path.exists(json_file):
23 <link rel="stylesheet" href="pure-min.css">
24 <link rel="stylesheet" href="/style.css">
27 No status file found</p></body></html>"""
30 result = json.load(open(json_file))
33 print "<link rel=\"stylesheet\" href=\"pure-min.css\">"
34 print "<link rel=\"stylesheet\" href=\"/style.css\">"
36 print "<h1>Monitoring :</h1>"
37 print "<form action=\"/index.cgi\" method=\"post\" class=\"pure-form-aligned\">"
38 print "<input type=\"hidden\" name=\"posting-script\" value=\"{{ pwd }}/{{ this_file }}\">"
39 print "<p><em>Last time of monitoring process : %s</em></p>" % (result['datetime'])
40 del result['datetime']
41 print "<div class=\"pure-controls\"><button type=\"submit\" class=\"pure-button \
42 pure-button-primary\" name=\"refresh\" value=\"refresh\">Refresh</button></div></form>"
45 print "<h2>These scripts and promises have failed :</h2>"
48 print "<h3>%s</h3><pre style=\"padding-left:30px;\">%s</pre>" % (cgi.escape(r), cgi.escape(result[r]))
51 print "<h2>These scripts and promises were successful :</h2>"
55 print "<li>%s</li>" % (r)
57 print "</body></html>"