aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-01-24 00:15:21 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-01-24 00:15:21 +0000
commit5ee43dc752b511452a9b8283ff8205364ee5ee4e (patch)
tree841dddf773869a64701c6d1f52c88f7bc53eb1c0 /packages
parentf81276457e9a666b2f0928ce45c6d14862f655af (diff)
downloadpfsense-packages-5ee43dc752b511452a9b8283ff8205364ee5ee4e.tar.gz
pfsense-packages-5ee43dc752b511452a9b8283ff8205364ee5ee4e.tar.bz2
pfsense-packages-5ee43dc752b511452a9b8283ff8205364ee5ee4e.zip
Add monitor ip support
Diffstat (limited to 'packages')
-rw-r--r--packages/tinydns/tinydns.inc19
-rw-r--r--packages/tinydns/tinydns_domains.xml13
2 files changed, 28 insertions, 4 deletions
diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc
index a59d2f9c..18bf5c6c 100644
--- a/packages/tinydns/tinydns.inc
+++ b/packages/tinydns/tinydns.inc
@@ -223,15 +223,22 @@ function tinydns_setup_ping_items() {
*/
foreach($config['installedpackages']['tinydnsdomains']['config'] as $domain) {
fwrite($fd, $ip . "|" . $domain['ipaddress'] . "|3|/usr/local/pkg/tinydns_down.php|/usr/local/pkg/tinydns_up.php\n");
+ if($domain['monitorip'] <> "")
+ $monitorip = $domain['monitorip'];
if($domain['row']) {
foreach($domain['row'] as $row) {
if($row['pingthreshold'])
$pingthreshold = $row['pingthreshold'];
else
$row['pingthreshold'] = "";
- fwrite($fd, $ip . "|" . $row['failoverip'] . "|3|/usr/local/pkg/tinydns_down.php|/usr/local/pkg/tinydns_up.php|{$pingthreshold}\n");
+ if($row['monitorip'])
+ fwrite($fd, $row['monitorip'] . "|" . $row['failoverip'] . "|3|/usr/local/pkg/tinydns_down.php|/usr/local/pkg/tinydns_up.php|{$pingthreshold}\n");
+ else
+ fwrite($fd, $ip . "|" . $row['failoverip'] . "|3|/usr/local/pkg/tinydns_down.php|/usr/local/pkg/tinydns_up.php|{$pingthreshold}\n");
}
}
+ if($domain['monitorip'])
+ fwrite($fd, $domain['monitorip'] . "|" . $row['failoverip'] . "|3|/usr/local/pkg/tinydns_down.php|/usr/local/pkg/tinydns_up.php|{$pingthreshold}\n");
}
fclose($fd);
conf_mount_ro();
@@ -254,9 +261,13 @@ function tinydns_create_zone_file() {
/* check record status, if it is down request
* backup server if defined.
*/
- $status = tinydns_get_record_status($ipaddress);
- if(!$status)
- $ipaddress = tinydns_get_backup_record($ipaddress);
+ if($domain['monitorip'])
+ $monitorip = $domain['monitorip'];
+ if($monitorip) {
+ $status = tinydns_get_record_status($monitorip);
+ if(!$status)
+ $ipaddress = tinydns_get_backup_record($ipaddress);
+ }
$record_data = tinydns_get_rowline_data($ipaddress, $domain['recordtype'], $ttl, $hostname);
if($record_data)
fwrite($fd, $record_data . "\n");
diff --git a/packages/tinydns/tinydns_domains.xml b/packages/tinydns/tinydns_domains.xml
index 15bed905..75e3c186 100644
--- a/packages/tinydns/tinydns_domains.xml
+++ b/packages/tinydns/tinydns_domains.xml
@@ -69,6 +69,12 @@
<size>35</size>
</field>
<field>
+ <fieldname>monitorip</fieldname>
+ <fielddescr>IP to ping to ensure service is up</fielddescr>
+ <type>input</type>
+ <size>35</size>
+ </field>
+ <field>
<fieldname>threshhold</fieldname>
<fielddescr>Time in minutes before DNS switches to backup host</fielddescr>
<type>input</type>
@@ -104,6 +110,13 @@
<type>input</type>
<size>7</size>
</rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>IP to ping to ensure service is up</fielddescr>
+ <fieldname>monitorip</fieldname>
+ <description>When the WAN MS ping time is surpassed, item will failover to next host</description>
+ <type>input</type>
+ <size>15</size>
+ </rowhelperfield>
</rowhelper>
</field>
</fields>