forked from HappyFaceMonitoring/HappyFaceModules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Nagios.html
64 lines (55 loc) · 2.1 KB
/
Nagios.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
## -*- coding: utf-8 -*-
<%inherit file="/module_base.html" />
<%def name="content()">
% if not service_info:
<p>No services in list!</p>
% elif dataset['services_not_ok'] == 0:
<p>All ${dataset['services_ok']} services are OK!</p>
% else:
<table class="TableData">
<tr class="TableHeader">
<td>Host</td>
<td>Service</td>
<td>Status</td>
<td>Status MR</td>
</tr>
% for info in service_info:
% if info['status_short'].lower() != 'ok':
% if info['status_short'].lower() == 'warning':
<tr bgcolor=#FFFF96>
% elif info['status_short'].lower() == 'critical':
<tr bgcolor=#FF6464>
% endif
<td><a href="${info['host_link']}">${info['host_name']}</a></td>
<td><a href="${info['service_link']}">${info['service_name']}</a></td>
<td><span title="${['status_long']}">${info['status_short']}</span></td>
<td>${info['status_machine_readable']}</td>
</tr>
% endif
% endfor
</table>
% endif
% if dataset['services_ok'] != 0:
<input type="button" value="show/hide good services" onfocus="this.blur()" onclick="$('#${module.instance_name}_details').slideToggle()" />
<div id="${module.instance_name}_details" style="display:none;">
<table class="TableData">
<tr class="TableHeader">
<td>Host</td>
<td>Service</td>
<td>Status</td>
<td>Status MR</td>
</tr>
% for info in service_info:
% if info['status_short'].lower() == 'ok':
<tr bgcolor=#AAFFAA>
<td><a href="${info['host_link']}">${info['host_name']}</a></td>
<td><a href="${info['service_link']}">${info['service_name']}</a></td>
<td><span title="${['status_long']}">${info['status_short']}</span></td>
<td>${info['status_machine_readable']}</td>
</tr>
% endif
% endfor
</table>
</div>
% endif
</%def>