Page 1 of 1

TI command to identify TM1 Server?

Posted: Wed Feb 19, 2014 2:03 pm
by tomcoffingiii
Hello Everyone,

The company I work for is currently running TM1 9.5.2 on a 64-bit windows box. We currently have about 10 different environments defined - 6 DEV servers, 2 UAT servers, and a PROD server. Each server has it's own "Server Environment" cube that is used to establish various directories to be used for the various processes and what not in each server.

Now, typically when we are working in our DEV servers on code upgrades or bug shakeout, we'll refresh the DEV server so that its code becomes in sync with what's currently in PROD. After the server is refreshed and restarted, our server environment cubes are then built based on files located in various directories for each server. The problem is that because we have different server information files in various locations, and our developers have full access to manipulate the files in these directories automatically, occasionally a server information file will be accidentally moved or deleted, which in turn causes problems building our server environment cube.

So my question is this - is it possible to build a TI that can self-identify which server it's running on, without relying on an 'outside' file?

If I'm in TM1 Architect or Perspectives - I can right-click on a server and click on "Who am I?", which will then tell me my username and which server I am on. If I can run something similar in a TI process, I can simply have a standard environmental cube that holds all of our various servers directories, then from there do lookups in our TI processes to know which directories to use.

Thanks for your time,

Tom

*EDIT* Please see the two posts below by FailureHappening and Lotsaram - both are very viable solutions.
+

Re: TI command to identify TM1 Server?

Posted: Wed Feb 19, 2014 9:33 pm
by failurehappening
Hi Tom

Do each of your instances have a separate log directory with the same name as the instance? You could use this bit of code to get that:

Code: Select all

sLogDirectory = GetProcessErrorFileDirectory;

#Use the fact the log directory is always in e:\data\project\tm1\logs\

nLogDirLength = (LONG('e:\data\project\tm1\logs\') +1);
sInstance = SUBST(sLogDirectory , nLogDirLength, (LONG(sLogDirectory) - nLogDirLength));
CellPutS(sInstance , 'Control Cube','Server Name','String');
It does rely on you giving the log directory the same name as the instance...

Re: TI command to identify TM1 Server?

Posted: Thu Feb 20, 2014 11:16 am
by lotsaram
You could conceivably call a batch file that writes out a text file with computer name, ip config and current directory and pick this output up in a subsequent TI process and use that to then configure your environment cubes. Do this in a startup chore and the risk of corruption due to an overwrite/promotion should be managed.

Re: TI command to identify TM1 Server?

Posted: Fri Feb 21, 2014 2:56 pm
by tomcoffingiii
FailureHappening - Good thinking! I had discovered that command last night and it just so happens that our message log directories do contain the name of the server. I was going to come to this thread and post the answer, but you beat me to it :)

Lotsaram - Thanks for the suggestion, we were going to go that route if FailureHappening's suggestion didn't work.