Ejemplo n.º 1
0
<?php

/*
	pfSense_MODULE:	ajax
*/
if (Connection_Aborted()) {
    exit;
}
require_once "config.inc";
require_once "pfsense-utils.inc";
function get_stats()
{
    $stats['cpu'] = cpu_usage();
    $stats['mem'] = mem_usage();
    $stats['uptime'] = get_uptime();
    $stats['states'] = get_pfstate();
    $stats['temp'] = get_temp();
    $stats['datetime'] = update_date_time();
    $stats['interfacestatistics'] = get_interfacestats();
    $stats['interfacestatus'] = get_interfacestatus();
    $stats['gateways'] = get_gatewaystats();
    $stats['cpufreq'] = get_cpufreq();
    $stats['load_average'] = get_load_average();
    $stats['mbuf'] = get_mbuf();
    $stats['mbufpercent'] = get_mbuf(true);
    $stats['statepercent'] = get_pfstate(true);
    $stats = join("|", $stats);
    return $stats;
}
function get_gatewaystats()
{
Ejemplo n.º 2
0
                    Trafik Şekillendirici <a href="firewall_shaper.php?reset=true">buradan</a> düzenlenebilir.
		    </p>
            </form>
<br><a href="status_queues.php?reset=true">Buradan kuyrukları sıfırlayabilrsiniz.</a> 

<?php 
include "fend.inc";
?>
</body>
</html>

<?php 
ob_flush();
sleep(3);
$counter = 0;
while (!Connection_Aborted()) {
    $stats_array = gather_altq_queue_stats(true);
    /* calculate total packets being moved through all queues. */
    $total_packets_s = 0;
    foreach ($stats_array as $stats_line) {
        $stat_line_split = split("\\|", $stats_line);
        $total_packets_s = $total_packets_s + intval($stat_line_split[2]);
    }
    $i = 0;
    foreach ($stats_array as $stats_line) {
        if ($stat_line_split[2] == "" and $counter > 1) {
            mwexec("/usr/bin/killall pfctl");
            exit;
        }
        $stat_line_split = split("\\|", $stats_line);
        $packet_sampled = intval($stat_line_split[2]);