Network monitor with history graph, total usage

Post your working scripts, libraries and tools
drozdman
Posts: 18
Joined: 05 Dec 2015, 01:07

Network monitor with history graph, total usage

14 Mar 2018, 19:51

I had to make this network monitor, since I had some problems with the Network Meter gadget in Vista sidebar. Network Meter is still very good and, as far as I know, the only gadget like that, btw.
I didn't want to be dependent on the sidebar, even though one can still get on the net the sidebar working on the newer shoddy versions of Windows (even on the Windows 8 abomination).

I needed separate history graphs for download and upload, because the same scale for both is not informative enough. I had some problems with readability, too. Anyway, it's always better to be able to customize a program to one's needs.

So this script does it. It depends on the great Gdip library by tic (graphics functions) and XNET module by SKAN for calculating traffic. AHK is about a team work so I have to link to Sean who started the work on this problem.

I copied the necessary functions in the script itself, so to save the trouble.

AHK limitation: program is suspended while the right click context menu is on. It's worth to remember.

Image


Also posted here

Save the file in Unicode or UTF-8 with signature (not in UTF-8 as it is chosen with the download feature here - it messes up unicode characters).

Code: [Select all] [Expand] [Download] (Drozd_Net_monitor.ahk)GeSHi © Codebox Plus



Drozd_Net_monitor2 st.png
Drozd_Net_monitor2 st.png (15.97 KiB) Viewed 58 times
Last edited by drozdman on 01 May 2018, 12:50, edited 5 times in total.
User avatar
gregster
Posts: 1061
Joined: 30 Sep 2013, 06:48

Re: Network monitor with history graph, total usage

14 Mar 2018, 22:34

Looks interesting - seems useful with good design. Thank you - also for your CPU monitor script!

Background color doesn't seem to change for me, if I choose it in the settings. Will investigate when I have time. (I am on Win 10 btw)
drozdman
Posts: 18
Joined: 05 Dec 2015, 01:07

Re: Network monitor with history graph, total usage

15 Mar 2018, 00:56

gregster wrote:Background color doesn't seem to change for me, if I choose it in the settings.


It must be restarted. It loads new settings from .ini file.
It's better to place the script outside C:\Program Files folder, so the permissions issues don't create problems.
User avatar
gregster
Posts: 1061
Joined: 30 Sep 2013, 06:48

Re: Network monitor with history graph, total usage

15 Mar 2018, 01:12

drozdman wrote:
gregster wrote:Background color doesn't seem to change for me, if I choose it in the settings.


It must be restarted. It loads new settings from .ini file.
It's better to place the script outside C:\Program Files folder, so the permissions issues don't create problems.

Oh, yeah, thank you for the feedback. I checked that out by now... your CPU monitor gave a hint about re-starting in the right-click menu ;) . Thanks again.
brutus_skywalker
Posts: 142
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Network monitor with history graph, total usage

17 Mar 2018, 00:01

Just Freaking Awesome dude, along with CPU monitor,no more rainmeter widgets for me... :bravo:
Last edited by brutus_skywalker on 21 Mar 2018, 01:08, edited 2 times in total.
Outsourcing Clicks & Presses Since 2004.
brutus_skywalker
Posts: 142
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Network monitor with history graph, total usage

21 Mar 2018, 01:06

I've noticed two bugs, one is on the stats where the script doesn't recognize changes in days especially if you close it & run it again another day it's 'current download' stats will be the same as from the day it was closed and it will resume in that manner,i patched mine by resetting 'current download/upload' at least once a day provided it wasn't already reset. Another thing i noticed is the interface detected and the IP that corresponds to it don't correlate.

Not really a big deal,and i fixed it for my self, but i thought you'd want to fix it for others minus sloppy fixes i tend to make...
Outsourcing Clicks & Presses Since 2004.
User avatar
gregster
Posts: 1061
Joined: 30 Sep 2013, 06:48

Re: Network monitor with history graph, total usage

21 Mar 2018, 01:28

For me, external and internal IPs (which are different) are both correct. Are you sure, you looked at the right thing?
drozdman
Posts: 18
Joined: 05 Dec 2015, 01:07

