Creating a Custom On-Premises Agent Using a Sample
- Set Up a Custom Agent
- Run the Sample Custom Agent to Retrieve and Display Events from SAS Customer Intelligence 360
- Connect the Custom Agent to SAS Customer Intelligence 360 through a Proxy Server
Set Up a Custom Agent
- Install Java
on the system.
- Agents require Java 17.
- Either the PATH
environment variable must include the folder that contains the
“java” executable, or the JRE_HOME or JAVA_HOME environment variable
must be set to the root of the Java installation.
Note: Older installations of the agent support only the JAVA_HOME variable.
- Download Maven 3.9.9 or later from maven.apache.org.
- Add the Maven bin directory to $PATH or %PATH%.
- Set or the export JAVA_HOME environment variable to point at the Java install root directory.
- Install the SDK JAR file into your
local repository:
mvn install:install-file -Dfile=<path where the agent was downloaded>/sdk/mkt-agent-sdk-jar-1.<current release>.jar \ -DpomFile=<path where the agent was downloaded>/sdk/pom.xml - Create a directory for building the sample custom agent.
- Copy
<path where the agent was downloaded>/sdk/sample/pom.xmlto the <sample custom agent> folder - Copy
<path where the agent was downloaded>/sdk/sample/logback.xmlto the <sample custom agent> folder - Create the src/main/java/sample subfolder under the <sample custom agent> folder.
- Copy
<path where the agent was downloaded>/sdk/sample/*.javato the <sample custom agent>/src/main/java/sample folder. - Change the directory to the <sample custom agent> directory that you created.
- Build the sample custom agent’s mvn compile.
On the navigation bar in SAS Customer Intelligence 360, click
Administration
Data and Integrations. Click Access Points.- Copy the URL for the external
gateway. This value is used in the subsequent sections of these
instructions.
Note: Only the host name is used in the URL for the gateway (for example,
extapigwservice-prod.ci360.sas.com). - Create a custom agent definition in SAS Customer Intelligence 360 that is used in the following sections. For more information, see Add a General Access Point.
Run the Sample Custom Agent to Retrieve and Display Events from SAS Customer Intelligence 360
Use the following code to run the sample access point from the <sample access point> directory:
mvn exec:java
-Dci360.gatewayHost=<SAS Customer Intelligence
360 Gateway host> -Dci360.tenantID=<tenant
ID> -Dci360.clientSecret=<client
secret> \ -
Dlogback.configurationFile=logback.xml
-Dexec.mainClass="sample.SampleAgent" -s "<maven
install root directory>\conf\settings.xml"
Connect the Custom Agent to SAS Customer Intelligence 360 through a Proxy Server
The SDK for the custom agent supports
connecting to SAS Customer Intelligence
360 through a proxy HTTP server. To use a proxy server, you enter the
following options in the mvn command lines in the previous
sections:
- Options for the proxy server using
the http protocol handler:
- -Dhttp.proxyHost: the host name of the proxy server
- -Dhttp.proxyPort: the port used by the proxy server
- -Dhttp.nonProxyHosts: the hosts for which communication should not go through the proxy server
- Options for the proxy server using
the http protocol handler when the connection is authenticated:
- -Dhttp.proxyUser: the user name on the proxy server
- -Dhttp.proxyPassword: the user password on the proxy server
- -Dhttp.proxyRealm: the authentication realm for the proxy server