MrMan606 DD-WRT Novice
Joined: 29 Feb 2012 Posts: 6
|
Posted: Thu Mar 15, 2012 19:16 Post subject: TraffView - Display traff daemon in html |
|
TraffView is a utility to display TRAFF raw data from the router into more efficient readable web page layout with table entries, totals with billing cycle defined. Optional WinSCP & email coding already included.
I was seaching for a tool to do the above but could not (may be just me) then decided to do it myself and when I'm done I thought to make it for general use and share it here with anyone who find it useful.
All details are below .. let me know if anyone find it useful for his needs. Also I would appreciate if you tested it on a different platform/setup than the mentioned below - to share your feedback here, so more people can benefit from it.
Regards,,
TraffView.vbs
v1.0 20120309 Initial version
Synopsis
Displaying Router's Traff daemon raw data in html format with totals and billing cycle reset
Year, Month, Day, Download, Upload, Total in table format
Running totals (in bold) for current month
Totals (in bold) and counter reset with billing cycle (User supplied)
Background changes with billing cycles for better display
Ready with optional setup for full automation using cron, WinSCP , Emailing and Windows Scheduler
Setup & Usage
Initial testing on Linksys E3000
DD-WRT v24-sp2 mega (c) 2010 NewMedia-NET GmbH
Release: 08/12/10 (SVN revision: 14929)
Project Home:
Downloads, Source, Sample output
http://code.google.com/p/my-mrman606-project
Required Files::
traff.vbs or traff.exe -- Main program
TraffView.dat -- Raw data from traff daemon on the router
Optional files
TraffVars.txt -- Variables used with WinSCP or Email
Generated Files
TraffWinSCP.txt -- WinSCP script file (If used)
TraffWinSCP.log -- log file from WinSCP copy (If used)
TraffView.htm -- Traff data displayed in htm
Basic Setup
extract traff data on router
e.g. nvram show |grep traff- > /mnt/TraffView.dat
copy this file to working folder on Windows
execute program with no SCP or Email options
Advanced Setup
Create TraffVars.txt on working folder (Sample below)
Execute program with SCP and/or Email options
Other Setup for daily automated operations
create cron job for extracting traff data on router
Create Windows Scheduler job for TraffView program
Suggested setup to schedule the cron .. Say @ 12:01am and Windows job @12:02am
This way will allow usage and totals up to previous days
Sample TraffVars file .. ALL required if using this option
WinScpIP="YourRouterIPAddress"
WinScpPwd="YourROOT-Password"
WinScpSourceFile="/mnt/TraffView.dat"
EmailServer="YourProviderSmtpServer"
EmailUser="YourProviderEmailUser"
EmailPwd="YourProviderEmailPassword"
EmailFrom="Account@provider.com"
EmailTo="AnyUser@provider.com"
EmailSubject="TraffViewORAnySubjectLine"
Usage from Windows command line
TraffView <Working Dir> <CycleDayStart> <WinSCP??> <Email??>
OR (if using the VBS version)
cscript TraffView.vbs <Working Dir> <CycleDayStart> <WinSCP??> <Email??>
Example (Basic) - TraffView.dat exist on folder, No WinSCP, No Email
cscript TraffView.vbs c:\temp\ 7 0 0
Example (Advanced)
TraffVars.txt exist on folder, Use WinSCP to copy raw data from router
cscript TraffView.vbs c:\temp\ 7 1 0
Example (Advanced)
TraffVars.txt exist on folder, Use WinSCP to copy raw data from router and Send email
cscript TraffView.vbs c:\temp\ 7 1 1 |
|