GenericDBCollectord
The Oracle Communications Unified Assurance Metric Database Collector runs a customizable database query and processes the results into metrics. This application utilizes rules for maximum flexibility and customization capability.
The default query and rules will poll the Unified Assurance Event database and get a count of the number of events per severity level, then save the results as metrics. Other functionality is also possible, but will require changes to the query that is used and to the rules to process the resulting data.
You can run this application as a service using the Services UI.
Metric Database Collector Setup
-
Review the query in the SelectSQLFile file referenced in the configuration to see the data that will be selected for processing. Update the query as needed.
-
Review the logic in the rules files referenced in the configuration to see the processing that will be done on the events that are selected:
-
LoadRules will be run during application startup to load data that might be needed during processing.
-
IncludeRules will be read during application startup to load additional files that might be called during processing.
-
BaseRules will be run for each event that is selected from the query.
Update the logic as needed.
-
-
Enable the default service, unless you need a specific configuration option.
See Services in Unified Assurance User's Guide for information about the Services UI.
Default Service
The following table shows the settings for the default service. Actual values are in bold, descriptions of values are in plaintext.
Field | Value |
---|---|
Package | coreCollection-app |
Name | Metric Database Collector |
Program | bin/core/collection/GenericDBCollectord |
Arguments | This field is blank. There is no default value. |
Description | Metric rules-based database collector |
Failover Type | Standalone (Supported: Standalone, Primary, Redundant/Backup) |
Status | Disabled |
Privileged | This option is selected. |
See Services in Unified Assurance User's Guide for general information about the settings for services.
See Using Application Primary/Backup Failover for more information about the different failover types.
Default Configuration
The following table shows the default configurations for the application. Actual values are in bold, descriptions of values are in plaintext.
Name | Default Value | Possible Values | Notes |
---|---|---|---|
BaseRules | collection/metric/db/base.rules | Text, 255 characters | The relative path to the application Base Rules file. |
BranchDir | core/default | Text, 255 characters | The relative path to the rules directory. |
CheckTime | 900 | An integer | How often (in seconds) where the application checks to see if there are any relevant changes. |
IncludeRules | collection/metric/db/base.includes | Text, 255 characters | The relative path to the application Include Rules file. |
LoadRules | collection/metric/db/base.load | Text, 255 characters | The relative path to the application Load Rules file. |
LogFile | logs/MetricDBCollector.log | Text, 255 characters | The relative path to the log file. |
LogLevel | ERROR | OFF, FATAL, ERROR, WARN, INFO, DEBUG | The logging level for the application. |
PollTime | 300 | An integer | How often the collector will start a poll cycle, in seconds. |
SelectSQLFile | collection/metric/db/base.sql | Text, 255 characters | The relative path to the SQL file containing the database query. |
SourceSchemaName | Events | Text, 255 characters | Database Schema name matching an entry in the Databases configuration; Connects and supports failover as per that configuration. Cannot be used in conjunction with DatabaseID. |
Threads | 3 | An integer | Number of process threads created. The aggregator takes a third of this value (rounded up) for database threads unless overridden by the DBThreads application configuration. |
DatabaseID | This field is blank. There is no default value. | Text, 255 characters | (Optional) Specific Database entry in the Databases configuration. Connects but does not support failover. Cannot be used in conjunction with SourceSchemaName |
DBThreads | This field is blank. There is no default value. | An integer | (Optional) Number of database threads to be created. If not specified, defaults to a third (rounded up) of Threads application configuration. |
ThresholdThreads | This field is blank. There is no default value. | An integer | (Optional) Number of threshold threads to be created. Enables the checking of thresholds in the application instead of the Default Threshold Engine. If not specified, application threshold checking is disabled. |
SendAllViolations | Disabled | Enabled or Disabled | (Optional) If enabled, thresholds will send violation notifications every poll cycle rather than only on state change. Requires ThresholdThreads. |
DSN | This field is blank. There is no default value. | Text, 255 characters | (Optional) (DEPRECATED unless you are connecting to an external database. For internal databases, use SourceSchemaName or DatabaseID.) The database connection information and driver. |
Password | This field is blank. There is no default value. | Text, 255 characters | (Optional) (DEPRECATED unless you are connecting to an external database. This is not encrypted. For internal databases, use the Database configuration password.) The database login password. |
Username | This field is blank. There is no default value. | Text, 255 characters | (Optional) (DEPRECATED unless you are connecting to an external database. For internal databases, use the Database configuration username.) The database login username. |
Best Practices
The following list shows you the best practices when using this collector.
-
With multiserver architecture, you configure this service differently from other services:
-
If you are connecting to an internal Unified Assurance database, configure this service on the server hosting that database.
-
If you are connecting to an external database, configure this service on the collection servers.
Note:
The Metric Database Collector does not support IPv6 communication with Microsoft SQL Server databases.
-
-
You must update the rules used by this application to support your specific use cases. The default rules provide an example of setting a single Device ID for the resulting metrics. In your environment, if this application collects data relevant to multiple devices, you must update the rules to support this use case.
-
To connect to an external database, Oracle recommends creating an entry in the Databases UI. To access this UI, from the Configuration menu, select Databases, and then Database.
-
If the database you need is not one of the default database types, you may be able to use FreeTDS to connect to it. See Configuring FreeTDS for more information.
When configuring Metric Database Collector settings in this situation, you can use the DSN, Username, Password configurations, even though these have been deprecated for internal Unified Assurance databases.
Rules
This collector uses the Unified Assurance standard rules architecture in Perl syntax. For information about creating rules, see the following in Unified Assurance Developer's Guide:
-
Core for information about core rules functions.
-
Metrics for information about metric rules functions.
Tokens
The collector exposes the following tokens for rules processing.
Token | Description |
---|---|
$Message | Hash reference to data row from query. Use $Message->{'FieldName'} to access the FieldName data. |
$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 the technical details you will need for advanced administration of the application:
-
Package: coreCollection-app
-
Package:
./GenericDBCollectord [OPTIONS]
-
Options:
-c, --AppConfigID N Application Config ID (Service, Job, or Request ID) -?, -h, --Help Print usage and exit
-
Threaded: Multithreaded