Skip to content

Assure1 Metric Post-Collection Calculation Engine (PCCE)

Overview

The Assure1 Metric Post-Collection Calculation Engine (PCCE) creates calculated metrics from data that is already in the Assure1 database. The PCCE retrieves a set of metric values from the database, runs the results through a customizable script which can then be used to create or update a meta-metric for a device. A meta-metric is a metric calculated from the values of other metrics.

For example, if running an ESXI Virtual Server with multiple Virtual Machines, Assure1 can be configured to create a meta-metric of CPU utilization from all of the Virtual Machines, then save the value for the host Virtual Server.

PCCE Setup

To use this functionality, Assure1 must already contain the Metrics that are to be calculated.

  1. Create a Collection of the metrics to be retrieved and calculated:

    Configuration -> Metrics -> Collections

  2. Create the Calculation that Assure1 will run against the collection. The policy can add the different values available, calculate averages, etc.

    Configuration -> Metrics -> Calculations

  3. Enable the default Job, unless a specific configuration option is needed.

    Configuration -> Broker Control -> Jobs

Default Scheduled Job

Field Value
Package Name coreProcessing-app
Job Name Metric Post-Collection Calculation Engine (PCCE)
Job Program bin/core/processing/MetricPostCalculator
Job Arguments
Job Description Calculate metrics with pre-defined formulas using data previously collected
Failover Type Standalone (Supported: Standalone, Primary/Backup)
Status Disabled
Privileged (Checked)
Minutes 0,5,10,15,20,25,30,35,40,45,50,55
Hours *
Days *
Months *
WeekDays *

Default Configuration

Name Value Possible Values Notes
LogFile logs/MetricPostCalculator.log Text, 255 characters Relative path to Log File.
LogLevel ERROR OFF, FATAL, ERROR, WARN, INFO, DEBUG Logging level used by application.
Threads 3 Integer The number of process threads created.
DBThreads Integer Optional - Number of database threads to be created. If not specified, defaults to "Threads" application configuration.
ThresholdThreads Integer Optional - Number of threshold threads to be created. Enables the checking of thresholds in the application instead of the Standard Thresholding Engine. If not specified, application threshold checking is disabled.

Best Practice

The following list shows you the best practices for working with this application:

  • The default job configuration is to run every 5 minutes to consolidate the available metric data.

  • In order to handle instances where the raw metric data has not yet been inserted into the database, the application has been changed to look for data points two poll cycles ago instead of one. This means that if the application is run at 12:20, it will look for data points at 12:10 instead of 12:15.

  • If thresholding is needed for the consolidated metric data, thresholds will need to be configured to check in the application itself, and the Default Thresholding Engine can not be used. This can be done by setting the threshold "Check Location" to "Application".

  • Potential Use Cases:

    • If retrieving Metrics from a single device and the meta-metric will be used by the same device, a single Metric Collection and Calculation is needed.

    • If retrieving Metrics from multiple devices and the meta-metric will be used by a different device from which the Metrics were retrieved, a single Metric Collection and Calculation is needed.

    • It is also possible to retrieve Metrics from multiple devices and have a meta-metric be created for each device, but more advanced coding knowledge is required.

Calculation Code

The Calculation Code is the Perl-based logic that processes the results from the Metric Collection polling. Refer to the following guides for details on rules creation:

Tokens

The PCCE exposes tokens during processing as shown in the following table.

Token Description
$Data->{Metrics}->{$MetricID}->{DeviceID} The device ID that the metric came from.
$Data->{Metrics}->{$MetricID}->{Factor} The amount to factor when displaying the metric data.
$Data->{Metrics}->{$MetricID}->{InstanceID} This refers to the specific instance ID for the metric.
$Data->{Metrics}->{$MetricID}->{Maximum} This will have the configured maximum value of the metric.
$Data->{Metrics}->{$MetricID}->{MethodID} This will have the configured method ID of the metric.
$Data->{Metrics}->{$MetricID}->{MetricTypeID} This will have the configured metric type ID of the metric.
$Data->{Metrics}->{$MetricID}->{PollTime} How often the metric is polled in seconds.
$Data->{Metrics}->{$MetricID}->{State} Whether or not the last poll was successful. 0 = failed to poll.
$Data->{Metrics}->{$MetricID}->{Time} The time the metric data was polled.
$Data->{Metrics}->{$MetricID}->{Value} The actual value of the metric.
$AppConfig Hash reference to the application configuration name-value pairs that were configured. (i.e. use $AppConfig->{'Host'} to retrieve the set value for 'Host'.)
$CustomHash Custom key, value cache available across all rules. Contents commonly defined in Load Rules then used in Base or other rules. NOTE: This variable is a shared object and any additional sub hashes or arrays must be shared before use or it will cause the error: "Invalid value for shared scalar". Instantiate the sub hash/array using '&share({})' e.g.
$CustomHash->{SubObject} = &share({});
$StorageHash Internal cache used as the StorageHash option when calling rules functions such as FindDeviceID(). NOTE: The structure of this cache is subject to change! Not recommended for custom global storage or manual manipulation; use $CustomHash.

Administration Details

The following list shows you the technical details you’ll need for advanced administration of the application:

  • Package - coreProcessing-app

  • Synopsis - ./MetricPostCalculator [OPTIONS]

  • Options:

     -c, --AppConfigID N   Application Config ID (Job ID)
     -?, -h, --Help        Print usage and exit
    
  • Metadata - Threaded: Multi-Threaded