GenericConnectord
The Oracle Communications Unified Assurance Event Generic Connector is a generic events processing engine that allows you to create custom event enrichment actions via rules. The connector polls the Events database using a custom SQL statement, parsing the results with the customized rules and creating or modifying events within Unified Assurance.
You can run this application as a service using the Services UI.
Generic Connector Setup
-
Review the query in the SelectSQLFile file referenced in the configuration to see the events 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 a specific configuration option is needed:
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 | Event Generic Database Connector |
Program | bin/core/collection/GenericConnectord |
Arguments | This field is blank. There is no default value. |
Description | Database Connector that performs custom processing on results from a SQL query |
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/event/generic/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. |
IncludeRules | collection/event/generic/base.includes | Text, 255 characters | The relative path to the application Include Rules file. |
LoadRules | collection/event/generic/base.load | Text, 255 characters | The relative path to the application Load Rules file. |
LogFile | logs/EventGenericDatabaseConnector.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 | 60 | An integer | How often the connector will poll the database in seconds. |
SelectSQLFile | eventMultiConnector/generic/lookup.sql | Text, 255 characters | The relative path to the SQL file containing the database query. |
ShardID | 1 | An integer | Database shard to be used. |
Rules
This connector 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.
-
Events for information about Event rules functions.
Tokens
The connector exposes the following tokens for rules processing.
Token | Description |
---|---|
$EventRow | Resulting data from query. Use $EventRow->{'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. |
Example Integration
In this example, the events returned by the default SQL query will be processed. The events returned are ones that have the EscalationFlag field set to 1. For each line returned, a fake ticket number will be generated, and then the Event EscalationFlag, TicketFlag, and TicketID fields are updated. Updating the EscalationFlag will make it so the connector does not try to process the event again and generate duplicate tickets.
my $EventID = $EventRow->{'EventID'};
my $Node = $EventRow->{'Node'};
my $Summary = $EventRow->{'Summary'};
my $EventType = $EventRow->{'EventType'};
my $LastReported = $EventRow->{'LastReported'};
$Log->Message('DEBUG','Running Rules on Event#' . $EventID . ' from Node=[' . $Node . '] and Summary=[' . $Summary . ']');
$Log->Message('WARN', 'Attempting to Open Ticket for EventID=[' . $EventID . ']');
my $TicketNum = int(rand(10000000000));
$Log->Message('WARN', 'Opened Ticket Number = [' . $TicketNum . '] for EventID=[' . $EventID . ']');
my ($ErrorFlag, $Message) = UpdateEvent({
DBH => \$EventDBH,
EventID => $EventID,
ShardID => $AppConfig->{'ShardID'},
Values => {
EscalationFlag => 2,
TicketFlag => 2,
TicketID => $TicketNum
}
});
Administration Details
The following list shows the technical details you will need for advanced administration of the application:
-
Package: coreCollection-app
-
Package:
./GenericConnectord [OPTIONS]
-
Options:
-c, --AppConfigID N AppConfigID => Application Config ID (Service, Job, or Request ID) -?, -h, --Help Print usage and exit
-
Threaded: Single Threaded