Hybrid Agent Command Reference

The following command-line options are available for the TIBCO Cloud™ Integration - Hybrid Agent.

authorize

Log in the user to the TIBCO Cloud Integration server with an OAuth token. You must log in before configuring an agent. You do not need to log in to run an agent.

The Hybrid Agent uses OAuth 2.0 authorization with a Bearer Token. The OAuth token is associated directly with the organization you were in when you generated the token. See OAuth Access Tokens for information on generating a token for your organization.

Note: If you are currently logged in with a username and password, you must first log out before you can use an OAuth token to login.

Usage

tibagent authorize [command options]

Options

Option Description
--token, -t The OAuth token value.

Example

Log in with the token CIC~qAcgYVobxgxxsKKvXxwmPo8f :

tibagent authorize --token CIC~qAcgYVobxgxxsKKvXxwmPo8f

login

Log in the user to the TIBCO Cloud Integration server with user credentials. You must log in before configuring an agent. You do not need to log in to apply an agent configuration in a Kubernetes environment or to run an agent.

Note: If you are currently logged in using an OAuth Token, you must first log out before you can use a username and password to login.

Usage

tibagent login [command options]

Options

Argument Description
-u <username>, --username <username> The username. This is optional; by default, it is the user who downloaded the Hybrid Agent, or can be set to another username at the login prompt. After your first login, the username is remembered for each successive login until you log out.
-p <password>, --password <password> The password. If the password is not specified as part of the -p option then you are prompted to type it in. The -p and --password arguments are optional, but if you specify it, the password argument is mandatory.
--org, -o <orgname> If you are part of multiple organizations and subscriptions, you can specify the organization name with the --org or -o argument. Upon successful login, you can access the apps from that organization. If the organization name contains spaces, the value must be contained in double quotes. If you specify no argument, upon successful login, a list of all organizations to which your account belongs will be shown.
--region, -r If you are part of organizations with multiple regions, you can specify the region with the --region argument. For example: --region "us-east-1"

Example

Log in with the username jsmith and password joshua5 in the na-dev organization and us-east1 region:

tibagent login -u jsmith -p joshua5 --org na-dev -r us-east1

configure agent

Configures an agent and creates an agent configuration file. By default, the file is located at /Users/<user>/.tibagent/agents/<agentName>. You must log in with the login or authorize command before configuring an agent.

Usage

tibagent configure agent [command options]

Options

Argument Description
--port <port>, -p <port> The port used by the agent. The default port is 7816. (Optional)
--config-dir <dir>, -c <dir> The directory for the configuration files. (Optional) The default value is ~/.tibagent. All configuration files for the agent are written under <config-dir>/agents/<agentName>/<agentName>.json Use the same <config-dir> for starting the Agent.
<agentName> The name of the agent. This can be any arbitrary name.

Example

Configure an agent named agent37 running on port 5150.

tibagent configure agent -p 5150 agent37

configure connect

Configures an agent for a tunnel connection and creates an agent configuration file. By default, the file is located at /Users/<user>/.tibagent/agents/<agentName>. You must log in with the login or authorize command before configuring an agent. See Using the Agent for Hybrid Connectivity for more information on tunnel connections.

You can configure an agent to manage and monitor remote apps using configure manage or for Hybrid Connectivity using configure connect to establish a tunnel connection between remote apps and on-premises resources. You cannot use a single agent to do both. Configure a dedicated agent for each one. These agents can run on the same machine.

Note: You must run configure agent before running configure connect.

Usage

tibagent configure connect [command options] <agentName>

Options

Argument Description
--accessSecret, -s The secret for the access key used for authentication.
--accessKey, -a The access key name.
--config-dir <dir>, -c <dir> The directory for the configuration files. (Optional) The default value is ~/.tibagent. All configuration files for the agent are written under <config-dir>/agents/<agentName>/<agentName>.json Use the same <config-dir> for starting the Agent.
--app, --ap Specify the apps to be added to connect. Multiple apps can be specified.
<agentName> The name of the agent. This can be any arbitrary name.

Example

Configure an agent named agent37 with the key my-key and an access secret. This auto-discovers new apps and creates new tunnels for any app using the specified access key:

tibagent configure connect --accessSecret c4sW+S0etc --accessKey my-key agent37

Configure an agent without an access key and give specific app names that will have tunnels:

Note: This configuration requires an access secret.
tibagent configure connect --accessSecret c4sW+S0etc --app MyApp1 --app MyApp2 agent37

configure manage

Configures an agent to manage and monitor remote apps and creates the necessary yaml files and scripts to deploy the agent in a Kubernetes environment. By default, the files are located at /Users/<user>/.tibagent/agents/<agentName> unless you have configured a specific directory with the --config-dir option when configuring the agent. Log in with the login or authorize command before configuring an agent.

You can configure an agent to manage and monitor remote apps using configure manage or for Hybrid Connectivity using configure connect to establish a tunnel connection between remote apps and on-premises resources. You cannot use a single agent to do both. Configure a dedicated agent for each one. These agents can run on the same machine.

Note: You must run configure agent before running configure manage.

Running configure manage generates a set of configuration files that are required to manage remote apps through the TIBCO Cloud™ Integration user interface. In addition two binaries are downloaded automatically from TIBCO Cloud Integration.

Generated files include: 

Downloaded files include: 

Usage

tibagent configure manage [command options] <agentName>

Options

Argument Description
--config-dir <dir>, -c <dir> The directory for the configuration files. (Optional) The default value is ~/.tibagent. All configuration files for the agent are written under <config-dir>/agents/<agentName>/<agentName>.json Use the same <config-dir> for starting the Agent.
--namespace The Kubernetes cluster namespace used by the agent. The default is default. (Optional)
--selector-label The label used by the agent to discover the remote apps it manages. The agent discovers apps with the same label. The default is tibco. (Optional)
<agentName> The name of the agent. This can be any arbitrary name.

Example

Configure an agent named agent37 with the directory my-directory and the namespace my-namespace. This generates the Kubernetes yaml files and scripts for the agent service. It also downloads any additional binary files that might be required.

tibagent configure manage --config-dir my-directory --namespace my-namespace agent37

apply manage

This command sets up Kubernetes resources for a Hybrid Agent that manages and monitors remote apps. Run the configure manage command first to generate the necessary files. Log in with the login or authorize command before running the apply manage command.

Note: You must run configure agent and configure manage before running apply manage.

Usage

tibagent apply manage [command options] <agentName>

Options

Argument Description
--config-dir <dir>, -c <dir> The directory for the configuration files. (Optional) The default value is ~/.tibagent. All configuration files for the agent are written under <config-dir>/agents/<agentName>/<agentName>.json Use the same <config-dir> for starting the Agent.
<agentName> The name of the agent. This can be any arbitrary name.

Example

Setup the Kubernetes environment for an agent named agent37 with the directory my-directory and the namespace my-namespace.

tibagent apply manage --config-dir my-directory --namespace my-namespace agent37

start agent

Starts a configured agent. This command does not require that you log in prior to using it. The start agent command uses the information in the agent configuration. You can optionally specify a folder for the agent configuration.

Note: The --spec argument is used only for an agent configured for Hybrid Connectivity. Starting an agent with the --spec argument disables the agent's ability to manage and monitor remote apps. If you need both Hybrid Connectivity and remote app management, configure a dedicated agent for each option and start them separately.

Typically, an TIBCO Cloud Integration Admin role user configures the Hybrid Agent on the target controlled access machine to run the agent. An IT operator sets up the machine to run the Hybrid Agent as a system process.

Alternatively, a TIBCO Cloud Integration Admin role user configures the Hybrid Agent using the -config-dir option to a folder where it is copied to the target machine for the IT operator to set up.

Usage

tibagent start agent [command options]

Options

Argument Description
<agentName> The name of the agent.
--config-dir <dir>, -c <dir> The directory for the configuration files. The default value is ~/.tibagent. (Optional) Use the same <config-dir> you specified with the tibagent configure agent command.
--data-chunk-size Set the maximum size of data for a single read-write operation. Default is 32KB.

Example:

tibagent start agent --data-chunk-size 64 <agentName>

Starts the agent and specifies the maximum data size of 64KB.

--log-file

Set the directory for your app logs. Include the full path for the directory. (Optional)

Note:

To use the nohup Linux command in conjunction with --logstream, you must include the --log-file argument or TIBCO Cloud™ Integration does not stream logs.

The --log-file argument is not supported for agents running in a Kubernetes pod.

Examples:

tibagent start agent --logStream --log-file <fileFullPath> <agentName>

tibagent start agent --logStream --log-file /Users/xyz/agent.log <agentName>

--logStream, --ls

Stream app logs. (Optional) Defaults to port 7771. See Streaming Logs from Apps with the Hybrid Agent for more information.

Example: 

tibagent start agent --logStream <agentName>

--logStreamPort Specifies the port where app logs should be streamed. (Optional) If you have more than one Hybrid Agent on the same machine and you want both agents to stream logs, it is important to use a different port for the second agent. The default setting is port 7771. See Streaming Logs from Apps with the Hybrid Agent for more information.

Example: 

tibagent start agent --logStream --logStreamPort <port number> <agentName>

--data-ack-mode

Specify the data ack mode. Defaults to true if not specified.

Example: 

tibagent start agent --data-ack-mode false <agentName>

--spec, -s [--spec option --spec option] [optional, multiple]

For Hybrid Connectivity, specifies tunnel specs in format <containerPort>:<onPremiseHost>:<onPremisePort>. The <onPremiseHost> hostname must be a valid DNS name or IP address. If <onPremiseHost> is missing, it defaults to localhost.

Examples:

-s 8888:localhost:8080 -s 9999::8080.

From TIBCO Cloud, the on-premises resource is available as <onPremiseHost>:<containerPort>, and it connects to <onPremiseHost>:<onPremisePort> See Using the Agent for Hybrid Connectivity for more information on tunnel connections.

Note: The --spec argument is used only for an agent configured for Hybrid Connectivity. Starting an agent with the --spec argument disables the agent's ability to manage and monitor remote apps. If you need both Hybrid Connectivity and remote app management, configure a dedicated agent for each option and start them separately.
--remote-debug Enables debug logging of the tunnel connection inside the app. When this option is enabled, tunnel debug messages from app logs are generated.

Examples

Start an agent named agent37:

tibagent start agent agent37

Start an agent named agent37 using the configuration directory ~/MyAgents:

tibagent start agent agent37 --config-dir ~/MyAgents

This expects the folder structure ~/MyAgents/agents/agent37/agent37.json which was generated when the agent37 was configured with the --config-dir option.

Note: If you have configured your agent to run in Kubernetes using the configure manage command, the start agent command starts the agent in a Kubernetes pod. If the agent is not configured to run in Kubernetes, the start agent command starts the agent as a stand alone agent that is not reliant on Kubernetes.
Note: If you want the timestamp of the log line in UTC timezone, you must set the environment variable LOCAL_TIME_UTC=true using the following command:
LOCAL_TIME_UTC=true ./tibagent start agent agent37 
By default, if you do not declare the environment variable (LOCAL_TIME_UTC), then it is the same as setting the variable LOCAL_TIME_UTC=false.

stop agent

Stop an agent running in a Kubernetes cluster.

Usage

tibagent stop agent [command options] <agentName>

Options

Argument Description
--config-dir <dir>, -c <dir> The directory for the configuration files. (Optional) The default value is ~/.tibagent. All configuration files for the agent are written under <config-dir>/agents/<agentName>/<agentName>.json Use the same <config-dir> for starting the Agent.
<agentName> The name of the agent. This can be any arbitrary name.

Example

Stop an agent named agent37:

tibagent stop agent agent37

Role Requirements