fusioninventory / fusioninventory-for-glpi

FusionInventory plugin for GLPI
http://www.FusionInventory.org/
GNU Affero General Public License v3.0
361 stars 148 forks source link

name of unmanaged device - plugins/fusioninventory/inc/networkport.class.php #1954

Open abmteam opened 7 years ago

abmteam commented 7 years ago

file -> plugins/fusioninventory/inc/networkport.class.php

When an unmanaged device is found, sometimes it gets no name.

Adding the last 5 lines below, it will try to use the manufacturer name when param sysname doesnt exist.

     // Add unmanaged device because not find device
     $input = array();
     $input['mac'] = $sysmac;
     if (isset($params['sysname'])) {
        $input['name'] = $params['sysname'];
     } else if (isset($params['name'])) {
      $input['name'] = $params['name'];
     } else {
     $input['name'] = PluginFusioninventoryInventoryExternalDB::getManufacturerWithMAC($sysmac);
    }
abmteam commented 7 years ago

Hi, the same can be done in the file "plugins/fusioninventory/inc/inventorynetworkequipmentlib.class.php" [about line 442].

Adding the last line below, it will try to use the manufacturer name.

          if (!isset($macNotPhone_id)) {
              // Create unknown ports
              $unknown_infos = array();
              $unknown_infos["name"] = '';
              $unknown_infos["name"] = PluginFusioninventoryInventoryExternalDB::getManufacturerWithMAC($macNotPhone);