It is currently April 24th, 2024, 3:34 pm

network cumulative dl & up values with VPN tunnel

Get help with creating, editing & fixing problems with skins
lcs2023
Posts: 3
Joined: June 8th, 2023, 11:55 am

network cumulative dl & up values with VPN tunnel

Post by lcs2023 »

hi guys

i just want to monitor the cumulative download and upload bytes via my wi-fi network adapter, but it seems like once i am connected to a VPN, the cumulative values will be changed to the cumulative values of that VPN network. If i disconnect from VPN, the cumulative values will return to the wi-fi network's.

Do you guys know how to make the cumulative values remain as the wi-fi network's? I have tried using interface = best / alias / name / number but all doesn't seem to work..

here's my network.ini snippet:

Code: Select all

; ----------------------------------
;              VARIABLES
; ----------------------------------

[Variables]
;Wi-Fi is the alias name
interface=Wi-Fi

; ----------------------------------
;              MEASURES
; ----------------------------------

[measureIP]
Measure=WebParser
Url=http://checkip.dyndns.org
UpdateRate=600
RegExp="(?siU)Address: (.*)</body>"
StringIndex=1
Substitute="":"N/A"

[measureNetIn]
Measure=NetIn
MaxValue=#maxDownload#
Interface=#interface#

[measureNetInTotal]
Measure=NetIn
Cumulative=1
Interface=#interface#

[measureNetOut]
Measure=NetOut
MaxValue=#maxUpload#
Interface=#interface#

[measureNetOutTotal]
Measure=NetOut
Cumulative=1
Interface=#interface#

; ----------------------------------
;                METERS
; ----------------------------------

[meterDownloadValue]
Meter=STRING
MeterStyle=styleRightText
MeasureName=measureNetIn
MeasureName2=measureNetInTotal
X=200
Y=0r
W=190
H=14
Text="%1B/s (%2B)"
NumOfDecimals=1
AutoScale=1

[meterUploadValue]
Meter=STRING
MeterStyle=styleRightText
MeasureName=measureNetOut
MeasureName2=measureNetOutTotal
X=200
Y=0r
W=190
H=14
Text="%1B/s (%2B)"
NumOfDecimals=1
AutoScale=1

User avatar
Yincognito
Rainmeter Sage
Posts: 7155
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: network cumulative dl & up values with VPN tunnel

Post by Yincognito »

lcs2023 wrote: June 8th, 2023, 12:05 pm hi guys

i just want to monitor the cumulative download and upload bytes via my wi-fi network adapter, but it seems like once i am connected to a VPN, the cumulative values will be changed to the cumulative values of that VPN network. If i disconnect from VPN, the cumulative values will return to the wi-fi network's.

Do you guys know how to make the cumulative values remain as the wi-fi network's? I have tried using interface = best / alias / name / number but all doesn't seem to work..

here's my network.ini snippet:

Code: Select all

; ----------------------------------
;              VARIABLES
; ----------------------------------

[Variables]
;Wi-Fi is the alias name
interface=Wi-Fi

; ----------------------------------
;              MEASURES
; ----------------------------------

[measureIP]
Measure=WebParser
Url=http://checkip.dyndns.org
UpdateRate=600
RegExp="(?siU)Address: (.*)</body>"
StringIndex=1
Substitute="":"N/A"

[measureNetIn]
Measure=NetIn
MaxValue=#maxDownload#
Interface=#interface#

[measureNetInTotal]
Measure=NetIn
Cumulative=1
Interface=#interface#

[measureNetOut]
Measure=NetOut
MaxValue=#maxUpload#
Interface=#interface#

[measureNetOutTotal]
Measure=NetOut
Cumulative=1
Interface=#interface#

; ----------------------------------
;                METERS
; ----------------------------------

[meterDownloadValue]
Meter=STRING
MeterStyle=styleRightText
MeasureName=measureNetIn
MeasureName2=measureNetInTotal
X=200
Y=0r
W=190
H=14
Text="%1B/s (%2B)"
NumOfDecimals=1
AutoScale=1

[meterUploadValue]
Meter=STRING
MeterStyle=styleRightText
MeasureName=measureNetOut
MeasureName2=measureNetOutTotal
X=200
Y=0r
W=190
H=14
Text="%1B/s (%2B)"
NumOfDecimals=1
AutoScale=1

