in reply to Re: Ping Script Error running on 64bit server
in thread Ping Script Error running on 64bit server

Since the code is designed to display the Nbtstat-a value if it does not match the host file. skipping would work but unfortunatly the script is no longer displaying if the Host is pingable or not output just reads
Hostname,IP,Alive,NBTHost,Port 55081 ComputerName,IP,Unknown status,,Closed
But it should have reported computername,IP,YES,,CLOSED this is only happening when we run the script from a Windows 64 bit OS.

Replies are listed 'Best First'.
Re^3: Ping Script Error running on 64bit server
by poj (Abbot) on Nov 18, 2017 at 11:31 UTC

    Try running a simplified version of the script and print the responses

    #!/usr/bin/env perl use warnings; use strict; my $serverlist = 'srvlst.txt'; open IN, '<',$serverlist or die "Run aborted. Cannot open endpoint list file ($serverlist)"; while (my $HOST = <IN>) { chomp $HOST; print "Pinging $HOST\n"; my $PingReply = `PING -n 1 -w 1 $HOST`; print "[$PingReply]\n"; if ($PingReply =~ /Reply from/) { my @Temp = split / /, $PingReply; my $IP = $Temp[2]; $IP =~ s/\[//g; $IP =~ s/\]//g; print "IP = [$IP]\n"; my $NBTResults = `nbtstat -a $IP | find \"UNIQUE\"`; print "nbtstat result [$NBTResults]\n"; } }
    poj