Project

General

Profile

Download (20.8 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	status_rrd_graph.php
5
	Part of pfSense
6
	Copyright (C) 2007 Seth Mos <seth.mos@dds.nl>
7
	All rights reserved.
8

    
9
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11

    
12
	1. Redistributions of source code must retain the above copyright notice,
13
	   this list of conditions and the following disclaimer.
14

    
15
	2. Redistributions in binary form must reproduce the above copyright
16
	   notice, this list of conditions and the following disclaimer in the
17
	   documentation and/or other materials provided with the distribution.
18

    
19
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
	POSSIBILITY OF SUCH DAMAGE.
29
*/
30
/*	
31
	pfSense_MODULE:	system
32
*/
33

    
34
##|+PRIV
35
##|*IDENT=page-status-rrdgraphs
36
##|*NAME=Status: RRD Graphs page
37
##|*DESCR=Allow access to the 'Status: RRD Graphs' page.
38
##|*MATCH=status_rrd_graph.php*
39
##|-PRIV
40

    
41
require("guiconfig.inc");
42
require_once("filter.inc");
43
require("shaper.inc");
44
require_once("rrd.inc");
45

    
46
/* if the rrd graphs are not enabled redirect to settings page */
47
if(! isset($config['rrd']['enable'])) {
48
	header("Location: status_rrd_graph_settings.php");
49
}
50

    
51
$rrddbpath = "/var/db/rrd/";
52
chdir($rrddbpath);
53
$databases = glob("*.rrd");
54

    
55

    
56
if ($_GET['cat']) {
57
	$curcat = htmlspecialchars($_GET['cat']);
58
} else {
59
	if(! empty($config['rrd']['category'])) {
60
		$curcat = $config['rrd']['category'];
61
	} else {
62
		$curcat = "system";
63
	}
64
}
65

    
66
if ($_GET['period']) {
67
	$curperiod = $_GET['period'];
68
} else {
69
	if(! empty($config['rrd']['period'])) {
70
		$curperiod = $config['rrd']['period'];
71
	} else {
72
		$curperiod = "absolute";
73
	}
74
}
75

    
76
if ($_GET['option']) {
77
	$curoption = $_GET['option'];
78
} else {
79
	switch($curcat) {
80
		case "system":
81
			$curoption = "processor";
82
			break;
83
		case "queues":
84
			$curoption = "queues";
85
			break;
86
		case "queuedrops":
87
			$curoption = "queuedrops";
88
			break;
89
		case "quality":
90
			foreach($databases as $database) {
91
				if(preg_match("/[-]quality\.rrd/i", $database)) {
92
					/* pick off the 1st database we find that matches the quality graph */
93
					$name = explode("-", $database);
94
					$curoption = "$name[0]";
95
					continue 2;
96
				}
97
			}
98
		case "wireless":
99
			foreach($databases as $database) {
100
				if(preg_match("/[-]wireless\.rrd/i", $database)) {
101
					/* pick off the 1st database we find that matches the wireless graph */
102
					$name = explode("-", $database);
103
					$curoption = "$name[0]";
104
					continue 2;
105
				}
106
			}
107
		case "cellular":
108
			foreach($databases as $database) {
109
				if(preg_match("/[-]cellular\.rrd/i", $database)) {
110
					/* pick off the 1st database we find that matches the celullar graph */
111
					$name = explode("-", $database);
112
					$curoption = "$name[0]";
113
					continue 2;
114
				}
115
			}
116
		case "vpnusers":
117
			foreach($databases as $database) {
118
				if(preg_match("/[-]vpnusers\.rrd/i", $database)) {
119
					/* pick off the 1st database we find that matches the VPN graphs */
120
					$name = explode("-", $database);
121
					$curoption = "$name[0]";
122
					continue 2;
123
				}
124
			}
125
		case "captiveportal":
126
			$curoption = "allgraphs";
127
			break;
128
		default:
129
			$curoption = "wan";
130
			break;
131
	}
132
}
133

    
134
$now = time();
135
if($curcat == "custom") {
136
	if (is_numeric($_GET['start'])) {
137
			if($start < ($now - (3600 * 24 * 365 * 5))) {
138
					$start = $now - (8 * 3600);
139
			}
140
			$start = $_GET['start'];
141
	} else {
142
			$start = $now - (8 * 3600);
143
	}
144
}
145

    
146
if (is_numeric($_GET['end'])) {
147
        $end = $_GET['end'];
148
} else {
149
        $end = $now;
150
}
151

    
152
/* this should never happen */
153
if($end < $start) {
154
	log_error("start $start is smaller than end $end");
155
        $end = $now;
156
}
157

    
158
$seconds = $end - $start;
159

    
160
$styles = array('inverse' => gettext('Inverse'),
161
		'absolute' => gettext('Absolute'));
162

    
163
// Set default and override later
164
$curstyle = "inverse";
165

    
166
if ($_GET['style']) {
167
	foreach($styles as $style) 
168
		if(strtoupper($style) == strtoupper($_GET['style'])) 
169
			$curstyle = $_GET['style'];
170
} else {
171
	if(! empty($config['rrd']['style'])) {
172
		$curstyle = $config['rrd']['style'];
173
	} else {
174
		$curstyle = "inverse";
175
	}
176
}
177

    
178
/* sort names reverse so WAN comes first */
179
rsort($databases);
180

    
181
/* these boilerplate databases are required for the other menu choices */
182
$dbheader = array("allgraphs-traffic.rrd",
183
		"allgraphs-quality.rrd",
184
		"allgraphs-wireless.rrd",
185
		"allgraphs-cellular.rrd",
186
		"allgraphs-vpnusers.rrd",
187
		"captiveportal-allgraphs.rrd",
188
		"allgraphs-packets.rrd",
189
		"system-allgraphs.rrd",
190
		"system-throughput.rrd",
191
		"outbound-quality.rrd",
192
		"outbound-packets.rrd",
193
		"outbound-traffic.rrd");
194

    
195
/* additional menu choices for the custom tab */
196
$dbheader_custom = array("system-throughput.rrd");
197

    
198
foreach($databases as $database) {
199
	if(stristr($database, "-wireless")) {
200
		$wireless = true;
201
	}
202
	if(stristr($database, "-queues")) {
203
		$queues = true;
204
	}
205
	if(stristr($database, "-cellular") && !empty($config['ppps'])) {
206
		$cellular = true;
207
	}
208
	if(stristr($database, "-vpnusers")) {
209
		$vpnusers = true;
210
	}
211
	if(stristr($database, "captiveportal-") && isset($config['captiveportal']['enable'])) {
212
		$captiveportal = true;
213
	}
214
}
215
/* append the existing array to the header */
216
$ui_databases = array_merge($dbheader, $databases);
217
$custom_databases = array_merge($dbheader_custom, $databases);
218

    
219
$graphs = array("8hour", "day", "week", "month", "quarter", "year", "4year");
220
$periods = array("absolute" => gettext("Absolute Timespans"), "current" => gettext("Current Period"), "previous" => gettext("Previous Period"));
221
$graph_length = array(
222
	"8hour" => 28800,
223
	"day" => 86400,
224
	"week" => 604800,
225
	"month" => 2764800,
226
	"quarter" => 8035200,
227
	"year" => 31622400,
228
	"4year" => 126489600);
229

    
230
$pgtitle = array(gettext("Status"),gettext("RRD Graphs"));
231
include("head.inc");
232

    
233
function get_dates($curperiod, $graph) {
234
	global $graph_length;
235
	$now = time();
236
	$end = $now;
237

    
238
	if($curperiod == "absolute") {
239
		$start = $end - $graph_length[$graph];
240
	} else {
241
		$curyear = date('Y', $now);
242
		$curmonth = date('m', $now);
243
		$curweek = date('W', $now);
244
		$curweekday = date('N', $now) - 1; // We want to start on monday
245
		$curday = date('d', $now);
246
		$curhour = date('G', $now);
247

    
248
		switch($curperiod) {
249
			case "previous":
250
				$offset = -1;
251
				break;
252
			default:
253
				$offset = 0;
254
		}
255
		switch($graph) {
256
			case "8hour":
257
				if($curhour < 24)
258
					$starthour = 16;
259
				if($curhour < 16)
260
					$starthour = 8;
261
				if($curhour < 8)
262
					$starthour = 0;
263

    
264
				switch($offset) {
265
					case 0:
266
						$houroffset = $starthour;
267
						break;
268
					default:
269
						$houroffset = $starthour + ($offset * 8);
270
						break;
271
				}
272
				$start = mktime($houroffset, 0, 0, $curmonth, $curday, $curyear);
273
				if($offset != 0) {
274
					$end = mktime(($houroffset + 8), 0, 0, $curmonth, $curday, $curyear);
275
				}
276
				break;
277
			case "day":
278
				$start = mktime(0, 0, 0, $curmonth, ($curday + $offset), $curyear);
279
				if($offset != 0)
280
					$end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear);
281
				break;
282
			case "week":
283
				switch($offset) {
284
					case 0:
285
						$weekoffset = 0;
286
						break;
287
					default:
288
						$weekoffset = ($offset * 7) - 7;
289
						break;
290
				}
291
				$start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset), $curyear);
292
				if($offset != 0)
293
					$end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear);
