Description of problem: ON systems with infiniband ifconfig gives the following error. Ifconfig uses the ioctl access method to get the full address information, which limits hardware addresses to 8 bytes. Because Infiniband address has 20 bytes, only the first 8 bytes are displayed correctly. Ifconfig is obsolete! For replacement check ip. Version-Release number of selected component (if applicable): NPalert-1.127.12-1.el6.noarch How reproducible: On systems with infiniband /usr/bin/monitor-queue ALERTS 50 100 Additional info: Not sure if this is the best way to fix it but it should be switched to use /sbin/ip command. $ diff -u /usr/share/perl5/vendor_perl/NOCpulse/SMONQueue.pm.old /usr/share/perl5/vendor_perl/NOCpulse/SMONQueue.pm --- /usr/share/perl5/vendor_perl/NOCpulse/SMONQueue.pm.old 2014-02-24 11:06:16.532523638 -0700 +++ /usr/share/perl5/vendor_perl/NOCpulse/SMONQueue.pm 2014-02-24 11:07:32.001971328 -0700 @@ -60,8 +60,8 @@ { my $self = shift; - my $mac = `/sbin/ifconfig`; - $mac =~ s/.*?HWaddr (\S*).*/$1/s; + my $mac = `/sbin/ip -o link`; + $mac =~ s/.*?ether (\S*).*/$1/s; my @nodes = split(/:/, $mac); $mac = sprintf("%02X:%02X:%02X:%02X:%02X:%02X", hex($nodes[0]), hex($nodes[1]), hex($nodes[2]), $ diff -u /usr/share/perl5/vendor_perl/NOCpulse/Gritch.pm.old /usr/share/perl5/vendor_perl/NOCpulse/Gritch.pm --- /usr/share/perl5/vendor_perl/NOCpulse/Gritch.pm.old 2014-02-24 11:04:45.193745385 -0700 +++ /usr/share/perl5/vendor_perl/NOCpulse/Gritch.pm 2014-02-24 11:14:59.589552051 -0700 @@ -430,8 +430,8 @@ sub get_mac { ############# - my $ifconfig = `/sbin/ifconfig`; - if ($ifconfig =~ /.*?HWaddr (\S*).*/) { + my $ifconfig = `/sbin/ip -o link`; + if ($ifconfig =~ /.*?ether (\S*).*/) { return $1; } else { return undef;
One more occurence of ifconfig in the Perl stack: From c7c6681588ff1f93ae92eea89e74ac3c631fa81a Mon Sep 17 00:00:00 2001 From: Jan Pazdziora <jpazdziora> Date: Tue, 25 Feb 2014 09:39:42 +0100 Subject: [PATCH] 1069332 - Use /sbin/ip instead of /sbin/ifconfig. --- monitoring/SatConfig/cluster/IpAddr.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitoring/SatConfig/cluster/IpAddr.pm b/monitoring/SatConfig/cluster/IpAddr.pm index 4912b9c..074d68e 100644 --- a/monitoring/SatConfig/cluster/IpAddr.pm +++ b/monitoring/SatConfig/cluster/IpAddr.pm @@ -96,8 +96,8 @@ sub macAddress { my $self = shift(); my $dev = $self->get_dev; - my $mac = `/sbin/ifconfig $dev`; - if ($mac =~ /HWaddr (\S+)/) { + my $mac = `/sbin/ip -o link`; + if ($mac =~ /^\d+:\s*\Q$dev\E:.*?ether (\S*).*/m) { return $1; } else { # NOTE: Kludge for ethernet issue - should be undef -- 1.8.3.1
Fixed in spacewalk master by commit f2162b0c3a2ff73eb56af26d9e7c0281e5ae1f11 1069332 - simplify regexp commit d732736216de3eda42f635a1245069aecbf0530f 1069332 - ifconfig without agrs showed only UP intefaces commit 1405955ff835c9ea4d8667963b36d85140ca8096 1069332 - Use /sbin/ip instead of /sbin/ifconfig. commit 2cbce5622affa1b91ea851a5990482d6e6428862 1069332 - ifconfig don't show Infiniband addresses properly
One more fix commit 449db5258269a6a6fc0e205af44d7f36c382db60 1069332 - fixing ip syntax
Spacewalk 2.2 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes22