Events Examples

The Oracle Communications Unified Assurance Fault Management platform aggregates and correlates fault and event information. The platform has many applications that are capable of receiving, processing, and enriching events in any format, from virtually any device. The applications actively process events to isolate and pinpoint the underlying cause of a problem. Advanced correlation tools are available and can use topological information to correlate events. You can easily make adjustments with the default de-duplication and highly customizable rules engine.

This topic provides examples of setting up event monitoring and management by:

Enabling and Starting Event Collection Aggregators

This procedure describes how to enable and start the trap and syslog aggregators to receive traps for event monitoring. The Event Trap Aggregator service is a generic SNMP trap message listener and the Event Syslog Aggregator service is a generic syslog message listener. Both services receive messages from devices, parse the results with customizable rules, and create de-duplicated events within Unified Assurance. By default, syslog messages are sent in a carriage return delimited format.

  1. From the Configuration menu, select Broker Control, and then Services.

    See Services in Unified Assurance User's Guide for information about this UI.

  2. Select the Event Trap Aggregator service.

    The Service (Edit) form appears.

  3. Change Status to Enabled.

  4. Optionally, depending on the server specifications and loads, increase the number of threads in the Threads field. As a starting point, use three times the number of CPU cores.

  5. Click Submit.

  6. Select the Event Syslog Aggregator service.

    The Service (Edit) form appears.

  7. Change Status to Enabled.

  8. Click Submit.

  9. Ctrl-click to select both the Event Trap Aggregator and Event Syslog Aggregator services.

  10. Click Start.

If traps and syslogs are not reaching Unified Assurance, check your firewall settings. By default, devices send SNMP trap messages on UDP port 162 and syslog messages on UPD port 514. These ports must be opened in your firewall for Unified Assurance to receive messages. See Opening Ports in Unified Assurance Installation Guide for information about which ports to open.

Viewing the Event List

After you start the aggregator services, they listen on their respective ports for incoming events, which they save to the Event database.

You view the events in event lists, either in dashboards or in the Events UI. You filter the events that appear in lists with event filters. You can use the default event filters, customize them, or create your own.

To view the main event list in the Events UI:

  1. From the main navigation menu, select Events.

  2. Expand the Filters by Group: Global folder and select the All Events filter.

    The event list appears, with all events for devices that forward SNMP trap and syslog events.

See Interacting with the Event List in Unified Assurance Concepts for more information about ways you can interact with the event list.

Creating Custom Event Filters

You can create custom event filters or customize the default event filters. You can control which users and user groups can access each filter.

For example, to create a filter to display all critical severity events that have not been acknowledged:

  1. From the Configuration menu, select Events, and then Filters.

    See Filters in Unified Assurance User's Guide for information about this UI.

  2. Click Add.

    The Filter (new) form appears.

  3. In Name, enter Unacknowledged Critical.

  4. Select a default display.

  5. Leave User Owner and Group Owner with their default settings. This lets all users and groups see the filter.

    If you set User Owner to a specific user, the filter appears under their Private Filters folder in the list of filters on the Events UI.

  6. In Filter Clause, enter the following:

    Ack=0 AND Severity=5
    

    This is the WHERE clause of the SQL select statement. Do not include the word WHERE.

  7. Click Submit.

  8. From the Configuration menu, select Events, and then Filter Groups.

    See Filter Groups for information about this UI.

  9. Select the Global filter group.

    The Event Filter Group (edit) form appears.

  10. In Filters, toggle from Selected to Available.

  11. Double-click the new Unacknowledged Critical filter to add it to the group.

  12. Click Submit.

You can now select the new Unacknowledged Critical filter in event lists. In the main Events UI, it appears under the Filters by Group: Global folder.

Creating Custom Event Menus and Tools

You can create custom event tools to run from the event list, specify a menu to display the tool, and create custom menus.

Tools can be:

