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 |
|
|
|
48 |
|
|
if($_REQUEST['getactivity']) {
|
49 |
|
|
$text = `/sbin/ipfw pipe show`;
|
50 |
|
|
if($text == "")
|
51 |
|
|
$text = "We could not find any limiters on this system.";
|
52 |
|
|
echo $text;
|
53 |
|
|
exit;
|
54 |
|
|
}
|
55 |
|
|
|
56 |
|
|
include("head.inc");
|
57 |
|
|
|
58 |
|
|
?>
|
59 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
60 |
|
|
|
61 |
|
|
<script type="text/javascript">
|
62 |
|
|
function getlimiteractivity() {
|
63 |
|
|
var url = "/diag_limiter_info.php";
|
64 |
|
|
var pars = 'getactivity=yes';
|
65 |
|
|
var myAjax = new Ajax.Request(
|
66 |
|
|
url,
|
67 |
|
|
{
|
68 |
|
|
method: 'post',
|
69 |
|
|
parameters: pars,
|
70 |
|
|
onComplete: activitycallback
|
71 |
|
|
});
|
72 |
|
|
}
|
73 |
|
|
function activitycallback(transport) {
|
74 |
54eb029e
|
jim-p
|
$('limiteractivitydiv').innerHTML = '<font face="Courier"><font size="2"><b><pre style="text-align:left;">' + transport.responseText + '</pre></font>';
|
75 |
9242ba15
|
Scott Ullrich
|
setTimeout('getlimiteractivity()', 2000);
|
76 |
|
|
}
|
77 |
|
|
setTimeout('getlimiteractivity()', 5000);
|
78 |
|
|
</script>
|
79 |
|
|
<div id='maincontent'>
|
80 |
|
|
<?php
|
81 |
|
|
include("fbegin.inc");
|
82 |
|
|
if(strstr($pfSversion, "1.2"))
|
83 |
|
|
echo "<p class=\"pgtitle\">{$pgtitle}</p>";
|
84 |
|
|
if($savemsg) {
|
85 |
|
|
echo "<div id='savemsg'>";
|
86 |
|
|
print_info_box($savemsg);
|
87 |
|
|
echo "</div>";
|
88 |
|
|
}
|
89 |
|
|
if ($input_errors)
|
90 |
|
|
print_input_errors($input_errors);
|
91 |
|
|
?>
|
92 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
93 |
|
|
<tr>
|
94 |
|
|
<td>
|
95 |
|
|
<table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
|
96 |
|
|
<tr>
|
97 |
|
|
<td>
|
98 |
|
|
<center>
|
99 |
|
|
<table>
|
100 |
|
|
<tr><td>
|
101 |
|
|
<div name='limiteractivitydiv' id='limiteractivitydiv'>
|
102 |
|
|
<b><?=gettext("Gathering Limiter information, please wait...");?>
|
103 |
|
|
</div>
|
104 |
|
|
</td></tr>
|
105 |
|
|
</table>
|
106 |
|
|
</td>
|
107 |
|
|
</tr>
|
108 |
|
|
</table>
|
109 |
|
|
</div>
|
110 |
|
|
</td>
|
111 |
|
|
</tr>
|
112 |
|
|
</table>
|
113 |
|
|
</form>
|
114 |
|
|
<?php include("fend.inc"); ?>
|
115 |
|
|
</body>
|
116 |
|
|
</html>
|