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.....
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.
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:
[itm_home]\tmaitm6
eg. cd \ibm\itm\tmaitm6
kt6agent test
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:
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"
@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:
- Select the file > Right-Click > Create shortcut
Rename the shortcut to "RRT Agent"
- Amend the properties of the shortcut to "Run: Minimized"
Click the [Advanced] button to check "Run as administrator"
Click [OK]
Click [OK] again to close RRT Agent Properties
- 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.
- Copy the same shortcut to the desktop
This shortcut can be used to start the agent without the need for a reboot
- 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
UID
ibm11278874