summaryrefslogtreecommitdiffstats
path: root/usr/local/www/includes/functions.inc.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-07-16 15:08:58 -0400
committerjim-p <jimp@pfsense.org>2013-07-16 15:08:58 -0400
commite4a0be9bee26f71da33e1fa4fca41f597fda2dbd (patch)
tree7537647d595882b96e533ebdfc535bf22bb466c9 /usr/local/www/includes/functions.inc.php
parent980b9cc6f854fb2b24f9345828e5920e306f29e3 (diff)
downloadpfsense-e4a0be9bee26f71da33e1fa4fca41f597fda2dbd.zip
pfsense-e4a0be9bee26f71da33e1fa4fca41f597fda2dbd.tar.gz
Make mbufs update via ajax
Diffstat (limited to 'usr/local/www/includes/functions.inc.php')
-rw-r--r--usr/local/www/includes/functions.inc.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php
index 322a13c..edef74e 100644
--- a/usr/local/www/includes/functions.inc.php
+++ b/usr/local/www/includes/functions.inc.php
@@ -21,6 +21,7 @@ function get_stats() {
$stats['gateways'] = get_gatewaystats();
$stats['cpufreq'] = get_cpufreq();
$stats['load_average'] = get_load_average();
+ $stats['mbuf'] = get_mbuf();
$stats = join("|", $stats);
return $stats;
}
@@ -162,6 +163,12 @@ function get_hwtype() {
return;
}
+function get_mbuf() {
+ $mbufs_output=trim(`netstat -mb | grep "mbuf clusters in use" | awk '{ print $1 }'`);
+ list( $mbufs_current, $mbufs_cache, $mbufs_total, $mbufs_max ) = explode( "/", $mbufs_output);
+ $mbufusage = round(($mbufs_total / $mbufs_max) * 100);
+}
+
function get_temp() {
$temp_out = "";
exec("/sbin/sysctl dev.cpu.0.temperature | /usr/bin/awk '{ print $2 }' | /usr/bin/cut -d 'C' -f 1", $dfout);
OpenPOWER on IntegriCloud