So I'm trying to download the bandwidth.csv file. I know I have to post to get_password_cookie.sh keep the cookies and then ask for the file.
But having trouble doing it.
Any help?
# Read CSV File
url='http://mygargoylerouter/utility/get_password_cookie.sh'
s =requests.session()
p = dict(postparms = 'mygargoylepassword')
headers = {'content-type': 'application/x-www-form-urlencoded'}
r = s.post(url,params = p,headers=headers)
print r
print r.text
c = r.cookies
r = requests.get('http://mygargoylerouter/bandwidth.csv', cookies = c, verify = False)
Seems to pull back a page, but I don;t think I'm logged in.
Pulling the bandwidth.csv file with python
Moderator: Moderators
-
- Posts: 8
- Joined: Mon Jan 16, 2017 6:28 am
Re: Pulling the bandwidth.csv file with python
I think you can just ssh to the server and run:
this is from /www/bandwidth.csv
Code: Select all
cat /tmp/bw_backup/do_bw_backup.sh | grep bw_get | sed 's/.*bw_get/bw_get/' | sed 's/\-f .*/-t/g' > /tmp/tmp.bw.sh
sh /tmp/tmp.bw.sh | sed 's/^[^\-]*\-//g' | sed 's/\-/,/g'
rm /tmp/tmp.bw.sh
NETGEAR WNDR3800 With 1.8.1
Re: Pulling the bandwidth.csv file with python
Hi Allan,
Thanks for the tip. Does this create a CSV file somehere? Do you perhaps have an idea on how to get the file onto my Windows PC every day on a schedule?
Regards
ABza
Thanks for the tip. Does this create a CSV file somehere? Do you perhaps have an idea on how to get the file onto my Windows PC every day on a schedule?
Regards
ABza
Re: Pulling the bandwidth.csv file with python
You have to use the code I posted two posts up. For windows I had to write a csharp program so I could store the authentication cookie