Trouble programatically downloading bandwidth.csv

Report issues relating to bandwith monitoring, bandwidth quotas or QoS in this forum.

Moderator: Moderators

Post Reply
KMan
Posts: 2
Joined: Sat May 13, 2017 9:34 am

Trouble programatically downloading bandwidth.csv

Post 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

KMan
Posts: 2
Joined: Sat May 13, 2017 9:34 am

Re: Trouble programatically downloading bandwidth.csv

Post 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

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Trouble programatically downloading bandwidth.csv

Post by Lantis »

Nice solution.
Thanks for sharing it
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Post Reply