ifconfig parsing issue (fedora >= 17)

Bug #1045356 reported by Remi Collet
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OCS Inventory: Unified Unix Agent
Fix Released
Low
Frank

Bug Description

See:
https://bugzilla.redhat.com/show_bug.cgi?id=853982

With patch attached, in .ocs file

    <HARDWARE>
...
      <DEFAULTGATEWAY>192.168.0.254</DEFAULTGATEWAY>
      <IPADDR>192.168.0.11/192.168.122.1</IPADDR>
...
    </HARDWARE>

    <NETWORKS>
      <DESCRIPTION>em1</DESCRIPTION>
      <DRIVER>r8169</DRIVER>
      <IPADDRESS>192.168.0.11</IPADDRESS>
      <IPDHCP></IPDHCP>
      <IPGATEWAY>192.168.0.254</IPGATEWAY>
      <IPMASK>255.255.255.0</IPMASK>
      <IPSUBNET>192.168.0.0</IPSUBNET>
      <MACADDR>20:cf:30:ec:c8:89</MACADDR>
      <PCISLOT>0000:02:00.0</PCISLOT>
      <STATUS>Up</STATUS>
      <TYPE>Ethernet</TYPE>
      <VIRTUALDEV></VIRTUALDEV>
    </NETWORKS>

Revision history for this message
Remi Collet (remicollet) wrote :
Revision history for this message
Frank (frank-bourdeau) wrote :

already corrected in trunk version

Changed in ocsinventory-unix-agent:
status: New → Invalid
Revision history for this message
Remi Collet (remicollet) wrote :

Revision 1112 is not enough.

Missing TYPE, and STATUS

Changed in ocsinventory-unix-agent:
status: Invalid → New
Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
assignee: nobody → Frank (frank-bourdeau)
importance: Undecided → Low
status: New → Fix Committed
Revision history for this message
Remi Collet (remicollet) wrote :

Revision 1123 still doesn't work...

Status still "down" for running interface.
Type is "ether" when "Ethernet" is expected.

Please consider the regex used if the proposed patch, as this works.

Changed in ocsinventory-unix-agent:
status: Fix Committed → In Progress
Revision history for this message
mortheres (mortheres) wrote :

Hi Remi,

Thanks a lot for your patch. The regexp has been committed in revision 1134 of the trunk branch to enhance revision 1112 : http://bazaar.launchpad.net/~ocsinventory-dev/ocsinventory-unix-agent/trunk/revision/1134 . It should works as expected now :) :).

Kind regards,

Guillaume

Changed in ocsinventory-unix-agent:
status: In Progress → Fix Committed
Revision history for this message
Remi Collet (remicollet) wrote :

Thanks for the status which is now OK.

Type still not correct.
Please consider attached patch.

Changed in ocsinventory-unix-agent:
status: Fix Committed → In Progress
Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
status: In Progress → Fix Committed
mortheres (mortheres)
Changed in ocsinventory-unix-agent:
milestone: none → 2.1rc1
Revision history for this message
Eric Germán Burgueño (nevermind85) wrote :

This patch is a regression. It breaks CentOS and RedHat 6 (and possibly other distros) which still report "inet addr":

# ocsinventory-agent --version
Ocsinventory unified agent for UNIX, Linux and MacOSX (2.1)
# cat /etc/issue
Red Hat Enterprise Linux Server release 6.5 (Santiago)
Kernel \r on an \m
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:8E:10:84
          inet addr:x.x.x.x Bcast:x.x.x.x Mask:x.x.x.x

Using
#if(/^\s*inet\s*(\S+)\s*netmask/){
returns empty IP on the HARDWARE info

Using
if(/^\s*inet add?r\s*:\s*(\S+)/ || /^\s*inet\s+(\S+)/){
works as expected.

Revision history for this message
Remi Collet (remicollet) wrote :

Confirmed on RHEL-6.5

# ifconfig
...
          inet adr:192.168.122.30 Bcast:192.168.122.255 Masque:255.255.255.0
...

# grep IPADD agent205.ocs
      <IPADDR>192.168.122.30</IPADDR>
      <IPADDRESS>192.168.122.30</IPADDRESS>

# grep IPADD agent210.ocs
      <IPADDR></IPADDR>
      <IPADDRESS>192.168.122.30</IPADDRESS>

Changed in ocsinventory-unix-agent:
status: Fix Committed → Confirmed
Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
status: Confirmed → Fix Committed
mortheres (mortheres)
Changed in ocsinventory-unix-agent:
status: Fix Committed → Fix Released
milestone: 2.1rc1 → 2.1.1
Revision history for this message
Eric Germán Burgueño (nevermind85) wrote :

I have just downloaded version 2.1.1 from trunk (revision 1189) and this bug still exists. IP is not being reported for RedHat 6.5 servers.

Revision history for this message
Eric Germán Burgueño (nevermind85) wrote :

This bug still exists with revision 1191. You need to please stop using ifconfig. It is deprecated and not included in CentOS 7 nor RedHat 7 unless manually installed. The whole network section disappears!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.