Snmp.pm discards Snmp devices in snmp_ip_scan
Bug #1219824 reported by
David Guerrero
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.
I think the condition should be
if ($ip eq $_->{IPADDR})
or something like that
Regards.
Changed in ocsinventory-unix-agent: | |
assignee: | nobody → mortheres (mortheres) |
importance: | Undecided → Medium |
status: | New → Fix Committed |
milestone: | none → 2.1 |
Changed in ocsinventory-unix-agent: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
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/~ocsinvento ry-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