To create a custom tool and menu:

  1. Create a custom SQL tool:

    1. From the Configuration menu, select Events, and then Tools.

      See Tools in Unified Assurance User's Guide for information about this UI.

    2. Click Add and select SQL Tool.

      The SQL Tool (New) form appears.

    3. In Tool Name, enter Custom Escalate to Critical.

    4. Optionally, from the Icon menu, select the flag_red icon.

    5. In SQL, enter the following query:

      UPDATE Events SET Severity=5 WHERE Severity !=5 AND EventID IN ($EVENTLIST);
      

      This query uses the EventID of the selected event, searches for it in the Events table in the Event database, and updates the Severity field to 5 (Critical).

    6. Click Submit.

  2. Create a custom menu for the custom tool:

    1. From the Configuration menu, select Events, and then Menus.

      See Menus in Unified Assurance User's Guide for information about this UI.

    2. Click Add.

      The Event Menu (new) form appears.

    3. In Name, enter Custom Menu.

    4. From User Group Name, select Administrators.

    5. From the Tools list, double-click the new Custom Escalate to Critical tool you just created and click Add.

    6. Click Submit.

  3. Find and use the new tool:

    1. Click the Unified Assurance logo to refresh the UI.

    2. From the main navigation menu, click Events.

    3. Expand the Filters by Group folder and select the All Events filter.

    4. Right-click a low-severity event to see the new Custom Menu in the list of tools and menus.

    5. From Custom Menu, select your new Custom Escalate to Critical tool.

      The severity of the event changes to critical.

Viewing and Editing Rules

In Unified Assurance, the Trapd and Syslog Aggregator rules files process raw trap data and syslog messages and determine the output to the Event database and event list.

To see the rules:

  1. From the Configuration menu, select Rules.

    See Rules in Unified Assurance User's Guide for information about this UI.

    The list of rules directories and subdirectories appears. Click the triangle icon beside the directory to expand or collapse it.

  2. Expand Core Rules (core), then Default read-write branch (default), then collection, then event, and then trap or syslog.

  3. Click any rules file.

    The Rule (edit) form appears with the rule.

Rules are separated into the following file types:

Process Order for Trapd Rules

To apply rules, Trapd does the following:

  1. Loads the base rules file into memory.

  2. Loads the load rules file into memory.

  3. Parses the include rules file and loads files referenced within into memory.

  4. Runs load rules.

  5. Runs base rules for each event.

  6. Runs files referenced in base.includes when invoked in the base rules.

  7. Runs customer.rules for each event after include rules are finished running.

The Trapd Aggregator application configuration defines which files contain the base rules, include rules, and load rules, and other settings. You can see and edit the application configuration using the Services UI. From the Configuration menu, select Broker Control, and then Services. See Trapd for more information about this aggregator and Services in Unified Assurance User's Guide for information about the Services UI.

Creating Custom Rules Files

You can create custom Unified Assurance rules files by converting vendor MIB files using the Unified Assurance Common Object Model (COM) SDK. See COM Overview for information.

Creating Custom Mechanizations

Mechanizations are MySQL stored procedures that perform scheduled tasks like facilitating event correlation and deleting expired events.

The following example shows how to create a mechanization that deletes cleared (green) events that are over 60 minutes old. It is similar to the default mechanization that deletes expired events.

  1. From the Configuration menu, select Events, then Processing, and then Mechanizations.

    See Mechanizations in Unified Assurance User's Guide for information about this UI.

  2. Click Add.

    The Mechanization (new) form appears.

  3. In Name, enter DeleteCleared.

  4. Schedule the mechanization to run every ten minutes by setting Minutes to 0,10,20,30,40,50 and all other time fields to *.

  5. Set Status to Enabled.

  6. In Stored Procedure, enter the following:

    DECLARE Done int default 0;
        DECLARE StartTime decimal(13, 3) unsigned default UNIX_TIMESTAMP(NOW(3));
        DECLARE StopTime decimal(13, 3) unsigned;
        DECLARE RowCount int default 0;
        DECLARE DeleteEventID bigint;
        DECLARE DeleteLastReported decimal(13, 3) unsigned;
        DECLARE Deletes CURSOR FOR
    SELECT EventID,
           LastReported
    FROM Events
    WHERE LastReported < (UNIX_TIMESTAMP() - 3600)
      AND Severity = 0;
    DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET Done = 1;
    OPEN Deletes;
    REPEAT
    FETCH Deletes
             INTO DeleteEventID,
                  DeleteLastReported;
            IF NOT Done THEN
                SET RowCount = RowCount + 1;
    UPDATE IGNORE Events
    SET Action      = 'DeleteCleared',
        Actor       = 'EventMechanization',
        Duration    = UNIX_TIMESTAMP(NOW(3)) - FirstReported,
        LastChanged = UNIX_TIMESTAMP(NOW(3))
    WHERE EventID     = DeleteEventID;
    DELETE IGNORE FROM Events
                             WHERE EventID = DeleteEventID;
    END IF;
        UNTIL Done END REPEAT;
    CLOSE Deletes;
    SET StopTime = UNIX_TIMESTAMP(NOW(3));
    
  7. Click Submit.

