1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
diag_limiter_info.php
|
5
|
Copyright (C) 2010 Scott Ullrich
|
6
|
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
|
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
|
/*
|
32
|
pfSense_BUILDER_BINARIES: /usr/bin/top
|
33
|
pfSense_MODULE: system
|
34
|
*/
|
35
|
|
36
|
##|+PRIV
|
37
|
##|*IDENT=page-diagnostics-limiter-info
|
38
|
##|*NAME=Diagnostics: Limiter Info
|
39
|
##|*DESCR=Allows access to the 'Diagnostics: Limiter Info' page
|
40
|
##|*MATCH=diag_limiter_info.php*
|
41
|
##|-PRIV
|
42
|
|
43
|
require("guiconfig.inc");
|
44
|
|
45
|
$pgtitle = gettext("Diagnostics: Limiter Info");
|
46
|
$shortcut_section = "trafficshaper-limiters";
|
47
|
|
48
|
if($_REQUEST['getactivity']) {
|
49
|
$text = `/sbin/ipfw pipe show`;
|
50
|
if($text == "")
|
51
|
$text = "Unable to find any limiters on this system.";
|
52
|
echo "Limiters:\n";
|
53
|
echo $text;
|
54
|
$text = `/sbin/ipfw queue show`;
|
55
|
if($text != "") {
|
56
|
echo "\n\nQueues:\n";
|
57
|
echo $text;
|
58
|
}
|
59
|
exit;
|
60
|
}
|
61
|
|
62
|
include("head.inc");
|
63
|
|
64
|
if ($input_errors)
|
65
|
print_input_errors($input_errors);
|
66
|
|
67
|
?>
|
68
|
<script>
|
69
|
function getlimiteractivity() {
|
70
|
$.ajax(
|
71
|
'/diag_limiter_info.php',
|
72
|
{
|
73
|
type: 'post',
|
74
|
data: {
|
75
|
getactivity: 'yes'
|
76
|
},
|
77
|
success: function (data) {
|
78
|
$('#xhrOutput').html(data);
|
79
|
},
|
80
|
});
|
81
|
}
|
82
|
|
83
|
events.push(function(){
|
84
|
setInterval('getlimiteractivity()', 2500);
|
85
|
getlimiteractivity();
|
86
|
});
|
87
|
</script>
|
88
|
|
89
|
<div class="panel panel-default">
|
90
|
<div class="panel-heading">Limiter Information</div>
|
91
|
<div class="panel-body">
|
92
|
<pre id="xhrOutput"><?=gettext("Gathering Limiter information, please wait...")?></pre>
|
93
|
</div>
|
94
|
</div>
|
95
|
|
96
|
<?php include("foot.inc");
|