It is currently May 4th, 2024, 1:52 am

how to separate internet traffic and home network traffic

Report bugs with the Rainmeter application and suggest features.
cosmicblu
Posts: 1
Joined: March 17th, 2013, 3:15 am

how to separate internet traffic and home network traffic

Post by cosmicblu »

dear amigos,
i need a method to distinguish internet traffic and home network traffic
in rainmeter skins.

i use a modified illustro skin to measuremy cumulative network usage but it seems to be polluted with the added amount of my network traffic between my home computers through the home network.



appending my current code:

Code: Select all

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
; Lines starting ; (semicolons) are commented out.
; That is, they do not affect the code and are here for demonstration purposes only.
; ----------------------------------

[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Author=poiru
AppVersion=2000000
Update=1000

[Metadata]
; Contains basic information of the skin.
Description=Shows your IP address and network activity.
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0

[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Digital Sans EF
textSize=10
colorBar=19A2DE
colorText=255,255,255,205
maxDownload=10485760
MaxUpload=10485760
; Set maxDownload and maxUpload to your maximum download and upload speed in bits.
; To convert kilobits, megabits, kilobytes, and megabytes into bits, go to http://www.google.com
; and search for something like "10 megabytes in bits".

; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------

[measureIP]
; This measure returns your IP. WebParser measures are relatively complicated. If you're a beginner with
; Rainmeter, take a look at some of the other illustro skins before modifying this one.
Measure=Plugin
Plugin=WebParser.dll
Url=http://checkip.dyndns.org
UpdateRate=14400
RegExp="(?siU)Address: (.*)</body>"
StringIndex=1
Substitute="":"Offline"
; Substitute works as follows: "A":"B" where A is a string to substitute and B is a string
; to substitute with. In this case, it substutes "" (i.e. empty) to N/A

[measureNetIn]
Measure=NetIn
NetInSpeed=#maxDownload#
; NetInSpeed must be set so your maximun download speed for the download bar to scale correctly

[measureNetOut]
Measure=NetOut
NetOutSpeed=#maxUpload#

[mdtot]
Measure=NetIn
Cumulative=1

[mutot]
Measure=NetOut
Cumulative=1

[mtot]
Measure=NetTotal
Cumulative=1

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=CENTER
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

[styleSeperator]
SolidColor=255,255,255,15

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meter bgimg]
Meter=IMAGE
X=0
Y=0
W=20
H=20
ImageName=#SKINSPATH#\Active.png
[meterBackground]
Meter=IMAGE
;ImageName=#SKINSPATH#\illustro\SHARED\Background6Line.png
; #SKINSPATH# is a global variable that stands for your skin path. It is
; usually Documents\Rainmeter\Skins.
X=0
Y=0

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=100
Y=12
W=190
H=18
Text="Network"
; Even though the text is set to Network, Rainmeter will display
; it as NETWORK, because styleTitle contains StringCase=UPPER.

[meterIPLabel]
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=40
W=190
H=14
Text="IP Address"

[meterIPValue]
Meter=STRING
MeterStyle=styleRightText
MeasureName=measureIP
X=200
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text="%1"
; %1 stands for the value of MeasureName (measureIP in this case).

;[meterSeperator]
;Meter=IMAGE
;MeterStyle=styleSeperator
;X=10
;Y=52
;W=190
;H=1

[meterUploadLabel]
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=60
W=190
H=14
Text="Upload"

[meterUploadValue]
Meter=STRING
MeterStyle=styleRightText
MeasureName=measureNetOut
X=200
Y=0r
W=190
H=14
Text="%1B/s"
NumOfDecimals=1
AutoScale=1k
; Because measureIP returns the current upload speed in bytes, we must use AutoScale=1 to
; automatically scale the value into a more readable figure.

[meterUploadBar]
Meter=BAR
MeterStyle=styleBar
MeasureName=measureNetOut
X=10
Y=75
W=190
H=4

[meterDownloadLabel]
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=80
W=190
H=14
Text="Dwnlod"

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

[meterDownloadBar]
Meter=BAR
MeterStyle=styleBar
MeasureName=measureNetIn
X=10
Y=95
W=190
H=4

[mdtotLabel]
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=120
W=190
H=14
Text="T Dwnld"

[mdtotValue]
Meter=STRING
MeterStyle=styleRightText
MeasureName=mdtot
X=200
Y=0r
W=190
H=14
Text="%1B"
NumOfDecimals=2
AutoScale=1


[mutotLabel]
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=100
W=190
H=14
Text="T Uplod"

[mutotValue]
Meter=STRING
MeterStyle=styleRightText
MeasureName=mutot
X=200
Y=0r
W=190
H=14
Text="%1B"
NumOfDecimals=2
AutoScale=1

[mtotLabel]
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=140
W=190
H=14
Text="Total Dat"

[mtotValue]
Meter=STRING
MeterStyle=styleRightText
MeasureName=mtot
X=200
Y=0r
W=190
H=14
Text="%1B"
NumOfDecimals=2
AutoScale=1



--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: how to separate internet traffic and home network traffi

Post by jsmorley »

You really can't.

If you have a router that has a "traffic" table you can access without needing any password to log on, or if the router can be made to output a log of some kind to a local text file on your PC, you could get at that with WebParser and perhaps, filtering on the LAN IP given to your PC by the router, just get traffic just from your PC to the internet. I don't know of anyone that has had much success with this, and every router is different.

As far as using NetIn/NetOut, that measures traffic in and out of the network interface card (NIC) on your PC. It will include all traffic between your PC and the router. There is no way to distinguish what traffic was "destined for" or "came from" the internet (WAN) vs. other devices interacting with your PC through the network. (LAN)