diff options
author | Bob Gilligan <gilligan@vyatta.com> | 2011-12-06 14:05:47 -0800 |
---|---|---|
committer | Bob Gilligan <gilligan@vyatta.com> | 2011-12-06 14:05:47 -0800 |
commit | 259c43c23c3ce4495be6e14a1cb57c1f289189ab (patch) | |
tree | d02d0a97e40a14c820a1558bbf75c596fd9420d5 | |
parent | 2a1863ccc87927b51042b8c23a7b2c819a18707c (diff) | |
parent | 50bf825368638cb640f79f7c4d875cf87274a058 (diff) | |
download | vyatta-cfg-system-259c43c23c3ce4495be6e14a1cb57c1f289189ab.tar.gz vyatta-cfg-system-259c43c23c3ce4495be6e14a1cb57c1f289189ab.zip |
Merge branch 'oxnard' of http://git.vyatta.com/vyatta-cfg-system into oxnard
-rw-r--r-- | debian/changelog | 15 | ||||
-rwxr-xr-x | scripts/keepalived/vyatta-show-vrrp.pl | 32 | ||||
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 5 |
3 files changed, 42 insertions, 10 deletions
diff --git a/debian/changelog b/debian/changelog index 2fb0cfc6..1c8902bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +vyatta-cfg-system (0.19.139) unstable; urgency=low + + * Add parsing of vrrp interfaces so that 'show vrrp interfaces <vmac- + interface>' will do what the user intended. + + -- John Southworth <john.southworth@vyatta.com> Tue, 06 Dec 2011 11:50:17 -0800 + +vyatta-cfg-system (0.19.138) unstable; urgency=low + + * make vyatta-interfaces.pl aware of vrrp interfaces + * Adjust the output of 'show vrrp' and 'show vrrp summary' for vmac + and address owner + + -- John Southworth <john.southworth@vyatta.com> Tue, 06 Dec 2011 09:14:43 -0800 + vyatta-cfg-system (0.19.137) unstable; urgency=low * Add HTTP headers to identify client and version. diff --git a/scripts/keepalived/vyatta-show-vrrp.pl b/scripts/keepalived/vyatta-show-vrrp.pl index 68a98390..ecf2bf75 100755 --- a/scripts/keepalived/vyatta-show-vrrp.pl +++ b/scripts/keepalived/vyatta-show-vrrp.pl @@ -182,7 +182,7 @@ sub get_master_info { sub vrrp_showsummary { my ($file) = @_; - + my $owner = "no"; my ($start_time, $intf, $group, $state, $ltime) = Vyatta::Keepalived::vrrp_state_parse($file); my ($interface_state, $link) = get_state_link($intf); @@ -190,9 +190,13 @@ sub vrrp_showsummary { my ($primary_addr, $priority, $preempt, $advert_int, $auth_type, $vmac_interface, @vips) = Vyatta::Keepalived::vrrp_get_config($intf, $group); - my $format = "\n%-16s%-8s%-8s%-16s%-16s%-16s"; + my $format = "\n%-16s%-8s%-8s%-16s%-10s%-9s%-13s"; my $vip = shift @vips; - printf($format, $intf, $group, 'vip', $vip, $link, $state); + if ($vmac_interface) { + $intf = "$intf" . "v" . "$group"; + $owner = "yes" if ($priority == 255); + } + printf($format, $intf, $group, 'vip', $vip, $link, $owner, $state); foreach my $vip (@vips){ printf("\n%-24s%-8s%-16s", ' ', 'vip', $vip); } @@ -203,7 +207,7 @@ sub vrrp_showsummary { sub vrrp_show { my ($file) = @_; - + my $owner = "no"; my $now_time = time; my ($start_time, $intf, $group, $state, $ltime) = Vyatta::Keepalived::vrrp_state_parse($file); @@ -217,7 +221,9 @@ sub vrrp_show { print "Physical interface: $intf, Source Address $primary_addr\n"; if ($vmac_interface) { my $vma = "$intf" . "v" . "$group"; + $owner = "yes" if ($priority == 255); print " Virtual MAC interface: $vma\n"; + print " Address Owner: $owner\n"; } print " Interface state: $link, Group $group, State: $state\n"; print " Priority: $priority, Advertisement interval: $advert_int, "; @@ -285,16 +291,26 @@ if (!Vyatta::Keepalived::is_running()) { my $display_func; if ($showsummary == 1) { $display_func = \&vrrp_showsummary; - my $format = '%-16s%-8s%-8s%-16s%-16s%-16s%s'; - printf($format, '', 'VRRP', 'Addr', '', 'Interface', 'VRRP', "\n"); - printf($format, 'Interface', 'Group', 'Type', 'Address', 'State', 'State', + my $format = '%-16s%-8s%-8s%-16s%-10s%-9s%-13s%s'; + printf($format, '', 'VRRP', 'Addr', '', 'Interface','Address', 'VRRP', "\n"); + printf($format, 'Interface', 'Group', 'Type', 'Address', 'State','Owner', 'State', "\n"); - printf($format, '-' x 9, '-' x 5, '-' x 4 , '-' x 7, '-' x 5, '-' x 5, ''); + printf($format, '-' x 9, '-' x 5, '-' x 4 , '-' x 7, '-' x 5, '-' x 5, '-' x 5, '', ); } else { $display_func = \&vrrp_show; } foreach my $intf (@intfs) { + my $intf_vrid; + if ($intf =~ m/(\w+)\.(\d+)v(\d+)/){ + $intf = "$1.$2"; + $intf_vrid = $3; + } elsif ($intf =~ m/(\w+)v(\d+)/){ + $intf = $1; + $intf_vrid = $2; + } + next if ($group ne 'all' && $intf_vrid && $intf_vrid != $group); + $group = $intf_vrid if ($group eq 'all' && $intf_vrid); my @state_files = Vyatta::Keepalived::get_state_files($intf, $group); foreach my $state_file (@state_files) { &$display_func($state_file); diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index c4d04e7a..2b75dba5 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -400,8 +400,9 @@ sub show_interfaces { next unless $intf; # skip unknown types next if $skip_interface{$name}; next unless ($type eq 'all' || $type eq $intf->type()); - - if ($vif_name) { + if ($intf->vrid()){ + push @match, $name; # add all vrrp interfaces + } elsif ($vif_name) { next unless $intf->vif(); push @match, $intf->vif() if ($vif_name eq $intf->physicalDevice()); |