1 |
37285f69
|
Scott Ullrich
|
<?php
|
2 |
|
|
/* $Id$ */
|
3 |
|
|
/*
|
4 |
|
|
status_rrd_graph.php
|
5 |
|
|
Part of pfSense
|
6 |
6216690b
|
smos
|
Copyright (C) 2007 Seth Mos <seth.mos@dds.nl>
|
7 |
ce77a9c4
|
Phil Davis
|
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
|
8 |
37285f69
|
Scott Ullrich
|
All rights reserved.
|
9 |
|
|
|
10 |
|
|
Redistribution and use in source and binary forms, with or without
|
11 |
|
|
modification, are permitted provided that the following conditions are met:
|
12 |
|
|
|
13 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
14 |
|
|
this list of conditions and the following disclaimer.
|
15 |
|
|
|
16 |
|
|
2. Redistributions in binary form must reproduce the above copyright
|
17 |
|
|
notice, this list of conditions and the following disclaimer in the
|
18 |
|
|
documentation and/or other materials provided with the distribution.
|
19 |
|
|
|
20 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
21 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
22 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
23 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
24 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
30 |
|
|
*/
|
31 |
1d333258
|
Scott Ullrich
|
/*
|
32 |
|
|
pfSense_MODULE: system
|
33 |
|
|
*/
|
34 |
37285f69
|
Scott Ullrich
|
|
35 |
6b07c15a
|
Matthew Grooms
|
##|+PRIV
|
36 |
|
|
##|*IDENT=page-status-rrdgraphs
|
37 |
|
|
##|*NAME=Status: RRD Graphs page
|
38 |
|
|
##|*DESCR=Allow access to the 'Status: RRD Graphs' page.
|
39 |
|
|
##|*MATCH=status_rrd_graph.php*
|
40 |
|
|
##|-PRIV
|
41 |
|
|
|
42 |
37285f69
|
Scott Ullrich
|
require("guiconfig.inc");
|
43 |
5208e648
|
Ermal Lu?i
|
require_once("filter.inc");
|
44 |
|
|
require("shaper.inc");
|
45 |
483e6de8
|
Scott Ullrich
|
require_once("rrd.inc");
|
46 |
37285f69
|
Scott Ullrich
|
|
47 |
59418cee
|
Darren Embry
|
unset($input_errors);
|
48 |
|
|
|
49 |
70281b3a
|
Seth Mos
|
/* if the rrd graphs are not enabled redirect to settings page */
|
50 |
|
|
if(! isset($config['rrd']['enable'])) {
|
51 |
|
|
header("Location: status_rrd_graph_settings.php");
|
52 |
|
|
}
|
53 |
|
|
|
54 |
329bb764
|
Seth Mos
|
$rrddbpath = "/var/db/rrd/";
|
55 |
002bc4ab
|
smos
|
chdir($rrddbpath);
|
56 |
|
|
$databases = glob("*.rrd");
|
57 |
|
|
|
58 |
329bb764
|
Seth Mos
|
|
59 |
89d25faf
|
Seth Mos
|
if ($_GET['cat']) {
|
60 |
034f08e7
|
Scott Ullrich
|
$curcat = htmlspecialchars($_GET['cat']);
|
61 |
37285f69
|
Scott Ullrich
|
} else {
|
62 |
69487053
|
Seth Mos
|
if(! empty($config['rrd']['category'])) {
|
63 |
|
|
$curcat = $config['rrd']['category'];
|
64 |
|
|
} else {
|
65 |
|
|
$curcat = "system";
|
66 |
|
|
}
|
67 |
89d25faf
|
Seth Mos
|
}
|
68 |
|
|
|
69 |
cba9d7d9
|
Renato Botelho
|
if ($_GET['zone'])
|
70 |
|
|
$curzone = $_GET['zone'];
|
71 |
|
|
else
|
72 |
|
|
$curzone = '';
|
73 |
|
|
|
74 |
7d906758
|
smos
|
if ($_GET['period']) {
|
75 |
|
|
$curperiod = $_GET['period'];
|
76 |
|
|
} else {
|
77 |
97acf646
|
Erik Fonnesbeck
|
if(! empty($config['rrd']['period'])) {
|
78 |
|
|
$curperiod = $config['rrd']['period'];
|
79 |
|
|
} else {
|
80 |
|
|
$curperiod = "absolute";
|
81 |
|
|
}
|
82 |
7d906758
|
smos
|
}
|
83 |
|
|
|
84 |
89d25faf
|
Seth Mos
|
if ($_GET['option']) {
|
85 |
|
|
$curoption = $_GET['option'];
|
86 |
|
|
} else {
|
87 |
329bb764
|
Seth Mos
|
switch($curcat) {
|
88 |
|
|
case "system":
|
89 |
|
|
$curoption = "processor";
|
90 |
|
|
break;
|
91 |
|
|
case "queues":
|
92 |
|
|
$curoption = "queues";
|
93 |
|
|
break;
|
94 |
|
|
case "queuedrops":
|
95 |
|
|
$curoption = "queuedrops";
|
96 |
7432ce7b
|
Seth Mos
|
break;
|
97 |
|
|
case "quality":
|
98 |
|
|
foreach($databases as $database) {
|
99 |
|
|
if(preg_match("/[-]quality\.rrd/i", $database)) {
|
100 |
|
|
/* pick off the 1st database we find that matches the quality graph */
|
101 |
|
|
$name = explode("-", $database);
|
102 |
|
|
$curoption = "$name[0]";
|
103 |
|
|
continue 2;
|
104 |
|
|
}
|
105 |
|
|
}
|
106 |
|
|
case "wireless":
|
107 |
|
|
foreach($databases as $database) {
|
108 |
|
|
if(preg_match("/[-]wireless\.rrd/i", $database)) {
|
109 |
|
|
/* pick off the 1st database we find that matches the wireless graph */
|
110 |
|
|
$name = explode("-", $database);
|
111 |
|
|
$curoption = "$name[0]";
|
112 |
|
|
continue 2;
|
113 |
|
|
}
|
114 |
|
|
}
|
115 |
|
|
case "cellular":
|
116 |
|
|
foreach($databases as $database) {
|
117 |
|
|
if(preg_match("/[-]cellular\.rrd/i", $database)) {
|
118 |
|
|
/* pick off the 1st database we find that matches the celullar graph */
|
119 |
|
|
$name = explode("-", $database);
|
120 |
|
|
$curoption = "$name[0]";
|
121 |
|
|
continue 2;
|
122 |
|
|
}
|
123 |
329bb764
|
Seth Mos
|
}
|
124 |
edd2d8b7
|
smos
|
case "vpnusers":
|
125 |
6b0c5ae6
|
smos
|
foreach($databases as $database) {
|
126 |
edd2d8b7
|
smos
|
if(preg_match("/[-]vpnusers\.rrd/i", $database)) {
|
127 |
6b0c5ae6
|
smos
|
/* pick off the 1st database we find that matches the VPN graphs */
|
128 |
|
|
$name = explode("-", $database);
|
129 |
|
|
$curoption = "$name[0]";
|
130 |
|
|
continue 2;
|
131 |
|
|
}
|
132 |
|
|
}
|
133 |
20413b72
|
Warren Baker
|
case "captiveportal":
|
134 |
|
|
$curoption = "allgraphs";
|
135 |
|
|
break;
|
136 |
2cdb75f8
|
nagyrobi
|
case "ntpd":
|
137 |
|
|
if(isset($config['ntpd']['statsgraph'])) {
|
138 |
|
|
$curoption = "allgraphs";
|
139 |
|
|
} else {
|
140 |
|
|
$curoption = "processor";
|
141 |
|
|
$curcat = "system";
|
142 |
|
|
}
|
143 |
|
|
break;
|
144 |
329bb764
|
Seth Mos
|
default:
|
145 |
|
|
$curoption = "wan";
|
146 |
|
|
break;
|
147 |
89d25faf
|
Seth Mos
|
}
|
148 |
37285f69
|
Scott Ullrich
|
}
|
149 |
|
|
|
150 |
6b0c5ae6
|
smos
|
$now = time();
|
151 |
47e68f48
|
smos
|
if($curcat == "custom") {
|
152 |
|
|
if (is_numeric($_GET['start'])) {
|
153 |
59418cee
|
Darren Embry
|
if($start < ($now - (3600 * 24 * 365 * 5))) {
|
154 |
|
|
$start = $now - (8 * 3600);
|
155 |
|
|
}
|
156 |
|
|
$start = $_GET['start'];
|
157 |
|
|
} else if ($_GET['start']) {
|
158 |
|
|
$start = strtotime($_GET['start']);
|
159 |
|
|
if ($start === FALSE || $start === -1) {
|
160 |
|
|
$input_errors[] = gettext("Invalid start date/time:") . " '{$_GET['start']}'";
|
161 |
c7cfbbd8
|
smos
|
$start = $now - (8 * 3600);
|
162 |
59418cee
|
Darren Embry
|
}
|
163 |
|
|
} else {
|
164 |
|
|
$start = $now - (8 * 3600);
|
165 |
47e68f48
|
smos
|
}
|
166 |
|
|
}
|
167 |
|
|
|
168 |
|
|
if (is_numeric($_GET['end'])) {
|
169 |
|
|
$end = $_GET['end'];
|
170 |
59418cee
|
Darren Embry
|
} else if ($_GET['end']) {
|
171 |
|
|
$end = strtotime($_GET['end']);
|
172 |
|
|
if ($end === FALSE || $end === -1) {
|
173 |
|
|
$input_errors[] = gettext("Invalid end date/time:") . " '{$_GET['end']}'";
|
174 |
|
|
$end = $now;
|
175 |
|
|
}
|
176 |
47e68f48
|
smos
|
} else {
|
177 |
|
|
$end = $now;
|
178 |
|
|
}
|
179 |
|
|
|
180 |
|
|
/* this should never happen */
|
181 |
|
|
if($end < $start) {
|
182 |
c7cfbbd8
|
smos
|
log_error("start $start is smaller than end $end");
|
183 |
47e68f48
|
smos
|
$end = $now;
|
184 |
|
|
}
|
185 |
|
|
|
186 |
|
|
$seconds = $end - $start;
|
187 |
5d7791a2
|
Scott Ullrich
|
|
188 |
|
|
$styles = array('inverse' => gettext('Inverse'),
|
189 |
|
|
'absolute' => gettext('Absolute'));
|
190 |
|
|
|
191 |
|
|
// Set default and override later
|
192 |
|
|
$curstyle = "inverse";
|
193 |
|
|
|
194 |
6ab7ae50
|
Seth Mos
|
if ($_GET['style']) {
|
195 |
5d7791a2
|
Scott Ullrich
|
foreach($styles as $style)
|
196 |
4ec48253
|
Scott Ullrich
|
if(strtoupper($style) == strtoupper($_GET['style']))
|
197 |
5d7791a2
|
Scott Ullrich
|
$curstyle = $_GET['style'];
|
198 |
37285f69
|
Scott Ullrich
|
} else {
|
199 |
69487053
|
Seth Mos
|
if(! empty($config['rrd']['style'])) {
|
200 |
|
|
$curstyle = $config['rrd']['style'];
|
201 |
|
|
} else {
|
202 |
|
|
$curstyle = "inverse";
|
203 |
|
|
}
|
204 |
37285f69
|
Scott Ullrich
|
}
|
205 |
|
|
|
206 |
329bb764
|
Seth Mos
|
/* sort names reverse so WAN comes first */
|
207 |
6ab7ae50
|
Seth Mos
|
rsort($databases);
|
208 |
37285f69
|
Scott Ullrich
|
|
209 |
9850b625
|
Seth Mos
|
/* these boilerplate databases are required for the other menu choices */
|
210 |
|
|
$dbheader = array("allgraphs-traffic.rrd",
|
211 |
|
|
"allgraphs-quality.rrd",
|
212 |
2f80d451
|
Seth Mos
|
"allgraphs-wireless.rrd",
|
213 |
ec51a222
|
thompsa
|
"allgraphs-cellular.rrd",
|
214 |
edd2d8b7
|
smos
|
"allgraphs-vpnusers.rrd",
|
215 |
9850b625
|
Seth Mos
|
"allgraphs-packets.rrd",
|
216 |
|
|
"system-allgraphs.rrd",
|
217 |
e3d7c123
|
Seth Mos
|
"system-throughput.rrd",
|
218 |
9850b625
|
Seth Mos
|
"outbound-quality.rrd",
|
219 |
|
|
"outbound-packets.rrd",
|
220 |
|
|
"outbound-traffic.rrd");
|
221 |
|
|
|
222 |
9cd5e6f5
|
Erik Fonnesbeck
|
/* additional menu choices for the custom tab */
|
223 |
|
|
$dbheader_custom = array("system-throughput.rrd");
|
224 |
|
|
|
225 |
7432ce7b
|
Seth Mos
|
foreach($databases as $database) {
|
226 |
edd2d8b7
|
smos
|
if(stristr($database, "-wireless")) {
|
227 |
7432ce7b
|
Seth Mos
|
$wireless = true;
|
228 |
|
|
}
|
229 |
edd2d8b7
|
smos
|
if(stristr($database, "-queues")) {
|
230 |
7432ce7b
|
Seth Mos
|
$queues = true;
|
231 |
|
|
}
|
232 |
17a71003
|
Ermal
|
if(stristr($database, "-cellular") && !empty($config['ppps'])) {
|
233 |
7432ce7b
|
Seth Mos
|
$cellular = true;
|
234 |
|
|
}
|
235 |
edd2d8b7
|
smos
|
if(stristr($database, "-vpnusers")) {
|
236 |
|
|
$vpnusers = true;
|
237 |
6b0c5ae6
|
smos
|
}
|
238 |
cba9d7d9
|
Renato Botelho
|
if(stristr($database, "captiveportal-") && is_array($config['captiveportal'])) {
|
239 |
20413b72
|
Warren Baker
|
$captiveportal = true;
|
240 |
|
|
}
|
241 |
2cdb75f8
|
nagyrobi
|
if(stristr($database, "ntpd") && isset($config['ntpd']['statsgraph'])) {
|
242 |
|
|
$ntpd = true;
|
243 |
|
|
}
|
244 |
7432ce7b
|
Seth Mos
|
}
|
245 |
9850b625
|
Seth Mos
|
/* append the existing array to the header */
|
246 |
a927edff
|
Seth Mos
|
$ui_databases = array_merge($dbheader, $databases);
|
247 |
9cd5e6f5
|
Erik Fonnesbeck
|
$custom_databases = array_merge($dbheader_custom, $databases);
|
248 |
9850b625
|
Seth Mos
|
|
249 |
d02491e6
|
Colin Fleming
|
$graphs = array("eighthour", "day", "week", "month", "quarter", "year", "fouryear");
|
250 |
97acf646
|
Erik Fonnesbeck
|
$periods = array("absolute" => gettext("Absolute Timespans"), "current" => gettext("Current Period"), "previous" => gettext("Previous Period"));
|
251 |
|
|
$graph_length = array(
|
252 |
d02491e6
|
Colin Fleming
|
"eighthour" => 28800,
|
253 |
97acf646
|
Erik Fonnesbeck
|
"day" => 86400,
|
254 |
|
|
"week" => 604800,
|
255 |
a35c1cdf
|
N0YB
|
"month" => 2678400,
|
256 |
|
|
"quarter" => 7948800,
|
257 |
97acf646
|
Erik Fonnesbeck
|
"year" => 31622400,
|
258 |
d02491e6
|
Colin Fleming
|
"fouryear" => 126230400);
|
259 |
6ab7ae50
|
Seth Mos
|
|
260 |
1d80829e
|
Carlos Eduardo Ramos
|
$pgtitle = array(gettext("Status"),gettext("RRD Graphs"));
|
261 |
ce49a7c9
|
Darren Embry
|
|
262 |
|
|
$closehead = false;
|
263 |
cba9d7d9
|
Renato Botelho
|
|
264 |
|
|
/* Load all CP zones */
|
265 |
52034432
|
Renato Botelho
|
if ($captiveportal && is_array($config['captiveportal'])) {
|
266 |
cba9d7d9
|
Renato Botelho
|
$cp_zones_tab_array = array();
|
267 |
|
|
foreach($config['captiveportal'] as $cpkey => $cp) {
|
268 |
|
|
if (!isset($cp['enable']))
|
269 |
|
|
continue;
|
270 |
|
|
|
271 |
|
|
if ($curzone == '') {
|
272 |
|
|
$tabactive = true;
|
273 |
|
|
$curzone = $cpkey;
|
274 |
|
|
} elseif ($curzone == $cpkey) {
|
275 |
|
|
$tabactive = true;
|
276 |
|
|
} else {
|
277 |
|
|
$tabactive = false;
|
278 |
|
|
}
|
279 |
|
|
|
280 |
|
|
$cp_zones_tab_array[] = array($cp['zone'], $tabactive, "status_rrd_graph.php?cat=captiveportal&zone=$cpkey");
|
281 |
|
|
}
|
282 |
|
|
}
|
283 |
|
|
|
284 |
89d25faf
|
Seth Mos
|
include("head.inc");
|
285 |
ce49a7c9
|
Darren Embry
|
?>
|
286 |
|
|
|
287 |
|
|
<?php if ($curcat === "custom") { ?>
|
288 |
|
|
<link rel="stylesheet" type="text/css" href="/javascript/jquery-ui-timepicker-addon/css/jquery-ui-timepicker-addon.css" />
|
289 |
b9cf74c3
|
Renato Botelho
|
<?php if (file_exists("{$g['www_path']}/themes/{$g['theme']}/jquery-ui-1.11.1.css")) { ?>
|
290 |
|
|
<link rel="stylesheet" type="text/css" href="/themes/<?= $g['theme'] ?>/jquery-ui-1.11.1.css" />
|
291 |
31d6f24b
|
Darren Embry
|
<?php } else { ?>
|
292 |
b9cf74c3
|
Renato Botelho
|
<link rel="stylesheet" type="text/css" href="/javascript/jquery/jquery-ui-1.11.1.css" />
|
293 |
31d6f24b
|
Darren Embry
|
<?php } ?>
|
294 |
ce49a7c9
|
Darren Embry
|
<script type="text/javascript" src="/javascript/jquery-ui-timepicker-addon/js/jquery-ui-timepicker-addon.js"></script>
|
295 |
|
|
<script type="text/javascript">
|
296 |
c2cc1721
|
Colin Fleming
|
//<![CDATA[
|
297 |
ce49a7c9
|
Darren Embry
|
jQuery(function ($) {
|
298 |
|
|
var options = {
|
299 |
|
|
dateFormat: 'mm/dd/yy',
|
300 |
|
|
timeFormat: 'hh:mm:ss',
|
301 |
|
|
showSecond: true
|
302 |
|
|
};
|
303 |
|
|
$("#startDateTime").datetimepicker(options);
|
304 |
|
|
$("#endDateTime").datetimepicker(options);
|
305 |
|
|
});
|
306 |
c2cc1721
|
Colin Fleming
|
//]]>
|
307 |
ce49a7c9
|
Darren Embry
|
</script>
|
308 |
|
|
<?php } ?>
|
309 |
|
|
|
310 |
|
|
<?php
|
311 |
6ab7ae50
|
Seth Mos
|
|
312 |
7d906758
|
smos
|
function get_dates($curperiod, $graph) {
|
313 |
97acf646
|
Erik Fonnesbeck
|
global $graph_length;
|
314 |
7d906758
|
smos
|
$now = time();
|
315 |
|
|
$end = $now;
|
316 |
|
|
|
317 |
97acf646
|
Erik Fonnesbeck
|
if($curperiod == "absolute") {
|
318 |
|
|
$start = $end - $graph_length[$graph];
|
319 |
|
|
} else {
|
320 |
|
|
$curyear = date('Y', $now);
|
321 |
|
|
$curmonth = date('m', $now);
|
322 |
|
|
$curweek = date('W', $now);
|
323 |
|
|
$curweekday = date('N', $now) - 1; // We want to start on monday
|
324 |
|
|
$curday = date('d', $now);
|
325 |
|
|
$curhour = date('G', $now);
|
326 |
c7cfbbd8
|
smos
|
|
327 |
97acf646
|
Erik Fonnesbeck
|
switch($curperiod) {
|
328 |
|
|
case "previous":
|
329 |
|
|
$offset = -1;
|
330 |
|
|
break;
|
331 |
|
|
default:
|
332 |
|
|
$offset = 0;
|
333 |
|
|
}
|
334 |
|
|
switch($graph) {
|
335 |
d02491e6
|
Colin Fleming
|
case "eighthour":
|
336 |
97acf646
|
Erik Fonnesbeck
|
if($curhour < 24)
|
337 |
|
|
$starthour = 16;
|
338 |
|
|
if($curhour < 16)
|
339 |
|
|
$starthour = 8;
|
340 |
|
|
if($curhour < 8)
|
341 |
|
|
$starthour = 0;
|
342 |
|
|
|
343 |
|
|
switch($offset) {
|
344 |
|
|
case 0:
|
345 |
|
|
$houroffset = $starthour;
|
346 |
|
|
break;
|
347 |
|
|
default:
|
348 |
|
|
$houroffset = $starthour + ($offset * 8);
|
349 |
|
|
break;
|
350 |
|
|
}
|
351 |
|
|
$start = mktime($houroffset, 0, 0, $curmonth, $curday, $curyear);
|
352 |
|
|
if($offset != 0) {
|
353 |
|
|
$end = mktime(($houroffset + 8), 0, 0, $curmonth, $curday, $curyear);
|
354 |
|
|
}
|
355 |
|
|
break;
|
356 |
|
|
case "day":
|
357 |
|
|
$start = mktime(0, 0, 0, $curmonth, ($curday + $offset), $curyear);
|
358 |
|
|
if($offset != 0)
|
359 |
|
|
$end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear);
|
360 |
|
|
break;
|
361 |
|
|
case "week":
|
362 |
|
|
switch($offset) {
|
363 |
|
|
case 0:
|
364 |
|
|
$weekoffset = 0;
|
365 |
|
|
break;
|
366 |
|
|
default:
|
367 |
|
|
$weekoffset = ($offset * 7) - 7;
|
368 |
|
|
break;
|
369 |
|
|
}
|
370 |
|
|
$start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset), $curyear);
|
371 |
|
|
if($offset != 0)
|
372 |
|
|
$end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear);
|
373 |
|
|
break;
|
374 |
|
|
case "month":
|
375 |
|
|
$start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear);
|
376 |
|
|
if($offset != 0)
|
377 |
|
|
$end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
|
378 |
|
|
break;
|
379 |
|
|
case "quarter":
|
380 |
|
|
$start = mktime(0, 0, 0, (($curmonth - 2) + $offset), 0, $curyear);
|
381 |
|
|
if($offset != 0)
|
382 |
|
|
$end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
|
383 |
|
|
break;
|
384 |
|
|
case "year":
|
385 |
|
|
$start = mktime(0, 0, 0, 1, 0, ($curyear + $offset));
|
386 |
|
|
if($offset != 0)
|
387 |
|
|
$end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
|
388 |
|
|
break;
|
389 |
d02491e6
|
Colin Fleming
|
case "fouryear":
|
390 |
97acf646
|
Erik Fonnesbeck
|
$start = mktime(0, 0, 0, 1, 0, (($curyear - 3) + $offset));
|
391 |
|
|
if($offset != 0)
|
392 |
|
|
$end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
|
393 |
|
|
break;
|
394 |
|
|
}
|
395 |
7d906758
|
smos
|
}
|
396 |
8cd558b6
|
ayvis
|
// echo "start $start ". date('l jS \of F Y h:i:s A', $start) .", end $end ". date('l jS \of F Y h:i:s A', $end) ."<br />";
|
397 |
7d906758
|
smos
|
$dates = array();
|
398 |
|
|
$dates['start'] = $start;
|
399 |
|
|
$dates['end'] = $end;
|
400 |
|
|
return $dates;
|
401 |
|
|
}
|
402 |
|
|
|
403 |
6ab7ae50
|
Seth Mos
|
?>
|
404 |
c2cc1721
|
Colin Fleming
|
</head>
|
405 |
37285f69
|
Scott Ullrich
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
406 |
|
|
<?php include("fbegin.inc"); ?>
|
407 |
59418cee
|
Darren Embry
|
<?php if ($input_errors && count($input_errors)) { print_input_errors($input_errors); } ?>
|
408 |
c2cc1721
|
Colin Fleming
|
<form name="form1" action="status_rrd_graph.php" method="get">
|
409 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="rrd graphs">
|
410 |
89d25faf
|
Seth Mos
|
<tr>
|
411 |
|
|
<td>
|
412 |
c2cc1721
|
Colin Fleming
|
<input type="hidden" name="cat" value="<?php echo "$curcat"; ?>" />
|
413 |
89d25faf
|
Seth Mos
|
<?php
|
414 |
|
|
$tab_array = array();
|
415 |
|
|
if($curcat == "system") { $tabactive = True; } else { $tabactive = False; }
|
416 |
4dea46ee
|
Rafael Lucas
|
$tab_array[] = array(gettext("System"), $tabactive, "status_rrd_graph.php?cat=system");
|
417 |
89d25faf
|
Seth Mos
|
if($curcat == "traffic") { $tabactive = True; } else { $tabactive = False; }
|
418 |
4dea46ee
|
Rafael Lucas
|
$tab_array[] = array(gettext("Traffic"), $tabactive, "status_rrd_graph.php?cat=traffic");
|
419 |
89d25faf
|
Seth Mos
|
if($curcat == "packets") { $tabactive = True; } else { $tabactive = False; }
|
420 |
4dea46ee
|
Rafael Lucas
|
$tab_array[] = array(gettext("Packets"), $tabactive, "status_rrd_graph.php?cat=packets");
|
421 |
89d25faf
|
Seth Mos
|
if($curcat == "quality") { $tabactive = True; } else { $tabactive = False; }
|
422 |
4dea46ee
|
Rafael Lucas
|
$tab_array[] = array(gettext("Quality"), $tabactive, "status_rrd_graph.php?cat=quality");
|
423 |
7432ce7b
|
Seth Mos
|
if($queues) {
|
424 |
|
|
if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; }
|
425 |
d9a0c4b8
|
Vinicius Coque
|
$tab_array[] = array(gettext("Queues"), $tabactive, "status_rrd_graph.php?cat=queues");
|
426 |
7432ce7b
|
Seth Mos
|
if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; }
|
427 |
d9a0c4b8
|
Vinicius Coque
|
$tab_array[] = array(gettext("QueueDrops"), $tabactive, "status_rrd_graph.php?cat=queuedrops");
|
428 |
7432ce7b
|
Seth Mos
|
}
|
429 |
|
|
if($wireless) {
|
430 |
|
|
if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; }
|
431 |
4dea46ee
|
Rafael Lucas
|
$tab_array[] = array(gettext("Wireless"), $tabactive, "status_rrd_graph.php?cat=wireless");
|
432 |
7432ce7b
|
Seth Mos
|
}
|
433 |
|
|
if($cellular) {
|
434 |
|
|
if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; }
|
435 |
4dea46ee
|
Rafael Lucas
|
$tab_array[] = array(gettext("Cellular"), $tabactive, "status_rrd_graph.php?cat=cellular");
|
436 |
7432ce7b
|
Seth Mos
|
}
|
437 |
edd2d8b7
|
smos
|
if($vpnusers) {
|
438 |
|
|
if($curcat == "vpnusers") { $tabactive = True; } else { $tabactive = False; }
|
439 |
|
|
$tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpnusers");
|
440 |
6b0c5ae6
|
smos
|
}
|
441 |
20413b72
|
Warren Baker
|
if($captiveportal) {
|
442 |
|
|
if($curcat == "captiveportal") { $tabactive = True; } else { $tabactive = False; }
|
443 |
|
|
$tab_array[] = array("Captive Portal", $tabactive, "status_rrd_graph.php?cat=captiveportal");
|
444 |
|
|
}
|
445 |
2cdb75f8
|
nagyrobi
|
if($ntpd) {
|
446 |
|
|
if($curcat == "ntpd") { $tabactive = True; } else { $tabactive = False; }
|
447 |
|
|
$tab_array[] = array("NTP", $tabactive, "status_rrd_graph.php?cat=ntpd");
|
448 |
|
|
}
|
449 |
47e68f48
|
smos
|
if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; }
|
450 |
4dea46ee
|
Rafael Lucas
|
$tab_array[] = array(gettext("Custom"), $tabactive, "status_rrd_graph.php?cat=custom");
|
451 |
69487053
|
Seth Mos
|
if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; }
|
452 |
4dea46ee
|
Rafael Lucas
|
$tab_array[] = array(gettext("Settings"), $tabactive, "status_rrd_graph_settings.php");
|
453 |
89d25faf
|
Seth Mos
|
display_top_tabs($tab_array);
|
454 |
|
|
?>
|
455 |
|
|
</td>
|
456 |
|
|
</tr>
|
457 |
cba9d7d9
|
Renato Botelho
|
<?php if ($curcat == "captiveportal") : ?>
|
458 |
|
|
<tr>
|
459 |
|
|
<td class="tabnavtbl">
|
460 |
|
|
<?php display_top_tabs($cp_zones_tab_array); ?>
|
461 |
|
|
</td>
|
462 |
|
|
</tr>
|
463 |
|
|
<?php endif; ?>
|
464 |
89d25faf
|
Seth Mos
|
<tr>
|
465 |
|
|
<td>
|
466 |
|
|
<div id="mainarea">
|
467 |
c2cc1721
|
Colin Fleming
|
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
|
468 |
89d25faf
|
Seth Mos
|
<tr>
|
469 |
|
|
<td colspan="2" class="list"><p><b><?=gettext("Note: Change of color and/or style may not take effect until the next refresh");?></b></p></td>
|
470 |
|
|
</tr>
|
471 |
|
|
<tr>
|
472 |
|
|
<td colspan="2" class="list">
|
473 |
3e6ec5df
|
Renato Botelho
|
<?=gettext("Graphs:");?>
|
474 |
c4877616
|
jim-p
|
<?php if (!empty($curzone)): ?>
|
475 |
c2cc1721
|
Colin Fleming
|
<input type="hidden" name="zone" value="<?= htmlspecialchars($curzone) ?>" />
|
476 |
c4877616
|
jim-p
|
<?php endif; ?>
|
477 |
89d25faf
|
Seth Mos
|
<select name="option" class="formselect" style="z-index: -10;" onchange="document.form1.submit()">
|
478 |
|
|
<?php
|
479 |
|
|
|
480 |
47e68f48
|
smos
|
if($curcat == "custom") {
|
481 |
9cd5e6f5
|
Erik Fonnesbeck
|
foreach ($custom_databases as $db => $database) {
|
482 |
cfbfd941
|
smos
|
$optionc = explode("-", $database);
|
483 |
47e68f48
|
smos
|
$search = array("-", ".rrd", $optionc);
|
484 |
|
|
$replace = array(" :: ", "", $friendly);
|
485 |
|
|
echo "<option value=\"{$database}\"";
|
486 |
|
|
$prettyprint = ucwords(str_replace($search, $replace, $database));
|
487 |
|
|
if($curoption == $database) {
|
488 |
c2cc1721
|
Colin Fleming
|
echo " selected=\"selected\"";
|
489 |
47e68f48
|
smos
|
}
|
490 |
|
|
echo ">" . htmlspecialchars($prettyprint) . "</option>\n";
|
491 |
|
|
}
|
492 |
|
|
}
|
493 |
a927edff
|
Seth Mos
|
foreach ($ui_databases as $db => $database) {
|
494 |
cba9d7d9
|
Renato Botelho
|
if(! preg_match("/($curcat)/i", $database))
|
495 |
89d25faf
|
Seth Mos
|
continue;
|
496 |
cba9d7d9
|
Renato Botelho
|
|
497 |
8878f4bb
|
Renato Botelho
|
if (($curcat == "captiveportal") && !empty($curzone) && !preg_match("/captiveportal-{$curzone}/i", $database))
|
498 |
cba9d7d9
|
Renato Botelho
|
continue;
|
499 |
|
|
|
500 |
cfbfd941
|
smos
|
$optionc = explode("-", $database);
|
501 |
89d25faf
|
Seth Mos
|
$search = array("-", ".rrd", $optionc);
|
502 |
35551994
|
Seth Mos
|
$replace = array(" :: ", "", $friendly);
|
503 |
47e68f48
|
smos
|
|
504 |
9850b625
|
Seth Mos
|
switch($curcat) {
|
505 |
20413b72
|
Warren Baker
|
case "captiveportal":
|
506 |
cba9d7d9
|
Renato Botelho
|
$optionc = str_replace($search, $replace, $optionc[2]);
|
507 |
20413b72
|
Warren Baker
|
echo "<option value=\"$optionc\"";
|
508 |
|
|
$prettyprint = ucwords(str_replace($search, $replace, $optionc));
|
509 |
|
|
break;
|
510 |
9850b625
|
Seth Mos
|
case "system":
|
511 |
85a4aab6
|
Erik Fonnesbeck
|
$optionc = str_replace($search, $replace, $optionc[1]);
|
512 |
|
|
echo "<option value=\"$optionc\"";
|
513 |
|
|
$prettyprint = ucwords(str_replace($search, $replace, $optionc));
|
514 |
9850b625
|
Seth Mos
|
break;
|
515 |
|
|
default:
|
516 |
|
|
/* Deduce a interface if possible and use the description */
|
517 |
|
|
$optionc = "$optionc[0]";
|
518 |
|
|
$friendly = convert_friendly_interface_to_friendly_descr(strtolower($optionc));
|
519 |
d9699f96
|
Seth Mos
|
if(empty($friendly)) {
|
520 |
|
|
$friendly = $optionc;
|
521 |
|
|
}
|
522 |
9850b625
|
Seth Mos
|
$search = array("-", ".rrd", $optionc);
|
523 |
|
|
$replace = array(" :: ", "", $friendly);
|
524 |
|
|
echo "<option value=\"$optionc\"";
|
525 |
|
|
$prettyprint = ucwords(str_replace($search, $replace, $friendly));
|
526 |
|
|
}
|
527 |
|
|
if($curoption == $optionc) {
|
528 |
c2cc1721
|
Colin Fleming
|
echo " selected=\"selected\"";
|
529 |
89d25faf
|
Seth Mos
|
}
|
530 |
|
|
echo ">" . htmlspecialchars($prettyprint) . "</option>\n";
|
531 |
|
|
}
|
532 |
|
|
|
533 |
|
|
?>
|
534 |
|
|
</select>
|
535 |
|
|
|
536 |
3e6ec5df
|
Renato Botelho
|
<?=gettext("Style:");?>
|
537 |
89d25faf
|
Seth Mos
|
<select name="style" class="formselect" style="z-index: -10;" onchange="document.form1.submit()">
|
538 |
|
|
<?php
|
539 |
|
|
foreach ($styles as $style => $styled) {
|
540 |
|
|
echo "<option value=\"$style\"";
|
541 |
c2cc1721
|
Colin Fleming
|
if ($style == $curstyle) echo " selected=\"selected\"";
|
542 |
89d25faf
|
Seth Mos
|
echo ">" . htmlspecialchars($styled) . "</option>\n";
|
543 |
|
|
}
|
544 |
|
|
?>
|
545 |
7d906758
|
smos
|
</select>
|
546 |
|
|
|
547 |
e4b57d26
|
Renato Botelho
|
<?php
|
548 |
47e68f48
|
smos
|
if($curcat <> "custom") {
|
549 |
|
|
?>
|
550 |
3e6ec5df
|
Renato Botelho
|
<?=gettext("Period:");?>
|
551 |
47e68f48
|
smos
|
<select name="period" class="formselect" style="z-index: -10;" onchange="document.form1.submit()">
|
552 |
|
|
<?php
|
553 |
|
|
foreach ($periods as $period => $value) {
|
554 |
|
|
echo "<option value=\"$period\"";
|
555 |
c2cc1721
|
Colin Fleming
|
if ($period == $curperiod) echo " selected=\"selected\"";
|
556 |
47e68f48
|
smos
|
echo ">" . htmlspecialchars($value) . "</option>\n";
|
557 |
|
|
}
|
558 |
c2cc1721
|
Colin Fleming
|
echo "</select>\n";
|
559 |
|
|
echo "</td></tr>\n";
|
560 |
7d906758
|
smos
|
}
|
561 |
|
|
?>
|
562 |
89d25faf
|
Seth Mos
|
<?php
|
563 |
|
|
|
564 |
47e68f48
|
smos
|
if($curcat == "custom") {
|
565 |
59418cee
|
Darren Embry
|
$tz = date_default_timezone_get();
|
566 |
|
|
$tz_msg = gettext("Enter date and/or time. Current timezone:") . " $tz";
|
567 |
ce49a7c9
|
Darren Embry
|
$start_fmt = strftime("%m/%d/%Y %H:%M:%S", $start);
|
568 |
|
|
$end_fmt = strftime("%m/%d/%Y %H:%M:%S", $end);
|
569 |
6b0c5ae6
|
smos
|
?>
|
570 |
|
|
<?=gettext("Start:");?>
|
571 |
e185c584
|
Phil Davis
|
<input id="startDateTime" title="<?= htmlentities($tz_msg); ?>." type="text" name="start" class="formfld unknown" size="24" value="<?= htmlentities($start_fmt); ?>" />
|
572 |
6b0c5ae6
|
smos
|
<?=gettext("End:");?>
|
573 |
e185c584
|
Phil Davis
|
<input id="endDateTime" title="<?= htmlentities($tz_msg); ?>." type="text" name="end" class="formfld unknown" size="24" value="<?= htmlentities($end_fmt); ?>" />
|
574 |
c2cc1721
|
Colin Fleming
|
<input type="submit" name="Submit" value="<?=gettext("Go"); ?>" />
|
575 |
|
|
</td></tr>
|
576 |
3e6ec5df
|
Renato Botelho
|
<?php
|
577 |
6b0c5ae6
|
smos
|
$curdatabase = $curoption;
|
578 |
|
|
$graph = "custom-$curdatabase";
|
579 |
9cd5e6f5
|
Erik Fonnesbeck
|
if(in_array($curdatabase, $custom_databases)) {
|
580 |
3a83296f
|
Darren Embry
|
$id = "{$graph}-{$curoption}-{$curdatabase}";
|
581 |
|
|
$id = preg_replace('/\./', '_', $id);
|
582 |
|
|
|
583 |
c2cc1721
|
Colin Fleming
|
echo "<tr><td colspan=\"2\" class=\"list\">\n";
|
584 |
|
|
echo "<img border=\"0\" name=\"{$id}\" ";
|
585 |
|
|
echo "id=\"{$id}\" alt=\"$prettydb Graph\" ";
|
586 |
|
|
echo "src=\"status_rrd_graph_img.php?start={$start}&end={$end}&database={$curdatabase}&style={$curstyle}&graph={$graph}\" />\n";
|
587 |
|
|
echo "<br /><hr /><br />\n";
|
588 |
6b0c5ae6
|
smos
|
echo "</td></tr>\n";
|
589 |
|
|
}
|
590 |
|
|
} else {
|
591 |
|
|
foreach($graphs as $graph) {
|
592 |
|
|
/* check which databases are valid for our category */
|
593 |
|
|
foreach($ui_databases as $curdatabase) {
|
594 |
cba9d7d9
|
Renato Botelho
|
if(! preg_match("/($curcat)/i", $curdatabase))
|
595 |
6b0c5ae6
|
smos
|
continue;
|
596 |
cba9d7d9
|
Renato Botelho
|
|
597 |
8878f4bb
|
Renato Botelho
|
if (($curcat == "captiveportal") && !empty($curzone) && !preg_match("/captiveportal-{$curzone}/i", $curdatabase))
|
598 |
cba9d7d9
|
Renato Botelho
|
continue;
|
599 |
|
|
|
600 |
cfbfd941
|
smos
|
$optionc = explode("-", $curdatabase);
|
601 |
6b0c5ae6
|
smos
|
$search = array("-", ".rrd", $optionc);
|
602 |
|
|
$replace = array(" :: ", "", $friendly);
|
603 |
|
|
switch($curoption) {
|
604 |
|
|
case "outbound":
|
605 |
2103b252
|
Erik Fonnesbeck
|
/* make sure we do not show the placeholder databases in the outbound view */
|
606 |
|
|
if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
|
607 |
|
|
continue 2;
|
608 |
|
|
}
|
609 |
6b0c5ae6
|
smos
|
/* only show interfaces with a gateway */
|
610 |
|
|
$optionc = "$optionc[0]";
|
611 |
|
|
if(!interface_has_gateway($optionc)) {
|
612 |
2103b252
|
Erik Fonnesbeck
|
if(!isset($gateways_arr)) {
|
613 |
|
|
if(preg_match("/quality/i", $curdatabase))
|
614 |
|
|
$gateways_arr = return_gateways_array();
|
615 |
|
|
else
|
616 |
|
|
$gateways_arr = array();
|
617 |
|
|
}
|
618 |
44aef543
|
Erik Fonnesbeck
|
$found_gateway = false;
|
619 |
|
|
foreach ($gateways_arr as $gw) {
|
620 |
|
|
if ($gw['name'] == $optionc) {
|
621 |
|
|
$found_gateway = true;
|
622 |
|
|
break;
|
623 |
|
|
}
|
624 |
|
|
}
|
625 |
|
|
if(!$found_gateway) {
|
626 |
6b0c5ae6
|
smos
|
continue 2;
|
627 |
|
|
}
|
628 |
|
|
}
|
629 |
44aef543
|
Erik Fonnesbeck
|
if(! preg_match("/(^$optionc-|-$optionc\\.)/i", $curdatabase)) {
|
630 |
a927edff
|
Seth Mos
|
continue 2;
|
631 |
|
|
}
|
632 |
6b0c5ae6
|
smos
|
break;
|
633 |
|
|
case "allgraphs":
|
634 |
|
|
/* make sure we do not show the placeholder databases in the all view */
|
635 |
|
|
if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
|
636 |
|
|
continue 2;
|
637 |
|
|
}
|
638 |
|
|
break;
|
639 |
|
|
default:
|
640 |
|
|
/* just use the name here */
|
641 |
44aef543
|
Erik Fonnesbeck
|
if(! preg_match("/(^$curoption-|-$curoption\\.)/i", $curdatabase)) {
|
642 |
6b0c5ae6
|
smos
|
continue 2;
|
643 |
|
|
}
|
644 |
|
|
}
|
645 |
9cd5e6f5
|
Erik Fonnesbeck
|
if(in_array($curdatabase, $ui_databases)) {
|
646 |
3a83296f
|
Darren Embry
|
$id = "{$graph}-{$curoption}-{$curdatabase}";
|
647 |
|
|
$id = preg_replace('/\./', '_', $id);
|
648 |
|
|
|
649 |
6b0c5ae6
|
smos
|
$dates = get_dates($curperiod, $graph);
|
650 |
|
|
$start = $dates['start'];
|
651 |
|
|
$end = $dates['end'];
|
652 |
c2cc1721
|
Colin Fleming
|
echo "<tr><td colspan=\"2\" class=\"list\">\n";
|
653 |
|
|
echo "<img border=\"0\" name=\"{$id}\" ";
|
654 |
|
|
echo "id=\"{$id}\" alt=\"$prettydb Graph\" ";
|
655 |
|
|
echo "src=\"status_rrd_graph_img.php?start={$start}&end={$end}&database={$curdatabase}&style={$curstyle}&graph={$graph}\" />\n";
|
656 |
|
|
echo "<br /><hr /><br />\n";
|
657 |
6b0c5ae6
|
smos
|
echo "</td></tr>\n";
|
658 |
|
|
}
|
659 |
89d25faf
|
Seth Mos
|
}
|
660 |
|
|
}
|
661 |
|
|
}
|
662 |
|
|
?>
|
663 |
|
|
<tr>
|
664 |
c2cc1721
|
Colin Fleming
|
<td colspan="2" class="list">
|
665 |
|
|
<script type="text/javascript">
|
666 |
|
|
//<![CDATA[
|
667 |
89d25faf
|
Seth Mos
|
function update_graph_images() {
|
668 |
|
|
//alert('updating');
|
669 |
|
|
var randomid = Math.floor(Math.random()*11);
|
670 |
|
|
<?php
|
671 |
7d906758
|
smos
|
foreach($graphs as $graph) {
|
672 |
683bf031
|
Seth Mos
|
/* check which databases are valid for our category */
|
673 |
9cd5e6f5
|
Erik Fonnesbeck
|
foreach($ui_databases as $curdatabase) {
|
674 |
683bf031
|
Seth Mos
|
if(! stristr($curdatabase, $curcat)) {
|
675 |
|
|
continue;
|
676 |
|
|
}
|
677 |
cfbfd941
|
smos
|
$optionc = explode("-", $curdatabase);
|
678 |
683bf031
|
Seth Mos
|
$search = array("-", ".rrd", $optionc);
|
679 |
|
|
$replace = array(" :: ", "", $friendly);
|
680 |
|
|
switch($curoption) {
|
681 |
|
|
case "outbound":
|
682 |
2103b252
|
Erik Fonnesbeck
|
/* make sure we do not show the placeholder databases in the outbound view */
|
683 |
|
|
if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
|
684 |
|
|
continue 2;
|
685 |
|
|
}
|
686 |
|
|
/* only show interfaces with a gateway */
|
687 |
44aef543
|
Erik Fonnesbeck
|
$optionc = "$optionc[0]";
|
688 |
2e76e612
|
Seth Mos
|
if(!interface_has_gateway($optionc)) {
|
689 |
44aef543
|
Erik Fonnesbeck
|
if(!isset($gateways_arr))
|
690 |
2103b252
|
Erik Fonnesbeck
|
if(preg_match("/quality/i", $curdatabase))
|
691 |
|
|
$gateways_arr = return_gateways_array();
|
692 |
|
|
else
|
693 |
|
|
$gateways_arr = array();
|
694 |
44aef543
|
Erik Fonnesbeck
|
$found_gateway = false;
|
695 |
|
|
foreach ($gateways_arr as $gw) {
|
696 |
|
|
if ($gw['name'] == $optionc) {
|
697 |
|
|
$found_gateway = true;
|
698 |
|
|
break;
|
699 |
|
|
}
|
700 |
|
|
}
|
701 |
|
|
if(!$found_gateway) {
|
702 |
683bf031
|
Seth Mos
|
continue 2;
|
703 |
44aef543
|
Erik Fonnesbeck
|
}
|
704 |
|
|
}
|
705 |
|
|
if(! preg_match("/(^$optionc-|-$optionc\\.)/i", $curdatabase)) {
|
706 |
|
|
continue 2;
|
707 |
683bf031
|
Seth Mos
|
}
|
708 |
9850b625
|
Seth Mos
|
break;
|
709 |
683bf031
|
Seth Mos
|
case "allgraphs":
|
710 |
9850b625
|
Seth Mos
|
/* make sure we do not show the placeholder databases in the all view */
|
711 |
|
|
if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
|
712 |
|
|
continue 2;
|
713 |
|
|
}
|
714 |
|
|
break;
|
715 |
683bf031
|
Seth Mos
|
default:
|
716 |
|
|
/* just use the name here */
|
717 |
44aef543
|
Erik Fonnesbeck
|
if(! preg_match("/(^$curoption-|-$curoption\\.)/i", $curdatabase)) {
|
718 |
683bf031
|
Seth Mos
|
continue 2;
|
719 |
|
|
}
|
720 |
|
|
}
|
721 |
7d906758
|
smos
|
$dates = get_dates($curperiod, $graph);
|
722 |
|
|
$start = $dates['start'];
|
723 |
d60f510a
|
smos
|
if($curperiod == "current") {
|
724 |
|
|
$end = $dates['end'];
|
725 |
|
|
}
|
726 |
78d84a88
|
Vinicius Coque
|
/* generate update events utilizing jQuery('') feature */
|
727 |
3a83296f
|
Darren Embry
|
$id = "{$graph}-{$curoption}-{$curdatabase}";
|
728 |
|
|
$id = preg_replace('/\./', '_', $id);
|
729 |
|
|
|
730 |
683bf031
|
Seth Mos
|
echo "\n";
|
731 |
3a83296f
|
Darren Embry
|
echo "\t\tjQuery('#{$id}').attr('src','status_rrd_graph_img.php?start={$start}&graph={$graph}&database={$curdatabase}&style={$curstyle}&tmp=' + randomid);\n";
|
732 |
683bf031
|
Seth Mos
|
}
|
733 |
|
|
}
|
734 |
89d25faf
|
Seth Mos
|
?>
|
735 |
|
|
window.setTimeout('update_graph_images()', 355000);
|
736 |
|
|
}
|
737 |
|
|
window.setTimeout('update_graph_images()', 355000);
|
738 |
c2cc1721
|
Colin Fleming
|
//]]>
|
739 |
89d25faf
|
Seth Mos
|
</script>
|
740 |
|
|
</td>
|
741 |
|
|
</tr>
|
742 |
|
|
</table>
|
743 |
|
|
</div>
|
744 |
|
|
</td>
|
745 |
|
|
</tr>
|
746 |
|
|
</table>
|
747 |
c2cc1721
|
Colin Fleming
|
</form>
|
748 |
37285f69
|
Scott Ullrich
|
<?php include("fend.inc"); ?>
|
749 |
|
|
</body>
|
750 |
|
|
</html>
|