From 80b7b4a14d850c58a1b8ba7aebeb255e4996ee98 Mon Sep 17 00:00:00 2001 From: Vadim Pisarev Date: Tue, 21 Nov 2023 14:01:29 -0500 Subject: [PATCH] fqdn fix --- lib/GLPI/Agent/Tools/Hostname.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/GLPI/Agent/Tools/Hostname.pm b/lib/GLPI/Agent/Tools/Hostname.pm index e3cdbf803..6d11d5780 100644 --- a/lib/GLPI/Agent/Tools/Hostname.pm +++ b/lib/GLPI/Agent/Tools/Hostname.pm @@ -46,8 +46,11 @@ sub getHostname { sub _getHostnameUnix { - Sys::Hostname->require(); - return Sys::Hostname::hostname(); + Net::Domain->require(); + my $fqdn = Net::Domain::hostfqdn(); + $fqdn =~ s/\.$//; + + return $fqdn; } sub _getHostnameWindows {