Found which Tm1 servers are working
-
- Regular Participant
- Posts: 221
- Joined: Sat Dec 04, 2010 2:35 pm
- OLAP Product: PAL
- Version: 2.0.9
- Excel Version: 2016
Found which Tm1 servers are working
Is possible using TI commands (or by another way) found which TM1 servers are working in current moment at host?
-
- Site Admin
- Posts: 1458
- Joined: Wed May 28, 2008 9:09 am
Re: Found which Tm1 servers are working
Suggest you look at using Powershell, on the lines of
get-service -name tm1
get-service -name tm1
-
- MVP
- Posts: 3706
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Found which Tm1 servers are working
I wouldn't trust just knowing that the service was running, what if the server is "up" but non-responsive? If there really truly was a need for it (and that's a decent sized if) then I'd be inclined to eitherDavid Usherwood wrote:Suggest you look at using Powershell, on the lines of
get-service -name tm1
- have an app that routinely logs in, retrieves a known view and logs out and informs if there is a hang on log in or wait on view retrieval
- have an app that monitors a top log output and informs if there are ever > x threads in wait status for > x seconds
- ask a certain Mr B Hill if he would add such a monitoring tool to his CubeSpy application
-
- MVP
- Posts: 733
- Joined: Wed May 14, 2008 11:06 pm
Re: Found which Tm1 servers are working
Just create a new process and put this in the Prolog:EP_explorer wrote:Is possible using TI commands (or by another way) found which TM1 servers are working in current moment at host?
Code: Select all
# turn off quoting
DatasourceASCIIQuoteCharacter = '';
# set up file names
sDataDirectoryPath = 'C:\YOUR\TM1\DATA\DIRECTORY\';
sOutputFileName = 'current_instances.txt';
sFullOutputFileName = '"' | sDataDirectoryPath | sOutputFileName | '"';
# this does the work
sCommand = 'tasklist /svc /fi "imagename eq tm1sd.exe" /fo csv > ' | sFullOutputFileName ;
# run the batch
sBatchFileName = sDataDirectoryPath | 'get_current_instances.bat';
AsciiOutput ( sBatchFileName, sCommand );
ExecuteCommand ( sBatchFileName, 1 );
# now pass this file back to TM1
#ExecuteProcess ( 'YOUR_PROCESS', 'pTM1InstanceFileName', sFullOutputFileName );
Robin Mackenzie
-
- MVP
- Posts: 733
- Joined: Wed May 14, 2008 11:06 pm
Re: Found which Tm1 servers are working
The output from the command (used in the code I posted) includes the PID (process identifier):lotsaram wrote:I wouldn't trust just knowing that the service was running, what if the server is "up" but non-responsive?
Code: Select all
tasklist /svc /fi "imagename eq tm1sd.exe" /fo csv
Code: Select all
tasklist /v /fi "imagename eq tm1sd.exe" /fo csv
Actually, you can start to get a bit clever and say:
Code: Select all
tasklist /svc /fi "imagename eq tm1sd.exe" /fi "memusage gt 20000000" /fo csv
More information available here.
YMMV
Robin Mackenzie
-
- Regular Participant
- Posts: 221
- Joined: Sat Dec 04, 2010 2:35 pm
- OLAP Product: PAL
- Version: 2.0.9
- Excel Version: 2016
Re: Found which Tm1 servers are working
Thank you for answers