glpi-project / glpi-agent

GLPI Agent
GNU General Public License v2.0
252 stars 61 forks source link

Switch 2048 #637

Closed romnvll closed 7 months ago

romnvll commented 8 months ago

Bug reporting acknowledgment

Yes, I read it

Professional support

None

Describe the bug

L'inventaire des switchs N2048 semble mal fonctionner

To reproduce

SNMP sur un switch dell N2048

Expected behavior

dans le fichier sysobject.ids il est ecrit que l'oid de de ce modele de swirch est : .1.3.6.1.4.1.674.10895.3054 Si on fait un walk sur cet OID : iso.3.6.1.4.1.674.10895.3054 = No Such Object available on this agent at this OID

je pense que les informations se trouvent dans la branche: iso.3.6.1.4.1.674.10895.5000

J'ai modifié le fichier sysobject.ids, mais l'agent cherche toujours sur partial match for sysobjectID .1.3.6.1.4.1.674.10895.3054 .

Operating system

Linux

GLPI Agent version

1.7.1

GLPI version

10.0.12

GLPIInventory plugin or other plugin version

No response

Additional context

No response

g-bougard commented 7 months ago

Hi @romnvll

please use english to have a larger audience.

You're making a wrong assumption on how to figure out how is used sysobjectID OID. Please read this SysObject.ids database documentation and the sysobjectid.ids project README to understand what to check.

And finally, when speaking about networking devices support, providing a snmpwalk output in an expected format can help to fix or enhance inventory results.

romnvll commented 7 months ago

If I've understood correctly, the documentation explains how it works, but not how to integrate a new model. to integrate a model, you have to go through you? is that right? I'll send you the snmpwalk file. Thank you very much.

g-bougard commented 7 months ago

Hi @romnvll

can you test with latest nightly build as it includes enhanced Dell devices support ? https://nightly.glpi-project.org/glpi-agent/

g-bougard commented 7 months ago

I tested your walk and it works as expected now.

So I'm closing the issue, but feel free to reopen if something is wrong during your validation with last nightly build.

romnvll commented 5 months ago

I'd like to reopen this ticket: with the latest version of the agent on dell switches, i only have the last switch in the stacks showing up. image

image

🤷‍♂️

romnvll commented 1 month ago

Hello, I've done all the updates, and the problem is still there. I've uninstalled/reinstalled the plugin, the tasks, but there's nothing I can do, the bug is still there. Is there anything I can do? Thank you

g-bougard commented 1 month ago

Hi @romnvll

which version of the agent are you using ?

Can you generate the device XML inventory with latest version using glpi-netinventory script and share it here ?

romnvll commented 1 month ago

Thank you for your reply @g-bougard . root@glpiv3:~# glpi-netinventory --version NetInventory task 6.4 based on GLPI Agent v1.11-1

output2048.txt

g-bougard commented 1 month ago

When importing manually this xml in a clean test instance, I can see 6 switches imported with each 53 ports: image

Is this what you expect ? If yes, this means you probably have something which hiding the missing ones. Did you check if they are in trashbin ? If they are, clean it and force a new inventory.

romnvll commented 1 month ago

I've never seen units 1, 2, 3, 4 and 5. I have nothing in the trash. Does this mean that they are not uncovered?

This command : glpi-netdiscovery --host 192.168.28.9 --community XXXX --v2c Return this

<?xml version="1.0" encoding="UTF-8"?>
<REQUEST>
  <CONTENT>
    <DEVICE>
      <AUTHSNMP>1</AUTHSNMP>
      <DESCRIPTION>Dell EMC Networking N2048, 6.5.3.4, Linux 3.6.5-e3cd5a07, Not Available</DESCRIPTION>
      <DNSHOSTNAME>192.168.28.9</DNSHOSTNAME>
      <FIRMWARE>6.5.3.4</FIRMWARE>
      <IP>192.168.28.9</IP>
      <IPS>
        <IP>192.168.28.9</IP>
      </IPS>
      <MAC>68:4f:64:8e:d3:36</MAC>
      <MANUFACTURER>Dell</MANUFACTURER>
      <MODEL>N2048</MODEL>
      <SERIAL>CN0DMD5F2829898I0326A09</SERIAL>
      <SNMPHOSTNAME>SW28-9</SNMPHOSTNAME>
      <TYPE>NETWORKING</TYPE>
      <UPTIME>182 days, 14:59:42.04</UPTIME>
    </DEVICE>
    <MODULEVERSION>6.4</MODULEVERSION>
    <PROCESSNUMBER>1</PROCESSNUMBER>
  </CONTENT>
  <DEVICEID>foo</DEVICEID>
  <QUERY>NETDISCOVERY</QUERY>
</REQUEST>

It's seems correct ?

g-bougard commented 1 month ago

It's correct too. The Netdiscovery task only reports essential datas so we know we can run snmpo Netinventory task on it.

Now, you may have issues with still integrated datas. You can check GLPI php-errors.log for error when integrating the XML. If you need any error, this may help you to understand if you have some maintenance to achieve on your GLPI environment.

You may always have issues with your import rules.

I advice you to try yourself the integration in a clean GLPI environment.

Anyway this is definitively not a glpi-agent issue as far I can understand.

