diff options
author | Erik Kristensen <ekristen@pfsense.org> | 2005-09-18 04:58:40 +0000 |
---|---|---|
committer | Erik Kristensen <ekristen@pfsense.org> | 2005-09-18 04:58:40 +0000 |
commit | 477361c744252f8e67cf42b2600bf34a2df59afa (patch) | |
tree | 5ff72279b8980bdc196b4ffc2bdfaaf768b37e83 /usr/local/www/includes | |
parent | be88414ade55b6745c7866d1dc7eab763c12b573 (diff) | |
download | pfsense-477361c744252f8e67cf42b2600bf34a2df59afa.zip pfsense-477361c744252f8e67cf42b2600bf34a2df59afa.tar.gz |
Merged Function for Single HTTP Request
Diffstat (limited to 'usr/local/www/includes')
-rw-r--r-- | usr/local/www/includes/functions.inc.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php index 0ffbb79..1f66d5e 100644 --- a/usr/local/www/includes/functions.inc.php +++ b/usr/local/www/includes/functions.inc.php @@ -4,6 +4,20 @@ if(Connection_Aborted()) { exit; } + + function get_stats() { + $stats['mem'] = mem_usage(); + $stats['cpu'] = cpu_usage(); + $stats['uptime'] = get_uptime(); + $stats['states'] = get_pfstate(); + $stats['temp'] = get_temp(); + + $stats = join("|", $stats); + + return $stats; + } + + function get_uptime() { exec("/sbin/sysctl -n kern.boottime", $boottime); preg_match("/sec = (\d+)/", $boottime[0], $matches); |