Solved

How to Ping 2 websites

Posted on 2011-02-20
21
287 Views
Last Modified: 2012-05-11
Experts,

I am stuck on how to figure out how to Ping yahoo.com 3 separate times and google.com 3 separate times waiting 1 minute between pings.   I looked at the supported data for my previous question cant seem to get it to work.  

My thoughts:

Not sure how what the syntax would be for 2 websites but for one I was thinking
ping -w 60000 -n 3 www.google.com

After researching I realized that -w is only to be used for a wait before a timeout.  Any ideas?  I am looking to have it wait 1 minute between a total of 6 pings to yahoo and google.  
0
Comment
Question by:Maliki Hassani
  • 11
  • 8
  • 2
21 Comments
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
@echo off
ping -n 3 www.yahoo.com
sleep 60
ping -n 3 www.googl.com

Open in new window


and use sleep from here

http://www.computerhope.com/dutil.htm
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
sleep is just a simple utility, to pause for however many seconds

sleep <seconds to sleep>

simple use.
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
typo missed the e off google!
0
 

Author Comment

by:Maliki Hassani
Comment Utility
So for the 1 - 4 steps am I hitting enter?  Wouldn't that just run it and never get to step 4?
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
no it runs' puses for 60 seconds and contiues.

you need to copy and paste into a batch file, called pingtest.bat
0
 

Author Comment

by:Maliki Hassani
Comment Utility
Sorry, I am not sure how to create a batch file. Let me google this..
0
 
LVL 6

Expert Comment

by:t-max
Comment Utility
Usually I use "ping -n 60 localhost" to wait 1 minute. You can put that between your other pings to make a one-minute delay. Hope this helps. Good luck!
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
notepad pingtest.bat

cut and paste the above into notepad.

Save the file.

download sleep into same folder as batch file.

run pingtest.bat
0
 

Author Comment

by:Maliki Hassani
Comment Utility
Thanks T-max
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
ping -n 60 is 60 counts, not 60 seconds. (it could be close, but you've got more than 3 pings!)

still need a batch file.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
and if you response time is slower, then it will be longer than 60 seconds.
0
 

Author Comment

by:Maliki Hassani
Comment Utility
Okay so I did what you said and it only waits 60 seconds then ends..  It should wait 60 seconds for 6 times.  Am I reading this wrong?
0
 

Author Comment

by:Maliki Hassani
Comment Utility
what about:

ping -n 1 www.yahoo.com
sleep 60
ping -n 1 www.yahoo.com
sleep 60
ping -n 1 www.yahoo.com
sleep 60

ping -n 1 www.google.com
sleep 60
ping -n 1 www.google.com
sleep 60
ping -n 1 www.google.com
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
that will work, if you want to ping, wait 60 seconds, send another ping etc
0
 

Author Comment

by:Maliki Hassani
Comment Utility
Great thanks for the cool trick!
0
 
LVL 117

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE) earned 500 total points
Comment Utility
yes, okay, I just re-read the question, and missed "separate".
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
yes, sleep is a handy utility to have around.
0
 

Author Comment

by:Maliki Hassani
Comment Utility
oh and what can I do from having it close the dos window after completion?
0
 
LVL 6

Expert Comment

by:t-max
Comment Utility
Right, -n 60 is the number of icmp packages you send, with a one minute delay.
Because you ping localhost or even your network IP, the response time won't an issue.
Moreover, there's an advantage pinging your network IP, because you can also discover at the same time if you are having issues with your network card, something that sleep won't tell you because it's only a cpu check.
0
 

Author Comment

by:Maliki Hassani
Comment Utility
Okay, that makes sense..  I ran it your way and it pinged 60 times. It is  great way for what you are talking about though.
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
you could use a pause in the batch file?
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now