Skip to content

Python script for logging RStats traffic info from Tomato USB, Asuswrt-Merlin, and other router firmware

License

Notifications You must be signed in to change notification settings

awsr/rstats-logger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Versions

rstats

  • Reads the rstats bandwidth usage file created by Tomato USB (router firmware), Asuswrt-Merlin, and others.
  • Displays human readable format to console.
  • Logs traffic stats to a JSON file.
  • Attempts to gracefully handle instances of a bug with ASUS RT-AC68U where values will get corrupted and show up as being in the exabyte range.

Usage:

python rstats.py <filename> [--out <output-filename>]

  • --out: Path to save/load JSON

Log format update

If upgrading the script to a version with a different file format, you can either:

or

  • Put update_log.py in a util subfolder from the main script and it'll run automatically.

Examples:

Print to console:

python rstats.py tomato_rstats.gz

Log to file:

python rstats.py tomato_rstats.gz --out traffic.json


Warning

Python seems to be told the system time is in UTC instead of what the router is set to... except in some circumstances. For reliability, the system's date command is used to get time values.

About

Python script for logging RStats traffic info from Tomato USB, Asuswrt-Merlin, and other router firmware

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%