Snmp.pm discards Snmp devices in snmp_ip_scan

Bug #1219824 reported by David Guerrero
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OCS Inventory: Unified Unix Agent
Fix Released
Medium
mortheres

Bug Description

When you add a network to scan for snmp devices but the "scanner" server is not part of that network, the subroutine "snmp_ip_scan" adds the devices found to the hash "netdevices", unless the IPADDR of the device is already part of the hash.

But the subroutine that decides if the device is already in the hash, "seach_netdevice", use the condition:

if ($ip =~ /$_->{IPADDR}/)

So, if you add to the hash the IPADDR "10.0.0.1", the devices which IPADDR starts with this (10.0.0.10, 10.0.0.11...10.0.0.100, 10.0.0.101...), won't be part of the hash.

I think the condition should be

if ($ip eq $_->{IPADDR})

or something like that

Regards.

Revision history for this message
mortheres (mortheres) wrote :

Hi,

Thanks a lot for your report. This bug has already been fixed in revision 1164 of the ocsinventory-stable branch: http://bazaar.launchpad.net/~ocsinventory-dev/ocsinventory-unix-agent/stable-2.1/revision/1164 . It will be included in final OCS 2.1 release.

You can simply test it by replacing the line
   if ($ip =~ /$_->{IPADDR}/) {

by

  if ($ip =~ /^$_->{IPADDR}$/) {

Kind regards,

--
Guillaume

mortheres (mortheres)
Changed in ocsinventory-unix-agent:
assignee: nobody → mortheres (mortheres)
importance: Undecided → Medium
status: New → Fix Committed
milestone: none → 2.1
Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
status: Fix Committed → 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.