Assure1 Topology Database Stitcher¶
Overview¶
The Assure1 Topology Database Stitcher is used to create device relationships in the Orient Database. It connects to the database configured, executes the specified queries and makes the results available to rules files for special processing and entry into the Orient Database.
The following are the jobs that utilize the Database Stitcher to create Orient relationships:
-
Topology Database Stitcher
-
Topology Perspective Stitcher
Database Stitcher 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 executed 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 executed for each event that is selected from the query above.
Update the logic as needed.
-
-
Enable the default Service, unless a specific configuration option is needed:
Default Scheduled Job¶
Field | Value |
---|---|
Package Name | coreCollection-app |
Job Name | (Various, see below.) |
Job Program | bin/core/collection/GenericDatabaseStitcher |
Job Arguments | |
Job Description | (Various, see below.) |
Failover Type | Standalone (Supported: Standalone, Primary/Backup) |
Status | Disabled |
Privileged | (Checked) |
Minutes | 0 |
Hours | (Various, see below.) |
Days | * |
Months | * |
WeekDays | * |
Job Name | Job Description | Hours |
---|---|---|
Topology Database Stitcher | Topology rules-based create and update Hierarchy from network inventory via database | 20 |
Topology Perspective Stitcher | Create perspective directed links from Layer2 inventory using a given device Root | 21 |
Default Configuration¶
Name | Value | Possible Values | Notes |
---|---|---|---|
BaseRules | (Various, see below.) | Text, 255 characters | Relative path to Base Rules |
BranchDir | core/default | Text, 255 characters | relative path to Rules dir |
IncludeRules | (Various, see below.) | Text, 255 characters | Relative path to Include Rules |
LoadRules | (Various, see below.) | Text, 255 characters | Relative path to Load Rules |
LogFile | (Various, see below.) | Text, 255 characters | Relative path to Log File. |
LogLevel | ERROR | OFF, FATAL, ERROR, WARN, INFO, DEBUG | Logging level used by application. |
SourceSchemaName | Assure1 | 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". |
DatabaseID | Text, 255 characters | Optional - Specific Database entry in the Databases configuration. Connects but does not support failover. Cannot be used in conjunction with "SourceSchemaName" | |
DeviceID | Integer | Optional - Used by the Perspective Stitcher to create perspective links. This should be the starting Root node of the perspective. If not given, defaults to local server device | |
DSN | Text, 255 characters | Optional - Details the database connection information and driver. DEPRECATED - Use SourceSchemaName or DatabaseID | |
EdgeTypeID | Integer | Optional - Used by the Perspective Stitcher to create directed perspective links. Should be either "HasPrimaryPerspective", "HasSecondaryPerspective" or a custom directed link type. | |
Password | Text, 255 characters | Optional - Database login password. DEPRECATED - NOT ENCRYPTED, Use the Database configuration password | |
SelectSQLFile | (Various, see below.) | Text, 255 characters | Optional - Relative path to SQL file containing database query. If not given, will directly runs Base Rules without a data set. |
Username | Text, 255 characters | Optional - Database login username. DEPRECATED - Use the Database configuration username |
Job Name | BaseRules | IncludeRules | LoadRules | LogFile | SelectSQLFile |
---|---|---|---|---|---|
Topology Database Stitcher | collection/topology/db/base.rules | collection/topology/db/base.includes | collection/topology/db/base.load | logs/TopologyGenericDBStitcher.log | collection/topology/db/lookup.sql |
Topology Perspective Stitcher | collection/topology/perspective/base.rules | collection/topology/perspective/base.includes | collection/topology/perspective/base.load | logs/TopologyPerspectiveStitcher.log | (blank) |
Best Practice¶
- The default job is configured to run at 8:00 pm every day, but the default perspective stitcher is configured to run at 9:00 pm every day.
Rules¶
This stitcher uses the Assure1 standard rules architecture, which are 100% Perl syntax. Refer to the following articles to assist in rules creation:
Tokens¶
The stitcher exposes the following tokens for use in rules processing.
Token | Description |
---|---|
$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'.) |
$DataRow | Resulting data from query. Use $DataRow->{'FieldName'} to access the "FieldName" data. Empty if SelectSQLFile application configuration is blank. |
$Count | Current row of the returned dataset. Value is 0 if SelectSQLFile application configuration is blank. |
$CustomHash | Custom key, value cache available across all rules. Contents commonly defined in Load Rules then used in Base or other rules. |
$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 needed for advanced administration of the application:
-
Package - coreCollection-app
-
Synopsis -
./GenericDatabaseStitcher [OPTIONS]
-
Options:
-c, --AppConfigID N Application Config ID (Service, Job, or Request ID) -?, -h, --Help Print usage and exit
-
Threaded - Single Threaded