diff options
author | slioch <slioch@eng-140.vyatta.com> | 2009-07-21 11:50:09 -0700 |
---|---|---|
committer | slioch <slioch@eng-140.vyatta.com> | 2009-07-21 11:50:09 -0700 |
commit | f947ef5883cd890a2cdc3e250f6790f3a630492f (patch) | |
tree | ceb0582cfb652bbef942f3a63661a3a60f9adb9a /scripts | |
parent | 25d9851b65fed9297caaa01b47ec6bae76d8c954 (diff) | |
download | vyatta-wanloadbalance-f947ef5883cd890a2cdc3e250f6790f3a630492f.tar.gz vyatta-wanloadbalance-f947ef5883cd890a2cdc3e250f6790f3a630492f.zip |
added udp ttl limited test type to health check. modified configuration layout. modified op mode command to
provide indication on multiple target success/failures.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyatta-wanloadbalance.pl | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/scripts/vyatta-wanloadbalance.pl b/scripts/vyatta-wanloadbalance.pl index cfc8755..36ecdfb 100644 --- a/scripts/vyatta-wanloadbalance.pl +++ b/scripts/vyatta-wanloadbalance.pl @@ -67,26 +67,26 @@ sub write_health { exit 1; } - $config->setLevel("load-balancing wan interface-health $ethNode rule"); + $config->setLevel("load-balancing wan interface-health $ethNode test"); my @rules = $config->listNodes(); foreach my $rule (@rules) { print FILE_LCK "\t\trule " . $rule . " {\n"; -# my $icmp = $config->returnValue("$rule icmp"); -# if (defined $icmp) { - print FILE_LCK "\t\t\ttype icmp {\n"; -# } - -# my $ttl = $config->returnValue("$rule ttl"); -# if (defined $ttl) { -# print FILE_LCK "\t\t\ttype udp {\n"; -# print FILE_LCK "\t\t\t\tttl " . $ttl . "\n"; -# } - -# if (defined $icmp && defined $ttl) { -# print "Only a single test type can be defined (ttl or icmp)\n"; -# exit 1; -# } + my $icmp = $config->exists("$rule ping"); + if (defined $icmp) { + print FILE_LCK "\t\t\ttype ping {\n"; + } + + my $udp = $config->returnValue("$rule ttl"); + if (defined $udp) { + print FILE_LCK "\t\t\ttype udp {\n"; + print FILE_LCK "\t\t\t\tttl $udp\n"; + } + + if (defined $icmp && defined $udp) { + print "Only a single test type can be defined (ttl or icmp)\n"; + exit 1; + } $option = $config->returnValue("$rule target"); if (defined $option) { |