Title: RE: [Nagios-users] Host name from IP address

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@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

Reply via email to