Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Ping - Ping unsuccessful due to unavailable network

Questions and comments specific to a particular plugin should go here.
Post Reply
tmetcalfe
Posts: 6
Joined: Fri Jun 15, 2012 8:52 pm

Ping - Ping unsuccessful due to unavailable network

Post 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?
Sem;colon
Plugin Developer
Posts: 625
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Ping - Ping unsuccessful due to unavailable network

Post by Sem;colon »

Hello tmetcalfe,

are you useing the latest version of the ping plugin (that comes with the latest version of EventGhost)?
If you like my work, Image me a drink :wink:
tmetcalfe
Posts: 6
Joined: Fri Jun 15, 2012 8:52 pm

Re: Ping - Ping unsuccessful due to unavailable network

Post 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.
Sem;colon
Plugin Developer
Posts: 625
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Ping - Ping unsuccessful due to unavailable network

Post 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!
If you like my work, Image me a drink :wink:
tmetcalfe
Posts: 6
Joined: Fri Jun 15, 2012 8:52 pm

Re: Ping - Ping unsuccessful due to unavailable network

Post 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
Sem;colon
Plugin Developer
Posts: 625
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Ping - Ping unsuccessful due to unavailable network

Post 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??
If you like my work, Image me a drink :wink:
tmetcalfe
Posts: 6
Joined: Fri Jun 15, 2012 8:52 pm

Re: Ping - Ping unsuccessful due to unavailable network

Post 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.
Sem;colon
Plugin Developer
Posts: 625
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Ping - Ping unsuccessful due to unavailable network

Post 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"??
If you like my work, Image me a drink :wink:
tmetcalfe
Posts: 6
Joined: Fri Jun 15, 2012 8:52 pm

Re: Ping - Ping unsuccessful due to unavailable network

Post 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!
Post Reply