Tagging Smarts Events for multi-tenancy
search cancel

Tagging Smarts Events for multi-tenancy

book

Article ID: 333430

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

To show an identifying field for an event in a report.  

Environment

MnR 7.x

Resolution

There are several steps involved in this process. 

 

1. Install the event-property-tagger module.

On the server where the event processing manager is running.  You will need to install this with the same instance being used for your Smarts event processing

manage-modules install event-property-tagger <instance name>

 

2. Decide what field you are going to use to differentiate your multi-tenancy with.  

In our example here, we are using the ElementName.   We have a CSV file containing the ElementName and the value we want assigned to the field.  There are different ways that this can be done, but typically customers either user regex or SQL pattern.   Refer to the APG Event Property Tagger documentation for full details.  

In this example we are going to use the SQL pattern as we want to match only on the network name of the device, and not the fully qualified domain name (FQDN).

3. Add the event property tagging filter to the event processing manager configuration

Edit the processing.xml file located in APG/Event-Processing/Event-Processing-Manager/<instance name>/conf

Change this:

        <processing-element name="Smarts" config="Smarts-Listener/emc-smarts/conf/smarts-listener.xml" data="AC" />
</processing-manager>


To this:

       <processing-element name="EPT" config="Event-Property-Tagger/emc-smarts/conf/event-property-tagging.xml" data="AC" />
        <processing-element name="Smarts" config="Smarts-Listener/emc-smarts/conf/smarts-listener.xml" data="EPT" />
</processing-manager>
 

4. Edit the event-property-tagging.xml.

File is located in  APG/Event-Processing/Event-Property-Tagger/<instance name>/conf

Set the file name used to read the tagging data:

    <!-- Use a "text-file" tag for each input file -->
    <text-file path="conf/test.csv" encoding="UTF-8">

Set the key property.   In this example, we are using only 1.  However, you can use more.

      <!-- List of the properties that make the key -->
      <key-properties>
        <!-- Use a "key-property" tag for each property to make the key. -->
        <!-- string-type can be "string", "sqlpattern", "regex" or "range" -->
        <!-- the order of the "key-property" must match the order of the columns in the input file -->
        <key-property delete-after-use="false" string-type="sqlpattern">ElementName</key-property>
      </key-properties>


Set the new property.   In this example we are adding one property called "agency"

      <!-- List of the properties to add to the raw values -->
      <new-properties>
        <!-- Use a "new-property" tag for each new property to add to the raw values. -->
        <new-property>agency</new-property>
      </new-properties>
 

5. Update the live writer files

You will need to edit the my-smarts-live.xml and my-smarts-archive.xml

These files are located in the APG/Event-Processing/Generic-Live-Writer/<instance name>/conf

Add the following line to the property fields:

<field field="agency" data-type="STRING" xsi:type="DefaultFieldMapping" />



6. Add the new parameter to the DB table

From the APG/bin directory, execute mysql-client

Username: root
Database: mysql
Password: watch4net


Execute the following commands:

use events;
ALTER TABLE events_live ADD <field name> VARCHAR(<size>);
ALTER TABLE events_archive ADD <field name> VARCHAR(<size>);


 

7. Add the new parameters to the frontend mapping configuration

Modify the FLOW-RPE2.xml file in APG/Custom/WebApps-Resources/Default/property-mapping
Add the following at the end of the <properties> section:

       <property name="com.watch4net.apg.v2.modules.database.GenericFlow.properties.StringValue">
                <name class="string"><parameter name></name>
                <table class="string">${table}</table>
                <display-name class="string"><parameter name></display-name>
        </property>



8. Restart the event-processing and Tomcat

Modifying reports to include new parameter. Here is an example on using the new parameter.   In this case we are going to add a column to the "all events" report to show the agency which was added in the tagging and take the following steps:
  1. Select the "all events template" and click on "edit mode"
  2. Select the "Report Details: Table" and click to add a property
  3. Label the column (i.e. Agency) and click on the "book" icon to select the parameter.   When the selection dialog comes up, click on the "RPE2" tab:
  4. Select your new parameter (in this case "agency") and click apply.   Click Save, and then return to browse mode.  

You will see the new column.







 
 



Additional Information

This new parameter can also be used in filtering for reports or as an expansion when creating event reports.