2019-12-10 07:12:50 +00:00
|
|
|
$def with (output, now)
|
2017-01-07 11:46:50 +00:00
|
|
|
|
2019-08-16 17:07:50 +00:00
|
|
|
<body onload="draw($output[0]['s_rate']);">
|
2017-01-07 11:46:50 +00:00
|
|
|
$ errors = 0
|
|
|
|
$ color = "green"
|
2019-08-22 08:52:18 +00:00
|
|
|
<div>
|
2019-11-25 14:49:07 +00:00
|
|
|
<div class="download-header">
|
2019-12-10 07:12:50 +00:00
|
|
|
<button class="download-button" onclick="window.location.href = 'download';">Download Report</button>
|
2019-11-25 14:49:07 +00:00
|
|
|
</div>
|
2020-01-20 14:10:37 +00:00
|
|
|
<div style="height: 100%;border-right:2px solid #ccc; padding:5px;overflow-x: hidden; float:left; width:48%">
|
2017-01-07 11:46:50 +00:00
|
|
|
$for server in range(len(output)):
|
|
|
|
$code:
|
|
|
|
errors = 0
|
|
|
|
color = "green"
|
|
|
|
|
|
|
|
$for check in output[server]['result'].keys():
|
|
|
|
$ isError = output[server]['result'].get(check)
|
|
|
|
$if isError != 0:
|
|
|
|
$code:
|
|
|
|
errors=errors+1
|
|
|
|
|
|
|
|
$if errors > 0:
|
|
|
|
$code:
|
|
|
|
color = "red"
|
2019-08-22 08:52:18 +00:00
|
|
|
<button class="accordion ${color}" onmouseenter="draw($output[server]['s_rate'])">$output[server]['name']: $errors error(s)</button>
|
2017-01-07 11:46:50 +00:00
|
|
|
<div class="panel">
|
|
|
|
|
|
|
|
<br>
|
|
|
|
<table width=100%>
|
|
|
|
<thead class="server-link">
|
|
|
|
<tr><th colspan="2">
|
|
|
|
<a href="$output[server]['url']" target="_blank">$output[server]['name']</a>
|
|
|
|
</th></tr>
|
|
|
|
</thead>
|
|
|
|
$for check in output[server]['result'].keys():
|
|
|
|
$ isError = output[server]['result'].get(check)
|
|
|
|
$if isError != 0:
|
|
|
|
<tr>
|
|
|
|
<td><a href="$output[server]['url']/$check"
|
|
|
|
target="_blank">$check</a></td>
|
|
|
|
<td><a href="$output[server]['url']/$check"
|
|
|
|
target="_blank"><img src="static/img/error.png"></a></td>
|
|
|
|
</tr>
|
|
|
|
$else:
|
|
|
|
<tr>
|
|
|
|
<td>$check</td>
|
|
|
|
<td><img src="static/img/ok.png"></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
$else:
|
|
|
|
$code:
|
|
|
|
color = "green"
|
2019-08-22 08:52:18 +00:00
|
|
|
<button class="accordion ${color}" onmouseenter="draw($output[server]['s_rate'])">$output[server]['name']</button>
|
2017-01-07 11:46:50 +00:00
|
|
|
<div class="panel">
|
|
|
|
|
|
|
|
<br>
|
|
|
|
<table width=100%>
|
|
|
|
<thead class="server-link">
|
|
|
|
<tr><th colspan="2">
|
|
|
|
<a href="$output[server]['url']" target="_blank">$output[server]['name']</a>
|
|
|
|
</th></tr>
|
|
|
|
</thead>
|
|
|
|
$for check in output[server]['result'].keys():
|
|
|
|
$ isError = output[server]['result'].get(check)
|
|
|
|
$if isError != 0:
|
|
|
|
<tr>
|
|
|
|
<td><a href="$output[server]['url']/$check"
|
|
|
|
target="_blank">$check</a></td>
|
|
|
|
<td><a href="$output[server]['url']/$check"
|
|
|
|
target="_blank"><img src="static/img/error.png"></a></td>
|
|
|
|
</tr>
|
|
|
|
$else:
|
|
|
|
<tr>
|
|
|
|
<td>$check</td>
|
|
|
|
<td><img src="static/img/ok.png"></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
</table>
|
|
|
|
</div>
|
2019-08-22 08:52:18 +00:00
|
|
|
</div>
|
2017-01-07 11:46:50 +00:00
|
|
|
|
|
|
|
|
2019-10-04 15:57:08 +00:00
|
|
|
<div class="canvas-container">
|
2019-10-04 09:29:56 +00:00
|
|
|
<div class="canvas-graph">
|
2019-10-04 15:57:08 +00:00
|
|
|
<div class="canvas-header"><h2 style="margin: 0">Hosts status</h2></div>
|
2019-08-22 08:52:18 +00:00
|
|
|
<canvas id="canvas" width="400" height="400"></canvas>
|
2019-10-04 09:29:56 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-01-20 14:10:37 +00:00
|
|
|
<div style="height: 10%; float:right">
|
2019-08-22 08:52:18 +00:00
|
|
|
<br><br><br>
|
2017-01-07 11:46:50 +00:00
|
|
|
Latest update: $now.day/$now.month/$now.year, $now.hour:$now.minute:$now.second
|
|
|
|
<br><br>
|
2020-01-20 14:10:37 +00:00
|
|
|
<a href="/">Home</a> | <a href="/help">Help</a>
|
2019-08-22 08:52:18 +00:00
|
|
|
</div>
|
2017-01-07 11:46:50 +00:00
|
|
|
|
2019-08-22 08:52:18 +00:00
|
|
|
</div>
|
2019-08-16 14:36:40 +00:00
|
|
|
</body>
|
2019-08-16 15:29:41 +00:00
|
|
|
|
|
|
|
<script src="static/monit-dashboard.js" type="text/javascript"></script>
|