Skip to content

Pager Duty — Whitelisting Applications Services and KPIs

Whitelist applications, services, and KPIs for the PagerDuty plugin via API requests.

4 min read Updated SS

Whitelisting happens at three levels as follows: Application Service, and KPIs

Whitelisting Applications#

API requests must contain the following:

  1. To obtain the Keycloak authentication token, execute this command by replacing the Keycloak IP and port.

    export signature=`curl -s -k -X POST -d "client_id=admin-cli" -d
    "username=appsoneadmin" -d "password=<password>" -d
    "grant_type=password" https://<keyclock
    ip:port/auth/realms/master/protocol/openid-connect/token | jq
    '.access_token' | cut -d '"' -f 2`
    
  2. To whitelist the application, execute the below command:

    curl -k -H "Content-Type: application/json" -H
    "Authorization:$signature" -X POST -d @application.json
    https://<controlcenterip>:<controlcenterport>/heal-
    controlcenter/v2.0/api/accounts/<accountidentifier>/whitelist
    
    1. Before whitelisting the application, ensure the following:

      Create a sample JSON file containing the names of all applications that need to be whitelisted, and then specify the file path in the whitelist command.

      For Example: application.json

      The application JSON file should be as below:
      [
      {
      "applicationName":"App-Service-02-DR",
      "applicationSuppressionInterval":25
      },
      {
      "applicationName":"CBC-DC",
      "applicationSuppressionInterval":25
      }
      ]
      

      Note: To get the application name from the percona as follows: Navigate to the percona database and select the appsone schema. Execute the below command to get all the applications:

      Select * from a controller where controller_type_id=191
      

      You can add multiple applications separated by a comma.

  3. URL Details as follows:

    Control Center_IP_Hostname: IP Address or the Hostname of the server where HEAL is installed.

    Control Center_Port: Port number of the server where HEAL is running.

    AccountIdentifier: Identifier of the Account being monitored. An Account Identifier is available in the Manage Accounts Screen of the HEAL Control Center UI.

  4. Above result will be stored in the Percona Database.

    Navigate to the Controller table and verify the values for the below column.

    Plugin_supr_interval and

    plugin_Whitelist_status

Whitelisting Services#

API requests must contain the following:

  1. To obtain the keyclock authentication token, execute the command by replacing the keyclock IP and Port.

    export signature=`curl -s -k -X POST -d "client_id=admin-cli" -d
    "username=appsoneadmin" -d "password=<password>"
    -d "grant_type=password" https://<keyclock
    ip:port/auth/realms/master/protocol/openid-connect/token | jq
    '.access_token' | cut -d '"' -f 2`
    
  2. To whitelist the application, execute the below command:

    curl -k -H "Content-Type: application/json" -H
    "Authorization:$signature" -X POST -d @service.json
    https://<controlcenterip>:<controlcenterport>/heal-
    controlcenter/v2.0/api/accounts/<accountidentifier>/applications/<ap
    plication-id>/whitelist
    
  3. Retrieve the application ID by executing the following query:

    SELECT application_id
    FROM view_application_service_mapping
    WHERE application_name = '<Name_of_application>';
    
    1. Before whitelisting the application, ensure the following:

      Create a sample JSON file containing the names of all services that need to be whitelisted, and then specify the file path in the whitelist command.

      For Example: service.json

      The service JSON file should be as below:

      [
      {
      "serviceName":"Web-Service-02-DR",
      "serviceSuppressionInterval":12
      },
      {
      "serviceName":"OnlineBanking-Service-DR",
      "serviceSuppressionInterval":12
      }
      ]
      

      Note: To get the application name from the percona as follows: Navigate to the percona database and select the appsone schema. Execute the below command to get all the services:

      Select * from a controller where controller_type_id=192
      

      You can add multiple services that belong to the application.

  4. URL Details as follows:

    Control Center_IP_Hostname: IP Address or the Hostname of the server where HEAL is installed.

    Control Center_Port: Port number of the server where HEAL is running.

    AccountIdentifier: Identifier of the Account being monitored. An Account Identifier is available in the Manage Accounts Screen of HEAL Control Center UI.

Whitelisting KPIs#

API requests must contain the following:

  1. To obtain the keyclock authentication token, execute the below command by replacing the keyclock IP and Port.

    export signature=`curl -s -k -X POST -d "client_id=admin-cli" -d
    "username=appsoneadmin"
    -d "password=<password>"
    -d "grant_type=password" https://<keyclock
    ip:port/auth/realms/master/protocol/ openid-
    connect/token | jq '.access_token' | cut -d '"' -f 2`
    
  2. To whitelist the application, execute the below command:

    curl -k -H "Content-Type: application/json" -H
    "Authorization:$signature" -X POST -d @KPI.json
    https://<controlcenterip>:<controlcenterport>/heal-
    controlcenter/v2.0/api/accounts/<accountidentifier>/applications/<ap
    plication- id>/service/<service-id>/whitelist
    
  3. Retrieve the service ID by executing the following query:

    SELECT service_id
    FROM view_application_service_mapping
    WHERE service_name = '<Name_of_service>';
    
    1. Before whitelisting the application, ensure the following:

      Create a sample JSON file containing the names of all KPIs that need to be whitelisted for the services and applications, and then specify the file path in the whitelist command.

      For Example: KPI.json

      The KPI JSON file should be as below:

      [
      "Ping Status",
      "Established Status",
      "Listen Status",
      "Process Running"
      ]
      

      Note: Execute the below command to get all the KPIs:

      select * from mst_kpi_details
      
  4. URL Details are as follows:

    Control Center_IP_Hostname: IP Address or the Hostname of the server where HEAL is installed.

    Control Center_Port: Port number of the server where HEAL is running.

    AccountIdentifier: Identifier of the Account being monitored. An Account Identifier is available in the Manage Accounts Screen of the HEAL Control Center UI.

    Service-id: Identifier assigned to a specific service within the application in the HEAL Control Center UI.