aspose file tools*
The moose likes Linux / UNIX and the fly likes WGET command not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "WGET command not working " Watch "WGET command not working " New topic
Author

WGET command not working

farooq kadri
Greenhorn

Joined: Jun 25, 2009
Posts: 12
Hi,

I have a website that I need to go to often and disable a monitor. To disable I need to login to the website-> click on monitor -> then uncheck a box.

I am told that I can do this through a scipt using the WGET command. I got the parameterized query and then tried to execute it through a *.sh script.

The script generates a php file in the location from where it is executed. When I go to the site and check the monitor is not disabled.

Could someone please advise on this. Thanks
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8971
    
    9

It sounds like wget is working fine. The default behavior of wget is to retrieve a URL. What you want to do is post the form that has the checkbox on it. A quick glance at the wget manual and it looks like you should use the --post-data or --post-file options to send data to your monitor.


[How To Ask Questions On JavaRanch]
farooq kadri
Greenhorn

Joined: Jun 25, 2009
Posts: 12
I read the manual but could not make much out of it. I tried the below:

wget --save-cookies cookies.txt \
--post-data VAR= 'https://siteuptime.com/api/rest/?method=siteuptime.auth&Email=email.com&Password=passwd'\
http://siteuptime.com

#wget --load-cookies cookies.txt \
# --p https://siteuptime.com/api/rest/?method=siteuptime.disablemonitor&AuthKey=$VAR&MonitorId=9294


But it dint seem to work. I am trying to post a command in the URL in combination with the WGET command. The command would disable/enable the monitors.

The API documentation for the command that I am trying to use is at : http://siteuptime.com/api.php
 
 
subject: WGET command not working