Topic: Couldn't import snmp models in 0.83+1.0 BETA3

Hello

I try to use the  0.83+1.0 beta3 of fusion inventory with glpi 0.83.1. While installing FusionInventory SNMP it doesn't import snmp models properly. After installing plugin on Plugins -> Fusion Inventory -> SNMP -> SNMP models I see a table of imported models but this table has only 2 colums name and Key of model discovery. Previous version has also type and comment columns.
When I open any model I see a number of OIDs but without mapping to inventory items.
I could find only that field plugin_fusioninventory_mappings_id in table glpi_plugin_fusinvsnmp_modelmibs contain 0 value in all rows. There is nothing in logs.
I tried to remove/install fusion inventory plugins in different order but no success.

Because of this inventory of snmp devices doesn't work. I see only device names and nothing more.

Please help to solve this problem.

Alexey.

Re: Couldn't import snmp models in 0.83+1.0 BETA3

Have you made an install or an update from old version ?

Co-leader, official developper
DCS official PARTNER: dcs.glpi@dcsit-group.com

Re: Couldn't import snmp models in 0.83+1.0 BETA3

Thank you for your attension.

I made fresh install.

I skip a story of steps which I did. I found the problem.

When importing snmp model a script searches for itemtype as in model xml i.e. itemtype_id but in glpi_plugin_fusioninventory_mappings table itemtype_name is stored. This simple patch solves my problem but it's urgly and have to be rewritten if oidobject->mapping_type may differ from model->type.

================================
--- fusinvsnmp/inc/importexport.class.php.orig    2012-04-27 13:40:59.165369131 +0400
+++ fusinvsnmp/inc/importexport.class.php    2012-04-27 13:41:10.705369133 +0400
@@ -350,7 +350,7 @@
             $oid_port_dyn = $child->dynamicport;
          }
          if (isset($child->mapping_type)) {
-            $mapping_type = $child->mapping_type;
+            $mapping_type = $type;
          }
          if (isset($child->mapping_name)) {
             $mapping_name = $child->mapping_name;
=================================

As of missing columns in models view I resolve problem also. These columns don't show by default and I must add them to list to show. This is not obviously but correct.

Re: Couldn't import snmp models in 0.83+1.0 BETA3

Thanks I have fixed : http://forge.fusioninventory.org/projec … .class.php

Co-leader, official developper
DCS official PARTNER: dcs.glpi@dcsit-group.com

Re: Couldn't import snmp models in 0.83+1.0 BETA3

I have tested this patch and it failed for me. I removed the supposedly useless line #353:

$mapping_type = $child->mapping_type;

and the mappings are now ok.

Re: Couldn't import snmp models in 0.83+1.0 BETA3

Lesha's fix seems to have worked for me.  The latest revision of the file on the forge imports all the models, but the models only contain the first OID.

Re: Couldn't import snmp models in 0.83+1.0 BETA3

Yes it's a bug, I will fix it this week end

Co-leader, official developper
DCS official PARTNER: dcs.glpi@dcsit-group.com