I cannot test this as I don't have your setup, but from the top of my head, have you read the notes in the manual for the Net measures, that say you cannot isolate LAN from WAN traffic with these measures? I'm asking because it looks similar to what you appear to want from the skin.

That being said, if the values indeed return to your WiFi exclusive after disconnecting from the VPN, maybe one way to get closer to what you want could be to try and parse the Stats file generated by Rainmeter in order to retain the WiFi values some other way in other measures, albeit that would probably be just the static value last recorded from where you were still not connected to the VPN.Or, you could manually store the WiFi values on every update, and pause that the moment you are connected to the internet via the VPN (which can be detected, of course). The latter approach will most likely produce the same result as trying to monitor the Stats file though, so the WiFi exclusive traffic for the duration of the VPN connection will still be unaccounted for.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
lcs2023
Posts: 3
Joined: June 8th, 2023, 11:55 am

Re: network cumulative dl & up values with VPN tunnel

Post by lcs2023 »

yup i have read the manual notes but doesn't seem to help
my objective is just to know the cumulative values of the wifi adapter.. the VPN data is also passing through the wifi adapter anyway. correct me if i am wrong.
User avatar
Yincognito
Rainmeter Sage
Posts: 7155
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: network cumulative dl & up values with VPN tunnel

Post by Yincognito »

lcs2023 wrote: June 9th, 2023, 11:18 am yup i have read the manual notes but doesn't seem to help
my objective is just to know the cumulative values of the wifi adapter.. the VPN data is also passing through the wifi adapter anyway. correct me if i am wrong.
Yes, the VPN data is also passing through the adapter, which is why you can't exclude it from the returned values (which will always be all data passing through the adapter irrespective of whether it's local or not), if that's what you want.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
lcs2023
Posts: 3
Joined: June 8th, 2023, 11:55 am

Re: network cumulative dl & up values with VPN tunnel

Post by lcs2023 »

Yincognito wrote: June 9th, 2023, 11:44 am Yes, the VPN data is also passing through the adapter, which is why you can't exclude it from the returned values (which will always be all data passing through the adapter irrespective of whether it's local or not), if that's what you want.
yup thats what i wanted
but it seems that the cumulative values will change when im connected to VPN
User avatar
SilverAzide
Rainmeter Sage
Posts: 2604
Joined: March 23rd, 2015, 5:26 pm

Re: network cumulative dl & up values with VPN tunnel

Post by SilverAzide »

lcs2023 wrote: June 9th, 2023, 12:12 pm yup thats what i wanted
but it seems that the cumulative values will change when im connected to VPN
I think you can do what you want, if I understand you correctly. You should be able to set the Interface option to the name of your VPN adapter, as in:

Code: Select all

Interface=Nord VPN Adapter
You can find the name using Powershell:

Code: Select all

Get-WmiObject -Class MSFT_NetAdapter -Namespace root\StandardCimv2 | Sort-Object -Property InterfaceType, Virtual, InterfaceDescription | Format-Table -Property @{Label='Interface Name'; Expression={$_.InterfaceDescription}}, @{Label='Connection'; Expression={$_.Name}}, Virtual, State, @{Label='Type'; Expression={$_.InterfaceType}} -AutoSize
Your "Wi-Fi" interface will show activity all the time, but the VPN adapter should only show activity when it is active.

If you are using the Cumulative=1 option, and you want very accurate info, you should know that this feature does not work well (or not reliably, anyway) in Rainmeter. You'll need to use an alternative approach for this.
Gadgets Wiki GitHub More Gadgets...
User avatar
Yincognito
Rainmeter Sage
Posts: 7155
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: network cumulative dl & up values with VPN tunnel

Post by Yincognito »

SilverAzide wrote: June 9th, 2023, 4:09 pm I think you can do what you want, if I understand you correctly.
I believe he wants the other (cumulative) data, i.e. only the WiFi one, without the VPN... :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2604
Joined: March 23rd, 2015, 5:26 pm

Re: network cumulative dl & up values with VPN tunnel

Post by SilverAzide »

Yincognito wrote: June 9th, 2023, 4:15 pm I believe he wants the other (cumulative) data, i.e. only the WiFi one, without the VPN... :???:
That can be done, I think, but you can't use cumulative for all adapters because values will be doubled. You need to sum them individually. And you must get the stats by adapter name, not by connection, or "Best", etc.
Gadgets Wiki GitHub More Gadgets...