ipv4 handling fix

Bug #1064296 reported by Peter Gervai
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OCS Inventory: Unified Unix Agent
Fix Released
Wishlist
Frank

Bug Description

This is a fast hack to handle multiple ipv4 addresses less horribly. It is still quite horrible, but I do not see any sane way to actually report separate addresses, netmasks and interfaces. I must confess I didn't really looked too hard either. ;-)

This one uses a decade newer tool 'ip', however I'm sure it's not universal, so you possibly want to check for 'ip' and fall back to 'ifconfig' if not available. Right now I'm a bit in hurry (as in the last few decades). If you insist me to write it please tell. ;)

Revision history for this message
Peter Gervai (grin) wrote :
Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
importance: Undecided → Low
importance: Low → Wishlist
assignee: nobody → Frank (frank-bourdeau)
status: New → In Progress
Revision history for this message
Peter Gervai (grin) wrote :

Wheeee!! :-)

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

I have tried applying this patch to my 2.1.1 installation, but while the module works, the whole network section is missing as Agent/Backend/OS/Linux/Network/Networks.pm still uses ifconfig and route, which are deprecated in CentOS/RedHat 7 and not included by default:

# ocsinventory-agent --debug
[debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.1.1
[debug] Log system initialised (Stderr)
...
[debug] Running Ocsinventory::Agent::Backend::OS::Linux::Network::IPv4
[debug] Running Ocsinventory::Agent::Backend::OS::Linux::Network::Networks
...
[debug] Calling handlers : `inventory_handler'
[debug] Section HARDWARE has changed since last inventory
[debug] Missing value(s): MAC-address . I will send this inventory to the server BUT important value(s) to identify the computer are missing
[debug] sending XML
...
    <HARDWARE>
      <CHECKSUM>1</CHECKSUM>
      <DATELASTLOGGEDUSER>Mon Feb 9 14:43</DATELASTLOGGEDUSER>
      <DESCRIPTION>x86_64/00-00-11 04:10:13</DESCRIPTION>
      <DNS>xxxx</DNS>
      <IPADDR>xxxx</IPADDR>
      <LASTLOGGEDUSER>xxxx</LASTLOGGEDUSER>
      <MEMORY>3792</MEMORY>
      <NAME>xxxx</NAME>
      <OSCOMMENTS>Unknown Linux distribution</OSCOMMENTS>
      <OSNAME>Linux</OSNAME>
      <OSVERSION>3.10.0-123.13.2.el7.x86_64</OSVERSION>
      <PROCESSORN>3</PROCESSORN>
      <PROCESSORS>2267</PROCESSORS>
      <PROCESSORT>Intel(R) Xeon(R) CPU E7- 4860 @ 2.27GHz</PROCESSORT>
      <SWAP>3999</SWAP>
      <USERID>xxxx</USERID>
      <UUID>xxxx</UUID>
      <VMSYSTEM>VMware</VMSYSTEM>
      <WORKGROUP>xxxx</WORKGROUP>
    </HARDWARE>
...
    <NETWORKS>
    </NETWORKS>
...

Revision history for this message
Alexander Pilch (alex-pi) wrote :

For the time being, you could install the package net-tools on CentOS 7 / REL 7. (provides ifconfig)

Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
milestone: none → 2.2rc1
status: In Progress → Fix Released
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.