-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpage.py
126 lines (114 loc) · 3.08 KB
/
webpage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
"""
This module contains the html the logging server uses to display its
status.
"""
htmlpage = """
<html>
<head>
<meta http-equiv="refreshNOT" content="5" />
<title>Logging Server Status Page</title>
<style type="text/css">
body {
margin-top: 10px;
margin-bottom: 10px;
margin-right: 10px;
margin-left: 10px;
font-family: verdana, arial, helvetica, sans-serif;
}
h2, h4 {
text-align: center;
padding-top: 0px;
padding-bottom: 0px;
margin: 2px;
}
table {
margin-left: auto;
margin-right: auto;
padding: 0;
border: 1px solid black;
border-collapse: collapse;
border-spacing: 0;
}
table.logs {
table-layout: fixed;
}
tr {
font-family: "Lucida Console", monospace;
font-size: 10pt;
}
tr.critical {
background-color: red;
color: yellow;
text-decoration: blink;
}
tr.error {
background-color: #ff3300; /* red */
color: yellow;
}
tr.warn {
background-color: #ffff99; /* yellow */
color: black;
}
tr.info {
background-color: lightgreen;
color: black;
}
tr.debug {
background-color: aquamarine;
color: black;
}
tr.header {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 10pt;
}
td.cell {
border: 1px solid black;
padding: 2px 2px;
}
</style>
</head>
<body>
<h4>Logging Server Status Page</h4>
<table width="50%%">
<tr class="header">
<td class="cell">Logging Server Start Time</td>
<td class="cell" colspan="2">%(starttime)s</td>
</tr>
<tr class="header">
<td class="cell">Logging Server Uptime</td>
<td class="cell" colspan="2">%(uptime)s</td>
</tr>
<tr class="header">
<td class="cell">Log Records Total</td>
<td class="cell" colspan="2">%(logrecordstotal)s</td>
</tr>
<tr class="header">
<td class="cell">Message Incoming Rate</td>
<td class="cell" colspan="2">%(incomingrate)s</td>
</tr>
<tr class="header">
<td class="cell">CPU Usage</td>
<td class="cell" colspan="2">%(cpu_usage)s</td>
</tr>
<tr class="header">
<td class="cell">Memory Usage</td>
<td class="cell" colspan="2">%(memory_usage)s</td>
</tr>
<tr class="header">
<td class="cell" rowspan="2">Disk IO</td>
<td class="cell">Read Time(milliseconds)</td>
<td class="cell">%(disk_io_read)s</td>
</tr>
<tr class="header">
<td class="cell">Write Time(milliseconds)</td>
<td class="cell">%(disk_io_write)s</td>
</tr>
</table width="95%%">
<!-- table of most recent log records -->
<h4>Most Recent Log Records</h4>
<table>
%(all)s
</table>
</body>
</html>
"""