summaryrefslogtreecommitdiffstats
path: root/usr/local/www/index.php
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-05-16 20:53:34 +0000
committerBill Marquette <billm@pfsense.org>2005-05-16 20:53:34 +0000
commit4f2c1590cb929bf192cfa6894361cdaae62dac40 (patch)
treecd18aaac262a4be2b9595578fce7a5bb8abe30b0 /usr/local/www/index.php
parent6db304e40bc3b85a7d43f3a5a9bee5b443a4326e (diff)
downloadpfsense-4f2c1590cb929bf192cfa6894361cdaae62dac40.zip
pfsense-4f2c1590cb929bf192cfa6894361cdaae62dac40.tar.gz
Show the current state table size on the index page
This ones for you Hoba
Diffstat (limited to 'usr/local/www/index.php')
-rwxr-xr-xusr/local/www/index.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/usr/local/www/index.php b/usr/local/www/index.php
index bec1ab2..9dcef1f 100755
--- a/usr/local/www/index.php
+++ b/usr/local/www/index.php
@@ -117,6 +117,18 @@ $cpuUsage = round(100 * (1 - $diff['idle'] / $totalDiff), 0);
return $cpuUsage;
}
+function get_pfstate() {
+ if (isset($config['system']['maximumstates']))
+ $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;
+}
+
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
@@ -182,7 +194,15 @@ return $cpuUsage;
<?=htmlspecialchars(date("D M j G:i:s T Y", $config['lastchange']));?>
</td>
</tr><?php endif; ?>
- <tr>
+ <tr>
+ <td width="25%" class="vncellt">State table size</td>
+ <td width="75%" class="listr">
+ <?php
+ echo "<input style='border: 0px solid white;' size='30' name='pfstate' id='pfstate' value='" .htmlspecialchars(get_pfstate()) . "'>";
+ ?>
+ </td>
+ </tr>
+ <tr>
<td width="25%" class="vncellt">CPU usage</td>
<td width="75%" class="listr">
<?php
@@ -288,6 +308,7 @@ While(!Connection_Aborted()) {
echo "<script language='javascript'>\n";
echo "document.forms[0].uptime.value = '" . get_uptime() . "';\n";
+ echo "document.forms[0].pfstate.value = '" . get_pfstate() . "';\n";
echo "document.cpuwidtha.style.width='" . $cpuUsage . "';\n";
echo "document.cpuwidthb.style.width='" . (100 - $cpuUsage) . "';\n";
OpenPOWER on IntegriCloud