summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-05-15 10:35:45 -0400
committerjim-p <jimp@pfsense.org>2012-05-15 13:05:16 -0400
commitac91161935eb4e8084fbf7f705ae099d5bb6f21c (patch)
tree1fdaeca79f3afdf6406de66f7fd32fa01411df02 /usr/local
parent0770e6030ee9741930900975aa29d55f39113e2d (diff)
downloadpfsense-ac91161935eb4e8084fbf7f705ae099d5bb6f21c.zip
pfsense-ac91161935eb4e8084fbf7f705ae099d5bb6f21c.tar.gz
Use a text description instead of a code.
Diffstat (limited to 'usr/local')
-rw-r--r--usr/local/www/status_ntpd.php48
1 files changed, 31 insertions, 17 deletions
diff --git a/usr/local/www/status_ntpd.php b/usr/local/www/status_ntpd.php
index 815d6b4..d3904f4 100644
--- a/usr/local/www/status_ntpd.php
+++ b/usr/local/www/status_ntpd.php
@@ -46,7 +46,34 @@ exec("/usr/bin/ntpq -pn | /usr/bin/tail +3", $ntpq_output);
$ntpq_servers = array();
foreach ($ntpq_output as $line) {
$server = array();
- $server['tallycode'] = substr($line, 0, 1);
+
+ switch (substr($line, 0, 1)) {
+ case " ":
+ $server['status'] = "Unreach/Pending";
+ break;
+ case "*":
+ $server['status'] = "Active Peer";
+ break;
+ case "+":
+ $server['status'] = "Candidate";
+ break;
+ case "o":
+ $server['status'] = "PPS Peer";
+ break;
+ case "#":
+ $server['status'] = "Selected";
+ break;
+ case ".":
+ $server['status'] = "Excess Peer";
+ break;
+ case "x":
+ $server['status'] = "False Ticker";
+ break;
+ case "-":
+ $server['status'] = "Outlier";
+ break;
+ }
+
$line = substr($line, 1);
$peerinfo = preg_split("/[\s\t]+/", $line);
@@ -77,7 +104,7 @@ include("head.inc");
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
<thead>
<tr>
- <th class="listhdrr"><?=gettext("Tally code"); ?></td>
+ <th class="listhdrr"><?=gettext("Status"); ?></td>
<th class="listhdrr"><?=gettext("Server"); ?></td>
<th class="listhdrr"><?=gettext("Ref ID"); ?></td>
<th class="listhdrr"><?=gettext("Stratum"); ?></td>
@@ -98,8 +125,8 @@ include("head.inc");
<?php else: ?>
<?php $i = 0; foreach ($ntpq_servers as $server): ?>
<tr>
- <td class="listlr">
- <?=$server['tallycode'];?>
+ <td class="listlr" nowrap>
+ <?=$server['status'];?>
</td>
<td class="listlr">
<?=$server['server'];?>
@@ -133,19 +160,6 @@ include("head.inc");
</td>
</tr>
<?php $i++; endforeach; endif; ?>
- <tr><td colspan="11">
- <br/>Tally code meanings:<br/>
- <ul>
- <li>(blank) = Peer in unreachable/unusable, or undetermined</li>
- <li>* = System Peer (active)</li>
- <li>+ = Candidate</li>
- <li>o = Peer with PPS</li>
- <li># = Survivor, but not among first six</li>
- <li>. = Excess peer not needed as there are too many</li>
- <li>x = Discarded as false ticker</li>
- <li>- = Discarded as an Outlier</li>
- </ul>
- </td></tr>
</tbody>
</table>
</div></td></tr>
OpenPOWER on IntegriCloud