Closed narfight closed 1 year ago
You should try with GLPI latest nightly that already solves some issues you report.
Trying on current nightly on my side with provided inventory file, I do not have the issues you list; but I do have some other. I'll investigate to find what's wrong; update may be broken if initial import is not ok itself.
OK, issues I've seen are not related to your issue.
But I also think you do not really have an issue. You equipment is a stacked one, therefore GLPI creates 3 different NetworkEquipments assets. Replaying inventory will also update those 3 ones; the "main" on a set of criteria, and all otehr on possible another set.
I put my GLPI Inventory up to date from github (commit n°cb2e55cdbbd9b91b01e90bbb4d589b130910ecba)
I deleted my 3 switchs objet and empty the recycle bin, reset all rulses of import and import two XML file (one from yesterday and this : stack-haut-1-03.txt)
First import : it's OK, 3 objets Second import for update : nothing, error in php log file (nothing in SQL) :
[2023-03-01 10:54:58] glpiphplog.WARNING: *** PHP User Warning (512): Phone/Computer MAC linked in /var/www/html/src/Inventory/Asset/NetworkPort.php at line 356
Backtrace :
src/Inventory/Asset/NetworkPort.php:356 trigger_error()
src/Inventory/Asset/NetworkPort.php:607 Glpi\Inventory\Asset\NetworkPort->handleMacConnection()
src/Inventory/Asset/NetworkPort.php:629 Glpi\Inventory\Asset\NetworkPort->handleConnections()
src/Inventory/Asset/NetworkPort.php:624 Glpi\Inventory\Asset\NetworkPort->portChanged()
src/Inventory/Asset/InventoryNetworkPort.php:623 Glpi\Inventory\Asset\NetworkPort->portCreated()
src/Inventory/Asset/InventoryNetworkPort.php:122 Glpi\Inventory\Asset\NetworkPort->handleCreates()
src/Inventory/Asset/NetworkPort.php:786 Glpi\Inventory\Asset\NetworkPort->handlePortsTrait()
src/Inventory/Asset/NetworkPort.php:614 Glpi\Inventory\Asset\NetworkPort->handlePorts()
src/Inventory/Asset/MainAsset.php:871 Glpi\Inventory\Asset\NetworkPort->handle()
src/Inventory/Asset/MainAsset.php:791 Glpi\Inventory\Asset\MainAsset->handleAssets()
src/Inventory/Asset/NetworkEquipment.php:227 Glpi\Inventory\Asset\MainAsset->rulepassed()
src/RuleImportAsset.php:1001 Glpi\Inventory\Asset\NetworkEquipment->rulepassed()
src/Rule.php:1522 RuleImportAsset->executeActions()
src/RuleCollection.php:1626 Rule->process()
src/Inventory/Asset/MainAsset.php:571 RuleCollection->processAllRules()
src/Inventory/Inventory.php:706 Glpi\Inventory\Asset\MainAsset->handle()
src/Inventory/Inventory.php:341 Glpi\Inventory\Inventory->handleItem()
src/Inventory/Request.php:360 Glpi\Inventory\Inventory->doInventory()
src/Inventory/Request.php:283 Glpi\Inventory\Request->inventory()
src/Inventory/Request.php:250 Glpi\Inventory\Request->network()
src/Inventory/Request.php:98 Glpi\Inventory\Request->networkInventory()
src/Agent/Communication/AbstractRequest.php:332 Glpi\Inventory\Request->handleAction()
src/Agent/Communication/AbstractRequest.php:269 Glpi\Agent\Communication\AbstractRequest->handleXMLRequest()
src/Inventory/Conf.php:220 Glpi\Agent\Communication\AbstractRequest->handleRequest()
src/Inventory/Conf.php:161 Glpi\Inventory\Conf->importContentFile()
front/inventory.conf.php:47 Glpi\Inventory\Conf->importFile()
[2023-03-01 10:56:07] glpiphplog.ERROR: *** PHP User Error (256): Duplicate entry '831132-13' for key 'unicity' in /var/www/html/src/DBmysql.php at line 1969
Backtrace :
src/DBmysql.php:1969 trigger_error()
src/Inventory/Asset/NetworkPort.php:531 DBmysql->executeStatement()
src/Inventory/Asset/NetworkPort.php:630 Glpi\Inventory\Asset\NetworkPort->handleVlans()
src/Inventory/Asset/NetworkPort.php:619 Glpi\Inventory\Asset\NetworkPort->portChanged()
src/Inventory/Asset/InventoryNetworkPort.php:507 Glpi\Inventory\Asset\NetworkPort->portUpdated()
src/Inventory/Asset/InventoryNetworkPort.php:121 Glpi\Inventory\Asset\NetworkPort->handleUpdates()
src/Inventory/Asset/NetworkPort.php:786 Glpi\Inventory\Asset\NetworkPort->handlePortsTrait()
src/Inventory/Asset/NetworkPort.php:614 Glpi\Inventory\Asset\NetworkPort->handlePorts()
src/Inventory/Asset/MainAsset.php:871 Glpi\Inventory\Asset\NetworkPort->handle()
src/Inventory/Asset/MainAsset.php:791 Glpi\Inventory\Asset\MainAsset->handleAssets()
src/Inventory/Asset/NetworkEquipment.php:227 Glpi\Inventory\Asset\MainAsset->rulepassed()
src/RuleImportAsset.php:969 Glpi\Inventory\Asset\NetworkEquipment->rulepassed()
src/Rule.php:1522 RuleImportAsset->executeActions()
src/RuleCollection.php:1626 Rule->process()
src/Inventory/Asset/MainAsset.php:571 RuleCollection->processAllRules()
src/Inventory/Inventory.php:706 Glpi\Inventory\Asset\MainAsset->handle()
src/Inventory/Inventory.php:341 Glpi\Inventory\Inventory->handleItem()
src/Inventory/Request.php:360 Glpi\Inventory\Inventory->doInventory()
src/Inventory/Request.php:283 Glpi\Inventory\Request->inventory()
src/Inventory/Request.php:250 Glpi\Inventory\Request->network()
src/Inventory/Request.php:98 Glpi\Inventory\Request->networkInventory()
src/Agent/Communication/AbstractRequest.php:332 Glpi\Inventory\Request->handleAction()
src/Agent/Communication/AbstractRequest.php:269 Glpi\Agent\Communication\AbstractRequest->handleXMLRequest()
src/Inventory/Conf.php:220 Glpi\Agent\Communication\AbstractRequest->handleRequest()
src/Inventory/Conf.php:161 Glpi\Inventory\Conf->importContentFile()
front/inventory.conf.php:47 Glpi\Inventory\Conf->importFile()
Can you try this on your setup ?
I do not reproduce with GLPI nightly build
https://nightly.glpi-project.org/glpi/
Can you try with it tomorrow (to get this fix -> https://github.com/glpi-project/glpi/pull/14187)
Update to GLPI 10.0.7-dev.
I can see the new name for the first import (ref to fix n°14187).
My prosses :
[2023-03-02 09:30:05] glpiphplog.ERROR: *** PHP User Error (256): Duplicate entry '831342-13' for key 'unicity' in /var/www/html/src/DBmysql.php at line 1969
Backtrace :
src/DBmysql.php:1969 trigger_error()
src/Inventory/Asset/NetworkPort.php:532 DBmysql->executeStatement()
src/Inventory/Asset/NetworkPort.php:632 Glpi\Inventory\Asset\NetworkPort->handleVlans()
src/Inventory/Asset/NetworkPort.php:621 Glpi\Inventory\Asset\NetworkPort->portChanged()
src/Inventory/Asset/InventoryNetworkPort.php:512 Glpi\Inventory\Asset\NetworkPort->portUpdated()
src/Inventory/Asset/InventoryNetworkPort.php:121 Glpi\Inventory\Asset\NetworkPort->handleUpdates()
src/Inventory/Asset/NetworkPort.php:815 Glpi\Inventory\Asset\NetworkPort->handlePortsTrait()
src/Inventory/Asset/NetworkPort.php:616 Glpi\Inventory\Asset\NetworkPort->handlePorts()
src/Inventory/Asset/MainAsset.php:874 Glpi\Inventory\Asset\NetworkPort->handle()
src/Inventory/Asset/MainAsset.php:794 Glpi\Inventory\Asset\MainAsset->handleAssets()
src/Inventory/Asset/NetworkEquipment.php:228 Glpi\Inventory\Asset\MainAsset->rulepassed()
src/RuleImportAsset.php:969 Glpi\Inventory\Asset\NetworkEquipment->rulepassed()
src/Rule.php:1519 RuleImportAsset->executeActions()
src/RuleCollection.php:1625 Rule->process()
src/Inventory/Asset/MainAsset.php:571 RuleCollection->processAllRules()
src/Inventory/Inventory.php:706 Glpi\Inventory\Asset\MainAsset->handle()
src/Inventory/Inventory.php:341 Glpi\Inventory\Inventory->handleItem()
src/Inventory/Request.php:360 Glpi\Inventory\Inventory->doInventory()
src/Inventory/Request.php:283 Glpi\Inventory\Request->inventory()
src/Inventory/Request.php:250 Glpi\Inventory\Request->network()
src/Inventory/Request.php:98 Glpi\Inventory\Request->networkInventory()
src/Agent/Communication/AbstractRequest.php:332 Glpi\Inventory\Request->handleAction()
src/Agent/Communication/AbstractRequest.php:269 Glpi\Agent\Communication\AbstractRequest->handleXMLRequest()
src/Inventory/Conf.php:220 Glpi\Agent\Communication\AbstractRequest->handleRequest()
src/Inventory/Conf.php:161 Glpi\Inventory\Conf->importContentFile()
front/inventory.conf.php:47 Glpi\Inventory\Conf->importFile()
probleme still here :-(
I've just tested with current 10.0/bugfixes, and I cannot reproduce. Something may have not been deleted on networkequipments removal; hard to say what.
can you clean all vlans ?
thank you @stonebuzz, it's the solution !
thank you to @trasher for your help :-)
:+1:
Hello,
I have a problem with import by SNMP (Version 2c) from stacked switch Powerconnect 5524. If I use the default rulse set for the import, GLPI overwrite 3 time the same objet :
The only solution for me, is to put the rulse import/update "by serial" on the top of "by mac" and It's work the first time. GLPI see 3 objet in network equipement. The probleme is on update, I have a lot of error and the inventory don't update my switch on GLPI :-(
the switch :
Import rulses actived in order :
Error SQL:
SNMP inventory file : stack-haut.txt GLPI : 10.0.6 GLPI Inventory : 1.1.0 (from marketplace) GLPI Agent : 1.4 and tested with 1.5-gitec37be05