Host name from IP address
Hans Wolters
j.wolters at piramide.nl
Mon Nov 6 18:41:59 CET 2006
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20061106/c112fb39/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
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