monitoring/MessageQueue/SMONQueue.pm | 4 ++--
monitoring/PerlModules/NP/Gritch/Gritch.pm | 4 ++--
monitoring/SatConfig/cluster/IpAddr.pm | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
New commits:
commit f2162b0c3a2ff73eb56af26d9e7c0281e5ae1f11
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Feb 25 10:57:25 2014 +0100
1069332 - simplify regexp
diff --git a/monitoring/SatConfig/cluster/IpAddr.pm
b/monitoring/SatConfig/cluster/IpAddr.pm
index 074d68e..91c23c7 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/ip -o link`;
- if ($mac =~ /^\d+:\s*\Q$dev\E:.*?ether (\S*).*/m) {
+ my $mac = `/sbin/ip -o link $dev`;
+ if ($mac =~ /ether (\S*)/m) {
return $1;
} else {
# NOTE: Kludge for ethernet issue - should be undef
commit d732736216de3eda42f635a1245069aecbf0530f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Feb 25 10:52:15 2014 +0100
1069332 - ifconfig without agrs showed only UP intefaces
diff --git a/monitoring/MessageQueue/SMONQueue.pm b/monitoring/MessageQueue/SMONQueue.pm
index f11ed50..cbf6fc4 100644
--- a/monitoring/MessageQueue/SMONQueue.pm
+++ b/monitoring/MessageQueue/SMONQueue.pm
@@ -61,7 +61,7 @@ sub calculate_mac
my $self = shift;
my $mac = `/sbin/ip -o link`;
- $mac =~ s/.*?ether (\S*).*/$1/s;
+ $mac =~ s/.*\bUP\b.*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 --git a/monitoring/PerlModules/NP/Gritch/Gritch.pm
b/monitoring/PerlModules/NP/Gritch/Gritch.pm
index e469e71..ee0bc23 100644
--- a/monitoring/PerlModules/NP/Gritch/Gritch.pm
+++ b/monitoring/PerlModules/NP/Gritch/Gritch.pm
@@ -431,7 +431,7 @@ sub get_mac {
#############
my $ifconfig = `/sbin/ip -o link`;
- if ($ifconfig =~ /.*?ether (\S*).*/) {
+ if ($ifconfig =~ /\bUP\b.*ether (\S*)/) {
return $1;
} else {
return undef;
commit 1405955ff835c9ea4d8667963b36d85140ca8096
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Feb 25 09:39:42 2014 +0100
1069332 - Use /sbin/ip instead of /sbin/ifconfig.
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
commit 2cbce5622affa1b91ea851a5990482d6e6428862
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Feb 25 10:41:24 2014 +0100
1069332 - ifconfig don't show Infiniband addresses properly
diff --git a/monitoring/MessageQueue/SMONQueue.pm b/monitoring/MessageQueue/SMONQueue.pm
index 813ddbf..f11ed50 100644
--- a/monitoring/MessageQueue/SMONQueue.pm
+++ b/monitoring/MessageQueue/SMONQueue.pm
@@ -60,8 +60,8 @@ sub calculate_mac
{
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 --git a/monitoring/PerlModules/NP/Gritch/Gritch.pm
b/monitoring/PerlModules/NP/Gritch/Gritch.pm
index 91cf731..e469e71 100644
--- a/monitoring/PerlModules/NP/Gritch/Gritch.pm
+++ b/monitoring/PerlModules/NP/Gritch/Gritch.pm
@@ -430,8 +430,8 @@ sub sendmail {
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;
Show replies by date