Found which Tm1 servers are working
Posted: Sun Apr 01, 2012 12:14 pm
Is possible using TI commands (or by another way) found which TM1 servers are working in current moment at host?
Discussing all things TM1, Planning Analytics, PAx and PAW
https://www.tm1forum.com/
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
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 );
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
Code: Select all
tasklist /svc /fi "imagename eq tm1sd.exe" /fi "memusage gt 20000000" /fo csv