Page 1 of 1

[RESOLVED] Exporting the audit to GLPI and excluding OUs

Published: November 7, 2024 - 2:00 PM
by cefinformatique
Hello,

while reviewing the setup.py file for the tis-glpi-plugin-export-to-glpi10 package, I noticed an undocumented parameter: 'list_excluded_ou'.

This parameter is of interest to me because I would like to exclude certain organizational units (OUs) from the data export to GLPI.

Do you have any information on this?

Re: Exporting the audit to GLPI and excluding OUs

Published: November 7, 2024 - 2:09 PM
by sfonteneau
Good morning

Yes, indeed, according to the code:

Code: Select all

    list_excluded_ou=[]
    if CONFGLPI.has_option('glpi', 'list_excluded_ou'):
        list_excluded_ou = CONFGLPI.get('glpi', 'list_excluded_ou').split('|')
        
...

    for pc in list_pc_wapt:
        for excluded_ou in list_excluded_ou:
            if str(pc['host_capabilities']['dn']).lower().endswith(excluded_ou.lower()):
                continue
        
You can indeed place a list of items like this:

Code: Select all

list_excluded_ou=ou=server,dc=tata,dc=local|ou=pc-critial,dc=tata,dc=local