Hello list.
I'm trying to normalize the entries in software list, meaning one only
entry for a given software. Unfortunatly for me, the current
implementation of fusioninventory-agent assign an editor value for
rpm-based linux distribution, and not for dpkg-based distributions. As
software import rules use name/editor as a unicity key, this result in
multiple entries for each single package:
Id Name Editor
x cron Red Hat Inc. -> redhat hosts
y cron CentOS -> centos hosts
z cron -> debian/ubuntu hosts
I've tried to use dictionnary rules for normalisation. However, they are
two issues here.
First, using an empty value in an assignement action for editor field in
a software rule doesn't work, because of line 324 in
"inc/ruledictionnarysoftwarecollection.class.php" (GLPI 0.84.7):
if (isset($res_rule["manufacturer"]) && $res_rule["manufacturer"]) {
The second condition is the issue here, as an empty value doesn't
satisfy it. Removing it fix the problem.
Maybe a better (but more invasive) solution would be a 'remove' action
instead of using 'assign' here.
Second, when using this rule a posteriori, be replaying it on the
existing database, just changing the editor string doesn't change much,
as there is no merging with already existing software. For instance, the
previous situation is turned in:
Id Name Editor
x cron
y cron
z cron
The code appears to make a distinction between a name or entity change
and other changes (line 289). As the editor is also used as a unicity
key, the condition should probably get changed to 'name, editor or
entity' change here.
The rule works fine at import time, tough.
This issues is mostly due to agent behaviour difference between
platforms. However, until a generic configurable post-processing
mecanism is implemented, normalisation is prefentially done on GLPI side.
--
Guillaume
_______________________________________________
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev