How to configure and run Hybrid agent as windows service

How to configure and run Hybrid agent as windows service

book

Article ID: KB0072665

calendar_today

Updated On:

Products Versions
TIBCO Cloud -

Description

We have an enhancement logged (IPAS-17712) with engineering to support Hybrid agent(aka tibagent) as a windows service. As a workaround we are listing out possible solutions until the enhancement is addressed.
1) Use tibtunnel as temporary solution as it supports registering windows service https://supportapps.tibco.com/ka/article/287/000043287.htm
2) Use 3rd party solution to register as windows service like sc.exe ( https://docs.microsoft.com/en-US/windows-server/administration/windows-commands/sc-create) or NSSM (http://nssm.cc)

Issue/Introduction

How to configure and run Hybrid agent as windows service

Resolution

In this article we are sharing the steps to configure tibagent as a window service using NSSM.
 
1. Download the TIBCO Cloud™ Integration - Hybrid Agent (tibagent) binary and create the access key. 
2. Create AccessKey.To create a new accessKey follow the steps in the documentation https://account.cloud.tibco.com/cloud/docs/proxy-agent/creating_access_key.html and copy accessSecret.
3.
Configure Hybrid agent
tibagent configure agent testagent
4. Configure connect and store accessSecret created in step 2
tibagent configure connect --accessSecret abcdefgh1234567890--accessKey test testagent
5. Download NSSM for windows

https://nssm.cc/download

6. No "installation" of nssm is needed. Just place it somewhere on the system (preferably somewhere in your PATH) and run it.
7. Run 
nssm install <servicename>

Ex: nssm install tibagentNT

8. Configure Application in NSSM editor

Path: path to tibagent executable
ex: C:\TCI_Aug21\tibagent.exe

Startup Directory: Tibagent directory
ex: C:\TCI_Aug21

Arguments: Rest of the tibagent start command.
ex: start agent -c "C:\Users\hchapara\.tibagent" --spec 7222:10.98.97.120:7222 testagent

 

NOTE: Specify the config directory in the tibagent start command even if using the default directory.

9. Configure I/O to redirect logs

10. Click on install service and the NT service should be registered. Start up the NT service and verify the logs to check if the agent started successfully.

 

Additional Information

https://docs.microsoft.com/en-US/windows-server/administration/windows-commands/sc-create
http://nssm.cc