TXTechie Posted June 13, 2019 Share Posted June 13, 2019 Hello Everyone, We have a primary and secondary Cisco Unified Intelligence Center (CUIC) reporting server that our Customer Service Agents will be using soon. Rather than confuse them with two separate shortcuts to to the primary and backup, I was going to create a single shortcut that points to an AutoIt executable that will first check to see if the primary web server/site is up and running and if so - launch the URL to it and - if not - launch the URL to the secondary server. I've got code working already just pinging the server using the AutoIt Ping command, but I want to also handle when the server can be pinged successfully but the web page is not working for whatever reason. So, what is the best way - what AutoIt command can I use - to verify just that the web page is running properly on the web server for me to perform my check against? Regards, TX Techie Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted June 13, 2019 Share Posted June 13, 2019 @TXTechie As you've said above, you can use Ping() function too, but you have to be sure that the website, even if "pingable", is up and running, so, you could (one of many ways) use _IE* functions to navigate to the website and look for a text that is available only when the website in running correctly. Take a look at IE UDF Automation Reference to see more about _IE L* functions Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
TXTechie Posted June 13, 2019 Author Share Posted June 13, 2019 (edited) @FrancescoDiMuro, thank you. However, I'm looking for a quick check that I can do without launching a browser and looking around, something like the _INetGetSource function. Would this be considered a good or best practice kind of check?: #include <Inet.au3> ; Check to see if the primary web server is up and running. _INetGetSource('<primary server URL>') If @error = 0 Then ; Launch the primary server's URL. ShellExecute('<primary server URL>') Else ; Launch the secondary server's URL. ShellExecute('<secondary server URL>') EndIf Edited June 13, 2019 by TXTechie Link to comment Share on other sites More sharing options...
Nine Posted June 13, 2019 Share Posted June 13, 2019 (edited) My personal preference is InetGetSize with forceLoad. Fastest as I tried multiple other ways... Edited June 13, 2019 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now