Kaseya Community

GET URL command: any way to interact with a web site?

  • Has anybody found a way to script interaction with a web site? e.g. I have a VPN router that I'd like to reset its VPN tunnel connection on every night. To do this manually requires logging into the router's web-based GUI and performing a few clicks. The Kaseya GET URL script command has virtually no documentation (other than a description), so assume it has no such capabilities?

    Know of any 3rd party commad line driven web scripting tool that we could call from within a Kaseya script?

    I submitted a feature request to Kaseya to extend the capabilities of the GET URL command, as this would add a tremendous amount of power to the overall product. Just think of all the router tests and status info that could be retrieved Eek

    Happy Holidays to all!

    Legacy Forum Name: GET URL command: any way to interact with a web site?,
    Legacy Posted By Username: ReedMikel
  • cURL can do this. http://curl.haxx.se/

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: sequoya
  • Thanks Sequoya! Support mentioned the CURL command too - indicating the GET URL command uses CURL to accomplish its functionality. I'm still not clear as to whether the GET URL command can be passed any of the CURL.exe command line switches. I suspect that GET URL is limited to a very simple web site retrieval. I'm guessing that I would have to "Execute File" CURL.exe within a script to access the full set of features that CURL supports?

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: ReedMikel
  • ReedMikel,

    when you click on a button to execute a script within a web app your browser performs a GET or a POST request in the same way it would request a normal web page. there is no execute file command within the HTTP protocol. server side execution of commands is done via scripts which have been written in web programming languages such as cgi, php or asp etc for that specific purpose.

    HTTP is a text based protocol. if you wanted you could perform your reset task by telnetting into the router on the web administration port. quite simply, browsers make a text based request & then display the text that is returned, thats all there is to it really. the thing that makes the whole process seem much more complicated than it really is is the browsers ability to render text into a fancy looking web page.

    anyway, i digress.. what you need to do is log into your router via a browser & find out what script is being executed when you click the you reset button. If you use mozilla firefox you can use the 'HttpFox' addon to do this. once you have found this out use cURL to log in & perform the request for you.

    more specifics about the cURL part of the process can be read here:

    http://curl.haxx.se/docs/httpscripting.html

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: james@williswhite.co.nz
  • If it helps, here is a curl command I use to log into a server using a form based login screen. I use it to verify that the website is allowing logins on a external monitoring custom system check, but I am sure you can see how it works. The -d parameters are the POST form names and values.


    cd d:\kaseya\scripttools\curl && d:\kaseya\scripttools\curl\curl.exe -k -d "txtPassword=&txtUserName=&submit=login&chkRememberMe=off&__VIEWSTATE=" -c c:\Temp\neededcookie.txt -L https://login.domain.com/Default.aspx > c:\Temp\result.html


    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: mparr
  • James and MPARR - thanks so much! I'll try out your suggestions. I have never had the time to delve into HTTP, but looks like it would help me a lot in this regard. I go back to assembly language days, so HTTP can't be too hard Smile

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: ReedMikel
  • your welcome. if you have experience with assembly then http will be a walk in the park Smile

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: james@williswhite.co.nz