Topic: FusionInvernory not discovering network on RHEL 7.5


I was wondering why FI v2.4 wasn't discovering network on my RHEL7.5
I tracked the problem down to FusionInventory/Agent/Task/Inventory/OS/Linux/Network/
In fact, the code waits old format output from `ifconfig` in the RHEL6 format,

eth0      Link encap:Ethernet  HWaddr 00:50:56:99:25:F8  
          inet adr:  Bcast:  Masque:

whereas RHEL7 outputs this :

ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.29.XXX.XX  netmask  broadcast 172.29.XXX.XXX
        ether xx:xx:xx:b4:5e:29  txqueuelen 1000  (Ethernet)

So the quick fix is obvious (for my very own purpose, not generally)

---  2018-05-28 14:49:43.743423204 +0200
+++ 2018-05-28 14:49:22.590183635 +0200
@@ -156,10 +156,10 @@
         } else { # In a section
             $ifData{DESCRIPTION} = $1 if $line =~ /^(\S+)/; # Interface name
-            $ifData{IPADDRESS} = $1 if $line =~ /inet addr:(\S+)/i;
-            $ifData{IPADDRESS6} = $1 if $line =~ /inet6 addr: (\S+)/i;
+            $ifData{IPADDRESS} = $1 if $line =~ /inet (\S+)/i;
+            $ifData{IPADDRESS6} = $1 if $line =~ /inet6 (\S+)/i;
             $ifData{IPMASK} = $1 if $line =~ /\S*mask:(\S+)/i;
-            $ifData{MACADDR} = $1 if $line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i;
+            $ifData{MACADDR} = $1 if $line =~ /ether?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i;
             $ifData{STATUS} = 'Up' if $line =~ /^\s+UP\s/;
             $ifData{TYPE} = $1 if $line =~ /link encap:(\S+)/i;

Is there still someone working on RHEL7 inventory, or should I submit some more robust code of my own ?



Re: FusionInvernory not discovering network on RHEL 7.5

Hi Xavier,

there's a just little problem with your fix : FusionInventory agent doesn't have any file named FusionInventory/Agent/Task/Inventory/OS/Linux/Network/
As you can see in sub getInterfacesFromIfconfig () {...}, we still parse the ifconfig output in the right way.

So I guess you have some mix with old install.

If you don't see how to identify your installation mix, can you provide the output of following commands:

fusioninventory-agent --version
fusioninventory-agent --setup
fusioninventory-inventory --debug --debug

Re: FusionInvernory not discovering network on RHEL 7.5

You are right, I've messed and mixed installations. For administrative reasons, I have to package myself FusionInventory agent. Here is what says --setup

fusioninventory-agent --debug --debug --setup
vardir: ./var
datadir: ./share
libdir: /usr/share/fusioninventory/lib

I supspect my packaging is wrong, but I can't find anywhere a .spec file for RHEL7

Thanks for your answer