glpi icon indicating copy to clipboard operation
glpi copied to clipboard

Software to Category Rule seems not to work upon inventory

Open Movix opened this issue 1 year ago • 20 comments

Describe the bug

Hello,

i defined some rules to assign a category to inventarised software. I put the default rule import category from inventopry tool in the last position and disabled it. Before i did that i had already some software inventorised and that created categories using those discovered in the inventory. I rearanged the software categories putting those discovered as sub categories of new ones i created. I executed the action to recalculate the category assignement and this worked as expected. After the following inventarisation run all categories are again assigned to the categories discovered. Those categories i put in subcategories were recreated.

Movix

To reproduce

  1. Create rules to assign categories to inventorised software
  2. Run an inventory
  3. Check if the assignement worked

Expected behavior

Assign software categories as defined to inventoarised software Do not change the category of a software that has been set to something else than what is inventorised (Locked field ?)

Operating system

Windows

GLPI Agent version

1.5

GLPI version

10.0.9

GLPIInventory plugin

1.2.3

Additional context

No response

Movix avatar Sep 15 '23 11:09 Movix

Hi @Movix

a simple rule like that (From Software Dictionnaries)

image

works fine

image

Can you check whether the category is locked?

("Lock" tab in the software form)

Best regards

stonebuzz avatar Sep 15 '23 12:09 stonebuzz

Stonebuzz,

did you deleted the default rule ? as said, the recalculation of rule works fine, that tells me the rules are well defined. Here some examples of my defined rules.

I cannot find any information about the locked state of categories. No action on category list nor any locked field in the category details. Also check the list of inventory/locked fields but nothing related to software

image

image

and i did not deleted the default rule image

Movix avatar Sep 15 '23 12:09 Movix

Rules for assigning a category to software

image

is not use by native inventory.

You need to use software dictionnaries

image

stonebuzz avatar Sep 15 '23 12:09 stonebuzz

ah ok, was not aware about that.

Movix avatar Sep 15 '23 12:09 Movix

Will this work to avoid redefining all rules by hand ? update glpi_rules set sub_type="RuleDictionnarySoftware" WHERE sub_type = "RuleSoftwareCategory"

Movix avatar Sep 15 '23 12:09 Movix

I think yes

stonebuzz avatar Sep 15 '23 12:09 stonebuzz

worked ! :)

Movix avatar Sep 15 '23 12:09 Movix

thank you

Movix avatar Sep 15 '23 12:09 Movix

Hello Stanislas,

is still encounter some issues. I created a software category backup software and put it as a child of the category System I have defined a rule that check the inventorised software name for 'Backup Exec' and let matches be assigned to the category backup Software Now when an inventory is done the rule recreates a new category Backup Software at the root of the software categories and assignes it. When i force the rule processing all get like it should be but the created categories at the root remains. I have two questions:

  1. Why does an already assigned category to a software gets modified where the rule has not changed ?
  2. Why does a new catégory is created ?

Best regards Movix

Movix avatar Sep 16 '23 08:09 Movix

Hello,

i reopen cause it's still not working as expected. See previous message. Did a bunch of tests but i was unable to identify some reason in my rules or categories. Perhaps it's better to file a new issue, please give me advice if you want me to do so

Movix

Movix avatar Sep 21 '23 18:09 Movix

Hi @Movix Can you check that the new category backup software is visible from the Software entity?

or at least that this category is in the same entity as the parent category (with the same notion of recusivity)

stonebuzz avatar Oct 25 '23 12:10 stonebuzz

Hello Stonebuzz,

From what i see i cannot find the entity a category is bound to. There seem to be no entity :| There is also no posibility to transfert a category to another entity in the action menu nor can i add a field entity to the category list or add a filter on an entity field in that list. Same situation for the Dictionnary rules. Softwares on the other hand are bound to the entity the computer they belong to is bound to. Probably i missunderstood your question

Movix

Movix avatar Oct 25 '23 13:10 Movix

Indeed, there is no notion of entity in software categories.

And I don't reproduce, I don't understand what's going on

stonebuzz avatar Oct 25 '23 14:10 stonebuzz

I can provide a remote access to one of the systems having this issue if you want to dive into it

Movix avatar Oct 25 '23 14:10 Movix

Using a remote access is professional support; not community one.

Please provide us a way to reproduce from a blank install; or you can of course consider taking a subscription to get professional support.

trasher avatar Oct 26 '23 08:10 trasher

Hello Trasher, i understand this, was just in case you wished to investigate in order to identify the issue that is perhaps a bug.

Here the steps to reproduce :

  1. Create a software category "Application"
  2. Create a software category "Backup Software" and put it as a child of "Application"
  3. Créate a dictionnary rule that take some inventorised software upon it's name into the category "Backup Software"
  4. Run an inventory

What you should see :

  1. A new category "Backup Software" is created at the root of the categories
  2. The inventorised software matching the "Backup Software" rule is tagged as "Backup Software" using the the root element
  3. Run a "Recalculate rules" and the see that the inventorised software has it's category move tpo the correct one
  4. Rerun an inventory, your software is again in the root category
  5. delete the root category "Backup Software"
  6. Rerun an inventory : the root category is recreated again

I verified those step on two distinct systems, same behavior.

Movix

Movix avatar Oct 26 '23 08:10 Movix

We have also seen this in GLPI 10.0.10.

Despite specifying in software dictionary to assign the software to a sub/child category of another, it creates the desired target category at the root level. The dictionary engine doesn't appear to respect and acknowledge multi-level categories.

hgpit avatar Nov 20 '23 17:11 hgpit

The new category "Backup Software" (from the first step) is created at same entity than Computer ?

stonebuzz avatar Nov 21 '23 07:11 stonebuzz

hi Stonebuzz, see here https://github.com/glpi-project/glpi/issues/16036

Movix

Movix avatar Nov 21 '23 08:11 Movix

Hello Trasher, i understand this, was just in case you wished to investigate in order to identify the issue that is perhaps a bug.

Here the steps to reproduce :

1. Create a software category "Application"

2. Create a software category "Backup Software" and put it as a child of "Application"

3. Créate a dictionnary rule that take some inventorised software upon it's name into the category "Backup Software"

4. Run an inventory

OK, I do reproduce that way; we'll take an eye.

trasher avatar Nov 22 '23 09:11 trasher