jamesez
Fri 16th Nov '01, 11:44pm
Hi!
On OpenBSD, `uptime` says "load averages:" not "load average:"
This patch will fix the problem, and it's compatible with either version of the `uptime` command:
diff -u admin/index.php-old admin/index.php
--- admin/index.php-old Fri Nov 16 22:38:24 2001
+++ admin/index.php Fri Nov 16 22:30:50 2001
@@ -123,7 +123,7 @@
$onlineusers = number_format($guests + $members) . " users online ($members members & $guests guests).";
- preg_match("/average: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$stats,$regs);
+ preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$stats,$regs);
echo "<tr class=\"secondalt\"><td>Server Load Averages</td><td><b>$regs[1], $regs[2], $regs[3]</b> $onlineusers</td></tr>\n";
}
?>
--Jim
Ed's note:
Find the line in blue (note that it doesn't include the "-" or "+"), and add what's in red to it.
On OpenBSD, `uptime` says "load averages:" not "load average:"
This patch will fix the problem, and it's compatible with either version of the `uptime` command:
diff -u admin/index.php-old admin/index.php
--- admin/index.php-old Fri Nov 16 22:38:24 2001
+++ admin/index.php Fri Nov 16 22:30:50 2001
@@ -123,7 +123,7 @@
$onlineusers = number_format($guests + $members) . " users online ($members members & $guests guests).";
- preg_match("/average: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$stats,$regs);
+ preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$stats,$regs);
echo "<tr class=\"secondalt\"><td>Server Load Averages</td><td><b>$regs[1], $regs[2], $regs[3]</b> $onlineusers</td></tr>\n";
}
?>
--Jim
Ed's note:
Find the line in blue (note that it doesn't include the "-" or "+"), and add what's in red to it.