294
				break;
295
			case "month":
296
				$start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear);
297
				if($offset != 0)
298
					$end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
299
				break;
300
			case "quarter":
301
				$start = mktime(0, 0, 0, (($curmonth - 2) + $offset), 0, $curyear);
302
				if($offset != 0)
303
					$end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
304
				break;
305
			case "year":
306
				$start = mktime(0, 0, 0, 1, 0, ($curyear + $offset));
307
				if($offset != 0)
308
					$end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
309
				break;
310
			case "4year":
311
				$start = mktime(0, 0, 0, 1, 0, (($curyear - 3) + $offset));
312
				if($offset != 0)
313
					$end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
314
				break;
315
		}
316
	}
317
	// 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>";
318
	$dates = array();
319
	$dates['start'] = $start;
320
	$dates['end'] = $end;
321
	return $dates;
322
}
323

    
324
?>
325
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
326
<?php include("fbegin.inc"); ?>
327
<table width="100%" border="0" cellpadding="0" cellspacing="0">
328
        <tr>
329
                <td>
330
			<form name="form1" action="status_rrd_graph.php" method="get">
331
			<input type="hidden" name="cat" value="<?php echo "$curcat"; ?>">
332
			<?php
333
			        $tab_array = array();
334
				if($curcat == "system") { $tabactive = True; } else { $tabactive = False; }
