Home > Chapter 20 Customization > Customization - RTVAgent
An RTVAgent publishes data to an RTView application (i.e. Display Builder, Data Server, Display Server, Historian or Display Viewer Application) via the RTVAgent Data Adapter. The RTVAgent provides tabular data via socket, http, or https to the receiving RTView application. Multiple RTVAgents can provide data differentiated by a unique agent name. The receiving application only needs to enable and define the port via the RTVAgent Data Adapter. See “RTVAgent Data Source” for more information.
Note: Communication is one way from the RTVAgent to the receiving RTView application.
RTVAgents need to designate the port where they are publishing data, the agent name and the agent class. For example, suppose you created an RTVAgent that gathers CPU usage for a particular platform and reports that data to an RTView application. The agent class name might be CPU agent. When you install on multiple computers the agent class name will remain the same, but you will need to specify a unique agent name for each computer. The Agent Name, Agent Class and Table Name are all exposed in the Display Builder's “Attach to RTVAgent Data” dialog when active (i.e. connected) RTVAgents are publishing data.
There are two ways to create a custom RTVAgent: Create a standalone Java application or use a full RTView application.
Creating a standalone Java application is advised if a smaller footprint agent is required and data is easily accessible via a Java API.
Using the API in the com.sl.gmsjagent package, refer to the docs/javadocs directory. There is a sample custom agent display (RTCache.rtv) file in custom/rtvagent (located in your RTView installation directory).
Review the README file (in that same directory) for directions on how to build the sample display, run an agent, and see the published data from inside the Display Builder.
Note: This sample creates simulated data and publishes it in two named tables every two seconds. An actual RTVAgent would be gathering information of interest and publishing it at its own periodic rate.
Using a RTView application is ideal when you want to install RTView as the RTVAgent and access data from one of RTView’s standard data sources.
Note: This option requires that RTView be installed and act as the RTVAgent which will be publishing data to the Data Server. The Data Server to which the data tables are sent should be configured to receive the data.
A simple display (.rtv) file can be used to provide tabular data to a remote instance of Data Server via socket or http. Using the Send Table function, create an RTVAgent at each site that has data tables to send:
1. Configure one or more instances of the Send Table function to send the data tables of interest. The function's Table to Send argument can be attached to tabular data from any of RTView's data sources. See “Tabular Functions” for more information.
2. Save the function instances in an .rtv file (e.g. SendTables.rtv).
3. Use the run_agent script to start the RTVAgent and load the .rtv file. For example:
run_agent SendTables.rtv
Note: Data tables from RTVAgents in the same agent class can be cached by attaching the valueTable property of a Cache object to RTVAgent data. See “Caches” for more information.