Automatically downloading RRD graph pictures



  • Greetings,

    in older versions webgui use basic authentication. I use download program that download RRD graph pictures from WebGUI.
    In 2.0 beta i cannot login with this feature. Its there any way how can i automatically download this RRD pictures from WebGUI?

    Thanks
    O.B.



  • Should be able to POST with usernamefld and passwordfld set accordingly using curl.



  • I tried post with this parms:
    ("usernamefld", "admin")
    ("passwordfld", "xxxxx")
    ("action", "/index.php")
    ("method", "post")
    but without any luck… Its there anything elese that i must post for successful login? Or better, show me batch for curl that can do this?

    Thank you very much!



  • I've done this using wget, I use the data from ifstats.php to determine if the network is idle before starting automated large downloads (remote backups)

    Just modify the last three wget's with the location of the rrds you want.

    #!/bin/bash
    wget -qO/dev/null --keep-session-cookies --save-cookies /tmp/cookies.txt --post-data 'login=Login&passwordfld=YOURPASSWORD&usernamefld=admin' http://172.16.10.1/index.php
    wget -qO- --keep-session-cookies --load-cookies /tmp/cookies.txt http://172.16.10.1/ifstats.php?if=wan
    wget -qO- --keep-session-cookies --load-cookies /tmp/cookies.txt http://172.16.10.1/ifstats.php?if=lan
    wget -qO- --keep-session-cookies --load-cookies /tmp/cookies.txt http://172.16.10.1/ifstats.php?if=opt1
    

  • Rebel Alliance Developer Netgate

    @mediadaemon:

    I've done this using wget, I use the data from ifstats.php to determine if the network is idle before starting automated large downloads (remote backups)

    Just modify the last three wget's with the location of the rrds you want.

    #!/bin/bash
    wget -qO/dev/null --keep-session-cookies --save-cookies /tmp/cookies.txt --post-data 'login=Login&passwordfld=YOURPASSWORD&usernamefld=admin' http://172.16.10.1/index.php
    wget -qO- --keep-session-cookies --load-cookies /tmp/cookies.txt http://172.16.10.1/ifstats.php?if=wan
    wget -qO- --keep-session-cookies --load-cookies /tmp/cookies.txt http://172.16.10.1/ifstats.php?if=lan
    wget -qO- --keep-session-cookies --load-cookies /tmp/cookies.txt http://172.16.10.1/ifstats.php?if=opt1
    

    I added a variation of this method here:
    http://doc.pfsense.org/index.php/Remote_Config_Backup

    Thanks for the info.


Log in to reply