Page 1 of 1

Finding out if a server is loaded and ready

Posted: Mon Jun 06, 2011 8:38 am
by sophie
Hi,

I am looking for some way to find if a TM1 server has finished loading after the recycle.
Right now, I keep refreshing my client every few minutes to check if a server is available.
I also periodically check the tm1server.log to verify "the server is ready" message.
I tried to write a script which will check the last line of the server log to confirm if the server has loaded. But that will not work if the server started running processes after it came up.
Is there a way to find this out through some other means?

Appreciate your help.

Sophie

Re: Finding out if a server is loaded and ready

Posted: Mon Jun 06, 2011 10:14 am
by anoops81
Hi Sophie ,

We have an approximate time in mind for our server startup , it is about 20 minutes . So we check after 20 minutes once the server is restarted , The timing will be almost same if no significant changes like production move has been made .

I would like to hear from the tm1 experts also on this . Any suggestions are most welcome .


Regards
Anoop

Re: Finding out if a server is loaded and ready

Posted: Mon Jun 06, 2011 12:46 pm
by tomok
In the logging directory of your TM1 server you will find a text file called tm1server.log. Scan this text file from the bottom up and look for a message that says "TM1 Server is ready" with a current date and time stamp.

Re: Finding out if a server is loaded and ready

Posted: Tue Jun 07, 2011 7:27 am
by Andy Key
Easy! Just use the built in AfterStartup trigger to send you an alert!

Oh no, hang on, there isn't one is there...

Best suggestion I can come up with would be to create an API app that repeatedly grabs the list of servers from the admin server.

Haven't got the API doco here, but isn't the code to loop through the available servers one of the samples? Not suggesting it is a complete solution - it is an API example after all, but could be a good starting point.

Re: Finding out if a server is loaded and ready

Posted: Tue Jun 07, 2011 11:31 am
by sophie
@ tomok - Yes, this is what we have been doing right now but it gets increasingly hectic as we have a long list of TM1 instances to check under different admin hosts.

@ Andy Key - Thanks for your suggestion. I do not have much idea about API but will go through the guides and let you know if I come across some way to do this.

Re: Finding out if a server is loaded and ready

Posted: Wed Jun 08, 2011 12:25 am
by afshin
lookup PowerShell

and particular this website.

http://msmvps.com/blogs/richardsiddaway ... -file.aspx

cgywin is another option !!

Re: Finding out if a server is loaded and ready

Posted: Mon Jun 13, 2011 11:19 am
by sophie
I tried out PowerShell, it looks like it cannot understand the "Tail-File" function and get the below error. Get-content works.

The term 'Tail-File' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.


I am looking for some way other than scanning through the server log because we never know how many lines we need to scan from the bottom of the file because, by the time we execute the command to check if our services are up, our scheduled processes might have started running and write into the server log.

Re: Finding out if a server is loaded and ready

Posted: Mon Jun 13, 2011 12:36 pm
by ellissj3
Sophie,

You could take a copy of the log files for each instance (as .txt file) and use a TI to scan the files for the record containing the below:

TM1.Server --------------------Session Start--------------------

Collect the Timestamp on the file (StartTime) and then scan for:

TM1.Server TM1 Server is ready

Collect the Timestamp on the file for this record (EndTime). I haven't tried this, but you should be able to then change both to serial time and do a difference between (endtime - starttime). See below formulas, as I got that decimal from another forum member on this site. You would have to do some work to add a counter if you were only interested in the logs from the start of the last service reboot.

ElapsedTime = ROUND ((EndTime - StartTime) / 0.000011574074074074) / 86400;
FormattedTime =TIMST(ElapsedTime, '\h:\i:\s');

Write the formatted time to a cube or kick it out to an ASCII file.

Re: Finding out if a server is loaded and ready

Posted: Mon Jun 13, 2011 2:32 pm
by David Usherwood
@Sophie, I haven't done much handson with Powershell, but a quick google for Tail-file disclosed that it's another module (they call it a cmdlet - yech :) ).
But thinking more about what you want to do, I went looking for grep - a Unix (etc) pattern matching tool. Turns out this is done by findstr, which _is_ builtin. Think this approach will work better than using TI but yes, it does mean learning a new tool.