Host name from IP address

Michael Jewett mgj at unb.ca
Mon Nov 6 21:13:35 CET 2006


again, I think I'm not explaining myself clearly.  I want to be able to 
get the host_name in the hosts.cfg file, like this:

define host{
         use                     edgeswitch-host
         host_name               5510-Toole
         alias                   Toole 5510
         address                 172.16.24.28
         }

So I give the IP address 172.16.24.28 and I get 5510-Toole as the 
returned value.

Is it possible?

Michael

-- 
    Michael Jewett
    Network Analyst
    ITS - Communications & Network Services
    mgj at unb.ca       (506) 447-3022       (506) 453-3590 (FAX)

    ITS at UNB - Services, Solutions, Strategies


-------- Original Message  --------
From: "Hans Wolters" <j.wolters at piramide.nl>
To: "Michael Jewett" <mgj at unb.ca>, "Ben Thomas" 
<bthomas at journalbroadcastgroup.com>
Subject: Re:[Nagios-users] Host name from IP address
Date: Mon Nov 06 2006 13:41:59 GMT-0400 (Atlantic Standard Time)

> Hi,
> 
> 
>  > I don't think I explained this properly.  I don't want to know the host
>  > name (DNS), I want know the name that Nagios knows it by, from the
>  > hosts.cfg file.
> 
>  >> So if you are not looking to write a script, just use ping -a <IP> in
>  >> windows and that will reverse dns the IP for you.  Then just do a ctl +
>  >> f in the config files.
> 
> Within perl it is not to hard:
> 
>         $iaddr = inet_aton($ipnumber);
>         $hostname = gethostbyaddr($iaddr, AF_INET);
> 
> Best regards,
> 
> Hans
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list