335
			        $tab_array[] = array(gettext("System"), $tabactive, "status_rrd_graph.php?cat=system");
336
				if($curcat == "traffic") { $tabactive = True; } else { $tabactive = False; }
337
			        $tab_array[] = array(gettext("Traffic"), $tabactive, "status_rrd_graph.php?cat=traffic");
338
				if($curcat == "packets") { $tabactive = True; } else { $tabactive = False; }
339
			        $tab_array[] = array(gettext("Packets"), $tabactive, "status_rrd_graph.php?cat=packets");
340
				if($curcat == "quality") { $tabactive = True; } else { $tabactive = False; }
341
			        $tab_array[] = array(gettext("Quality"), $tabactive, "status_rrd_graph.php?cat=quality");
342
				if($queues) {
343
					if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; }
344
						$tab_array[] = array(gettext("Queues"), $tabactive, "status_rrd_graph.php?cat=queues");
345
					if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; }
346
						$tab_array[] = array(gettext("QueueDrops"), $tabactive, "status_rrd_graph.php?cat=queuedrops");
347
				}
348
				if($wireless) {
349
					if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; }
350
				        $tab_array[] = array(gettext("Wireless"), $tabactive, "status_rrd_graph.php?cat=wireless");
351
				}
352
				if($cellular) {
353
					if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; }
354
				        $tab_array[] = array(gettext("Cellular"), $tabactive, "status_rrd_graph.php?cat=cellular");
355
				}
356
				if($vpnusers) {
357
					if($curcat == "vpnusers") { $tabactive = True; } else { $tabactive = False; }
358
				        $tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpnusers");
359
				}
360
				if($captiveportal) {
361
					if($curcat == "captiveportal") { $tabactive = True; } else { $tabactive = False; }
362
				        $tab_array[] = array("Captive Portal", $tabactive, "status_rrd_graph.php?cat=captiveportal");
363
				}
364
				if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; }
365
			        $tab_array[] = array(gettext("Custom"), $tabactive, "status_rrd_graph.php?cat=custom");
366
				if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; }
367
			        $tab_array[] = array(gettext("Settings"), $tabactive, "status_rrd_graph_settings.php");
368
			        display_top_tabs($tab_array);
369
			?>
370
                </td>
371
        </tr>
372
        <tr>
373
                <td>
374
                        <div id="mainarea">
375
                        <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
376
                                <tr>
377
                                        <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>
378
				</tr>
379
				<tr>
380
                                        <td colspan="2" class="list">
381
					<?=gettext("Graphs:");?>
382
					<select name="option" class="formselect" style="z-index: -10;" onchange="document.form1.submit()">
383
					<?php
