If you are unable to create a new account, please email support@bspsoftware.com

 

Best way to automate stop/start of Cognos service

Started by gohabsgo, 06 Nov 2023 10:48:43 AM

Previous topic - Next topic

gohabsgo

Hi Folks,
Wondering what the best way would be to automate via batch/script file to stop / start the cognos service.  Every so often the cognos service seems to "forget" about users in a given namespace which is fixed by us restarting the service.  Looking for a proactive way to prevent this by scheduling a stop/start during regular weekend maintenance window.

Assume some kind of batch vile run via windows scheduler perhaps?

Thanks in advance,
-Dan

dougp

I don't know about "the best way", but...

I use PowerShell scripts called from the Windows Task Scheduler.  One task stops Cognos and one task starts Cognos.  I schedule the tasks far enough apart that not only can the service shut down completely before I try to start it, but there is also an opportunity for maintenance tasks.  For any maintenance I can do through PowerShell and will complete within the window, I also have a scheduled task for that.  Because I don't use the maintenance task often, I leave its Windows Task disabled most of the time.

ronald_U

Quote from: dougp on 06 Nov 2023 04:55:07 PMI don't know about "the best way", but...

I use PowerShell scripts called from the Windows Task Scheduler.  One task stops Cognos and one task starts Cognos.  I schedule the tasks far enough apart that not only can the service shut down completely before I try to start it, but there is also an opportunity for maintenance tasks.  For any maintenance I can do through PowerShell and will complete within the window, I also have a scheduled task for that.  Because I don't use the maintenance task often, I leave its Windows Task disabled most of the time.


Hey DougP

Im fairly new to Cognos product and looking for ways to apply some monitoring and automation around it. Your post caught my attention when you mentioned powershell so i assume you are running cognos on Windows servers.

With that said, im trying to identify all cognos related tasks and processes on Windows so that my scripts could chek if said tasks are running or not. Would you happen to know the name of the processes as they would be reflected in powershell tasklist command output?

dougp

My answer will be woefully incomplete because my environment is very specific.  I'm running a single-server install on Windows Server.

What you'll see consistently are the dispatcher and the query service.

$svc = (Get-WmiObject -Class Win32_Process | Where-Object name -eq 'java.exe')
$dispatcher  = $svc | Where-Object CommandLine -like '*cognosserver*'
$queryservice = $svc | Where-Object CommandLine -like '*dataset-service*'

Cognos will spin up many other Windows processes as needed.

The dispatcher runs a bunch of services that are internal to Cognos and not exposed to Windows in any way I know of.  These are the services you can monitor through Cognos Administration, which also provides the ability to inspect high water marks and configure alerts.  If Cognos Administration doesn't provide sufficient capability for you, I think what you may need is the Cognos SDK.