From acb1cb8976fb92893e399c1bf2f7a78e73a5eb8b Mon Sep 17 00:00:00 2001 From: John Southworth Date: Mon, 5 Dec 2011 11:56:17 -0800 Subject: make vyatta-interfaces.pl aware of vrrp interfaces --- scripts/vyatta-interfaces.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') 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()); -- cgit v1.2.3 From f9da3f5d82db01f6eecca7773e8a5863237d7646 Mon Sep 17 00:00:00 2001 From: Bob Gilligan Date: Mon, 5 Dec 2011 17:44:41 -0800 Subject: Add HTTP headers to identify client and version. --- scripts/install/install-image | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/install/install-image b/scripts/install/install-image index 5abef7ca..ea8cfd7f 100755 --- a/scripts/install/install-image +++ b/scripts/install/install-image @@ -62,8 +62,12 @@ fetch_iso_by_url () auth="" fi + client_hdr="-H vyatta-client: install-image" + vyatta_version=`dpkg-query --showformat='${Version}' --show vyatta-version` + vers_hdr="-H vyatta-version: $vyatta_version" + filename="${TEMP_DIR}/${NEW_ISO##*/}" - curl $auth -f -o $filename $NEW_ISO + curl "$client_hdr" "$vers_hdr" $auth -f -o $filename $NEW_ISO if [ $? -ne 0 ]; then echo "Unable to fetch ISO from $NEW_ISO" rm -f $filename @@ -78,7 +82,7 @@ fetch_iso_by_url () echo "ISO download suceeded." echo "Checking for digital signature file..." - curl -f -o ${filename}.asc ${NEW_ISO}.asc + curl "$client_hdr" "$vers_hdr" -f -o ${filename}.asc ${NEW_ISO}.asc if [ $? -ne 0 ]; then echo "Unable to fetch digital signature file." echo -n "Do you want to continue without signature check? (yes/no) [yes] " -- cgit v1.2.3 From aa6d8d69e18ebf681c79dc6a0d7ea6dce4c74a76 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Tue, 6 Dec 2011 09:13:49 -0800 Subject: Adjust the output of 'show vrrp' and 'show vrrp summary' for vmac and address owner --- scripts/keepalived/vyatta-show-vrrp.pl | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/keepalived/vyatta-show-vrrp.pl b/scripts/keepalived/vyatta-show-vrrp.pl index 68a98390..818d5e40 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,11 +291,11 @@ 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; } -- cgit v1.2.3