384

    
385
					if($curcat == "custom") {
386
						foreach ($custom_databases as $db => $database) {
387
							$optionc = explode("-", $database);
388
							$search = array("-", ".rrd", $optionc);
389
							$replace = array(" :: ", "", $friendly);
390
							echo "<option value=\"{$database}\"";
391
							$prettyprint = ucwords(str_replace($search, $replace, $database));
392
							if($curoption == $database) {
393
								echo " selected";
394
							}
395
							echo ">" . htmlspecialchars($prettyprint) . "</option>\n";
396
						}
397
					}
398
					foreach ($ui_databases as $db => $database) {
399
						if(! preg_match("/($curcat)/i", $database)) {
400
							continue;
401
						}
402
						$optionc = explode("-", $database);
403
						$search = array("-", ".rrd", $optionc);
404
						$replace = array(" :: ", "", $friendly);
405

    
406
						switch($curcat) {
407
							case "captiveportal":
408
								$optionc = str_replace($search, $replace, $optionc[1]);
409
								echo "<option value=\"$optionc\"";
410
								$prettyprint = ucwords(str_replace($search, $replace, $optionc));
411
								break;
412
							case "system":
413
								$optionc = str_replace($search, $replace, $optionc[1]);
414
								echo "<option value=\"$optionc\"";
415
								$prettyprint = ucwords(str_replace($search, $replace, $optionc));
416
								break;
417
							default:
418
								/* Deduce a interface if possible and use the description */
419
								$optionc = "$optionc[0]";
420
								$friendly = convert_friendly_interface_to_friendly_descr(strtolower($optionc));
421
								if(empty($friendly)) {
422
									$friendly = $optionc;
423
								}
424
								$search = array("-", ".rrd", $optionc);
425
								$replace = array(" :: ", "", $friendly);
426
								echo "<option value=\"$optionc\"";
427
								$prettyprint = ucwords(str_replace($search, $replace, $friendly));
428
						}
429
						if($curoption == $optionc) {
430
							echo " selected";
431
						}
432
						echo ">" . htmlspecialchars($prettyprint) . "</option>\n";
433
					}
434

    
435
					?>
436
					</select>
437

    
438
					<?=gettext("Style:");?>
439
					<select name="style" class="formselect" style="z-index: -10;" onchange="document.form1.submit()">
440
					<?php
441
					foreach ($styles as $style => $styled) {
442
						echo "<option value=\"$style\"";
443
						if ($style == $curstyle) echo " selected";
444
						echo ">" . htmlspecialchars($styled) . "</option>\n";
445
					}
446
					?>
447
					</select>
448
					
449
					<?php
450
					if($curcat <> "custom") {
451
					?>
452
						<?=gettext("Period:");?>
453
						<select name="period" class="formselect" style="z-index: -10;" onchange="document.form1.submit()">
454
						<?php
455
						foreach ($periods as $period => $value) {
456
							echo "<option value=\"$period\"";
457
							if ($period == $curperiod) echo " selected";
458
							echo ">" . htmlspecialchars($value) . "</option>\n";
459
						}
460
					}
461
					?>
462
					</select>
463
					<?php
464

    
465
					if($curcat == "custom") {
466
						?>
467
						<?=gettext("Start:");?>
468
						<input type="text" name="start" class="formfldunknown" length="32" value="<?php echo $start;?>">
469
						<?=gettext("End:");?>
470
						<input type="text" name="end" class="formfldunknown" length="32" value="<?php echo $end;?>">
471
						<input type="submit" name="Submit" value="<?=gettext("Go"); ?>">
472
						<?php
473
						$curdatabase = $curoption;
474
						$graph = "custom-$curdatabase";
475
						if(in_array($curdatabase, $custom_databases)) {
476
							echo "<tr><td colspan=2 class=\"list\">\n";
477
							echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' ";
478
							echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" ";
479
							echo "SRC=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}\" />\n";
480
							echo "<br /><hr><br />\n";								
481
							echo "</td></tr>\n";
482
						}
483
					} else {
484
						foreach($graphs as $graph) {
485
							/* check which databases are valid for our category */
486
							foreach($ui_databases as $curdatabase) {
487
								if(! preg_match("/($curcat)/i", $curdatabase)) {
488
									continue;
489
								}
490
								$optionc = explode("-", $curdatabase);
491
								$search = array("-", ".rrd", $optionc);
492
								$replace = array(" :: ", "", $friendly);
493
								switch($curoption) {
494
									case "outbound":
495
										/* make sure we do not show the placeholder databases in the outbound view */
496
										if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
497
											continue 2;
498
										}
499
										/* only show interfaces with a gateway */
500
										$optionc = "$optionc[0]";
501
										if(!interface_has_gateway($optionc)) {
502
											if(!isset($gateways_arr)) {
503
												if(preg_match("/quality/i", $curdatabase))
504
													$gateways_arr = return_gateways_array();
505
												else
506
													$gateways_arr = array();
507
											}
508
											$found_gateway = false;
509
											foreach ($gateways_arr as $gw) {
510
												if ($gw['name'] == $optionc) {
511
													$found_gateway = true;
512
													break;
513
												}
514
											}
515
											if(!$found_gateway) {
516
												continue 2;
517
											}
518
										}
519
										if(! preg_match("/(^$optionc-|-$optionc\\.)/i", $curdatabase)) {
520
											continue 2;
521
										}
522
										break;
523
									case "allgraphs":
524
										/* make sure we do not show the placeholder databases in the all view */
525
										if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
526
											continue 2;
527
										}
528
										break;
529
									default:
530
										/* just use the name here */
531
										if(! preg_match("/(^$curoption-|-$curoption\\.)/i", $curdatabase)) {
532
											continue 2;
533
										}
534
								}
535
								if(in_array($curdatabase, $ui_databases)) {
536
									$dates = get_dates($curperiod, $graph);
537
									$start = $dates['start'];
538
									$end = $dates['end'];
539
									echo "<tr><td colspan=2 class=\"list\">\n";
540
									echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' ";
541
									echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" ";
542
									echo "SRC=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}\" />\n";
543
									echo "<br /><hr><br />\n";								
544
									echo "</td></tr>\n";
545
								}
546
							}
547
						}
548
					}
549
					?>
550
					</td>
551
				</tr>
552
				<tr>
553
					<td colspan=2 class="list">
554
					<script language="javascript">
555
						function update_graph_images() {
556
							//alert('updating');
557
							var randomid = Math.floor(Math.random()*11);
558
							<?php
559
							foreach($graphs as $graph) {
560
								/* check which databases are valid for our category */
561
								foreach($ui_databases as $curdatabase) {
562
									if(! stristr($curdatabase, $curcat)) {
563
										continue;
564
									}
565
									$optionc = explode("-", $curdatabase);
566
									$search = array("-", ".rrd", $optionc);
567
									$replace = array(" :: ", "", $friendly);
568
									switch($curoption) {
569
										case "outbound":
570
											/* make sure we do not show the placeholder databases in the outbound view */
571
											if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
572
												continue 2;
573
											}
574
											/* only show interfaces with a gateway */
575
											$optionc = "$optionc[0]";
576
											if(!interface_has_gateway($optionc)) {
577
												if(!isset($gateways_arr))
578
													if(preg_match("/quality/i", $curdatabase))
579
														$gateways_arr = return_gateways_array();
580
													else
581
														$gateways_arr = array();
582
												$found_gateway = false;
583
												foreach ($gateways_arr as $gw) {
584
													if ($gw['name'] == $optionc) {
585
														$found_gateway = true;
586
														break;
587
													}
588
												}
589
												if(!$found_gateway) {
590
													continue 2;
591
												}
592
											}
593
											if(! preg_match("/(^$optionc-|-$optionc\\.)/i", $curdatabase)) {
594
												continue 2;
595
											}
596
											break;
597
										case "allgraphs":
598
											/* make sure we do not show the placeholder databases in the all view */
599
											if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
600
												continue 2;
601
											}
602
											break;
603
										default:
604
											/* just use the name here */
605
											if(! preg_match("/(^$curoption-|-$curoption\\.)/i", $curdatabase)) {
606
												continue 2;
607
											}
608
									}
609
									$dates = get_dates($curperiod, $graph);
610
									$start = $dates['start'];
611
									if($curperiod == "current") {
612
										$end = $dates['end'];
613
									}
614
									/* generate update events utilizing jQuery('') feature */
615
									echo "\n";
616
									echo "\t\tjQuery('#{$graph}-{$curoption}-{$curdatabase}').attr('src','status_rrd_graph_img.php?start={$start}&graph={$graph}&database={$curdatabase}&style={$curstyle}&tmp=' + randomid);\n";
617
									}
618
								}
619
							?>
620
							window.setTimeout('update_graph_images()', 355000);
621
						}
622
						window.setTimeout('update_graph_images()', 355000);
623
					</script>
624
					</form>
625
					</td>
626
				</tr>
627
			</table>
628
		</div>
629
		</td>
630
	</tr>
631
</table>
632

    
633
<?php include("fend.inc"); ?>
634
</body>
635
</html>
(181-181/238)