What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Remote Traffic Monitoring?

damccull

New Around Here
Is it possible to pull the realtime traffic monitor data from an api endpoint, or to get it via ssh somehow? I would like to write a script or a UI that runs on my local PC and gets remote stats for the router instead of having to keep the router's webpage open all the time.

Thanks,
damccull
 
Is it possible to pull the realtime traffic monitor data from an api endpoint, or to get it via ssh somehow? I would like to write a script or a UI that runs on my local PC and gets remote stats for the router instead of having to keep the router's webpage open all the time.

Thanks,
damccull
You can use scp to copy the traffic.db to your local PC and sqlite to query the traffic. There is a single table called "traffic" in the database. Here is what .fullschema shows in sqlite:

sqlite> .fullschema
CREATE TABLE traffic(mac TEXT NOT NULL,app_name VARCHAR(50) NOT NULL,cat_name VARCHAR(50) NOT NULL,timestamp UNSIGNED BIG INT NOT NULL,tx UNSIGNED BIG INT NOT NULL,rx UNSIGNED BIG INT NOT NULL);
CREATE INDEX mac ON traffic(mac ASC);
CREATE INDEX app_name ON traffic(app_name ASC);
CREATE INDEX cat_name ON traffic(cat_name ASC);
CREATE INDEX timestamp ON traffic(timestamp ASC);
 
You can use scp to copy the traffic.db to your local PC and sqlite to query the traffic. There is a single table called "traffic" in the database. Here is what .fullschema shows in sqlite:

Thanks! Would you mind telling me where that file is located, by chance?
 
I did a command similar to the following (made up MAC address below) on my MacBook Pro and saw a couple of sites my 12 year old daughter visited that my wife wouldn't be too happy about:

sqlite3 traffic.db "select * from traffic;" | grep 70:1E:E2:22:13:05 | cut -f2 -d\| | sort | uniq
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Back
Top