Unknown macro: {next_previous_links}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Follow the procedure below in order to configure WSO2 API Manager to receive geolocation based alerts.

  1. Download the Geolocation data from here.
  2. Unzip the file you downloaded.
  3. Create the database by executing one of the scripts in the Geolocation Data/dbscripts directory. In this example, mysql.sql is executed.

    This can be done using the MySQL Workbench.

    For detailed instructions to run the database script, see MySQL Documentation - The Workbench Scripting Shell.

  4. Restore data to the BLOCKS and LOCATION tables by importing data from the following files.

    • Geolocation Data/data/BLOCKS.csv
    • Geolocation Data/data/LOCATION.csv
  5. Download a JDBC provider depending on the database you are using (MySQL in this example), and copy it to the <DAS_HOME>/repository/components/lib directory.
  6. Configure datasource in the <DAS_HOME>/repository/conf/datasources/geolocation-datasources.xml file as follows.

    <datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">
        <datasources>
            <datasource>
                <name>GEO_LOCATION_DATA</name>
                <description>The datasource used for Geo location database</description>
                <jndiConfig>
                    <name>jdbc/GEO_LOCATION_DATA</name>
                </jndiConfig>
                <definition type="RDBMS">
                    <configuration>
                        <url>jdbc:mysql://localhost:3306/GEO_LOCATION_DATA</url>
                        <username>wso2carbon</username>
                        <password>wso2carbon</password>
                        <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                        <maxActive>50</maxActive>
                        <maxWait>60000</maxWait>
                        <testOnBorrow>true</testOnBorrow>
                        <validationQuery>SELECT 1</validationQuery>
                        <validationInterval>30000</validationInterval>
                        <defaultAutoCommit>false</defaultAutoCommit>
                    </configuration>
                </definition>
            </datasource>
        </datasources>
    </datasources-configuration>


  7. Log into the WSO2 API Manager Admin Portal using the https://localhost:<SERVER_PORT>/admin URL.
  8. Under Settings => Analytics, click Configure Alerts to open the Alert Configurations page.
  9. In the Geo Location Configurations section, click Activate for APIM_GEO_LOCATION_STATS. This opens the Edit Configuration page with the default configuration for geolocation statistics as shown below.

    Modify parameter values as required.
  10. Click Save Configuration.

The scrip that summarizes geolocation based statistics is run at hour 23.00 of each day. Therefore, statistics are not immediately shown when you enable geolocation based statistics. If you want these statistics to be updated immediately, follow the procedure below.

  1. In the WSO2 APIM Analytics Management Console, click the Main tab.
  2. In the Batch Analytics section, click Scripts.
  3. Click Execute for the APIMAnalytics-APIM_GEO_LOCATION_STATS-APIM_GEO_LOCATION_STATS-batch1 script.
  • No labels