Why can’t I wget specific cacti graph images

cactigraphmonitoringwget

I'm trying to wget a specific cacti graph image in order to make a daily report. We have htpasswd for the cacti website, and I've added a user for that. I'm usign wget's --http-user/password to pass it. That's working because without it, I get 403 Authorization Required back. However when I try to wget the image, I get redirected to index.php. What is it doing?

I've tried to change the user agent to the same as my Firefox in wget, no change. I've set the referer in wget to be the cacti page, no change. What is it doing? Is there something special with http auth and wget?

Best Answer

You can pass cookie info with your wget command:

wget --help | grep cookie
   --cookies=off         don't use cookies.
   --load-cookies=FILE   load cookies from FILE before session.
   --save-cookies=FILE   save cookies to FILE after session.