COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => COGNOS 8 Administration => Topic started by: RajBedi on 16 Apr 2010 08:39:57 AM

Title: Determining Active Content Manager Via Script
Post by: RajBedi on 16 Apr 2010 08:39:57 AM
Hi there,
We have a number of Content Manager servers in our environment.
One of these servers becomes the Active Content Manager, while all the others act as hot standbys.

I have the need for a script to determine if the server I am running on is hosting the Active Content Manager service as opposed to a standby.

Currently I am doing the following:
1. Run some greps on cogstartup.xml to get the port that the Content Manager service runs on for the current server.
2. Run netstat and check if any other hosts are connected to the Content Manager service port determined in step 1.

If there are no other server connected this means either:
a) This is not the Active Content Manager, or
b) All other servers are down or this is a single server environment.

So it's not perfect but gives me a good idea of where the Content Manager is hosted via a script.

I'm just curious if anyone knows of a more elegant way to do this?
Cognos Support suggested purchasing an SDK component to do this but it's not worth it as the above works well enough for our purposes.

Any thoughts?
Title: Re: Determining Active Content Manager Via Script
Post by: smiley on 16 Apr 2010 04:38:26 PM
Paste the content manager adresses in a browser.
The page that comes back with "active content manager" is the one you're looking for.
Title: Re: Determining Active Content Manager Via Script
Post by: RajBedi on 19 Apr 2010 03:47:33 PM
That works well Smiley, thanks!  :)

I don't actually have browsers installed on these web servers but I do have a centralized monitoring server with wget installed on the same subnet.

I can definitely see writing a quick script with wget and a bit of parsing to extract this info.