Beruflich Dokumente
Kultur Dokumente
*****************
'**********************************************************************************
*****************
' This script was written to parse the OPAL log for a registration issue due to a
network break/stop
'causing OPAL to register to a ESS (Backup Gatekeeper) that was provided at the
time of initial
'registration. OPAL will not revert back to the Primary Gatekeeper until it has
been restarted. This
'script will parse the OPAL log for the error and restart the services if found.
Maintain the send email part. do not move it to below other wise you will receive
emails even if the services are up.
'JamesDavis
'**********************************************************************************
*****************
'**********************************************************************************
*****************
'******************************************
'Elvates Privlage to Administrator
'******************************************
Set WshShell = WScript.CreateObject("WScript.Shell")
If WScript.Arguments.Length = 0 Then
Set ObjShell = CreateObject("Shell.Application")
ObjShell.ShellExecute "wscript.exe" _
, """" & WScript.ScriptFullName & """ RunAsAdministrator", ,
"runas", 1
WScript.Quit
Else
'******************************************
'Log File and Phrase to be parsed
'******************************************
Const ForReading = 1
strFileName = "D:\Cyara\logs\Opal\Opal.log"
strSucceeded = "Registered"
strText = objFile.ReadAll
objFile.Close
'******************************************
'Service Stopped if Failed String Found
'******************************************
IF InStr(strText, strFailed) Then
objService.StopService()
Next
strServiceName = "CyaraCallEngine"
objService.StopService()
WScript.Sleep 10000
Next
'************************************************************
'Uncomment to delete previous log after services have stopped
'************************************************************
'obj.DeleteFile("D:\Cyara\logs\Opal\Opal.log"),DeleteReadOnly
dateStamp = Now()
'wscript.echo stuff
Set WriteStuff =
objFSO.OpentextFile("D:\Cyara\logs\Opal\OPAL_Rejection.txt", 8, True)
WriteStuff.WriteLine(Stuff)
WriteStuff.close
'************************************************************
'Update Email to desired deliveries
'************************************************************
SendEmail("UPDATE With to Email")
'SendEmail("UPDATE With to Email if second is needed")
'************************************************************
'Serivces Started backup
'************************************************************
objService.StartService()
Next
strServiceName = "CyaraCallEngine"
objService.StartService()
Next
dateStamp = Now()
'wscript.echo stuff
Set WriteStuff =
objFSO.OpentextFile("D:\Cyara\logs\Opal\OPAL_NoErrors.txt", 2, True)
WriteStuff.WriteLine(Stuff)
WriteStuff.close
End IF
End IF
'************************************************************
'Update From, Subject, Textbody and SMTP address
'************************************************************
Function SendEmail(toEmail)
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "webportal@cyarasolutions.com"
objEmail.To = toEmail
objEmail.Subject = "UPDATE"
objEmail.Textbody = "UPDATE"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"UPDATE"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
objEmail.Configuration.Fields.Update
objEmail.Send
End Function