summaryrefslogtreecommitdiffstats
path: root/usr/local/www/includes
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/includes')
-rw-r--r--usr/local/www/includes/functions.inc.php14
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);
OpenPOWER on IntegriCloud