glpi-project / glpi-inventory-plugin

GLPI Inventory plugin
GNU Affero General Public License v3.0
43 stars 24 forks source link

Tag isn't added to NetInventory tasks #504

Open eduardomozart opened 2 months ago

eduardomozart commented 2 months ago

Describe the bug

I installed GLPI Agent but the tag seems to be associated only with the Computer item itself. When doing a NetInventory task, this tag isn't associated to the item itself, so I can't apply Rules to assign Assets to Entities based on the tag itself.

To reproduce

  1. Assign a Tag to a GLPI Agent computer.
  2. Do a NetInventory task.
  3. No <TAG> is assigned to NetInventory tasks so it's impossible to assign these Assets to other Entities based on TAG.

Expected behavior

NetInventory items should use the TAG defined on GLPI Agent computer.

Operating system

Windows

GLPI Agent version

Other (See additional context below)

GLPI version

Other (See additional context below)

GLPIInventory plugin

1.3.5

Additional context

GLPI Agent: 1.7.3 GLPI: 10.0.14

Sample inventory of a Network Printer:

<?xml version="1.0" encoding="UTF-8"?>
<REQUEST>
  <CONTENT>
    <DEVICE>
      <CARTRIDGES>
        <DRUMBLACK>91</DRUMBLACK>
        <TONERBLACK>OK</TONERBLACK>
      </CARTRIDGES>
      <FIRMWARES>
        <DESCRIPTION>device firmware</DESCRIPTION>
        <MANUFACTURER>Brother</MANUFACTURER>
        <NAME>NC-8800h</NAME>
        <TYPE>device</TYPE>
        <VERSION>N</VERSION>
      </FIRMWARES>
      <INFO>
        <COMMENTS>Brother NC-8400w, Firmware Ver.N  ,MID 84U-E07</COMMENTS>
        <CONTACT>Suporte TI</CONTACT>
        <FIRMWARE>N</FIRMWARE>
        <ID>2</ID>
        <IPS>
          <IP>192.168.0.197</IP>
        </IPS>
        <LOCATION>Escritório RNetworks</LOCATION>
        <MAC>b4:b5:b6:e3:32:d4</MAC>
        <MANUFACTURER>Brother</MANUFACTURER>
        <MEMORY>32</MEMORY>
        <MODEL>NC-8800h</MODEL>
        <NAME>BRWB4B5B6E332D4</NAME>
        <RAM>32</RAM>
        <SERIAL>U63982B2N294272</SERIAL>
        <TYPE>PRINTER</TYPE>
        <UPTIME>1 day, 07:10:31.70</UPTIME>
      </INFO>
      <PAGECOUNTERS>
        <TOTAL>894</TOTAL>
      </PAGECOUNTERS>
      <PORTS>
        <PORT>
          <IFDESCR>NC-8400w</IFDESCR>
          <IFINERRORS>0</IFINERRORS>
          <IFINOCTETS>5254389</IFINOCTETS>
          <IFINTERNALSTATUS>1</IFINTERNALSTATUS>
          <IFLASTCHANGE>13 minutes, 23.95</IFLASTCHANGE>
          <IFMTU>1500</IFMTU>
          <IFNAME>NC-8400w</IFNAME>
          <IFNUMBER>1</IFNUMBER>
          <IFOUTERRORS>0</IFOUTERRORS>
          <IFOUTOCTETS>1518867</IFOUTOCTETS>
          <IFSPEED>72000000</IFSPEED>
          <IFSTATUS>1</IFSTATUS>
          <IFTYPE>7</IFTYPE>
          <IP>192.168.0.197</IP>
          <IPS>
            <IP>192.168.0.197</IP>
          </IPS>
          <MAC>b4:b5:b6:e3:32:d4</MAC>
        </PORT>
        <PORT>
          <IFDESCR>SoftwareLoopBack</IFDESCR>
          <IFINERRORS>0</IFINERRORS>
          <IFINOCTETS>100</IFINOCTETS>
          <IFINTERNALSTATUS>1</IFINTERNALSTATUS>
          <IFLASTCHANGE>0.00 seconds</IFLASTCHANGE>
          <IFMTU>1500</IFMTU>
          <IFNAME>SoftwareLoopBack</IFNAME>
          <IFNUMBER>2</IFNUMBER>
          <IFOUTERRORS>0</IFOUTERRORS>
          <IFOUTOCTETS>100</IFOUTOCTETS>
          <IFSPEED>0</IFSPEED>
          <IFSTATUS>1</IFSTATUS>
          <IFTYPE>24</IFTYPE>
        </PORT>
      </PORTS>
    </DEVICE>
    <MODULEVERSION>6.1</MODULEVERSION>
    <PROCESSNUMBER>74</PROCESSNUMBER>
  </CONTENT>
  <DEVICEID>server02-2024-04-15-16-08-05</DEVICEID>
  <QUERY>SNMPQUERY</QUERY>
</REQUEST>

Another alternative would be to be possible to assign Asset to Entity based on GLPI Agent computer (DEVICEID).

github-actions[bot] commented 2 weeks ago

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 7 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.

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

eduardomozart commented 2 weeks ago

@trasher why do you remove the bug tag? It should be possible to set a tag for NetInventory items.

trasher commented 2 weeks ago

It is a new feature request, not a bug.