Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WGET command not working

 
farooq kadri
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
farooq kadri
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic