Project

General

Profile

Download (2.62 KB) Statistics
| Branch: | Tag: | Revision:
1 9242ba15 Scott Ullrich
<?php
2
/* $Id$ */
3
/*
4 45d6ada5 Sjon Hortensius
	diag_limiter_info.php
5
	Copyright (C) 2010 Scott Ullrich
6
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7
	All rights reserved.
8 9242ba15 Scott Ullrich
9 45d6ada5 Sjon Hortensius
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11 9242ba15 Scott Ullrich
12 45d6ada5 Sjon Hortensius
	1. Redistributions of source code must retain the above copyright notice,
13
	   this list of conditions and the following disclaimer.
14 9242ba15 Scott Ullrich
15 45d6ada5 Sjon Hortensius
	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 9242ba15 Scott Ullrich
19 45d6ada5 Sjon Hortensius
	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 9242ba15 Scott Ullrich
*/
30
31
/*
32
	pfSense_BUILDER_BINARIES:	/usr/bin/top
33 45d6ada5 Sjon Hortensius
	pfSense_MODULE: system
34 9242ba15 Scott Ullrich
*/
35
36
##|+PRIV
37 7997ed44 Renato Botelho
##|*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 9242ba15 Scott Ullrich
##|-PRIV
42
43
require("guiconfig.inc");
44
45
$pgtitle = gettext("Diagnostics: Limiter Info");
46 d71fc5d3 jim-p
$shortcut_section = "trafficshaper-limiters";
47 9242ba15 Scott Ullrich
48
if($_REQUEST['getactivity']) {
49
	$text = `/sbin/ipfw pipe show`;
50 45d6ada5 Sjon Hortensius
	if($text == "")
51
		$text = "Unable to find any limiters on this system.";
52 f8707b15 jim-p
	echo "Limiters:\n";
53 9242ba15 Scott Ullrich
	echo $text;
54 f8707b15 jim-p
	$text = `/sbin/ipfw queue show`;
55
	if($text != "") {
56
		echo "\n\nQueues:\n";
57
		echo $text;
58
	}
59 9242ba15 Scott Ullrich
	exit;
60
}
61
62
include("head.inc");
63
64 45d6ada5 Sjon Hortensius
if ($input_errors)
65
	print_input_errors($input_errors);
66
67 9242ba15 Scott Ullrich
?>
68 45d6ada5 Sjon Hortensius
<script>
69 9242ba15 Scott Ullrich
	function getlimiteractivity() {
70 45d6ada5 Sjon Hortensius
		$.ajax(
71
			'/diag_limiter_info.php',
72 9242ba15 Scott Ullrich
			{
73 ebfc87d6 Vinicius Coque
				type: 'post',
74 45d6ada5 Sjon Hortensius
				data: {
75
					getactivity: 'yes'
76
				},
77
				success: function (data) {
78
					$('#xhrOutput').html(data);
79
				},
80
		});
81 9242ba15 Scott Ullrich
	}
82 45d6ada5 Sjon Hortensius
83
	events.push(function(){
84
		setInterval('getlimiteractivity()', 2500);
85
		getlimiteractivity();
86
	});
87 9242ba15 Scott Ullrich
</script>
88 45d6ada5 Sjon Hortensius
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 9610936a Colin Fleming
</div>
95 45d6ada5 Sjon Hortensius
96
<?php include("foot.inc");