IBM Support

ITCAM for Transactions - Running the RRT / T6 agent as a process

Technical Blog Post


Abstract

ITCAM for Transactions - Running the RRT / T6 agent as a process

Body

IBM Tivoli Composite Application Manager for Transactions
~ How to do stuff
~
By Kevin Baldwin -


How to.....How to.....

Run the RRT/T6 agent as a process

By default, a Robotic Response Time (RRT) agent installed in a Windows® environment is run as a service.

However, there are occasions when you need to run the agent as a process. This is most likely going to happen when RFT and some types of RPT playback need to interact with the desktop, or access environment variables that are only available when the agent runs as a process or their content changes based on how kt6agent is running.

Since the release of Windows 10 Version 1803 and Windows Server 2019, the Interactive Services Detection Service (UI0Detect) is no longer available.

As a result of this change, switching to Session 0 isn't possible. It also means, native Windows services marked as "Allow service to interact with the desktop" via the Services applet (i.e. services.msc) are no longer granted interactive with desktop rights by the Windows Service Control Manager (SCM). Therefore, even when you switch desktop to Session 0, native interactive services will no longer be visible.

More information is available in these pages:
Features and functionality removed in Windows 10
https://docs.microsoft.com/en-au/windows/deployment/planning/windows-10-removed-features

Interactive Services
https://docs.microsoft.com/en-gb/windows/win32/services/interactive-services?redirectedfrom=MSDN

This all adds up to an increased likelihood that running the T6 agent as a process is the only way to reliably run certain types of RPT script and all types of RFT script.

To check if running the t6 agent as a process helps address playback issues, perform this initial test:
 
1. Stop the T6 agent
 
2. Open a command window
 
3. Change directory to:
     [itm_home]\tmaitm6
     eg. cd \ibm\itm\tmaitm6
 
4. Run the following command:
     kt6agent test
 
5. When t6 is started this way the cursor doesn't return to the command line and the command window mustn't be closed unless you want to stop the t6 agent

If playbacks work using this method, you might find the following instructions useful as a means of running the t6 agent as a process without needing to manually execute the batch file when the machine is restarted:
 
The batch file used in the following instructions starts by checking whether the T6 agent is already running.


If it is, you see one of these messages:
kt6agent already running as a process...
Or...
kt6agent already running as a service...

If the agent isn't running, it starts as a process.

Follow these instructions to run the T6 agent as a process:

Open MTEMS to stop the RRT Agent and change "ITCAM for Robotic Response Time" to use a "Startup Type" of "Manual"
image

image
 
Copy & paste the following rows up to and including "endlocal" into a text editor.
 
  @echo off
cls
setlocal
if exist %temp%\kt6running.bat del %temp%\kt6running.bat
::#############################################
::##### Is kt6agent already running       #####
::##### If it isn't, start it...          #####
::#############################################
set KT6MSG=kt6agent already running as a process...
sc query kt6agent | find "STATE              : 4"
if errorlevel 1 goto CHECKPROC
set KT6MSG=kt6agent already running as a service...
goto KT6RUNNING
::
:CHECKPROC
tasklist | find /I "kt6agent.exe"
if errorlevel 1 goto START
::  
:KT6RUNNING
echo @echo off > %temp%\kt6running.bat
echo cls >> %temp%\kt6running.bat
echo mode con: cols=80 lines=10 >> %temp%\kt6running.bat
echo echo %date% at %time%: %KT6MSG% >> %temp%\kt6running.bat
start %temp%\kt6running.bat /max
endlocal
goto END
::
:START
start "Robotic Response Time Agent running. To stop the agent, close the window" /D%CANDLE_HOME%\TMAITM6 /min /WAIT kt6agent test
:END  
endlocal

Save the file as "Start_kt6.bat" or "Start_kt6.cmd" to a folder of your choice on the T6 Agent machine

Create a shortcut to the batch file:
 
  1. Select the file > Right-Click > Create shortcut
    Rename the shortcut to "RRT Agent"
     
  2. Amend the properties of the shortcut to "Run: Minimized"
    image

    Click the [Advanced] button to check "Run as administrator"
    image
    Click [OK]
    Click [OK] again to close RRT Agent Properties
     
  3. Copy the shortcut to the appropriate "startup" directory:

    Individual users startup folder:
    C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

    Or, the All Users startup folder:
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

    Enable viewing of hidden folders to see the startup folders.
     
  4. Copy the same shortcut to the desktop
    This shortcut can be used to start the agent without the need for a reboot
     
  5. Restart the machine

When the machine starts or the shortcut is used to start the agent, 2 command windows are opened and minimized to the taskbar.

To stop the agent:

  • Close the "Robotic Response Time" command window
  • Open the "RRT Agent" command window
  • Answer "yes" to the "Terminate batch job" prompt

Use the desktop shortcut to start the agent without a machine reboot.

Note...
When the agent is started this way, the cursor doesn't return to the command line.
The command window must not be closed unless you want to stop the t6 agent.

MTEMS status isn't updated when the agent is running as a process.

To check the status of the agent you can:

  • Check the agent is online in the TEP console
  • Use Windows® Task Manager to make sure the kt6agent process is running
  • Use the desktop icon to run "Start RRT"

    If it's already running, you see one of these messages:
    kt6agent already running as a process...
    Or...
    kt6agent already running as a service...


    If the agent isn't running, it starts as a process.



Visit the ITCAM for Transactions ~ How to do stuff ~ Homepage for more articles in this series

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS5MD2","label":"Tivoli Composite Application Manager for Transactions"},"ARM Category":[{"code":"a8m500000008i3OAAQ","label":"ITCAM-for-Transactions-\u003ERobotic Response Time RRT"}],"ARM Case Number":"TS003615578","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.4.0","Line of Business":{"code":"LOB45","label":"Automation"}}]

UID

ibm11278874