Re: Network monitor with history graph, total usage

21 Mar 2018, 11:47

brutus_skywalker wrote:I've noticed two bugs, one is on the stats where the script doesn't recognize changes in days especially if you close it & run it again another day it's 'current download' stats will be the same as from the day it was closed and it will resume in that manner,
.


"Today" means here: since last shutdown. The script detects shutdown and then starts a new day count. It doesn't clear the data after closing the script or after standby or hibernation. There must be a shutdown detected to clear the "Today" data. That was better for me.

brutus_skywalker wrote: Another thing i noticed is the interface detected and the IP that corresponds to it don't correlate..


Not sure why. It should work. You mean external or internal?
External IP should be the same as this: http://checkip.dyndns.org/
brutus_skywalker
Posts: 142
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Network monitor with history graph, total usage

21 Mar 2018, 22:28

drozdman wrote:
brutus_skywalker wrote:I've noticed two bugs, one is on the stats where the script doesn't recognize changes in days especially if you close it & run it again another day it's 'current download' stats will be the same as from the day it was closed and it will resume in that manner,
.


"Today" means here: since last shutdown. The script detects shutdown and then starts a new day count. It doesn't clear the data after closing the script or after standby or hibernation. There must be a shutdown detected to clear the "Today" data. That was better for me.

brutus_skywalker wrote: Another thing i noticed is the interface detected and the IP that corresponds to it don't correlate..


Not sure why. It should work. You mean external or internal?
External IP should be the same as this: http://checkip.dyndns.org/



Cool, but given i don't reboot for days or months even,i'd rather have 'Today' indicate today's stats,so for anyone who feels the same here's my snippet,it resets 'Today' stat at least once a day.

Code: [Select all] [Expand] [Download] (file.ahk)GeSHi © Codebox Plus



As for the IP error, it actuall works when i'm using a VPN,protonVPN which creates TAP interface device or even when i'm on wifi but for some reason, my router connected ethernet device is indicated as having the IP of another Wifi Adapter,and yes i wasn't running the vpn when i saw the anomaly,it's no big deal i suppose, i just thought i'd point it out. It might have something to do with the fact that i have multiple adapters with an internet connection,especially given running the VPN renders it the only adapter with an internet connection,so possibly multiple connection options is the problem.
Outsourcing Clicks & Presses Since 2004.
drozdman
Posts: 18
Joined: 05 Dec 2015, 01:07

Re: Network monitor with history graph, total usage

22 Mar 2018, 11:44

@brutus_skywalker

Even with VPN the external IP check should work.
But the multiple networks may be the problem. When you have LAN and WiFi on Windows it's hard to know which one the OS will choose.
I would try to restart XNET on change of network (refresh manually). Maybe it will work.

Code: [Select all] [Download] GeSHi © Codebox Plus

Net=
Net := new XNET(True)
brutus_skywalker
Posts: 142
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Network monitor with history graph, total usage

23 Mar 2018, 07:33

drozdman wrote:@brutus_skywalker

Even with VPN the external IP check should work.
But the multiple networks may be the problem. When you have LAN and WiFi on Windows it's hard to know which one the OS will choose.
I would try to restart XNET on change of network (refresh manually). Maybe it will work.

Code: [Select all] [Download] GeSHi © Codebox Plus

Net=
Net := new XNET(True)



Works beautifully thanks much,i didn't realize it,but the reading actually also stopped when it was displaying the wrong network device & IP. And instead of manually resetting i opted for automatic reset every time a new IP was detected,the reset seemingly selects the network interface that the browser as well as other internet connected applications will use as well, so perfect solution. ;)

FIXED: my snippet to additionally refresh the IP and the interface on the GUI the moment an IP change is detected

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Outsourcing Clicks & Presses Since 2004.
Helgef
Posts: 2898
Joined: 17 Jul 2016, 01:02
Contact:

Re: Network monitor with history graph, total usage

25 Mar 2018, 07:22

very nice, thanks for sharing :bravo:.

Cheers.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: kunkel321, Rado_K and 14 guests