forked from ccnmtl/hound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
94 lines (84 loc) · 3.65 KB
/
index.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Hound</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<style type="text/css">
tr.OK th { background-color: #ccffcc; }
tr.Failed th { background-color: #ffcccc; }
tr.Error th { background-color: #ffddcc; }
th { vertical-align: top; white-space:nowrap;}
a.box {
display: block;
float: left;
width: 10px;
height: 10px;
margin: 1px;
border: 1px solid black;
}
a.OK { background-color: #0f0;}
a.Failed { background-color: #f00;}
a.Error { background-color: #f60;}
</style>
</head>
<body>
<div class="container">
<h1>Hound</h1>
<div>
<div>
{{ range $index, $element := .Alerts }}
<a class="box {{$element.Status}}"
href="#alert-{{$element.Hash}}"
title="{{$element.Name}}"></a>
{{ end }}
<div class="clearfix"></div>
</div>
<img width="800" height="150" src="{{.GraphiteBase}}?width=800&height=150&_salt=1399312175.381&target=keepLastValue({{.MetricBase}}errors)&target=keepLastValue({{.MetricBase}}successes)&target=keepLastValue({{.MetricBase}}failures)&from=-24hours&areaMode=stacked&bgcolor=ffffff&fgcolor=333333&colorList=ff6600,44bb44,ff0000"/><br />
<img width="800" height="75" src="{{.GraphiteBase}}?width=800&height=75&hideGrid=true&hideLegend=true&graphOnly=false&hideAxes=false&_salt=1399312175.381&target=keepLastValue({{.MetricBase}}errors)&target=keepLastValue({{.MetricBase}}successes)&target=keepLastValue({{.MetricBase}}failures)&from=-7days&areaMode=stacked&bgcolor=eeeeee&fgcolor=333333&colorList=ff6600,44bb44,ff0000"/>
</div>
<table class="table table-sm table-striped table-responsive">
<tr>
<th>Metric</th>
<th></th>
<th>Current Value/Threshold</th>
<th>Graphite Metric</th>
</tr>
{{ range $index, $element := .Alerts }}
<tr class="{{ $element.BootstrapStatus }}">
<th>
<a id="alert-{{$element.Hash}}"></a>
{{if eq $element.Icon "info"}}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 8 8">
<path d="M3 0c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm-1.5 2.5c-.83 0-1.5.67-1.5 1.5h1c0-.28.22-.5.5-.5s.5.22.5.5-1 1.64-1 2.5c0 .86.67 1.5 1.5 1.5s1.5-.67 1.5-1.5h-1c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-.36 1-1.84 1-2.5 0-.81-.67-1.5-1.5-1.5z" transform="translate(2)"
/>
</svg>
{{end}}
{{if eq $element.Icon "warning"}}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 8 8">
<path d="M3.09 0c-.06 0-.1.04-.13.09l-2.94 6.81c-.02.05-.03.13-.03.19v.81c0 .05.04.09.09.09h6.81c.05 0 .09-.04.09-.09v-.81c0-.05-.01-.14-.03-.19l-2.94-6.81c-.02-.05-.07-.09-.13-.09h-.81zm-.09 3h1v2h-1v-2zm0 3h1v1h-1v-1z" />
</svg>
{{end}}
{{$element.Name}}
</th>
<td>
<a href="/alert/{{$element.Hash}}/">
<!-- open-iconic graph.svg -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 8 8">
<path d="M7.03 0l-3.03 3-1-1-3 3.03 1 1 2-2.03 1 1 4-4-.97-1zm-7.03 7v1h8v-1h-8z" />
</svg>
</a>
</td>
<td>
{{$element.Value}} {{$element.RenderDirection}} {{$element.Threshold}}
</td>
<td><small>
{{$element.Metric}}
</small></td>
</tr>
{{ end }}
</table>
</div><!-- end .container -->
</body>
</html>