Network Plugin

Questions and comments specific to a particular plugin should go here.
Post Reply
User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Network Plugin

Post by kgschlosser » Sat Jun 13, 2020 7:14 am

Network Plugin
V0.0.1b


I was reading over the Windows SDK and I came upon the networking components. I thought wouldn't it be nice to have the ability to respond to changes to a PC's ip address. or gateway. perhaps the DNS servers.
Then I thought hmmm. It would be something to know what could be wrong if an internet connection goes south for some reason. we have all see this kind of an issue take place where the internet connection is 1/2 way working.

So I put together this plugin which will tell you if there are problems with your local DHCP server, It will also tell you if there is a problem with your local router (like it needing to be reset) I went one step further. in the event of an internet issue other then your local router. Like a complete drop of your internet connection you will get an event telling you of a DHCP issue with your WAN. If you have a correct IP from your ISP and packets are able to be router through your router to that public IP address we know there is not an issue locally. I then check the DNS servers. If there is no name resolution but I am able to access the internet using ip addresses you will be told there is a WAN DNS issue. If we are able to route through your local router but are unable to access the internet completely then there is a gateway problem with your ISP and you will get a WAN Gateway error event.

If you change the name of a network adapter you will get an event. If you change ip, dns, gateway of a network adapter eg will have an event for it. if you enable or disable ipv4 or ipv6.. you guessed it.
If you add or remove an adapter. event


There is a single action that you can use. This is to obtain your public WAN ip address. It returns both the ipv6 and ipv4 addresses in a dictionary.

Have fun playing.
Attachments
Network-v0.0.1b.egplugin
(89.47 KiB) Downloaded 123 times
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 378
Joined: Fri Jul 03, 2009 10:04 am

Re: Network Plugin

Post by Snowbird » Thu Aug 27, 2020 9:12 am

Hey K,

just wanted to try out your plugin, but it doesn't seem to load as expected

Code: Select all

27/08  11:10:04   Exception in thread Thread-7:
27/08  11:10:04   Traceback (most recent call last):
27/08  11:10:04     File "threading.pyc", line 801, in __bootstrap_inner
27/08  11:10:04     File "threading.pyc", line 754, in run
27/08  11:10:04     File "C:\ProgramData\EventGhost\plugins\Network\__init__.py", line 148, in loop
27/08  11:10:04       last_config = windows.get_adapters()
27/08  11:10:04     File "C:\ProgramData\EventGhost\plugins\Network\windows\__init__.py", line 117, in get_adapters
27/08  11:10:04       raise ctypes.WinError()
27/08  11:10:04   WindowsError: [Error 0] The operation completed successfully.

Snowbird
Experienced User
Posts: 378
Joined: Fri Jul 03, 2009 10:04 am

Re: Network Plugin

Post by Snowbird » Thu Aug 27, 2020 9:22 am

is there a way to detect when the internet connection goes down, I know this question has been asked a lot and even got answers, but I wish we can go further, and for example "pause" all plugins that make use of networking until the connection goes up again ? This will avoid so many error messages and the need to reload certain plugins to make them work fine again when the connection is dropped. I always thought that such functionality should have been embedded in EG core, networking nowadays is omnipresent and programs such as EG should be able to detect and do some clever actions when the internet is gone.

User avatar
Medy
Experienced User
Posts: 206
Joined: Sat Nov 15, 2014 8:33 pm
Location: Germany

Re: Network Plugin

Post by Medy » Tue Jun 08, 2021 11:15 am

Snowbird wrote:
Thu Aug 27, 2020 9:22 am
is there a way to detect when the internet connection goes down, I know this question has been asked a lot and even got answers, but I wish we can go further, and for example "pause" all plugins that make use of networking until the connection goes up again ? This will avoid so many error messages and the need to reload certain plugins to make them work fine again when the connection is dropped. I always thought that such functionality should have been embedded in EG core, networking nowadays is omnipresent and programs such as EG should be able to detect and do some clever actions when the internet is gone.

You can send a request to a website and see if it goes through ...
or usually you would use google dns server for example

you create a little script for that and add it for every makro / action you do.
here you can find some possible aproaches.

https://stackoverflow.com/questions/376 ... connection

Post Reply