Bug #2340

Error during Network Inventory

Added by Fabien Tebaldini over 3 years ago. Updated over 3 years ago.

Status:ClosedStart date:11/26/2013
Priority:NormalDue date:
Assignee:Gonéri Le Bouder% Done:

100%

Category:netinventory
Target version:2.3.4
For junior contributor:No

Description

Agent version : 2.3.3
NetDiscovery: 2.2.0
NetInventory: 2.2.0
Server Debian 7.2

Running a network inventory from GLPI, the task does not end.

I tried directly on the agent, with the command :
fusioninventory-netinventory --host 172.24.5.100 --model /var/www/glpi/plugins/fusioninventory/snmpmodels/1188708.xml

I have this error message :
Thread 1 terminated abnormally: Undefined subroutine &FusionInventory::Agent::Tools::Hardware::Generic::setConnectedDevicesMacAddresses called at /home/fusioninventory/share/fusioninventory/lib/FusionInventory/Agent/Tools/Hardware.pm line 889.

I had almost the same message with the version 2.3.2 of the agent. I reinstalled it all, OS included but no improvement noticed with the 2.3.3 version.

The problem seems to be set in the Hardware.pm file, and more precisely in this part :

# check if vlan-specific queries are needed
    my $vlan_query =
        any { $_->{VLAN} }
        @{$model->{WALK}};

    if ($vlan_query) {
        # set connected devices mac addresses for each VLAN,
        # using VLAN-specific SNMP connections
        while (my ($suffix, $value) = each %{$vlans}) {
            my $vlan_id = $suffix;
            $snmp->switch_community("@" . $vlan_id);
            FusionInventory::Agent::Tools::Hardware::Generic::setConnectedDevicesMacAddresses(
                snmp   => $snmp,
                model  => $model,
                ports  => $ports,
                logger => $logger
            );
        }
    } else {
        # set connected devices mac addresses only once
        FusionInventory::Agent::Tools::Hardware::Generic::setConnectedDevicesMacAddresses(
            snmp   => $snmp,
            model  => $model,
            ports  => $ports,
            logger => $logger
        );
    }

History

#1 Updated by Gonéri Le Bouder over 3 years ago

  • Priority changed from High to Normal

This changes should fix the problem:

diff --git a/lib/FusionInventory/Agent/Tools/Hardware.pm b/lib/FusionInventory/Agent/Tools/Hardware.pm
index 0869ae9..c30a28a 100644
--- a/lib/FusionInventory/Agent/Tools/Hardware.pm
+++ b/lib/FusionInventory/Agent/Tools/Hardware.pm
@@ -9,6 +9,7 @@ use List::Util qw(first);

 use FusionInventory::Agent::Tools; # runFunction
 use FusionInventory::Agent::Tools::Network;
+use FusionInventory::Agent::Tools::Hardware::Generic;

 our @EXPORT = qw(
     getDeviceBaseInfo

#2 Updated by Anonymous over 3 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset commit:279bce197a3396c1f5a10e64e0100f7b29a357a6.

#3 Updated by Fabien Tebaldini over 3 years ago

Gonéri Le Bouder wrote:

This changes should fix the problem:
[...]

It's working ! Thanks ! :)

#4 Updated by Gonéri Le Bouder over 3 years ago

  • Status changed from Resolved to Closed
  • Assignee set to Gonéri Le Bouder
  • Target version set to 2.3.4

Also available in: Atom PDF