Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.11.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

Empty value for IPADDR when address contains 127.

All reports from hosts that contains 127. or ::1/128 in the address send the report with empty in IPADDR value to the server. For example, will send empty IPADDR.

The problem seems to be on file IPv4.pm or IP.pm in all operating systems in all versions. 

This line is the problem:

AIX/IPv4.pm:    if(/^\s*inet\s+(\S+).*/){($1=~/127.+/)?next:push @ip, $1};
BSD/IPv4.pm:      ($1=~/127.+/)?next:push @ip, $1
Linux/Network/IPv4.pm:      ($1=~/127.+/)?next:push @ip, $1
MacOS/IPv4.pm:        ($1=~/127.+/)?next:push @ip, $1
Solaris/IPv4.pm:    if(/^\s*inet\s+(\S+).*/){($1=~/127.+/)?next:($ip{$1}=1)};
Solaris/Bios.pm:#Kernel version: SunOS 5.10 Generic_127112-07

If we change to:

Linux/Network/IPv4.pm:      ($1=~/^127.+/)?next:push @ip, $1

the report send the IPADDR value.

The same for IPv6 in version 2.3. 

Linux/Network/IP.pm:                ($1=~/::1\/128/)?next:push @ip, $1;
Linux/Network/IP.pm:                ($1=~/::1/)?next:push @ip, $1;

The solution is the same on the regex, including ^ before ::1.

Carlos Paniago e Jorge Correa

in OCS Inventory NG agent for Unix by (120 points)
retagged by

Please log in or register to answer this question.

Powered by Question2Answer