Page 1 of 1
Ping - Ping unsuccessful due to unavailable network
Posted: Fri Dec 06, 2013 10:59 pm
by tmetcalfe
The Idea
Determine whether or not my PC is connected to the internet.
The Attempt
Using Ping plugin, attempt to ping
http://www.google.com. Fire GOOGLE_IS_ALIVE on success, GOOGLE_IS_DEAD on failure.
The Problem
Works just fine on a successful ping, but on a failure get the following...
Code: Select all
Error in Action: "Ping: One Ping Now: www.google.com"
Traceback (most recent call last) (1610):
File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
return self(*args)
File "C:\Program Files (x86)\EventGhost\plugins\Ping\_init_.py", line 132, in _call_
result = pyPing.Ping(dummyEvent)
File "C:\Program Files (x86)\EventGhost\plugins\Ping\_init_.py", line 549, in Ping
self.SendOnePing()
File "C:\Progrm Files (x86)\EventGhost\plugins\Ping\_init_.py", line 508, in SendOnePing
dest_addr = socket.gethostbyname(self.hostName)
gaierror: [Errno 11004] getaddrinfo failed
and no Main.GOOGLE_IS_DEAD event. Have I misconfigured the Ping plugin? Is this just what it does when the computer is not connected to the internet? If so, is there a better way to go about accomplishing what I want to accomplish?
Re: Ping - Ping unsuccessful due to unavailable network
Posted: Tue Dec 10, 2013 1:07 pm
by Sem;colon
Hello tmetcalfe,
are you useing the latest version of the ping plugin (that comes with the latest version of EventGhost)?
Re: Ping - Ping unsuccessful due to unavailable network
Posted: Tue Dec 10, 2013 6:33 pm
by tmetcalfe
Sem;colon wrote:Hello tmetcalfe,
are you useing the latest version of the ping plugin (that comes with the latest version of EventGhost)?
Now I am, just updated it. Tinkered with the plugin's config, but I can't figure out what to put for the string to look for on a successful ping.
Re: Ping - Ping unsuccessful due to unavailable network
Posted: Tue Dec 10, 2013 8:29 pm
by Sem;colon
Hello tmetcalfe,
usually the default works just fine - anyway if not, go to "satrt"->"run" and open "cmd.exe".
A black box appears.
Type "ping
www.google.com" and hit enter.
You will get about 4 lines telling you that google answers, you can choose any part of the repy. (I recommend the value of "Bytes" which is "=32" for me - but obviously not for you

)
You could also try "Bytes=" itself...
I hope this helps!
Re: Ping - Ping unsuccessful due to unavailable network
Posted: Wed Dec 11, 2013 2:32 am
by tmetcalfe
Sem;colon wrote:Hello tmetcalfe,
usually the default works just fine - anyway if not, go to "satrt"->"run" and open "cmd.exe".
A black box appears.
Type "ping
http://www.google.com" and hit enter.
You will get about 4 lines telling you that google answers, you can choose any part of the repy. (I recommend the value of "Bytes" which is "=32" for me - but obviously not for you

)
You could also try "Bytes=" itself...
I hope this helps!
I had hoped that would be the solution, but alas, after trying "time=", "time", "=" or "ms", a failure is returned regardless of whether I'm connected to the net or not.
This is what I get from using the ping command using the command prompt:
Code: Select all
Pinging www.google.com [2607:f8b0:4000:805::1011] with 32 bytes of data:
Reply from 2607:f8b0:4000:805::1011: time=78ms
Reply from 2607:f8b0:4000:805::1011: time=69ms
Reply from 2607:f8b0:4000:805::1011: time=63ms
Reply from 2607:f8b0:4000:805::1011: time=63ms
Ping statistics for 2607:f8b0:4000:805::1011:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 63ms, Maximum = 78ms, Average = 68ms
Re: Ping - Ping unsuccessful due to unavailable network
Posted: Wed Dec 11, 2013 10:17 pm
by Sem;colon
that's interesting, you're pinging in IPv6...
But that shouldn't make a problem, but please try "ping -4
www.google.com" anyway.
Can you post the Error you get??
Re: Ping - Ping unsuccessful due to unavailable network
Posted: Thu Dec 12, 2013 6:03 am
by tmetcalfe
Hadn't even thought of the difference between IPv6 and IPv4. In any case, I -4'd it and "bytes=32 time=62ms TTL=51" was what I got for each ping. Ignoring "time=##ms" showing up, I plugged in "bytes", and "TTL" and still all I get is GOOGLE_IS_DEAD, my failure message. I'm not getting any error message with the new ping plugin.
Re: Ping - Ping unsuccessful due to unavailable network
Posted: Thu Dec 12, 2013 7:28 pm
by Sem;colon
hmm... Did you try choosing a higher "Time to wait for the host.."? Like 3000??
Does it work if you use "add host" instead of "one ping now"??
Re: Ping - Ping unsuccessful due to unavailable network
Posted: Fri Dec 13, 2013 3:44 am
by tmetcalfe
Sem;colon wrote:hmm... Did you try choosing a higher "Time to wait for the host.."? Like 3000??
Does it work if you use "add host" instead of "one ping now"??
I jacked the time to wait up to 3000 and nothing, but changing it to "add host" fixed it. Think I like this method better in any case. Thanks for your help!