diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-01-15 03:33:18 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-01-15 03:33:18 +0000 |
commit | 767a716ecd96105621e239633c04651a02bd8fb8 (patch) | |
tree | a9455173dba67b71599f611cb3eebb6aaa584745 /usr/local/www/includes/functions.inc.php | |
parent | 3e789a8b1385cbd0ccc952b7eac5e1e01ff1a478 (diff) | |
download | pfsense-767a716ecd96105621e239633c04651a02bd8fb8.zip pfsense-767a716ecd96105621e239633c04651a02bd8fb8.tar.gz |
Correct warnings and errors found eclipse
Diffstat (limited to 'usr/local/www/includes/functions.inc.php')
-rw-r--r-- | usr/local/www/includes/functions.inc.php | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php index d87adcc..6abbf75 100644 --- a/usr/local/www/includes/functions.inc.php +++ b/usr/local/www/includes/functions.inc.php @@ -20,6 +20,8 @@ function get_stats() { function get_uptime() { + $boottime = ""; + $matches = ""; exec("/sbin/sysctl -n kern.boottime", $boottime); preg_match("/sec = (\d+)/", $boottime[0], $matches); $boottime = $matches[1]; @@ -67,15 +69,16 @@ function cpu_usage() { function get_pfstate() { global $config; - if (isset($config['system']['maximumstates']) and $config['system']['maximumstates'] > 0) - $maxstates="/{$config['system']['maximumstates']}"; - else - $maxstates="/10000"; - $curentries = `/sbin/pfctl -si |grep current`; - if (preg_match("/([0-9]+)/", $curentries, $matches)) { - $curentries = $matches[1]; - } - return $curentries . $maxstates; + $matches = ""; + if (isset($config['system']['maximumstates']) and $config['system']['maximumstates'] > 0) + $maxstates="/{$config['system']['maximumstates']}"; + else + $maxstates="/10000"; + $curentries = `/sbin/pfctl -si |grep current`; + if (preg_match("/([0-9]+)/", $curentries, $matches)) { + $curentries = $matches[1]; + } + return $curentries . $maxstates; } function has_temp() { @@ -111,6 +114,7 @@ function get_temp() { function disk_usage() { + $dfout = ""; exec("/bin/df -h | /usr/bin/grep -w '/' | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d '%' -f 1", $dfout); $diskusage = trim($dfout[0]); @@ -129,6 +133,7 @@ function swap_usage() function mem_usage() { + $memory = ""; exec("/sbin/sysctl -n vm.stats.vm.v_page_count vm.stats.vm.v_inactive_count " . "vm.stats.vm.v_cache_count vm.stats.vm.v_free_count", $memory); |