fusioninventory / fusioninventory-for-glpi

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

I wana use the full server name for the assets computer name #3210

Open hanchat opened 3 years ago

hanchat commented 3 years ago

my company's servers named started with IP address, like 10.10.10.x-database1. Now the assets computer names are all set as 10, then 10.10.x-database set as domain name. that is not what I want. so I want the assets computer name set as full name like 10.10.10.x-database1.

hanchat commented 3 years ago

or any setting can change to full name for assets computer name?

hanchat commented 3 years ago

update glpi_computers SET name = (select name from glpi_plugin_fusioninventory_agents where glpi_plugin_fusioninventory_agents.id=glpi_computers.id) ;

genedupre commented 3 years ago

Hi, another way would be to comment out the line responsible that converts the fqdn to the hostname /usr/share/fusioninventory/lib/FusionInventory/Agent/Task/Inventory/Generic/Hostname.pm

    my $hostname = hostname();
    #$hostname =~ s/\..*//; # keep just the hostname
    $inventory->setHardware({NAME => $hostname});
hanchat commented 3 years ago

Hi there sorry for late replay, and thanks for replay. but I can't find the path agent or task or Generic, nor find the key work setHardware in the glpi project code. my glpi & fusioninventory version is GLPI 9.5.5 Copyright (C) 2015-2021 Teclib' and contributors FusionInventory 9.5+3.0 - Copyleft © 2010-2019 by FusionInventory Team can you please point out where are they? or something I miss?

BR Henry

At 2021-09-20 22:13:25, "Dupre Gene" @.***> wrote:

Hi, another way would be to comment out the line responsible that converts the fqdn to the hostname /usr/share/fusioninventory/lib/FusionInventory/Agent/Task/Inventory/Generic/Hostname.pm

my $hostname = hostname();
#$hostname =~ s/\..*//; # keep just the hostname
$inventory->setHardware({NAME => $hostname});

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.