in reply to Re: Pinging.
in thread Pinging.

You can use AdminMisc's GetHostAddress($DNS_Name) this will supply you with the IP address.

I would keep all the servers host names in a text file list. Then I read the complete list into an array like this

open(srv,"c:/server.txt")|| die "$^E\n"; chomp ( my @servers =<srv>);
then foreach item in the list get the Ip address.
Foreach my $srv (sort @servers){ my $ip = Win32::AdminMisc::GetHostAddress($srv); print "\nhost: $srv\tIp Address: $ip\n";}
Cheers,...Blackadder

Replies are listed 'Best First'.
Re: Re: Re: Pinging.
by Anonymous Monk on Aug 07, 2002 at 13:40 UTC
    hi there. is this script for win32? will this script do the required as described above? what i realy think i need it to do is telnet my servers ip address on port 25 and if it recieves a response (i.e it doesn't time out) then all is ok, else display an error message
      Have a look at this write up I had a week back. You could use just the check_host procedure if you want. It is platform independant. I'm using it on Win32 at the moment, and also had the same code execute on AIX 4.3.3 with NO problem. The script essentally does a TCP connect to the machine specified.