Bug 768188 - NOCpulse throws error every 15minutes if "eth0" is not a device
Summary: NOCpulse throws error every 15minutes if "eth0" is not a device
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.6
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space16 space18 875600
TreeView+ depends on / blocked
 
Reported: 2011-12-16 00:07 UTC by Daniel Jabbour
Modified: 2018-11-30 22:03 UTC (History)
3 users (show)

Fixed In Version: MessageQueue-3.26.6-1 perl-NOCpulse-Gritch-1.27.10-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 875600 (view as bug list)
Environment:
Last Closed: 2012-11-01 16:17:55 UTC
Embargoed:


Attachments (Terms of Use)

Description Daniel Jabbour 2011-12-16 00:07:20 UTC
Description of problem:
Some servers do not have eth0 devices. For instance, my Spacewalk server only has eth1 and eth2, no eth0 device, as it was removed. Despite the interface eth0 being completely removed from udev and ifconfig -a not showing it, NOCpulse is throwing errors every 15 minutes via cron.

It seems this is due to a hard-coded check in the code:
MessageQueue/SMONQueue.pm
for retrieving MAC address:
my $mac = `/sbin/ifconfig eth0`;

It should detect the first ethernet card, or any card that's enabled perhaps... but not hardcoded to eth0.

Version-Release number of selected component (if applicable):
Tested on 1.5, assumed to still be present in 1.6.

How reproducible:
Always.

Steps to Reproduce:

1. Install Spacewalk on a system without eth0. Look at your email, and you'll see lots of errors.

From: 	Cron Daemon <root.com>
Subject: 	Cron <nocpulse@spacewalk>  if [ -e /etc/NOCpulse.ini ] ; then /usr/bin/monitor-queue ALERTS 50 100 2>&1 > /dev/null; fi
Date: 	December 14, 2011 4:15:02 PM PST
To: 	nocpulse.com

eth0: error fetching interface information: Device not found

Actual results:
Errors when eth0 is not an interface on the system.

Expected results:
No errors when eth0 does not exist.

Additional info:

Comment 1 Michael Mráka 2011-12-19 10:54:08 UTC
The issue has been fixed in spacewalk master by
commit 0b51c04ea9c35366cc818e9909e0773d30f1a405
    768188 - return mac address of the first available interface

Comment 2 Milan Zázrivec 2011-12-22 16:47:08 UTC
Spacewalk 1.6 has been released.

Comment 3 Jonathan 2012-04-11 15:02:08 UTC
It still fails in OpenVZ/Virtuozzo because the ifconfig output:

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:274526 errors:0 dropped:0 overruns:0 frame:0
          TX packets:274526 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:714536966 (681.4 MiB)  TX bytes:714536966 (681.4 MiB)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:159719 errors:0 dropped:0 overruns:0 frame:0
          TX packets:119694 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:211441162 (201.6 MiB)  TX bytes:56311647 (53.7 MiB)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:123.123.123.123  P-t-P:82.194.77.40  Bcast:82.194.77.40  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

Dont find a valid value for HWaddr.

Comment 4 Michael Mráka 2012-05-03 12:53:58 UTC
One more fix in spacewalk master
commit e308b4838fad54b3dd657d5080051b9b8a87b101
    768188 - return mac address of the first available interface

Comment 5 Thomas Cameron 2012-06-07 20:07:40 UTC
This is also failing in RHN Satellite 5.4.1, even after I change the line in SMONQueue.pm:

[root@molly ~]# diff /usr/share/perl5/vendor_perl/NOCpulse/SMONQueue.pm /usr/share/perl5/vendor_perl/NOCpulse/SMONQueue.pm.orig
63c63
<     my $mac = `/sbin/ifconfig p4p1`;
---
>     my $mac = `/sbin/ifconfig eth0`;

I restart Monitoring and MonitoringScout and I see:

[root@molly ~]# grep eth0 /etc/NOCpulse.ini 
serverIF=eth0

Is there somewhere else that I need to change?

I see:

[root@molly ~]# grep -ri eth0 /usr/share/perl5/vendor_perl/NOCpulse/
/usr/share/perl5/vendor_perl/NOCpulse/SMONQueue.pm:    my $mac = `/sbin/ifconfig eth0`;
/usr/share/perl5/vendor_perl/NOCpulse/SMONQueue.pm.orig:    my $mac = `/sbin/ifconfig eth0`;
/usr/share/perl5/vendor_perl/NOCpulse/Gritch.pm:  my $ifconfig = `/sbin/ifconfig eth0`;
/usr/share/perl5/vendor_perl/NOCpulse/Probe/DataSource/InterfaceTrafficOutput.pm:            # Match "  eth0:"
/usr/share/perl5/vendor_perl/NOCpulse/Probe/DataSource/test/TestUnixHelpers.pm:  eth0:1195668513 32384086    0    0    0     0          0         0 887520285 30738814    0    0    0 833234       0          0
/usr/share/perl5/vendor_perl/NOCpulse/Probe/DataSource/test/TestUnixHelpers.pm:    $traffic = $data_source->interface_traffic('eth0');
/usr/share/perl5/vendor_perl/NOCpulse/Probe/DataSource/test/TestPsOutput.pm: 1391     1  1260  608 00:00:00 S /sbin/pump -i eth0

Looks like there are several places where eth0 is hard coded. Help?

Comment 6 Michael Mráka 2012-06-08 11:35:20 UTC
(In reply to comment #5)
> This is also failing in RHN Satellite 5.4.1, even after I change the line in
> SMONQueue.pm:

Do fixes from comment #1 and comment #4 solve your issue?

Comment 8 Jan Pazdziora 2012-10-30 19:22:54 UTC
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/

Comment 9 Jan Pazdziora 2012-11-01 16:17:55 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18


Note You need to log in before you can comment on or make changes to this bug.