romnvll commented 1 month ago

yes, I get a lot of errors like : *** PHP User Warning (512): getFromDBByCrit expects to get one result. I'll see if I can find a solution on the glpi inventory project. Thank you very much for your time spend

romnvll commented 1 month ago

Pour celles et ceux qui rencontrent ce problème : Il ne s'agit pas d'une erreur de l'agent, mais plutôt d'un problème lié à l'évolution de ma base GLPI, qui a traversé plusieurs versions depuis la 0.78, je crois. Malheureusement, la structure de la base de données ne correspondait pas du tout à celle attendue.

Voici un extrait du diagnostic effectué avec la commande suivante :

php bin/console glpi:database:check_schema_integrity
Le schéma diffère pour la table "glpi_items_softwareversions".
--- Schéma de base de données attendu
+++ Schéma de base de données actuel
@@ @@
   `softwareversions_id` int NOT NULL DEFAULT 0,
   PRIMARY KEY (`id`),
   UNIQUE KEY `unicity` (`itemtype`,`items_id`,`softwareversions_id`),
-  KEY `computers_info` (`entities_id`,`is_template_item`,`is_deleted_item`),
   KEY `date_install` (`date_install`),
   KEY `is_deleted_item` (`is_deleted_item`),
   KEY `is_deleted` (`is_deleted`),
Le schéma diffère pour la table "glpi_logs".
--- Schéma de base de données attendu
+++ Schéma de base de données actuel
@@ @@
   `user_name` varchar(255),
   PRIMARY KEY (`id`),
   KEY `date_mod` (`date_mod`),
-  KEY `id_search_option` (`id_search_option`),
   KEY `item` (`itemtype`,`items_id`),
   KEY `itemtype_link` (`itemtype_link`)
 )
Le schéma diffère pour la table "glpi_networkports".
--- Schéma de base de données attendu
+++ Schéma de base de données actuel
@@ @@
   `date_creation` datetime,
   `date_mod` datetime,
   `entities_id` int NOT NULL DEFAULT 0,
+  `gateway` varchar(255),
   `ifalias` varchar(255),
   `ifconnectionstatus` int NOT NULL DEFAULT 0,
   `ifdescr` varchar(255),
@@ @@
   `ifspeed` bigint NOT NULL DEFAULT 0,
   `ifstatus` varchar(255),
   `instantiation_type` varchar(255),
+  `ip` varchar(255),
   `is_deleted` tinyint NOT NULL DEFAULT 0,
   `is_dynamic` tinyint NOT NULL DEFAULT 0,
   `is_recursive` tinyint NOT NULL DEFAULT 0,
@@ @@
   `logical_number` int NOT NULL DEFAULT 0,
   `mac` varchar(255),
   `name` varchar(255),
+  `netmask` varchar(255),
+  `netpoints_id` int NOT NULL DEFAULT 0,
+  `networkinterfaces_id` int NOT NULL DEFAULT 0,
   `portduplex` varchar(255),
+  `subnet` varchar(255),
   `trunk` tinyint NOT NULL DEFAULT 0,
   PRIMARY KEY (`id`),
   KEY `date_creation` (`date_creation`),
@@ @@
   KEY `is_dynamic` (`is_dynamic`),
   KEY `is_recursive` (`is_recursive`),
   KEY `item` (`itemtype`,`items_id`),
-  KEY `mac` (`mac`),
-  KEY `name` (`name`)
+  KEY `name` (`name`),
+  KEY `netpoints_id` (`netpoints_id`),
+  KEY `networkinterfaces_id` (`networkinterfaces_id`)
 )
Le schéma diffère pour la table "glpi_vlans".
--- Schéma de base de données attendu
+++ Schéma de base de données actuel
@@ @@
   KEY `date_mod` (`date_mod`),
   KEY `entities_id` (`entities_id`),
   KEY `is_recursive` (`is_recursive`),
-  KEY `name` (`name`),
-  KEY `tag` (`tag`)
+  KEY `name` (`name`)
 )
Le schéma diffère pour la table "glpi_itilfollowups".
--- Schéma de base de données attendu
+++ Schéma de base de données actuel
@@ @@
   `is_private` tinyint NOT NULL DEFAULT 0,
   `items_id` int NOT NULL DEFAULT 0,
   `itemtype` varchar(100) NOT NULL,
-  `requesttypes_id` int unsigned NOT NULL DEFAULT 0,
+  `realtime` float NOT NULL DEFAULT 0,
   `sourceitems_id` int NOT NULL DEFAULT 0,
   `sourceof_items_id` int NOT NULL DEFAULT 0,
   `timeline_position` tinyint NOT NULL DEFAULT 0,
@@ @@
   KEY `date` (`date`),
   KEY `is_private` (`is_private`),
   KEY `item` (`itemtype`,`items_id`),
-  KEY `requesttypes_id` (`requesttypes_id`),
   KEY `sourceitems_id` (`sourceitems_id`),
   KEY `sourceof_items_id` (`sourceof_items_id`),
   KEY `users_id_editor` (`users_id_editor`),
   KEY `users_id` (`users_id`)
 )

j'ai corrigé la base et hop ... ça fonctionne