Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Contrail Insights User-Defined Plug-Ins

Contrail Insights plug-ins can be used to extend the set of metrics monitored and analyzed by Contrail Insights. Plug-ins are executed by a Contrail Insights Agent. The metrics produced by the plug-in are associated with the host on which the Agent executed.

Contrail Insights Ansible playbooks install a plug-in executable file on a host(s) and configure the plug-in in the Contrail Insights Platform.

Add a User-Defined Command Plug-In

To create a new plug-in in Contrail Insights, provide the executable files with the valid output format. For this example, the check_nginx.py file is used, which has the following output:

In the Contrail Insights installation directory, there is a directory named user_defined_plugins. You need to create a <PLUGIN_FILE>.json with the configuration for the plug-in and the metrics it exposes. In the following example, we create a nginx_connections.json for the check_nginx.py plug-in referenced above.

The field MetricMap is a list of metrics and its unit that is collected by this plug-in and field AggregateId indicates in what host aggregate you want to run this plug-in. If the AggregateId is specified, then the plug-in will only apply to the hosts in that aggregate. If AggregateId is not specified, then the plug-in will run on all of the hosts monitored by Contrail Insights.

Table 1 describes the fields in the sample configuration.

Table 1: Explanation of Fields in the Plug-In Configuration JSON File

Field

Description

AggregateId

Specifies a host aggregate. Plug-in is installed and configured to run on hosts in this aggregate. If AggregateId is not specified, then plug-in is configured to run on all hosts on which Contrail Insights Agent is installed.

Collection

A label applied to data produced by this plug-in.

Config.CommandLine

The command to execute.

MetricMap

A list of metrics produced by the plug-in and the units of each metric (for display in the Dashboard).

PluginId

Plug-in identifier in Contrail Insights. This must be unique among all configured plug-ins.

PluginName

Name of the plug-in. Name is used as a prefix for the name of all metrics produced by the plug-in.

PluginType

Type of the plug-in. Valid option: command.

Scope

Scope of this plug-in. Valid option: host.

State

Specifies if plug-in is active. Valid options: enabled, disabled.

The user- defined plug-ins need to be specified in the group_vars as follows:

The Contrail Insights Ansible playbooks copies these two types of files to all of the appropriate agents and then configures the plug-in in the appformix_controller.

Configure a Supported Plug-In

Contrail Insights includes a set of supported plug-ins in the certified_plugins directory of the release bundle. You can configure a supported plug-in to be installed by setting the appformix_plugins variable in Ansible and running the installation playbook. For example: