Project

General

Profile

Download (3.46 KB) Statistics
| Branch: | Tag: | Revision:
1 9242ba15 Scott Ullrich
<?php
2
/* $Id$ */
3
/*
4
    diag_limiter_info.php
5
    Copyright (C) 2010 Scott Ullrich
6
    All rights reserved.
7
8
    Redistribution and use in source and binary forms, with or without
9
    modification, are permitted provided that the following conditions are met:
10
11
    1. Redistributions of source code must retain the above copyright notice,
12
       this list of conditions and the following disclaimer.
13
14
    2. Redistributions in binary form must reproduce the above copyright
15
       notice, this list of conditions and the following disclaimer in the
16
       documentation and/or other materials provided with the distribution.
17
18
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
22
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
    POSSIBILITY OF SUCH DAMAGE.
28
*/
29
30
/*
31
	pfSense_BUILDER_BINARIES:	/usr/bin/top
32
	pfSense_MODULE:	system
33
*/
34
35
##|+PRIV
36
##|*IDENT=page-diag-system-activity
37
##|*NAME=Diagnostics: System Activity
38
##|*DESCR=Allows access to the 'Diagnostics: System Activity' page
39
##|*MATCH=diag_system_activity*
40
##|-PRIV
41
42
require("guiconfig.inc");
43
44
$pfSversion = str_replace("\n", "", file_get_contents("/etc/version"));
45
46
$pgtitle = gettext("Diagnostics: Limiter Info");
47 d71fc5d3 jim-p
$shortcut_section = "trafficshaper-limiters";
48 9242ba15 Scott Ullrich
49
if($_REQUEST['getactivity']) {
50
	$text = `/sbin/ipfw pipe show`;
51
	if($text == "") 
52
		$text = "We could not find any limiters on this system.";
53 f8707b15 jim-p
	echo "Limiters:\n";
54 9242ba15 Scott Ullrich
	echo $text;
55 f8707b15 jim-p
	$text = `/sbin/ipfw queue show`;
56
	if($text != "") {
57
		echo "\n\nQueues:\n";
58
		echo $text;
59
	}
60 9242ba15 Scott Ullrich
	exit;
61
}
62
63
include("head.inc");
64
65
?>
66
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
67
68
<script type="text/javascript">
69
	function getlimiteractivity() {
70
		var url = "/diag_limiter_info.php";
71
		var pars = 'getactivity=yes';
72 ebfc87d6 Vinicius Coque
		jQuery.ajax(
73 9242ba15 Scott Ullrich
			url,
74
			{
75 ebfc87d6 Vinicius Coque
				type: 'post',
76
				data: pars,
77
				complete: activitycallback
78 9242ba15 Scott Ullrich
			});
79
	}
80
	function activitycallback(transport) {
81 ebfc87d6 Vinicius Coque
		jQuery('#limiteractivitydiv').html('<font face="Courier"><font size="2"><b><pre style="text-align:left;">' + transport.responseText  + '</pre></font>');
82 9242ba15 Scott Ullrich
		setTimeout('getlimiteractivity()', 2000);		
83
	}
84
	setTimeout('getlimiteractivity()', 5000);	
85
</script>
86
<div id='maincontent'>
87
<?php
88
	include("fbegin.inc"); 
89
	if(strstr($pfSversion, "1.2")) 
90
		echo "<p class=\"pgtitle\">{$pgtitle}</p>";
91
	if($savemsg) {
92
		echo "<div id='savemsg'>";
93
		print_info_box($savemsg);
94
		echo "</div>";	
95
	}
96
	if ($input_errors)
97
		print_input_errors($input_errors);
98
?>
99
<table width="100%" border="0" cellpadding="0" cellspacing="0">  
100
  <tr>
101
    <td>
102
	<table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
103
		<tr>
104
			<td>
105
				<center>
106
				<table>
107
					<tr><td>
108
						<div name='limiteractivitydiv' id='limiteractivitydiv'>
109
							<b><?=gettext("Gathering Limiter information, please wait...");?>
110
						</div>
111
					</td></tr>
112
				</table>
113
			</td>
114
		</tr>
115
	</table>
116
	</div>
117
    </td>
118
  </tr>
119
</table>
120
</form>
121
<?php include("fend.inc"); ?>
122
</body>
123
</html>