1 |
438d04f6
|
Scott Ullrich
|
<?php
|
2 |
|
|
/* $Id$ */
|
3 |
|
|
/*
|
4 |
|
|
diag_pf_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 |
79992f17
|
Scott Ullrich
|
$pgtitle = gettext("Diagnostics: pfInfo");
|
47 |
438d04f6
|
Scott Ullrich
|
|
48 |
|
|
if($_REQUEST['getactivity']) {
|
49 |
|
|
$text = `/sbin/pfctl -vvsi`;
|
50 |
|
|
$text .= "<p/>";
|
51 |
7fd51c68
|
Scott Ullrich
|
$text .= `/sbin/pfctl -vvsm`;
|
52 |
|
|
$text .= "<p/>";
|
53 |
|
|
$text .= `/sbin/pfctl -vvst`;
|
54 |
|
|
$text .= "<p/>";
|
55 |
438d04f6
|
Scott Ullrich
|
$text .= `/sbin/pfctl -vvsI`;
|
56 |
|
|
echo $text;
|
57 |
|
|
exit;
|
58 |
|
|
}
|
59 |
|
|
|
60 |
|
|
include("head.inc");
|
61 |
|
|
|
62 |
|
|
?>
|
63 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
64 |
|
|
|
65 |
|
|
<script type="text/javascript">
|
66 |
|
|
function getcpuactivity() {
|
67 |
|
|
var url = "/diag_pf_info.php";
|
68 |
|
|
var pars = 'getactivity=yes';
|
69 |
ebfc87d6
|
Vinicius Coque
|
jQuery.ajax(
|
70 |
438d04f6
|
Scott Ullrich
|
url,
|
71 |
|
|
{
|
72 |
ebfc87d6
|
Vinicius Coque
|
type: 'post',
|
73 |
|
|
data: pars,
|
74 |
|
|
complete: activitycallback
|
75 |
438d04f6
|
Scott Ullrich
|
});
|
76 |
|
|
}
|
77 |
|
|
function activitycallback(transport) {
|
78 |
ebfc87d6
|
Vinicius Coque
|
jQuery('#cpuactivitydiv').html('<font face="Courier"><font size="2"><b><pre style="text-align:left;">' + transport.responseText + '</pre></font>');
|
79 |
b3584478
|
Scott Ullrich
|
setTimeout('getcpuactivity()', 2000);
|
80 |
438d04f6
|
Scott Ullrich
|
}
|
81 |
b3584478
|
Scott Ullrich
|
setTimeout('getcpuactivity()', 5000);
|
82 |
438d04f6
|
Scott Ullrich
|
</script>
|
83 |
|
|
<div id='maincontent'>
|
84 |
|
|
<?php
|
85 |
|
|
include("fbegin.inc");
|
86 |
|
|
if(strstr($pfSversion, "1.2"))
|
87 |
|
|
echo "<p class=\"pgtitle\">{$pgtitle}</p>";
|
88 |
|
|
if($savemsg) {
|
89 |
|
|
echo "<div id='savemsg'>";
|
90 |
|
|
print_info_box($savemsg);
|
91 |
|
|
echo "</div>";
|
92 |
|
|
}
|
93 |
|
|
if ($input_errors)
|
94 |
|
|
print_input_errors($input_errors);
|
95 |
|
|
?>
|
96 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
97 |
|
|
<tr>
|
98 |
|
|
<td>
|
99 |
|
|
<table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
|
100 |
|
|
<tr>
|
101 |
|
|
<td>
|
102 |
|
|
<center>
|
103 |
|
|
<table>
|
104 |
|
|
<tr><td>
|
105 |
|
|
<div name='cpuactivitydiv' id='cpuactivitydiv'>
|
106 |
|
|
<b><?=gettext("Gathering PF information, please wait...");?>
|
107 |
|
|
</div>
|
108 |
|
|
</td></tr>
|
109 |
|
|
</table>
|
110 |
|
|
</td>
|
111 |
|
|
</tr>
|
112 |
|
|
</table>
|
113 |
|
|
</div>
|
114 |
|
|
</td>
|
115 |
|
|
</tr>
|
116 |
|
|
</table>
|
117 |
|
|
</form>
|
118 |
|
|
<?php include("fend.inc"); ?>
|
119 |
|
|
</body>
|
120 |
|
|
</html>
|