Page 1 of 1

Trouble programatically downloading bandwidth.csv

Posted: Sat May 13, 2017 9:47 am
by KMan
I'm trying to save historical bandwidth usage, in 15 minute blocks. To do this, I think I need to periodically (daily?) download the bandwidth.csv file and store it.

I'm having trouble accessing that file programatically.

I've tried using several different clients (a few that I know work with other sites) using basic authentication via http(s). Is this expected to work? I keep getting re-directed to the login page. For username, I've tried '', 'Admin', 'admin', 'root'.

Should I just use ssh instead? I'm less familiar with ssh, but could probably figure it out if bandwidth.csv exists as a file on the Gargoyle file system.

Any help is appreciated!

Thanks,
Kyle

Re: Trouble programatically downloading bandwidth.csv

Posted: Sun May 14, 2017 10:13 am
by KMan
I solved this by switching to ssh. Had to do a some digging in these forums to find out how to do it ... but I ended up doing the following:

1) Changed /etc/init.d/bwmon_gargoyle

- For bdist2, changed the number of intervals from 24 to 96 (to get a whole 24 hrs worth of 15 minute intervals)

2) Re-booted gargoyle

3) Used the following command in ssh:

Code: Select all

 "bw_get -i bdist2-upload-900-96 -h"
4) Used plink to get it from the command line:

Code: Select all

  plink root@192.168.1.1 -pw {PW} "bw_get -i bdist2-upload-900-96 -h"
4) Created a daily scheduled task in windows task scheduler to execute the plink command and store it to a file.

edit:ispy Just format

Re: Trouble programatically downloading bandwidth.csv

Posted: Sun May 14, 2017 11:07 pm
by Lantis
Nice solution.
Thanks for sharing it