summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-07-03 19:40:28 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-07-03 19:40:28 +0000
commitd269563b39c52769288d13a4bb6da83fe17b6b08 (patch)
treeae8ee08782dc8b0aac9223d5519f2ae018c47d5a
parent1ed2947caa600c1bd172ede9e374ce85b0ce6348 (diff)
downloadpfsense-d269563b39c52769288d13a4bb6da83fe17b6b08.zip
pfsense-d269563b39c52769288d13a4bb6da83fe17b6b08.tar.gz
MFC 12872
Fix the date parsing so it works properly on single digit days of the month. This was a presentation issue and caused incorrect display of the change date. Also display when we have no changes on log.
-rwxr-xr-xusr/local/www/status_slbd_pool.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/usr/local/www/status_slbd_pool.php b/usr/local/www/status_slbd_pool.php
index 5e1c7ef..c3030f8 100755
--- a/usr/local/www/status_slbd_pool.php
+++ b/usr/local/www/status_slbd_pool.php
@@ -91,9 +91,10 @@ include("head.inc");
$svr = split("\|", $server);
$monitorip = $svr[1];
$logstates = return_clog($slbd_logfile, $nentries, array("$monitorip", "marking"), true);
+ $logstates = $logstates[0];
- if(stristr($logstates[0], $monitorip)) {
- $date = split(" ", $logstates[0]);
+ if(stristr($logstates, $monitorip)) {
+ $date = preg_split("/[ ]+/" , $logstates);
$lastchange = "$date[0] $date[1] $year $date[2]";
}
if(stristr($poolstatus, $monitorip)) {
@@ -107,7 +108,13 @@ include("head.inc");
$online = "Offline";
$bgcolor = "lightcoral";
}
- PRINT "<tr><td bgcolor=\"$bgcolor\" > $online </td><td> Last change $lastchange</td></tr>";
+ PRINT "<tr><td bgcolor=\"$bgcolor\" > $online </td><td>";
+ if($lastchange <> "") {
+ PRINT "Last change $lastchange";
+ } else {
+ PRINT "No changes found in logfile";
+ }
+ PRINT "</td></tr>";
}
} else {
PRINT "<tr><td> {$vipent['monitor']} </td></tr>";
OpenPOWER on IntegriCloud