1 package Ocsinventory::Agent::Backend::OS::Generic::Hostname;
4 eval { require (Sys::Hostname) };
7 return if ($? >> 8)!=0;
9 return if ($? >> 8)!=0;
13 # Initialise the distro entry
16 my $inventory = $params->{inventory};
20 # ico, Tue, 26 May 2009 17:58:27 +0200
21 chomp ( my $hostname = `hostname --fqdn` );
22 #eval { require (Sys::Hostname) };
24 # $hostname = Sys::Hostname::hostname();
26 # chomp ( $hostname = `hostname` ); # TODO: This is not generic.
28 #$hostname =~ s/\..*//; # keep just the hostname
31 $inventory->setHardware ({NAME => $hostname});