Re: [EXIM] eximstats-html

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Andrew M. Inggs
Fecha:  
A: exim-users
Asunto: Re: [EXIM] eximstats-html
On 17 March 1999, Nigel Metheringham wrote:
> mbaker@??? said:
> > uname -n also gives the unqualified name. Is there any portable way to
> > get the FQDN?
>
> Since all machines will, almost by definition, have exim
>
>     exim -bP primary_hostname

>
> As a more general answer, I'd suggest looking at the Perl CPAN modules
> - there is at least one that deals with the problem of getting hold of
> the host name in a manner that works on all machines.


The standard Perl Sys::Hostname gives you the function hostname, but
that basically gives you `uname -n' (FQDN on standard Red Hat install,
but unqualified hostname on every other system I've used). The
Net::Domain, from the libnet set of perl modules

    CPAN/authors/id/GBARR/libnet-1.0606.tar.gz


gives you three functions: hostname, hostfqdn, hostdomain which try hard
to return unqualified hostname, fully qualified domain name and domain
respectively. I've tested in on Red Hat Linux 5.2, Silicon Graphics
IRIX 6.2 and Digital Unix 4.0D, all work as expected.

--
Andrew M. Inggs
aminggs@???

--
*** Exim information can be found at http://www.exim.org/ ***