diff --git a/perl-xCAT/xCAT/PPCmac.pm b/perl-xCAT/xCAT/PPCmac.pm index 93b85b693..f498d0799 100644 --- a/perl-xCAT/xCAT/PPCmac.pm +++ b/perl-xCAT/xCAT/PPCmac.pm @@ -414,12 +414,6 @@ sub getmacs { } } - ######################################### - # Put all the attributes required - # together - ######################################### - push @$result,"# Type MAC_Address Phys_Port_Loc Adapter Port_Group Phys_Port Logical_Port VLan VSwitch Curr_Conn_Speed\n"; - foreach ( keys %$hash ) { my $node = $_; my $d = $hash->{$_}; @@ -430,6 +424,12 @@ sub getmacs { push @$result,"\n$node:\n"; + ######################################### + # Put all the attributes required + # together + ######################################### + push @$result,"#Type MAC_Address Phys_Port_Loc Adapter Port_Group Phys_Port Logical_Port VLan VSwitch Curr_Conn_Speed\n"; + for ( my $num = 1; $num <= $mac_count; $num++ ) { my $mac_addr = $nodeatt{$mtms}{$id}{$num}{'mac_addr'}; my $adapter_id = $nodeatt{$mtms}{$id}{$num}{'adapter_id'}; @@ -448,12 +448,12 @@ sub getmacs { } my %att = (); - $att{'MAC_Address'} = ($mac_addr) ? $mac_addr : "N/A"; - $att{'Adapter'} = ($adapter_id) ? $adapter_id : "N/A"; + $att{'MAC_Address'} = ($mac_addr) ? $mac_addr : "N/A"; + $att{'Adapter'} = ($adapter_id) ? $adapter_id : "N/A"; $att{'Port_Group'} = ($port_group) ? $port_group : "N/A"; - $att{'Phys_Port'} = ($phys_port_id) ? $phys_port_id : "N/A"; - $att{'Logical_Port'} = ($logical_port_id) ? $logical_port_id : "N/A"; - $att{'VLan'} = ($vlan_id) ? $vlan_id : "N/A"; + $att{'Phys_Port'} = ($phys_port_id) ? $phys_port_id : "N/A"; + $att{'Logical_Port'} = ($logical_port_id) ? $logical_port_id : "N/A"; + $att{'VLan'} = ($vlan_id) ? $vlan_id : "N/A"; $att{'VSwitch'} = ($vswitch) ? $vswitch : "N/A"; $att{'Phys_Port_Loc'} = ($phys_port_loc) ? $phys_port_loc : "N/A"; $att{'Curr_Conn_Speed'} = ($curr_conn_speed) ? $curr_conn_speed : "N/A"; diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 6927ba64f..637d174f2 100644 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -111,7 +111,8 @@ my %usage = ( getmacs [-V|--verbose] getmacs [-h|--help|-v|--version] PPC specific: - getmacs [-f][-d][-D -S server -G gateway -C client]", + getmacs [-F filter] + getmacs [-f][-d][-D [-S server] [-G gateway] [-C client]]", "mkvm" => "Usage: Common: diff --git a/xCAT-client/pods/man1/getmacs.1.pod b/xCAT-client/pods/man1/getmacs.1.pod index 5511defd4..d6b59536c 100644 --- a/xCAT-client/pods/man1/getmacs.1.pod +++ b/xCAT-client/pods/man1/getmacs.1.pod @@ -8,7 +8,9 @@ I I -I [-f][-d][-D -S server -G gateway -C client] +I [-F filter] + +I [-f][-d][-D [-S server] [-G gateway] [-C client]] =head1 DESCRIPTION @@ -27,6 +29,8 @@ B<-D> Perform ping test. B<-f> Force immediate shutdown of the partition. +B<-F> Specify filters to select the correct adapter. Acceptable filters are Type,MAC_Address,Phys_Port_Loc,Adapter,Port_Group,Phys_Port,Logical_Port,VLan,VSwitch,Curr_Conn_Speed. + B<-G> Gateway IP address of the partition. The default is to read from xCAT database if no -G specified. B<-h> Display usage message. @@ -53,11 +57,15 @@ I Output is similar to: +# Type MAC_Address Phys_Port_Loc Adapter Port_Group Phys_Port Logical_Port VLan VSwitch Curr_Conn_Speed + lpar4: -#Type Location Code MAC Address Full Path Name Ping Result +#Type MAC_Address Phys_Port_Loc Adapter Port_Group Phys_Port Logical_Port VLan VSwitch Curr_Conn_Speed -ent U9133.55A.10B7D1G-V12-C4-T1 8e:e2:24:5c:f0:04 /vdevice/l-lan@30000004 virtual +hea 7607DFB07F02 N/A N/A N/A N/A N/A 1 ETHERNET0 N/A + +ent U78A1.001.99203B5-P1-T6 00145eb55788 /lhea@23c00614/ethernet@23e00514 unsuccessful physical @@ -69,13 +77,29 @@ Output is similar to: lpar4: -#Type Location Code MAC Address Full Path Name Ping Result +#Type MAC_Address Phys_Port_Loc Adapter Port_Group Phys_Port Logical_Port VLan VSwitch Curr_Conn_Speed -ent U9133.55A.10B7D1G-V12-C4-T1 8ee2245cf004 /vdevice/l-lan@30000004 virtual +hea 7607DFB07F02 N/A N/A N/A N/A N/A 1 ETHERNET0 N/A + +ent U78A1.001.99203B5-P1-T6 00145eb55788 /lhea@23c00614/ethernet@23e00514 unsuccessful physical -3. To retrieve the MAC address while performing a ping test for the HMC-managed partition lpar4 and display the result only, enter: +3. To retrieve the MAC address for the HMC-managed partition lpar4 with filter Type=hea,VSwitch=ETHERNET0. + +I + +Output is similar to: + +lpar4: + +#Type MAC_Address Phys_Port_Loc Adapter Port_Group Phys_Port Logical_Port VLan VSwitch Curr_Conn_Speed + +hea 7607DFB07F02 N/A N/A N/A N/A N/A 1 ETHERNET0 N/A + + + +4. To retrieve the MAC address while performing a ping test for the HMC-managed partition lpar4 and display the result only, enter: I