aboutsummaryrefslogtreecommitdiffstats
path: root/packages/tinydns/tinydns_status.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-01-24 01:10:09 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-01-24 01:10:09 +0000
commit87c4907f7fc19e7b29afd34f67553400fddd8fb4 (patch)
tree64a8f346c84c9128182b7e28692e4d5236bfc20e /packages/tinydns/tinydns_status.php
parent5ee43dc752b511452a9b8283ff8205364ee5ee4e (diff)
downloadpfsense-packages-87c4907f7fc19e7b29afd34f67553400fddd8fb4.tar.gz
pfsense-packages-87c4907f7fc19e7b29afd34f67553400fddd8fb4.tar.bz2
pfsense-packages-87c4907f7fc19e7b29afd34f67553400fddd8fb4.zip
Use monitorip if available.
Diffstat (limited to 'packages/tinydns/tinydns_status.php')
-rw-r--r--packages/tinydns/tinydns_status.php32
1 files changed, 22 insertions, 10 deletions
diff --git a/packages/tinydns/tinydns_status.php b/packages/tinydns/tinydns_status.php
index 7bc5a441..49f07a10 100644
--- a/packages/tinydns/tinydns_status.php
+++ b/packages/tinydns/tinydns_status.php
@@ -84,7 +84,11 @@ foreach($config['installedpackages']['tinydnsdomains']['config'] as $ping) {
continue;
$ipaddress = $ping['ipaddress'];
$hostname = $ping['hostname'];
- $status = file_get_contents("/var/db/pingstatus/$ipaddress");
+ $monitorip = $ping['monitorip'];
+ if(file_exists("/var/db/pingstatus/$monitorip"))
+ $status = file_get_contents("/var/db/pingstatus/$monitorip");
+ else
+ $status = "N/A";
if(stristr($tinydns_data, "+{$hostname}:{$ipaddress}"))
$inservice = "<FONT COLOR='GREEN'>YES</FONT>";
else
@@ -97,7 +101,7 @@ foreach($config['installedpackages']['tinydnsdomains']['config'] as $ping) {
if(stristr($status,"DOWN"))
echo "<FONT COLOR='red'>DOWN</FONT>";
else
- echo $status;
+ echo "UP";
echo "</td>";
echo "<td class=\"listlr\">";
@@ -105,8 +109,10 @@ foreach($config['installedpackages']['tinydnsdomains']['config'] as $ping) {
echo "</td>";
echo "<td class=\"listlr\">";
- if(file_exists("/var/db/pingmsstatus/$ipaddress"))
- $msstatus = file_get_contents("/var/db/pingmsstatus/$ipaddress");
+ if(!$monitorip)
+ $monitorip = $ipaddress;
+ if(file_exists("/var/db/pingmsstatus/$monitorip"))
+ $msstatus = file_get_contents("/var/db/pingmsstatus/$monitorip");
else
$msstatus = "N/A";
echo $msstatus;
@@ -115,13 +121,17 @@ foreach($config['installedpackages']['tinydnsdomains']['config'] as $ping) {
foreach($ping['row'] as $row) {
$ipaddress = $row['failoverip'];
- $status = file_get_contents("/var/db/pingstatus/$ipaddress");
+ $monitorip = $row['monitorip'];
+ if(file_exists("/var/db/pingstatus/$monitorip"))
+ $status = file_get_contents("/var/db/pingstatus/$monitorip");
+ else
+ $status = "N/A";
echo "<tr>";
echo "<td class=\"listlr\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|->&nbsp;&nbsp;";
echo $ipaddress;
if($row['loadbalance'])
echo " (LB)";
- if(stristr($tinydns_data, "+{$hostname}:{$row['failoverip']}"))
+ if(stristr($tinydns_data, "+{$hostname}:{$row['monitorip']}"))
$inservice = "<FONT COLOR='GREEN'>YES</FONT>";
else
$inservice = "<FONT COLOR='BLUE'>NO</FONT>";
@@ -130,7 +140,7 @@ foreach($config['installedpackages']['tinydnsdomains']['config'] as $ping) {
if(stristr($status,"DOWN"))
echo "<FONT COLOR='red'>DOWN</FONT>";
else
- echo $status;
+ echo "UP";
echo "</td>";
echo "<td class=\"listlr\">";
@@ -138,14 +148,16 @@ foreach($config['installedpackages']['tinydnsdomains']['config'] as $ping) {
echo "</td>";
echo "<td class=\"listlr\">";
- if(file_exists("/var/db/pingmsstatus/$ipaddress"))
- $msstatus = file_get_contents("/var/db/pingmsstatus/$ipaddress");
+ if(!$monitorip)
+ $monitorip = $ipaddress;
+ if(file_exists("/var/db/pingmsstatus/$monitorip"))
+ $msstatus = file_get_contents("/var/db/pingmsstatus/$monitorip");
else
$msstatus = "N/A";
+
echo $msstatus;
echo "</td>";
echo "</tr>";
-
}
echo "<tr><td>&nbsp;</td></tr>";
}