com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Activity Monitoring Toolbox

The Activity Monitoring toolbox is a default, out-of-the-box toolbox provided by WSO2 BAM for point-and-click installation. It includes the necessary artifacts (hive scripts, data stream definitions, properties files, gadgets etc.) required to collect and monitor activity related to services deployed in any WSO2 service-hosting product such as WSO2 ESB, WSO2 Application Server, WSO2 Data Services Server.

Prerequisites of the use case

  1. Download and start WSO2 BAM and log in to its management console. Instructions are given in section Getting Started. 
  2. Set up BAM Service Statistics Data Agent or BAM Mediator in a service-hosting WSO2 product. In this example, we use WSO2 ESB. Follow the instructions in BAM Mediator. Alternatively, you can pump some sample service statistics by running ant command in $bam_home /samples/activity-monitoring folder.

    You can give custom values in parameters for Data receiver URL, user name and password. Default values are as follows. 

    ParameterDefault Value
    URLtcp://localhost:7611
    User Nameadmin
    Passwordadmin

     Now lets see how new values can be given as parameters  

    ParameterNew Value
    URLtcp://localhost:7612
    User Nameuser
    Passwordpass123

     Command with new values : ant -Durl=tcp://localhost:7612 -Dusername=user -Dpassword=pass123

    Activity monitoring toolbox that comes with this sample is using the embedded H2 database to persist summarized data. It only works with a default BAM installation. Therefore, if you change the default settings (such as port offset and h2 database), you have to change Hive script accordingly. For example, if you offset the default BAM port, update the Cassandra port of the Hive script accordingly: cassandra.port = 9161.

Installing the toolbox 

  1. Log in to BAM's management console and select Add under BAM Toolbox in the Main menu.
  2. The Add Tool Box page appears.
  3. Select the Activity Monitoring Toolbox and Install. It deploys all required artifacts to BAM.

    You might have to wait a few seconds and refresh the page to see the status as Installed.

Executing the analytics scripts

  1. After installing the toolbox, navigate to List under Analytics in the Main menu.
  2. When installing the toolbox, an analytics script is added as follows. Click the Execute link associated with it to display statistics on the dashboard.

    But, if you are sending data through BAM mediator, then edit this script and use the stream name of BAM mediator for cassandra.cf.name value and then execute. 

Configure summarized database

You can configure a summarized database in <BAM_HOME>/repository/conf/datasources/master-datasources.xml file as follows:

<datasource> 
           <name>WSO2BAM_DATASOURCE</name> 
           <description>The datasource used for analyzer data</description> 
           <definition type="RDBMS"> 
               <configuration> 
                   <url>jdbc:h2:repository/database/samples/BAM_STATS_DB;AUTO_SERVER=TRUE</url> 
                   <username>wso2carbon</username> 
                   <password>wso2carbon</password> 
                   <driverClassName>org.h2.Driver</driverClassName> 
                   <maxActive>50</maxActive> 
                   <maxWait>60000</maxWait> 
                   <testOnBorrow>true</testOnBorrow> 
                   <validationQuery>SELECT 1</validationQuery> 
                   <validationInterval>30000</validationInterval> 
               </configuration> 
           </definition> 
</datasource>

You can also configure the Cassandra datasource in the Hive script in master-datasources.xml.

Displaying statistics on dashboard

  1. After running the Hive script, clickDashboard in the Main menu.
  2. The dashboard displays all activity IDs received during a given date-time range and for selected Server, Service and Operation. For example
  3. Click Explore to view all messages related to a specific activity ID in a given selection criteria. Error messages appear highlighted in red. Data other than header, body and host address appear when you click the green Explore button.
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.