Automating Cognos Server Reboot - V4.0
Automating Cognos Server Reboot - V4.0
Navigate to your Control Panel and select Add scheduled Tasks as shown
below
Repeat the steps above for all the other Dispatcher and Content Manager
servers.
If you are running Cognos 8.3 and Cognos 10 in parallel, you can use a separate
schedule for Cognos 8.3 as well.
Two separate batch files are required one for Cognos 8.3 and another for
Cognos 10. There is no change in the batch file except the path of the
installation should be changed appropriately.
File Name: Cog8Stop.bat and Cog10stop.bat (D:\BATCH)
Note: This needs to be scheduled through the service account with which the
Cognos 8.3 and Cognos 10 services are running.
SL:NO
1
2
3
4
Machine
A
B
C
D
Cognos 8.3
1:30 PM EST
1:35 PM EST
1:40 PM EST
1:45 PM EST
Cognos 10
1:35 PM EST
1:30 PM EST
1:45 PM EST
1:40 PM EST
After 5:00 PM EST, we will proceed with starting the Cognos services on 8.3 and
10 instances through a custom batch file.
File Name: Cog8Start.bat and Cog10Start.bat (D:\BATCH)
SL:NO
1
2
3
4
Machine
A
B
C
D
Cognos 8.3
5:20 PM EST
5:15 PM EST
5:10 PM EST
5:05 PM EST
Cognos 10
5:15 PM EST
5:20 PM EST
5:05 PM EST
5:10 PM EST
The order of the start sequence is critical, the start sequence should be
Primary CM, Standby CM, Dispatcher 1, Dispatcher 2
A notification mail is sent after stopping the Cognos server and also after
starting the Cognos servers along with the log files.
Based on the log file description, ROS (Return of service) communication can
be sent to the application teams. Return of service communication is a
notification to the application teams stating that the outage is completed and
the Cognos servers are up and running.
Benefits:
This technique reduces the manual effort required to bring down the Cognos
instance and bring up the same in case of a multi-tiered environment.
Batch File Specifications:
To stop cognos instance: (cog10stop.bat)
Rem batch file to stop the Cognos 10 Sandbox instance
IF EXIST D:\BATCH\StopTrigger.txt GOTO YES
GOTO NO
:YES
(
D:
cd D:\Cognos10.1.0\bin
CALL cogconfig.bat -stop
sc config "IBM Cognos:9301" start= disabled
CALL D:\BATCH\SendSuccessMail.vbs
GOTO END
)
:NO
(
CALL D:\BATCH\SendErrorMail.vbs
)
:END
SendSuccessMail.vbs:
'**********************************************************************
****************************************************************
'* CDOSYS object to send mail related to Cognos Server status
'* This script is created for Cognos 10 Sandbox instance
'* Cogserver.log file path needs to be Specified for different Cognos
8.3 and Cognos 10 Environments to ensure the Latest Logs are sent
'**********************************************************************
****************************************************************
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Cognos Sandbox 10 instance Stopped"
myMail.From="Enter the From Address"
myMail.To="User 1; User 2"
myMail.TextBody="Cognos 10 Sandbox Instance Stopped, Attached are the
log files. Please review the cogconfig_repsponse.csv file for further
details. You can reach the Global Platform Solutions - BI Service
Delivery team for any questions."
myMail.AddAttachment "D:\Cognos10.1.0\logs\cbs_stop.log"
myMail.AddAttachment "D:\Cognos10.1.0\logs\cbs_isrunning.log"
myMail.AddAttachment "D:\Cognos10.1.0\logs\cogconfig_response.csv"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="SMTP
Server Name"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
SendErrorMail:
'**********************************************************************
****************************************************************
'* CDOSYS object to send mail related to Cognos Server status
'* This script is created for Cognos 10 Sandbox instance
'* Cogserver.log file path needs to be Specified for different Cognos
8.3 and Cognos 10 Environments to ensure the Latest Logs are sent
'**********************************************************************
****************************************************************
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Cognos Sandbox 10 instance is running AS IS"
myMail.From="From Address"
myMail.To="User 1;User 2"
myMail.TextBody="Cognos 10 Sandbox Instance is running AS IS. No
trigger file found"
myMail.AddAttachment "D:\Cognos10.1.0\logs\cbs_stop.log"
myMail.AddAttachment "D:\Cognos10.1.0\logs\cbs_isrunning.log"
myMail.AddAttachment "D:\Cognos10.1.0\logs\cogconfig_response.csv"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="<Enter
the SMTP Server>"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
myMail.Configuration.Fields.Update
myMail.Send
Set myMail=nothing
objRegEx.IgnoreCase = True
objRegEx.Pattern = "ERROR|Failed|Unable"
myMail.From="From Address"
myMail.To="User 1;User 2"
myMail.TextBody="Cognos Sandbox Instance could NOT be
Started, Attached are the log files"
myMail.AddAttachment "D:\Cognos10.1.0\logs\cbs_start.log"
myMail.AddAttachment
"D:\Cognos10.1.0\logs\cbs_isrunning.log"
myMail.AddAttachment
"D:\Cognos10.1.0\logs\cogconfig_response.csv"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="<SMTP
Server>"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
i = 1
End If
Loop
If i = 0 then
Dim fso, f1,f2
Set fso = CreateObject("Scripting.FileSystemObject")
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Cognos Sandbox 10.1 instance is started
successfully, Please review the Logs for further information"
myMail.From="From Address"
myMail.To="User 1;User 2"
myMail.TextBody="Cognos Sandbox Instance started
Successfully, Attached are the log files"
myMail.AddAttachment "D:\Cognos10.1.0\logs\cbs_start.log"
myMail.AddAttachment
"D:\Cognos10.1.0\logs\cbs_isrunning.log"
myMail.AddAttachment
"D:\Cognos10.1.0\logs\cogconfig_response.csv"
myMail.CreateMHTMLBody "http://<CM
HOST>:<PORT>/p2pd/servlet"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="<SMTP
Server>"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
Const DeleteReadOnly = True
SendErrorMail:
'**********************************************************************
****************************************************************
'* CDOSYS object to send mail related to Cognos Server status
'* This script is created for Cognos 10 Sandbox instance
'* Cogserver.log file path needs to be Specified for different Cognos
8.3 and Cognos 10 Environments to ensure the Latest Logs are sent
'**********************************************************************
****************************************************************
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Cognos Sandbox 10 instance is running AS IS"
myMail.From="From Address"
myMail.To="User 1;User 2"
myMail.TextBody="Cognos 10 Sandbox Instance is running AS IS. No
trigger file found"
myMail.AddAttachment "D:\Cognos10.1.0\logs\cbs_stop.log"
myMail.AddAttachment "D:\Cognos10.1.0\logs\cbs_isrunning.log"
myMail.AddAttachment "D:\Cognos10.1.0\logs\cogconfig_response.csv"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="<SMTP
Server>"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
Conclusion:
This approach avoids manual interruption for any scheduled outages. This is
tested and implemented for Cognos 8.3 and Cognos 10 instances running on
Windows 2003 Server.