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.

Checking for Network Connection Stutus

If you have a question or need help, this is the place to be.
Post Reply
oncemore
Posts: 6
Joined: Sat Mar 15, 2014 12:33 am

Checking for Network Connection Stutus

Post by oncemore »

I have a few network connections (adapters) on my PC and I want to be able to check to see which ones are connected and then do different actions based on the results.

EG:
1) Check to see if Connection (adapter) X is connected.
2) If yes GOTO 5
3) If no, connect
4) Wait until connected (checking....checking...checking...done.)
5) Open program Y

How do I do this with EventGhost? I can't find a way to do it with "standard" EG. Is there a plugin or something that someone can recommend?
Last edited by oncemore on Wed Mar 19, 2014 1:12 am, edited 1 time in total.
oncemore
Posts: 6
Joined: Sat Mar 15, 2014 12:33 am

Re: Checking for Network Connection Stutus

Post by oncemore »

Anyone?

Not much life in this forum is there? :-(
pushpull
Posts: 8
Joined: Sun Mar 16, 2014 11:48 am

Re: Checking for Network Connection Stutus

Post by pushpull »

There is a ping plugin that looks for a response from a network device. As far as "connecting" are you talking about "waking on lan" a computer?
oncemore
Posts: 6
Joined: Sat Mar 15, 2014 12:33 am

Re: Checking for Network Connection Stutus

Post by oncemore »

Thanks for the reply.
pushpull wrote:There is a ping plugin that looks for a response from a network device.

Can you ping an adapter if you don't know the IP? (It's dynamic)

As far as "connecting" are you talking about "waking on lan" a computer?
For my steps 1 and 4 I want to find the status of a network adapter, such as, is the cable connected?, is the network connected? etc. ie, The sort of thing you would see in the "Network and Sharing Centre":
Untitled.jpg
or you would get from ipconfig in a command window:

Code: Select all

C:\Windows\system32>ipconfig

Windows IP Configuration


Ethernet adapter Local Area Connection 5:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Local Area Connection 3:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : blah::blah
   IPv4 Address. . . . . . . . . . . : 10.x.x.x
   Subnet Mask . . . . . . . . . . . : 255.255.255.252
   Default Gateway . . . . . . . . . :

Wireless LAN adapter Wireless Network Connection 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Then I can do something based on the status. This is the easy bit. I just execute a program which connects, as necessary. :-)
pushpull
Posts: 8
Joined: Sun Mar 16, 2014 11:48 am

Re: Checking for Network Connection Stutus

Post by pushpull »

If you don't know the IP because it is dynamic then the only way to ping it is by pinging the hostname. I have a laptop on my network called minibrain and if I ping it by it's hostname and it is off line then the response I get back is - Ping request could not find host minibrain. Please check the name and try again. If I ping it when it is on by the hostname it will display the host name followed by the IP in brackets and the received packets display the IP. If you ping it with the IP when it is off it will just time out after all four attempts. I don't know how the ping plugin works for EG. I would assume it would be set up to use either IP or hostname. It would seem that either way, a ping would be either be positive or negative and show up as such in the event logger as such. This applies for devices that are on your LAN and not accessed through the web. As far as ipconfig is concerned, this only displays information on the computer that the command is run on.
oncemore
Posts: 6
Joined: Sat Mar 15, 2014 12:33 am

Re: Checking for Network Connection Stutus

Post by oncemore »

pushpull wrote:If you don't know the IP because it is dynamic then the only way to ping it is by pinging the hostname.
The hostname is the computer EG is on (localhost) so I will always get an acknowledgment if I ping that.

I need to test if a specific adapter is connected, so I don't think ping will work.

pushpull wrote:As far as ipconfig is concerned, this only displays information on the computer that the command is run on.
Yep, exactly. I want information about the computer that EG is running on. Specifically, the status of various network adapters: connected/disconnected, if an IP has been allocated etc.
pushpull
Posts: 8
Joined: Sun Mar 16, 2014 11:48 am

Re: Checking for Network Connection Stutus

Post by pushpull »

Ping the adapter you want to know about. What exactly are you referring to when you say adapter? Are you talking about another computer, a print server, a NAS? My laptop has one hostname and another laptop on my network has another hostname as does the computer I run my music on as well as a computer I use as a server. I have a print server with another hostname. I have a host of hostnames so to say.
oncemore
Posts: 6
Joined: Sat Mar 15, 2014 12:33 am

Re: Checking for Network Connection Stutus

Post by oncemore »

pushpull wrote:Ping the adapter you want to know about.
How do I do that if I don't know it's IP, or even if it has one? Adapters don't have individual host names as far as I am aware.
pushpull wrote:What exactly are you referring to when you say adapter?
Ethernet NIC, WIFI connection, Bluetooth connection etc, real or virtual, built-in or USB etc
http://www.techopedia.com/definition/85 ... rk-adapter
The image of Windows Network Connections and the ipconfig output in my above post both refer to adapters, eg

Code: Select all

Ethernet adapter Local Area Connection 5:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
That stuff there ----------------------------------------^^^^^^^^^^^^^^^^^ "media disconnected" is the sort of thing I want to know.
pushpull wrote: I have a host of hostnames so to say.
:-) Yep, me too. And each of those objects (Server, Laptop etc) can have multiple adapters such as Ethernet LAN, WIFI etc.
kkl
Experienced User
Posts: 317
Joined: Wed May 04, 2011 9:32 pm

Re: Checking for Network Connection Stutus

Post by kkl »

Since you know the ipconfig command that gives you the result you are interested in, I'll throw out the following idea:

1. Using the Start Application action, run your Ipconfig command with the output redirected into a text file.
2. Use the File Operations plug-in to "read" the result of that text file. See example here.
Post Reply