Closed SteadEXE closed 2 years ago
To avoid a lot of logs, I purged the logs, I had to keep it for 1 year but I set it to 6 months
Log before changement over 6 month
after :
I have same issue, this generates too many logs over a long period of time
To avoid a lot of logs, I purged the logs, I had to keep it for 1 year but I set it to 6 months
Log before changement over 6 month
after :
I did the same to prevent bloating the database.
I have a device USB Device #573 that get removed all the time, I went on the device itself, it has 65000 lines of history, everytime it moves from one computer to another. It changes manufacturer all the time too.
I have same issue, this generates too many logs over a long period of time
I am pretty sure if you go on this device 1270 you will get a lot of history for it and I am sure this device is used by a lot of computers.
Here is an example of a device moving all the day:
@SteadEXE
device 1270, same issue ping pong on two computer
But I don't have this problem on all computers. For the moment , I found two computer that have this bug
I try delete USB Composite Device (1270)
Scan agent glpi my computer , create USB Composite Device (1846) Scan the second computer , USB Composite Device (1846).
maybe delete the two computer and then new create with agent GLPI, i wil try. My data is a migration 9.5.7 ==> 10.0.0 ( april 2022)
On my side, I guess this is because we use dock/usb hub so a lot of computers detect devices with same serial number. I don't know if somebody from GLPI team has an idea of how can we mitigate the issue in this case
Could you please provide anonymized inventory files that permit to reproduce this issue?
Those are two computers (my collegue's one and mine).
We apparently share RTL8153 Gigabit Ethernet Adapter and USB Composite Devices.
I guess a fix would be to allow a device to be used by more than one computer. For real devices it will not change anything. And for dupplicated serial number it will stop the ping pong. Another fix would be to use a combo agent+serial number, but it prevents moving a device from one computer to another which is not ideal for stock management.
Thanks for inventory files, I'll take a look next week
I've inspected and tested provided inventory files; and it seems there is nothing we can really do; those peripherals are strictly the same on both computers.
There is an option in the peripheral form called "Management type" you can set to "Global management" to prevent that kind of case. You have to inventory the first computer, set "dumb" peripherals to global management and then import all other computers. Doing that, all linked peripherals stay on first computer, no entries in log (all is OK on that side), but as far as I've seen, those ones are never linked at all on second computer (which is maybe a bug).
Could you please test?
I did it on "dump" devices. Do you think it is possible to add a crontask to automatically detect those devices and change their management mode to global management if it moves more than x times over y days ? So people who want to keep their database clean can enable the crontask. Maybe it could be a fix.
I guess without changing anything it can uses "link created" entries of history.
I am still new with GLPI source code.
Update: With global management it keeps changing the manufacturer of these devices and some infos. It's a really hard task to fix everything by hand on a huge park of computers
could you please provide same inventories in xml format?
I just made a test on glpi9.5 with the fusioninventory plugin; and the behavior is exactly the same.
pull request #11915 improves default blacklist on serials; this exclude several entries
Hello
I try, Its ok with this fix. Thanks @trasher
By the way there is something weird happening, I set global management, I locked the manufacturer field but it keeps trying to update it:
Ah yes in the log USB composite DEVICE
We made several changes you can test with latest nightly:
It may be related but when I global management I got my php-errors spammed by:
[2022-07-01 01:57:42] glpiphplog.WARNING: *** PHP User Warning (512): getFromDBByCrit expects to get one result, 11 found in query "SELECT id
FROM glpi_computers_items
WHERE itemtype
= 'Peripheral' AND items_id
= '3'". in E:\GLPI\src\CommonDBTM.php at line 396
Backtrace :
src\CommonDBTM.php:396 trigger_error()
src\Inventory\Asset\InventoryAsset.php:361 CommonDBTM->getFromDBByCrit()
src\Inventory\Asset\Peripheral.php:250 Glpi\Inventory\Asset\InventoryAsset->addOrMoveItem()
src\Inventory\Asset\MainAsset.php:811 Glpi\Inventory\Asset\Peripheral->handle()
src\Inventory\Asset\MainAsset.php:731 Glpi\Inventory\Asset\MainAsset->handleAssets()
src\RuleImportAsset.php:945 Glpi\Inventory\Asset\MainAsset->rulepassed()
src\Rule.php:1510 RuleImportAsset->executeActions()
src\RuleCollection.php:1591 Rule->process()
src\Inventory\Asset\MainAsset.php:550 RuleCollection->processAllRules()
src\Inventory\Inventory.php:697 Glpi\Inventory\Asset\MainAsset->handle()
src\Inventory\Inventory.php:331 Glpi\Inventory\Inventory->handleItem()
src\Inventory\Request.php:360 Glpi\Inventory\Inventory->doInventory()
src\Inventory\Request.php:90 Glpi\Inventory\Request->inventory()
src\Agent\Communication\AbstractRequest.php:325 Glpi\Inventory\Request->handleAction()
src\Agent\Communication\AbstractRequest.php:237 Glpi\Agent\Communication\AbstractRequest->handleJSONRequest()
front\inventory.php:86 Glpi\Agent\Communication\AbstractRequest->handleRequest()
plugins\glpiinventory\front\communication.php:72 include_once()
plugins\glpiinventory\index.php:45 include_once()
The 11 results are the 11 computers sharing the same global device.
It may be related but when I global management I got my php-errors spammed by:
[2022-07-01 01:57:42] glpiphplog.WARNING: *** PHP User Warning (512): getFromDBByCrit expects to get one result, 11 found in query "SELECT
id
FROMglpi_computers_items
WHEREitemtype
= 'Peripheral' ANDitems_id
= '3'". in E:\GLPI\src\CommonDBTM.php at line 396 Backtrace : src\CommonDBTM.php:396 trigger_error() src\Inventory\Asset\InventoryAsset.php:361 CommonDBTM->getFromDBByCrit() src\Inventory\Asset\Peripheral.php:250 Glpi\Inventory\Asset\InventoryAsset->addOrMoveItem() src\Inventory\Asset\MainAsset.php:811 Glpi\Inventory\Asset\Peripheral->handle() src\Inventory\Asset\MainAsset.php:731 Glpi\Inventory\Asset\MainAsset->handleAssets() src\RuleImportAsset.php:945 Glpi\Inventory\Asset\MainAsset->rulepassed() src\Rule.php:1510 RuleImportAsset->executeActions() src\RuleCollection.php:1591 Rule->process() src\Inventory\Asset\MainAsset.php:550 RuleCollection->processAllRules() src\Inventory\Inventory.php:697 Glpi\Inventory\Asset\MainAsset->handle() src\Inventory\Inventory.php:331 Glpi\Inventory\Inventory->handleItem() src\Inventory\Request.php:360 Glpi\Inventory\Inventory->doInventory() src\Inventory\Request.php:90 Glpi\Inventory\Request->inventory() src\Agent\Communication\AbstractRequest.php:325 Glpi\Inventory\Request->handleAction() src\Agent\Communication\AbstractRequest.php:237 Glpi\Agent\Communication\AbstractRequest->handleJSONRequest() front\inventory.php:86 Glpi\Agent\Communication\AbstractRequest->handleRequest() plugins\glpiinventory\front\communication.php:72 include_once() plugins\glpiinventory\index.php:45 include_once()The 11 results are the 11 computers sharing the same global device.
Please open a new issue. Multiple changes have been made on this part, and it would probably better to consider this as another bug and start its analysis from scratch.
Sure I'll do it.
Code of Conduct
Is there an existing issue for this?
Version
10.0.1
Bug description
I discovered that everytime an agent inventories a computer a lot of USB/Network Interface devices get added and immediately deleted. It creates thousands lines of logs everyday. At the moment I added a purge task to prevent database from growing.
It appears to occurs for docks/usb devices. Maybe there is a way to identify them in a more reliable way.
My computer (another example):
Relevant log output
No response
Page URL
No response
Steps To reproduce
No response
Your GLPI setup information
Anything else?
After some investigation it looks like, the same device is detected on multiple computer. Probably because the device has a generic serial number. This issue seems to be related from using docks/hub or even switches. Everytime a computer perform an inventory with the bugged/dupplicated device, the device move from one computer to another, creating logs entries. For example my network card adapter is a Realtek on a HP dock, but it has the same serial number on all computers.