Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Software dictionary rules don't complete all actions #15818

Closed
2 tasks done
hgpit opened this issue Oct 18, 2023 · 10 comments
Closed
2 tasks done

Software dictionary rules don't complete all actions #15818

hgpit opened this issue Oct 18, 2023 · 10 comments
Assignees
Labels

Comments

@hgpit
Copy link

hgpit commented Oct 18, 2023

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

10.0.10

Bug description

Software Dictionary rules doen't perform all defined actions during import.

Relevant log output

Nothing posted in Apache or PHP logs that I can see

Steps To reproduce

  1. Create Software Dictionary rule:
    image
  2. Run inventory/import from suitable GLPI Agent client
  3. Check GLPI software asset database to see that the Software name gets changed, but the the category reassignment and publisher change is ignored:
    image

Your GLPI setup information

Operating system: Linux g000077 4.18.0-372.16.1.el8_6.0.1.x86_64 #​1 SMP Thu Jul 14 21:39:58 UTC 2022 x86_64
PHP 7.4.33 fpm-fcgi (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apcu, bz2, calendar, cgi-fcgi, ctype, curl,
date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imagick, imap, intl, json, ldap, libxml, mbstring, mysqli,
mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, posix, session, shmop, snmp, sockets, sodium, sqlite3, standard, sysvmsg,
sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="-1" memory_limit="2G" post_max_size="50M" safe_mode="" session.save_handler="files"
upload_max_filesize="25M"
Software: Apache ()
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Server Software: MariaDB Server
Server Version: 10.6.12-MariaDB-log
Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Parameters: glpi-rw@it-db-server-2.my-domain.local/glpi_it
Host info: it-db-server-2.my-domain.local via TCP/IP

PHP version (7.4.33) is supported.
Sessions configuration is OK.
Allocated memory is sufficient.
mysqli extension is installed.
Following extensions are installed: dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter.
curl extension is installed.
gd extension is installed.
intl extension is installed.
zlib extension is installed.
The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
Database engine version (10.6.12) is supported.
No files from previous GLPI version detected.
The log file has been created successfully.
Write access to /var/www/helpdesk.my-domain.local/files/_cache has been validated.
Write access to /var/www/helpdesk.my-domain.local/config has been validated.
Write access to /var/www/helpdesk.my-domain.local/files/_cron has been validated.
Write access to /var/www/helpdesk.my-domain.local/files has been validated.
Write access to /var/www/helpdesk.my-domain.local/files/_dumps has been validated.
Write access to /var/www/helpdesk.my-domain.local/files/_graphs has been validated.
Write access to /var/www/helpdesk.my-domain.local/files/_lock has been validated.
Write access to /var/www/helpdesk.my-domain.local/files/_pictures has been validated.
Write access to /var/www/helpdesk.my-domain.local/files/_plugins has been validated.
Write access to /var/www/helpdesk.my-domain.local/files/_rss has been validated.
Write access to /var/www/helpdesk.my-domain.local/files/_sessions has been validated.
Write access to /var/www/helpdesk.my-domain.local/files/_tmp has been validated.
Write access to /var/www/helpdesk.my-domain.local/files/_uploads has been validated.
For security reasons, SELinux mode should be Enforcing.
PHP 7.4 official support has ended. An upgrade to a more recent PHP version is recommended.
Web server root directory configuration seems safe.
Sessions configuration is secured.
OS and PHP are relying on 64 bits integers.
exif extension is installed.
ldap extension is installed.
openssl extension is installed.
Following extensions are installed: bz2, Phar, zip.
Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to /var/www/helpdesk.my-domain.local/marketplace has been validated.
Timezones seems loaded in database.

Anything else?

No response

@stonebuzz
Copy link
Contributor

Hi @hgpit

can you post here related inventory file et rules dictionnaries (you can export them from GLPI)?

Best regards

@hgpit
Copy link
Author

hgpit commented Oct 18, 2023

@stonebuzz If I run the main exporter
image
The resulting XML file doesn't appear to contain any Software Dictionary rules, despite having a couple dozen or so in GLPI itself.
(attached anyway).

I ran an inventory from one of the test client Windows machines (using 'glpi-inventory --json > inventory.json') and attached result. Let me know if this needs to be done in a different way. All our tests have understandably been via automatic inventorying through the GLPI GUI.

inventory.json

rules.xml.txt

Thanks

@hgpit
Copy link
Author

hgpit commented Oct 18, 2023

Ah, instantly upon posting I found the way to individually export the Software Dictionary rule.

Please see attached:
rule.xml.txt

@hgpit
Copy link
Author

hgpit commented Oct 18, 2023

By the way, I don't believe the issue is with the specific rule as we observe the same behaviour on any other rules we test.
For instance:
image
ACTION 'A' takes place, but ACTION 'B' is ignored/skipped/missed.

It's an 'OR' criteria rule.

@stonebuzz
Copy link
Contributor

stonebuzz commented Oct 18, 2023

I think I've found it,
your inventory file already contains an "Acronis Cyber Protect" software.

{
            "arch": "x86_64",
            "from": "registry",
            "guid": "9EBDE6F5-EAE6-4326-A3A1-DEAA29F32D1D_BackupAndRecovery",
            "install_date": "2023-10-16",
            "name": "Acronis Cyber Protect",
            "publisher": "Acronis",
            "system_category": "application",
            "uninstall_string": "C:\Program Files\Common Files\Acronis\BackupAndRecovery\AcronisUninstaller.exe",
            "version": "15.0.36514"
         },

and you try to transform this one

{
            "arch": "x86_64",
            "from": "registry",
            "guid": "{C3C08FBE-639E-4453-963C-0959CF18D60C}",
            "install_date": "2023-10-16",
            "name": "Cyber Protect",
            "publisher": "Acronis",
            "system_category": "system_component",
            "uninstall_string": "MsiExec.exe /X{C3C08FBE-639E-4453-963C-0959CF18D60C}",
            "url_info_about": "https://www.acronis.com",
            "version": "15.0.36514"
         },

Like the first one,

which prevents GLPI from doing its reconciliation job properly

It does change the name, but when it comes to processing the category and publisher, it's the first one that's processed.

can you adapt your rule (with other values for categorie / name / publisher) to see if GLPI correctly handles "Cyber Protect"?

You'll need to remove the two "Acronis Cyber Protect" softwares to start again from a "clean" base.

Best regards

@hgpit
Copy link
Author

hgpit commented Oct 18, 2023

I can see what you mean by there being two Acronis-related entries in the JSON. One named 'Cyber Protect' and one named 'Acronis Cyber Protect', and that it might possibly confuse the engine somehow?

But, I think you are also asking me to delete existing entries in my GLPI? I can't do that as our GLPI holds 1000's of audited software licenses (manually entered over the last 10+ years) which is already assigned to software/versions.

This is why we need the dictionary to work properly, so we can automatically match/merge the software from our estate into our existing GLPI data. We've only just started to trial automatic inventorying of software, but have been asset managing software in GLPI (manually) for a very long time.

Would you be able to clarify what you are suggesting?

Thanks

@stonebuzz
Copy link
Contributor

Just delete both acronis software , and adapt rule to see if glpi handle correctly cyber protect soft when glpi dictionnary update it with another name

@hgpit
Copy link
Author

hgpit commented Oct 18, 2023

So, there are two software version entries in our live GLPI which appear to have been introduced automatically via inventory:
1

I Deleted A and B, leaving me with:
2

I then re-ran the inventory:
image

So, yes, it appears that the first qualifying software item in the inventory gets renamed (name and publisher) and [possibly] assigned to the correct category. Then on the second qualifying entry there is no match, as the rule is looking for just 'Cyber Protect'. So that is starting to make sense. I am going to create another rule (or regexp the existing rule) to hopefully catch both. and see what happens.

@hgpit
Copy link
Author

hgpit commented Oct 26, 2023

I will post an update on our finding ASAP, unfortunately I got tied up with other commitments. Hoping to get back to this very soon.

Copy link
Contributor

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue.
If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

@github-actions github-actions bot added the Stale label Dec 26, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants