Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Automatically downloading RRD graph pictures

    Scheduled Pinned Locked Moved 2.0-RC Snapshot Feedback and Problems - RETIRED
    5 Posts 4 Posters 3.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      Bredys
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • C
        cmb
        last edited by

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

        1 Reply Last reply Reply Quote 0
        • B
          Bredys
          last edited by

          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!

          1 Reply Last reply Reply Quote 0
          • M
            mediadaemon
            last edited by

            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
            
            1 Reply Last reply Reply Quote 0
            • jimpJ
              jimp Rebel Alliance Developer Netgate
              last edited by

              @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.

              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.