#!/usr/local/bin/php 1) { continue; } $stat_line_split = split("\|", $stats_line); $packet_sampled = intval($stat_line_split[2]); $speed = $stat_line_split[1]; $borrows = intval($stat_line_split[3]); $suspends = intval($stat_line_split[4]); $drops = intval($stat_line_split[5]); $packet_s = round(400 * (1 - $packet_sampled / $total_packets_s), 0); $finscript .= "$('queue{$i}widthb').width='{$packet_s}';"; $finscript .= "$('queue{$i}widtha').width='" . (400 - $packet_s) . "';"; $borrows_txt = "{$borrows} borrows"; $suspends_txt = "{$suspends} suspends"; $drops_txt = "${drops} drops"; $finscript .= "$('queue{$i}pps').value = '{$packet_sampled}/pps';"; $finscript .= "$('queue{$i}bps').value = '{$speed}';"; $finscript .= "$('queue{$i}borrows').value = '{$borrows_txt}';"; $finscript .= "$('queue{$i}suspends').value = '{$suspends_txt}';"; $finscript .= "$('queue{$i}drops').value = '{$drops_txt}';"; $i++; } header("Content-type: text/javascript"); echo $finscript; exit; } $a_queues = array(); exec("/sbin/pfctl -vsq", $pfctl_vsq_array); foreach($pfctl_vsq_array as $pfctl) { if (preg_match_all("/queue\s+(\w+)\s+(\w+)\s+(\w+)\s+/",$pfctl,$match_array)) { if (stristr($match_array[1][0],"root_")) continue; $a_queues[] = $match_array[1][0] . " on " . convert_real_interface_to_friendly_descr($match_array[3][0]); } } $pgtitle = array(gettext("Status"),gettext("Traffic shaper"),gettext("Queues")); include("head.inc"); ?>