Viewing Logs and Changing Log Levels

You can use the Trapd and Syslog logs for debugging and troubleshooting. By default, the aggregators write to log files under the $A1BASEDIR/logs/ directory. You can view the log files directly in this directory, or you can view, filter, and search log messages in the Logs UI.

The default logging level is ERROR, which means that only errors will be written to the logs, but you can increase or decrease the logging level for debugging and troubleshooting.

The following example shows how to increase the log level for the Trapd Aggregator to DEBUG, which writes all error, warning, info, and debug information to the logs.

To increase the log level and view the log messages in the Logs UI:

  1. From the Configuration menu, select Broker Control, and then Services.

    See Services in Unified Assurance User's Guide for information about this UI.

  2. Select the Event Trap Aggregator service.

    Tip:

    You can use the filter bar to filter the services by name and find the service more quickly.

  3. In Configuration, change the value of LogLevel to DEBUG.

  4. Click Submit.

  5. Select the Event Trap Aggregator service again.

  6. From the button bar, click Restart.

    The service is restarted and the new configuration takes effect.

  7. From the main navigation, click Logs.

    The Logs UI appears.

  8. In the search bar, enter the following to filter the logs for those from Trapd:

    app:Trapd
    

Creating Custom Watcher Policies

Watcher policies poll for certain events within a specified time period, and trigger synthetic meta events depending on the poll results. For example, the default watcher policies send an event when there have been no syslog messages from a device in 15 minutes and when a user has three failed login attempts within 15 minutes. You can modify the default policies, or create new ones.

To create and enable a watcher policy:

  1. Create a custom meta event for the custom watcher policy to trigger:

    1. From the Configuration menu, select Events, then Processing, and then Meta Events.

      See Meta Events for information about this UI.

    2. Select the default Login Failure x3 event and click Clone.

      The Meta Event (edit) form appears.

    3. In any fields where 3 is used, replace 3 with 5. For example, change the Name field to Login Failure x5

    4. Click Submit.

  2. Create the custom watcher policy:

    1. From the Configuration menu, select Events, then Processing, and then Watcher Policies.

      See Watcher Policies for information about this UI.

    2. Select the default Login Failure x3 watcher policy and click Clone.

      The Watcher Policy (new) form appears.

    3. In Name, enter Login Failure x5.

    4. In Description, change Sum of Count >= 3 to Sum of Count >= 5.

    5. Set State to Enabled.

    6. In Threshold, change Value to 5.

    7. In Action, change Meta Event to Login Failure x5

    8. Click Submit.

  3. Enable and start the Event Watcher service:

    1. From the Configuration menu, select Broker Control, and then Services.

      See Services for information about this UI.

    2. Select the Event Watcher service.

    3. Set Status to Enabled.

    4. Click Submit.

    5. Select the Event Watcher service again.

    6. From the button bar, click Start.

The Event Watcher service starts watching for login failures, and creates a Login Failure x5 event if anyone fails five login attempts in 15 minutes.

Configuring Custom Actions with CAPE Policies

The Custom Action Policy Engine (CAPE) Service runs policies that trigger custom Perl code that performs custom actions. You use CAPE policies to perform special processing based on information from within the Unified Assurance database. However, nodes are not limited to Unified Assurance information only. CAPE policies query the Unified Assurance database at a defined poll interval and, if the query returns a value, the policies trigger CAPE nodes, which are defined within the policy. The CAPE node contains Perl-based logic to perform custom actions on the data returned by the CAPE policy.

The process of implementing CAPE policies is:

  1. Optionally, create a CAPE-specific device zone. This is not required, but recommended. See About CAPE Device Zones for more information.

  2. Create a CAPE node to perform the custom actions.

  3. Create a CAPE policy to select the events to perform the actions on.

  4. Create a custom CAPE service to run the node. The examples assume a single database shard, but if you are using multiple shards, create a custom service for each shard.

About CAPE Device Zones

Oracle recommends creating CAPE-specific device zones to use with your CAPE implementation. These are not regular devices zones; you do not add devices to these zones, and they do not restrict the devices or events that the policies apply to. Instead, you select these zones when creating CAPE policies and services so that you can generate unique log files for each policy, and have greater flexibility in stopping, starting, and managing policies.

By default, CAPE policies are applied to all zones. Without CAPE-specific zones, if you have multiple CAPE services and policies, each service runs all of the policies. This can result in unnecessary repetition of work, performance issues, or server failure. For example, if you have five CAPE services and ten CAPE policies in the default zone, each service will run each policy, so all ten policies will run five times. By instead using distinct, CAPE-specific zones, you can specify which service runs which policy. This lets you run only the relevant policies and avoid repetition that could overburden your servers.

Oracle recommends setting up one CAPE zone for each CAPE service, and one CAPE service for each set of chained nodes and policies. For example, you might have:

Example CAPE Policy for Device Down Events

This example shows how to create a CAPE policy and node that check threshold violation events to see if a device is reachable or not. It assumes that the Ping Latency Poller and Standard Thresholding Engine services are running.

  1. Create the CAPE device zone:

    1. From the Configuration menu, select Device Catalog, and then Device Zones.

      See Device Zones in Unified Assurance User's Guide for information about this UI.

    2. Click Add.

    3. In Name, enter CAPE Device Down.

    4. Click Submit.

  2. Create the CAPE node:

    1. From the Configuration menu, select Events, then CAPE, and then Nodes.

      See Nodes in Unified Assurance User's Guide for information about this UI.

    2. Click Add.

      The CAPE Node (new) form appears.

    3. In Name, enter CAPE Device Down.

    4. Optionally, enter a description.

    5. In Node Text, add the following code:

      # Grab the values selected in the SELECT statement used in the CAPE policy. Only things referenced in the CAPE policy's SQL SELECT statement are available to the CAPE node.
      my $EventID   = $EventData->{'EventID'};
      my $IPAddress = $EventData->{'IPAddress'};
      my $Severity  = $EventData->{'Severity'};
      
      # Attempt to ping the device and store the result in the $ping variable. The CAPE policy's SQL SELECT statement pulls only Device Down events, which are created by the threshold engine for the Device Down threshold. 
      $Log->Message("DEBUG", "Running Ping check command");
      my $ping = `ping -c10 $IPAddress`;
      $Log->Message("DEBUG", "Result of Ping test ----> [ $ping ]");
      
      # If the result of the ping contains the text 'ttl', the ping was successful. Set the event severity to '0' (cleared) and save a log message to the CAPE log. If the ping failed, set the event severity to '5' (critical).
      if ($ping =~ m/ttl/i){
         $Log->Message("DEBUG", "Result of Ping Test SUCCESSFUL - suppressing event");
         $Severity = 0;
      }
      else {
         $Log->Message("DEBUG", "Result of Ping Test failed, escalating event");
         $Severity = 5;
      }
      
      # Create a journal entry for the EventID with the output of the ping from the previous step.
      $Log->Message("DEBUG", "Inserting into Journal [$EventID:$ping]");
      my ($ErrorFlag, $Message) = AddJournal({
          DBH       => $EventDBH,
          EventID   => $EventID,
          TimeStamp => time(),
          Username  => '1',
          Entry     => $ping,
          ShardID   => $AppConfig->{'ShardID'}
      });
      
      # Update the event with new information. Update the severity if the ping was successful. This prevents CAPE redoing events it has previously acted upon. 
      $Log->Message("DEBUG", "Updating event entry [$EventID:$Severity]");
      my ($ErrorFlag, $Message) = UpdateEvent({
          DBH     => \$EventDBH,
          EventID => $EventID,
          Values  => {
              Severity => $Severity
          }
      });
      
    6. Click Submit.

  3. Create a CAPE policy:

    1. From the Configuration menu, select Events, then CAPE, and then Policies.

      See Policies in Unified Assurance User's Guide for information about this UI.

    2. Click Add.

      The CAPE Policy (new) form appears.

    3. In Name, enter CAPE Device Down.

    4. Optionally, enter a description.

    5. From the Zone menu, select the CAPE Device Down zone that you just created.

    6. Set Event Grouping to Process Events Individually.

      This setting determines whether the returned data is processed individually (one row at a time), or together (all at once).

    7. Set Poll Interval to 300.

      The policy will run against the event list every 5 minutes.

      Note:

      Make sure the poll interval is realistic for the amount of time the policy processing will take. Polling every 30 seconds when the process takes more than 30 seconds will result in errors.

    8. In First Node Executed, select the CAPE Device Down node you just created.

    9. Set State to Enabled.

    10. In Event Select Statement, add the following code:

      SELECT EventID, Severity, IPAddress
        FROM Events
       WHERE Severity   = 5
         AND EventType = "Device Down"
       LIMIT 10
      
    11. Click Submit.

  4. Create and start a custom CAPE service:

    1. From the Configuration menu, select Broker Control, and then Services.

      See Services in Unified Assurance User's Guide for information about this UI.

    2. Select the Event Custom Action Policy Engine (CAPE) service.

      Tip:

      You can use the filter bar to filter the services by name and find the service more quickly.

    3. Click Clone.

    4. In Name, enter CAPE Device Down.

    5. Set Status to Enabled.

    6. Under Configuration, set the following fields:

      1. Set the following fields:

        • LogFile: logs/CAPEDeviceDown.log

        • LogLevel: DEBUG

      2. Add the DeviceZoneID field and set it to CAPE Device Down.

    7. Click Submit.

