Re: Remote pinging dilemma

From: gabor salai (gabor.salai_at_euroherc.hr)
Date: 02/28/05


Date: Mon, 28 Feb 2005 09:15:46 +0100


"D.P. Roberts" <dproberts@pbride.com> wrote in message
news:#N8BgkEHFHA.904@tk2msftngp13.phx.gbl...
> I have a lab of 50 xp pro machines, and sometimes I need a quick way to
ping
> all 50 to find out which ones (if any) aren't reachable. So the script
would
> need to ping each client one time, and then return the computername or IP
> address of any that didn't reply. Anyone know if this is possible?
>
> Thanks!

not to be the best possible solution, but works, i use .bat files
for pinging and logging. there are two files, one [ping1.bat] with ip
addresses, and other [ping2.bat] with working loop
"cr.dat" is simple file consisting of cr/lf to simulate "enter" user input
it appears that the easiest way is to specifay all addresses to ping in
editor in outer procedure [ping1.bat]
ping1.bat is entry point for task schedular, so i have scanned
complete network every often, 24/24
just to mention, that sometimes [doue to overload, or router inercy]
single ping is not enough to check activity, so i have additional check
if first single ping fails. this is fully working example, just adjust
paths.

---------ping1.bat
@echo off
set LOG=d:\schedule\ping1.log
set BAT=c:\batl\schedule
echo ----------->>%LOG%
date <cr.dat | find "Current" >>%LOG%
time <cr.dat | find "Current" >>%LOG%

echo ws name1 ...
call %BAT%\ping2 10.82.0.11 %LOG%
echo ws name2 ...
call %BAT%\ping2 212.39.98.162 %LOG%
echo ws name3 ...
call %BAT%\ping2 10.31.0.203 %LOG%
rem here goes the rest of the list ...
rem ...
echo finished
echo.>>%LOG%
---------------

---------ping2.bat
rem %1 address to check
rem %2 log file
set WRK=d:\schedule\ping2.tmp
ping -n 1 %1 > %WRK%
find "Reply" %WRK% > nul
if not errorlevel 1 goto lab1
echo extended...
ping %1 >> %WRK%
find "Reply" %WRK% > nul
if not errorlevel 1 goto lab1
echo failed!
:lab1
type %WRK% >> %2
-----------



Relevant Pages

  • Re: ask for sample ping source code without IP protocal stack
    ... > a ping echo program based on the ethernet driver, ... > and ICMP header are correct, but Windows ping can not receive my echo. ...
    (comp.arch.embedded)
  • Re: [fw-wiz] ECHO Protocol
    ... Yes, I know that there are alternate "ping" programs that will allow you to use TCP, UDP or possibly anything that programmer could think of, but the traditional ping uses ICMP. ... Two of the ICMP types are referred to as echo and echo reply, which are the ICMP types used for ping. ... Ping command in Windows uses ICMP protocol, while others say that Ping uses ...
    (Firewall-Wizards)
  • dhclient doesnt respond to DHCP OFFER
    ... It has two pcmcia nework cards - one connected to ... Echo (ping) request ...
    (comp.os.linux.networking)
  • Re: Judge bans Navy from using sonar off Southern California
    ... the 'high powered sonar' referred to is _Active_ sonar. ... returning echo enable more information about the echoing surface can be ... thumb that a target can hear the 'ping' long before the transmitter ...
    (sci.military.naval)