BMC — Whitelisting Applications Services and KPIs
Whitelist applications, services, and KPIs for the BMC plugin via API calls.
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 following command:
curl -k -H "Content-Type: application/json" -H "Authorization:$signature" -X POST -d @application.json https://<controlcenterip>:<controlcenterport>/healcontrolcenter/ v2.0/api/accounts/<accountidentifier>/whitelist
-
-
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’s JSON file should be as follows:[ { "applicationName":"App-Service-02-DR", "applicationSuppressionInterval":25 }, { "applicationName":"CBC-DC", "applicationSuppressionInterval":25 } ]
-
Note: To get the application name from Percona, do the following:
- Go to the Percona database and select the appsone schema.
- Execute the command below to get all the applications:
Select * from a controller where controller_type_id=191
3. URL details are as follows:
Control Center_IP_Hostname: IP address or the server’s hostname where HEAL is installed.
Control Center_Port: Port number of the server where HEAL is running.
AccountIdentifier: The identity of the account being monitored. An account identifier is available in the Manage Accounts screen of the HEAL Control Center UI.
4. The above result will be stored in the Percona Database.
Navigate to the Controller table and verify the values for the column below.
-
- Plugin_supr_interval and
- plugin_Whitelist_status
Whitelisting Services#
API requests must contain the following:
1. To obtain the Keycloak authentication token, execute the 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 command below:
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/<application-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>';
-
-
Before whitelisting the application, ensure the following:
Create a sample JSON file listing 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 follows:[ { "serviceName":"Web-Service-02-DR", "serviceSuppressionInterval":12 }, { "serviceName":"OnlineBanking-Service-DR", "serviceSuppressionInterval":12 } ]
-
Note: To get the application name from Percona, do the following:
- Go to the Percona database and select the appsone schema.
Run the command below to get all the services:
Select * from a controller where controller_type_id=192You can add multiple services that belong to the application.
3. 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: The identity of the account being monitored. An account identifier is available in the Manage Accounts screen of the HEAL Control Center UI.
Whitelisting KPIs#
API requests must contain the following:
To obtain the Keycloak authentication token, execute the command below 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`
To whitelist the application, execute the command below:
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/<application- id>/service/<service-id>/whitelist
Retrieved the service ID by executing the following query:
SELECT service_id FROM view_application_service_mapping WHERE service_name = '<Name_of_service>';
- 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 follows:[ "Ping Status", "Established Status", "Listen Status", "Process Running" ]
-
Note: Execute the command below to get all the KPIs:
select * from mst_kpi_details
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: The identity 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.
Whitelisted Status#
The command below (input) provides the status of the whitelisted applications, services, and KPIs.
curl -k -H "Authorization:$signature" -X GET https://<controlcenterip>:<controlcenterport>/heal-controlcenter/v2.0/api/accounts/<accountidentifier>/whitelist
For Example:
Input:
http://192.0.2.2:8082/appsone- controlcenter/v2.0/api/accounts/qa-d681ef13-d690-4917- 9f3a-6c79b- 1/whitelist
Output:
{
"message": "SUCCESS", "responseStatus": "SUCCESS", "data": {
"whitelistActive": true, "whiteList": [
{
"applicationName": "OnlineBanking-DR", "applicationSuppressionInterval": 0, "serviceWhitelist": [
{
"serviceName": "DB-Service-01-DR", "kpiWhitelist": [
"CPU Util", "Memory Util", "Listen Status", "Established Status", "Ping Status"
],
"serviceSuppressionInterval": 0
}
]
},
{
"applicationName": "Dot_Net", "applicationSuppressionInterval": 0, "serviceWhitelist": [
{
"serviceName": "DontNet-App-Service", "kpiWhitelist": [], "serviceSuppressionInterval": 5
}
]
}
]
}
}