Guide That Contains This Content
[+] Expand All
[-] Collapse All


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

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

    Add a User-Defined Plug-In

    To create a user-defined plug-in, provide an executable command that produces output in a valid format for plug-ins. For this example, the script is used, which produces the following output:

    $ python ./
    OK - 4connections active_connections

    The contents of can be:

    def get_plugin_name():
        return ''
    def get_metric():
        return 4
    def get_metric_units():
        return 'connections'
    def get_metric_name():
        return 'active_connections'
    print "OK - {0}: {1}{2} {3}".format(get_plugin_name(),

    To add this plug-in, define a JSON configuration file in the user_defined_plugins directory of the AppFormix software distribution. The JSON configuration file specifies how to execute the plug-in and the metrics that are produced by the plug-in. In this example, create the nginx.json file with the plug-in configuration for the plug-in referenced above.

    $ cat > appformix-2.15.2/user_defined_plugins/nginx.json <<EOF
        "AggregateId": "web",
        "Collection": "host_pythonchecknginxpy_collection",
        "Config": {
            "CommandLine": "python"
        "MetricMap": [
                "Name": "active_connections",
                "Units": "connections"
        "PluginId": "pythonchecknginxpy",
        "PluginName": "",
        "PluginType": "command",
        "Scope": "host",
        "State": "enabled",

    Table Table 1 describes the fields in the sample configuration.

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




    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 AppFormix Agent is installed.


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


    The command to execute.


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


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


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


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


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


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

    A list of user-defined plug-ins can be specified in Ansible group_vars in a variable appformix_user_defined_plugins. The variable specifies a list in which each element of the list is a dictionary. Each dictionary has a plugin_info field to specify the JSON configuration file and plugin_file to specify a file to be copied to the host on which the plug-in will be executed by the AppFormix Agent.

      - { plugin_info: 'user_defined_plugins/nginx.json',
          plugin_file: 'user_defined_plugins/'}

    Configure a Supported Plug-In

    AppFormix 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:

            - { plugin_info: 'certified_plugins/contrail_vrouter.json' }
            - { plugin_info: 'certified_plugins/cassandra_node_usage.json' }
            - { plugin_info: 'certified_plugins/zookeeper_usage.json' }

    Modified: 2018-05-23