It is currently April 20th, 2019, 3:11 pm

Pull Active IP Connections from DD-WRT WebGUI

Tips and Tricks from the Rainmeter Community
highpec
Posts: 14
Joined: June 17th, 2018, 8:01 am

Pull Active IP Connections from DD-WRT WebGUI

highpec » June 23rd, 2018, 2:28 am

It's really hard to get much data from DD-WRT, because almost none of the important data is in plaintext, it's all loaded from Json and javascript, etc. But I did find a workaround for one thing, finding the Active IP Connections. This is useful for people like me who do a lot of web-scraping and need to see how many connections I have active at any given time (helps me adjust the threads being used, etc).

The code may be a little ghetto because I'm a rookie, but I didn't see really any other guides about DD-WRT on the RainMeter forums so I figured I'd share this.

Code: Select all

[MeasureNetworkConnections]
Measure=WebParser
URL=http://username:password@ROUTERIP/Status_Conntrack.asp
RegExp=(?siU)</script></div>(.*)</div><br />
Header=Cache-Control: no-cache
UpdateRate=5

[MeasureNetworkConnectionsCurrent]
Measure=WebParser
URL=[MeasureNetworkConnections]
StringIndex=1
MinValue=0
MaxValue=INSERT MAX CONNECTIONS YOU HAVE SET HERE (if you want to make a line graph, etc, otherwise this code is unneeded).

[MeterNetworkConnectionsText]
Meter=String
FontFace=Segoe UI
Text=[MeasureNetworkConnectionsCurrent]
FontSize=16
FontColor=#White#
AntiAlias=1
DynamicVariables=1
X=540
Y=460
It's one of the only plaintext pages you can see in DD-WRT panel. I'm unsure exactly how the web parser works so far as, does it download the entire page or stop downloading once it finds the data? Either way, it seems to update quickly without any issue. Note that setting the UpdateRate any faster than 5 will increase CPU usage of RainMeter. But even with it set to "1," with all the other stuff I have going on in this script (mainly HWiNFO network monitoring), the CPU usage is only like .13%.