Example CAPE Policy for Enriching the DeviceType Field

This example shows how to create a CAPE policy and node to add information to the DeviceType field for events.

  1. Create the CAPE device zone:

    1. From the Configuration menu, select Device Catalog, and then Device Zones.

      See Device Zones in Unified Assurance User's Guide for information about this UI.

    2. Click Add.

    3. In Name, enter CAPE Enrich DeviceType.

    4. Click Submit.

  2. Create the blank CAPE node:

    1. From the Configuration menu, select Events, then CAPE, and then Nodes.

      See Nodes in Unified Assurance User's Guide for information about this UI.

    2. Click Add.

      The CAPE Node (new) form appears.

    3. In Name, enter CAPE Enrich DeviceType.

    4. Optionally, enter an alias and description. You can use the description of what this node does provided before this procedure.

    5. Click Submit.

      The node is created.

      Note:

      You have not yet included any Perl code in the node. This mimics the iterative process of creating a real CAPE node and policy, where you create a blank node, then create a policy, and make continual refinements to the code in the policy and node until it works as desired.

  3. Add code to the CAPE node:

    1. Select the CAPE Enrich DeviceType node you just created.

    2. In Node Text, add the following code, replacing <date> and <username> with appropriate values.

      ###########################################################################################################
      # Perl Modules
      use Data::Dumper;
      use DBI;
      ###########################################################################################################
      # Assure1 Modules
      use Assure1::Config;
      use Assure1::Core;
      use Assure1::Events;
      use Assure1::API;
      ###########################################################################################################
      # Create database handles to connect to the Assure1 and Event databases.
      our $Config  = Assure1::Config->new();
      my $A1DBH    = DBConnect( $Config, 'Assure1', { AutoCommit => 1 } );
      my $EventDBH = DBConnect( $Config, 'Event', { AutoCommit => 1 } );
      
      # Extract relevant information from the $EventData hash
      my $IPAddress  = $EventData->{IPAddress};
      my $Node       = $EventData->{Node};
      my $EventID    = $EventData->{EventID};
      my $DeviceType = $EventData->{DeviceType};
      
      # Log the extracted information
      $Log->Message( 'DEBUG', [
              '#===================================',
              '# CAPE CPU Enrichment Event Values',
              '# IPAddress  = ' . $IPAddress,
              '# Node       = ' . $Node,
              '# EventID    = ' . $EventID,
              '# DeviceType = ' . $DeviceType,
              '#==================================='
      ] );
      
      my $apiHandle = new Assure1::API; # Create an API handle for making API calls
      
      my $trace = "CAPEEnrichDeviceType[$EventID]:"; # Create a unique identifier for this CAPE node and EventID.
      
      ###########################################################################################################
      # MAIN
      ###########################################################################################################
      
      $Log->Message( 'DEBUG', "$trace Starting..." );
      
      # Check if $IPAddress is defined and not empty
      if (defined $IPAddress && $IPAddress !~ /^\s*$/) {
      
          # First get the DeviceID using the FindDeviceID function
          my ( $ErrorFlag, $Message, $DeviceID ) = FindDeviceID( {
                  DBH         => \$A1DBH,
                  StorageHash => $StorageHash,
                  IP          => $IPAddress
          } );
      
          $Log->Message( 'INFO', "FindDeviceID result: ErrorFlag=$ErrorFlag, Message=$Message, DeviceID=$DeviceID" );
      
          if (defined $DeviceID && $DeviceID !~ /^\s*$/) {
      
              # Then get SNMP info from the device using the FindDeviceID
              my ( $ErrorFlag, $Message, $DeviceInfo ) = GetDeviceByID( {
                      DBH               => \$A1DBH,
                      DeviceID          => $DeviceID,
                      IncludeSNMPAccess => 1,
                      IncludeMetaData   => 1,
                      StorageHash       => $StorageHash
              } );
      
              if (defined $DeviceInfo && !$ErrorFlag) {
      
                  $Log->Message( 'DEBUG', "$Message : Retrieved device info for $Node: DeviceID=$DeviceID, DeviceInfo :" . Dumper($DeviceInfo) );
                  $Log->Message( 'INFO', "$Message : Retrieved SysObjectID for $Node: SysObjectID :" . $DeviceInfo->{'SysObjectID'} );
      
                  if (defined $DeviceInfo->{'SysObjectID'} && $DeviceInfo->{'SysObjectID'} !~ /^\s*$/) {
      
                      my $DeviceTypeSysObjectID = "id-" . $DeviceInfo->{SysObjectID};
      
                  $Log->Message( 'INFO', "$Message : CallAPI SysObjectID :" . $DeviceTypeSysObjectID );
      
                      my ($error, $result) = CallAPI({
                              handle => $apiHandle,
                              url    => '/api/device/types/' . $DeviceTypeSysObjectID,
                              method => 'read',
                              params => [],
                      });
      
                      $Log->Message( 'DEBUG', "CallAPI result for DeviceTypes: error=" . ( $error // 'undef' ) . ", result=" . Dumper($result) );
      
                          if ($error == 0 && defined $result && defined $result->[0]) {
      
                          $Log->Message( 'INFO', "CallAPI DeviceTypeCategoryName name : " . $result->[0]->{'DeviceTypeCategoryName'} );
                          $Log->Message( 'INFO', "CallAPI DeviceTypeVendorName name : " . $result->[0]->{'DeviceTypeVendorName'} );
                          $Log->Message( 'INFO', "CallAPI DeviceTypeName name : " . $result->[0]->{'DeviceTypeName'} );
      
                          $DeviceType = $result->[0]->{'DeviceTypeCategoryName'} .' : ' . $result->[0]->{'DeviceTypeVendorName'} . ' : ' . $result->[0]->{'DeviceTypeName'};
      
                          if (defined $DeviceType && $DeviceType !~ /^\s*$/) {
      
                              my ( $ErrorFlag, $Message ) = UpdateEvent( {
                                  DBH     => \$EventDBH,
                                  EventID => $EventID,
                                  ShardID => 1,
                                  Values  => {
                                      DeviceType => $DeviceType,
                                      Actor      => 'CAPE',
                                      Action     => 'CAPE: CAPEEnrichDeviceType'
                                  }
                              } );
      
                              $Log->Message( 'INFO', "UpdateEvent event with DeviceType result: ErrorFlag=$ErrorFlag, Message=$Message" );
      
                          } else {
                              $Log->Message( 'WARN', "DeviceType is empty or undefined. Skipping UpdateEvent." );
                          }
                      } else {
                          $Log->Message( 'ERROR', "CallAPI failed or returned invalid result. Error: " . ($error // 'undefined') );
                      }
                  } else {
                      $Log->Message( 'ERROR', "SysObjectID is empty or undefined for DeviceID: $DeviceID" );
                  }
              } else {
                  $Log->Message( 'ERROR', "Failed to get device info for DeviceID $DeviceID: $Message" );
              }
          } else {
              $Log->Message( 'WARN', "DeviceID is empty or undefined. Ending Processing." );
          }
      } else {
          $Log->Message( 'WARN', "IPAddress is empty or undefined. Ending Processing." );
      }
      
      if (defined $DeviceType && $DeviceType eq 'Unknown') {
          $Log->Message( 'WARN', "Device not present in Device Catalog" );
      
          my ( $ErrorFlag, $Message ) = UpdateEvent( {
              DBH     => \$EventDBH,
              EventID => $EventID,
              ShardID => 1,
              Values  => {
                  DeviceType => 'Device not found in Device Catalog',
                  Actor      => 'CAPE',
                  Action     => 'CAPE: CAPEEnrichDeviceType'
              }
          } );
      }
      
      $Log->Message( "DEBUG", "$trace Finished..." );
      
    3. Click Submit.

  4. Create a CAPE policy:

    1. From the Configuration menu, select Events, then CAPE, and then Policies.

      See Policies in Unified Assurance User's Guide for information about this UI.

    2. Click Add.

      The CAPE Policy (new) form appears.

    3. In Name, enter CAPE EnrichDeviceType.

    4. Optionally, enter a description.

    5. From the Zone menu, select the CAPE Enrich DeviceType zone that you just created.

    6. Set Event Grouping to Process Events Individually.

    7. Leave Poll Interval set to 30.

      Note:

      Make sure the poll interval is realistic for the amount of time the policy processing will take. Polling every 30 seconds when the process takes more than 30 seconds to run will result in errors.

    8. In First Node Executed, select the CAPE Enrich DeviceType node that you just created.

    9. Set State to Enabled.

    10. In Event Select Statement, add the following code:

      SELECT
          IPAddress,
          EventID,
          Node,
          DeviceType
        FROM
          Events
        WHERE
          DeviceType = 'Unknown';
        LIMIT 10
      
    11. Click Submit.

  5. Create and start a custom CAPE service:

    1. From the Configuration menu, select Broker Control, and then Services.

      See Services in Unified Assurance User's Guide for information about this UI.

    2. Select the Event Custom Action Policy Engine (CAPE) service.

      Tip:

      You can use the filter bar to filter the services by name and find the service more quickly.

    3. Click Clone.

    4. In Name, enter CAPE Enrich DeviceType.

    5. Set Status to Enabled.

    6. Under Configuration, set the following fields:

      1. Set the following fields:

        • LogFile: logs/CAPEEnrichDeviceType.log

        • LogLevel: DEBUG

      2. Add the DeviceZoneID field and set it to CAPE Enrich DeviceType.

    7. Click Submit.

    8. Select the service you just created and click Start.

To verify the functionality:

  1. Add the DeviceType column to an event display:

    1. From the Configuration menu, select Events, and then Displays.

    2. Select the display you want to add it to, such as the default event display.

    3. Under Columns, for DeviceType, select Visible, deselect Editable, and optionally drag and drop it to appear in a different order.

    4. Click Submit.

  2. Check the event list:

    1. From the main navigation menu, select Events.

    2. Select an event filter that uses the event display you added the DeviceType column to.

    3. Review the values in the DeviceType column:

      • When a device has a corresponding type in the device catalog, the value has the following format:

        <DeviceTypeCategoryName> : <DeviceTypeVendorName> : <DeviceTypeName>

      • When a device has no corresponding type in the device catalog, the value is Device not found in Device Catalog.

      • When the CAPE service has not yet processed the event, the value is Unknown.