-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
195 lines (158 loc) · 4.83 KB
/
index.php
File metadata and controls
195 lines (158 loc) · 4.83 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?php
require_once(dirname(__FILE__) . '/../../common.inc.php');
// initialization stuff
pre_init();
// start session
init_session();
// grab GET or POST variables
grab_request_vars();
// check prereqs
check_prereqs();
// check authentication
check_authentication(false);
$refreshvalue = 10; //value in seconds to refresh page
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>NOC</title>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style type="text/css">
body {
background: #404040;
padding: .5em;
}
#taskbar {
background: lightgrey;
}
.noc_summary_data {
font-size: 5em;
line-height: 1em;
text-align: center;
}
.noc_unknown, .noc_warning, .noc_unknown a, .noc_warning a {
color: black;
text-shadow: none;
}
.noc_critical, .noc_ok, .noc_critical a, .noc_ok a {
color: white;
text-shadow: 1px 1px 0 #5f0000;
}
.noc_ok {
background: green;
color: white;
text-shadow: 1px 1px 0 #015f00;
}
.noc_warning {
background: yellow;
color: black;
text-shadow: -1px -1px 0 #feff5f;
}
.noc_unknown {
background: orange;
color: black;
text-shadow: -1px -1px 0 #feff5f;
}
.noc_critical {
background: red;
color: white;
text-shadow: 1px 1px 0 #5f0000;
}
.nagios_statusbar {
background: gray;
background: -moz-linear-gradient(top center, #6a6a6a, #464646);
position: fixed;
bottom: 0;
width: 100%;
margin: 0 0 0 -1em;
height: 40px;
text-align: right;
border-top: 1px solid #818181;
opacity: .9;
}
.nagios_statusbar_item {
border-left: 2px groove #000;
height: 40px;
line-height: 40px;
padding: 0 1em;
color: white;
text-shadow: 1px 1px 0 black;
position: relative;
float: right;
}
#loading {
background: transparent url(../../../images/throbber.gif) no-repeat center center;
width: 24px;
height: 40px;
position: absolute;
}
.newAlert {
font-weight: bold;
}
</style>
</head>
<body>
<script type="text/javascript">
var placeHolder, refreshValue = 10;
var count = refreshValue;
$().ready(function () {
placeHolder = $("#nagios_placeholder");
updateNagiosData(placeHolder);
window.setInterval(updateCountDown, 1000);
});
// timestamp stuff
function createTimeStamp() {
// create timestamp
var ts = new Date();
ts = ts.toTimeString();
ts = ts.replace(/\s+\(.+/ig, "");
$("#timestamp_wrap").empty().append("<div class=\"timestamp_drop\"></div><div class=\"timestamp_stamp\">" + ts + "</div>");
}
function updateNagiosData(block) {
$("#loading").fadeIn(200);
block.load("./details.php", function (response) {
$(this).html(response);
$("#loading").fadeOut(200);
createTimeStamp();
});
}
function updateCountDown() {
var countdown = $("#refreshing_countdown");
count--;
if (count == 0) {
updateNagiosData(placeHolder);
count = refreshValue;
}
countdown.text(count);
}
</script>
<div id="nagios_placeholder"></div>
<div class="nagios_statusbar">
<div class="nagios_statusbar_item">
<div id="timestamp_wrap"></div>
</div>
<div class="nagios_statusbar_item">
<div id="loading"></div>
<p id="refreshing">Refresh in <span id="refreshing_countdown"></span> seconds</p>
</div>
</div>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>
</html>