Ok, here's an improved version that checks for failed pings as well and cleans up the output. Usage is the same as before. Again, watch for wrapping, there should be 14 lines.
-------PingResponse.bat------- @echo off :top set PingResponse=PingFailed for /f "delims=<m=; tokens=5" %%i in ('ping %1 -n 1^|find "Reply"') do set /A PingResponse=%%i echo %PingResponse% if %PingResponse% LSS %2 goto top if %PingResponse%==PingFailed goto failed echo blat - -body "Ping response was %PingResponse% milliseconds." -server mailserver.com -f m...@self.com -subject "Ping was too long" -to m...@self.com blat - -body "Ping response was %PingResponse% milliseconds." -server mailserver.com -f m...@self.com -subject "Ping was too long" -to m...@self.com goto top :failed echo blat - -body "Ping failed." -server mailserver.com -f m...@self.com -subject "Ping failed." -to m...@self.com blat - -body "Ping failed." -server mailserver.com -f m...@self.com -subject "Ping failed." -to m...@self.com goto top -------PingResponse.bat------- From: Crawford, Scott [mailto:crawfo...@evangel.edu] Sent: Wednesday, August 17, 2011 5:43 PM To: NT System Admin Issues Subject: RE: Need a free ping monitor with email notification for a handful of devices Cheap and dirty, but might do the trick. Usage is: PingResponse IP AcceptableTime For example, PingResponse google.com 10 would repeatedly ping google and if it was ever over 10 milliseconds, blat will email you. Note that there's only 5 lines so watch wrapping. Also, this will not message you when ping returns a request time out so if 5 seconds is too short, you modify the ping command in line 2 with -w to change the timeout. -------PingResponse.bat------- :top for /f "delims=m=; tokens=5" %%i in ('ping %1 -n 1^|find "Reply"') do set /A PingResponse=%%i if %PingResponse% LSS %2 goto top blat - -body "Ping response was %PingResponse% milliseconds." -server mailserver.com -f m...@self.com<mailto:m...@self.com> -subject "Ping was too long" -to m...@self.com<mailto:m...@self.com> goto top -------PingResponse.bat------- From: Jonathan [mailto:ncm...@gmail.com]<mailto:[mailto:ncm...@gmail.com]> Sent: Wednesday, August 17, 2011 4:38 PM To: NT System Admin Issues Subject: Re: Need a free ping monitor with email notification for a handful of devices Thanks, but it doesn't look like Servers Alive will do what I need. Essentially, I need a continuous ping: Reply from 10.10.10.10<http://10.10.10.10>: bytes=32 time=15ms TTL=245 Reply from 10.10.10.10<http://10.10.10.10>: bytes=32 time=15ms TTL=245 Reply from 10.10.10.10<http://10.10.10.10>: bytes=32 time=15ms TTL=245 Reply from 10.10.10.10<http://10.10.10.10>: bytes=32 time=15ms TTL=245 Reply from 10.10.10.10<http://10.10.10.10>: bytes=32 time=15ms TTL=245 Reply from 10.10.10.10<http://10.10.10.10>: bytes=32 time=15ms TTL=245 Reply from 10.10.10.10<http://10.10.10.10>: bytes=32 time=19ms TTL=245 Reply from 10.10.10.10<http://10.10.10.10>: bytes=32 time=14ms TTL=245 Reply from 10.10.10.10<http://10.10.10.10>: bytes=32 time=15ms TTL=245 and send an alert to one or more configurable email addresses if time >= x ms for more than y pings, where x and y would be configurable by me. >From an up/down perspective, servers alive would be fine, but I need to be >able to tell what the link latency is between two endpoints. Anything more >than 90 ms could be problematic for me... Jonathan On Wed, Aug 17, 2011 at 3:56 PM, Stephen Wimberly <riverside...@gmail.com<mailto:riverside...@gmail.com>> wrote: Servers Alive used to monitor 10 for free http://www.woodstone.nu/salive/features.php ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com> with the body: unsubscribe ntsysadmin -- Jonathan, A+, MCSA, MCSE ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com> with the body: unsubscribe ntsysadmin ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com> with the body: unsubscribe ntsysadmin ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to listmana...@lyris.sunbeltsoftware.com with the body: unsubscribe ntsysadmin