Iznogoud Posted February 5, 2008 Posted February 5, 2008 I am searching and searching for a solution to check the status of a website. Between Offline or Online. The problem is that it is a website of a sharepoint enviroment and you need to log in first before you can enter the site. Are there ways to check the status of a website so you can check if it's online or offline. Why do i want this? Because i want to know when the site is down so i can react as quickly as possible to fix the problem. Now i know some will say you need to make it so good it won't fail, but i am dependable of a second party wich is hosting this platform. Could someone help me a bit or push me in the right direction?
ending Posted February 5, 2008 Posted February 5, 2008 Easy message tool. #include <INet.au3> Global $URL = "www.google.com" If NOT(_INetGetSource($URL) = "") Then MsgBox(0,"","Your website is ONline") Else MsgBox(0,"","Your website is OFFline") EndIf Exit
Iznogoud Posted February 5, 2008 Author Posted February 5, 2008 Easy message tool. #include <INet.au3> Global $URL = "www.google.com" If NOT(_INetGetSource($URL) = "") Then MsgBox(0,"","Your website is ONline") Else MsgBox(0,"","Your website is OFFline") EndIf Exit Oke, but the website wich you need to enter to get into the sharepoint enviroment is password protected. If you go to http://sharepointsite you get a pop up box wich needs a username and password.
ptrex Posted February 6, 2008 Posted February 6, 2008 @Iznogoud why don't you jus ping the server to see if there is a response ? regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
BrettF Posted February 6, 2008 Posted February 6, 2008 If you don't generally know the IP, or if it changes then TCPNameToIp is also a good place to start. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Iznogoud Posted February 6, 2008 Author Posted February 6, 2008 The problem is that the sharepoint enviroment is running on a server wich is hosting more enviroments for other customers. A few weeks ago the the server was down, but i don't know if i could ping the server or if our website alone was down. I am thinking about a script wich launches IE and log in and watch for pixels or something like that, but the problem than is the pc where this script is running is constitantly in use by this script. So nobody can work on that pc. So i am looking for a way wich can connect or check to that site in a way like a trayicon, but that is for later use. First i need to find a way wich i described above. So i don't know if the ping would fail if our site is down because the server could be running and answering the ping while our site is down.
BrettF Posted February 6, 2008 Posted February 6, 2008 The problem is that the sharepoint enviroment is running on a server wich is hosting more enviroments for other customers.A few weeks ago the the server was down, but i don't know if i could ping the server or if our website alone was down.I am thinking about a script wich launches IE and log in and watch for pixels or something like that, but the problem than is the pc where this script is running is constitantly in use by this script.So nobody can work on that pc.So i am looking for a way wich can connect or check to that site in a way like a trayicon, but that is for later use.First i need to find a way wich i described above. So i don't know if the ping would fail if our site is down because the server could be running and answering the ping while our site is down.Then _InetGetSource Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Legacy99 Posted February 6, 2008 Posted February 6, 2008 (edited) I had a similar issue but ours is a custom site. Basically we monitor the web server but not the website on it and the client wanted an automated way of telling if the site was down. I came up with this script from bits of others that will email someone if its up/down and writes to a log file on another server for historical purposes, maybe you can find something useful. The downside is that it has to run as a scheduled task on a pc somewhere and that if your using NTLM authenication I'm not sure if you can automate the logon info, we've got single sign on internally so it's not an issue here. It's not perfect but it's been working here for almost a year without any issues (Other than McAfee blocking port 25 after an upgrade). It looks long but it's not that bad. expandcollapse popup#include <IE.au3> #include <INet.au3> #include <date.au3> #include <file.au3> Opt("TrayIconDebug", 0) ;Declare Variables, fill these in yourself $Check1 = 0 $URL = "https://your website" $PageTitle = "the title of the website" $PageError = "Error in the title of the page in the case of a logon failure" $CheckLog = "UNC or local path of your log file" $EmailFrom = "Who is sending the email, Optional" $SubjectSuccess = "Subject of the email if it's ok " $SubjectFail = "Failure subject. " $EmailBodySuccess = "Logon Was Successful @ " $MailTo = "who gets the email? helpdesk? @ yourdomain.com" $CCrecpt = "CC the email to" $BCCrecpt = "BCC the email to" $mailserv = "The name or ip of your SMTP server" $EmailBodyFail = "** DO NOT REPLY TO THIS EMAIL ** Hourly Check Logon Failed @ " & _Now() & ". Test Manually As Per Documentation. Escalate to On Call Person if Manual Check Fails." ;Opens the browser and checks for conditions $o_IE = _IECreate () WinSetState("", "", @SW_MAXIMIZE) _IENavigate ($o_IE, $URL) Sleep(1000); If Not WinActivate($PageTitle,"")Then $Check1 = 1 WinClose("Internet Explorer","") ElseIf WinActivate( $PageError,"")Then $Check1 = 2 WinClose("Internet Explorer","") ElseIf WinActivate($PageTitle,"")Then $Check1 = 0 WinClose($PageTitle,"") EndIf ;process the eror code and email appropiate group and write the log MsgBox(0,"",$check1) IF $Check1 = 1 Then EmailFailure() EndIf If $check1 = 0 Then EmailSuccess() EndIf IF $Check1 = 0 Then CheckSuccess() EndIf IF $Check1 = 2 Then CheckSuccess1() EndIf ;Functions ;we only want to know about failures, commenting out EmailSuccess #cs Func EmailSuccess() _FileWriteLog($CheckLog, "Logon Successful") $objMessage = ObjCreate("CDO.Message") $objMessage.Subject = $SubjectSuccess & _Now() $objMessage.From = $EmailFrom ;$objMessage.To = $MailTo ;$objMessage.CC = $CCrecpt $objMessage.BCC= $BCCrecpt $objMessage.TextBody = $EmailBodySuccess & _Now() ;==This section provides the configuration information for the remote SMTP server. ;==Normally you will only change the server name or IP. $objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ;Name or IP of Remote SMTP Server $objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $mailserv ;Server port (typically 25) $objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 $objMessage.Configuration.Fields.Update ;==End remote SMTP server configuration section== $objMessage.Send EndFunc #ce Func EmailFailure() _FileWriteLog($CheckLog,"Logon Error Code = Fail" ) $objMessage = ObjCreate("CDO.Message") $objMessage.Subject = $SubjectFail & _Now() $objMessage.From = $EmailFrom ;$objMessage.To = $MailTo ;$objMessage.CC = $CCrecpt $objMessage.BCC = $BCCrecpt $objMessage.TextBody = $EmailBodyFail ;==This section provides the configuration information for the remote SMTP server. ;==Normally you will only change the server name or IP. $objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ;Name or IP of Remote SMTP Server $objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $mailserv ;Server port (typically 25) $objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 $objMessage.Configuration.Fields.Update ;==End remote SMTP server configuration section== $objMessage.Send EndFunc Func CheckSuccess() _FileWriteLog($CheckLog,"Logon Successful" ) EndFunc Func CheckSuccess1() _FileWriteLog($CheckLog,"Logon not really Successful" ) EndFunc Exit Edited February 6, 2008 by Legacy99
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