Alarm policy management endpoints in the REST API
The following section provides a list of supported endpoints and an overview about running these endpoints. Before you run an endpoint, you must authenticate yourself. For more information, see Access and authentication for the REST API.
Run APIs to create, update, enable, disable, delete, and search for alarm policies.
Alarm policy management
Use REST APIs to create, update, enable, disable, and delete alarm policies.
POST alarm_policies
Create an alarm policy
Authorization: Bearer <JWT_token>
For instructions on obtaining the JWT token, see Access and authentication for the REST API.
Parameter details
Request body
"entityThresholds":[
{
"metricDetails":{
"entityTypeId":"String",
"metricId":"String",
"label":"String",
"unit":"String",
"path":"String"
},
"order":Integer,
"alarmConfigurations":[
{
"condition":{
"comparison":"String",
"threshold":"String",
"duration":Integer,
"baseline":Boolean
},
"action":{
"severity":"String",
"autoClose":Boolean
},
"configOrder":Integer
}
],
"type":"String",
"evaluationCriteria":"String"
}
],
"enabled":Boolean,
"policyName":"String",
"description":"String",
"executionOrder":Integer
}
Example request body
Example 1: Static threshold condition
"entityThresholds": [
{
"metricDetails": {
"entityTypeId": "IAK_WPAR",
"metricId": "UsedMemory",
"label": "Memory Used",
"unit": "MB",
"path": "iak/1.1.20/IAK_WPAR/UsedMemory"
},
"order": 0,
"alarmConfigurations": [
{
"condition": {
"comparison": "above",
"threshold": 18,
"duration": 10,
"baseline": false
},
"action": {
"severity": "CRITICAL",
"autoClose": false
},
"configOrder": 0
}
],
"type": "MULTI",
"evaluationCriteria": "( agent_host_name starts-with 'clm-pun-' ) AND ( agent_os contains 'Windows' ) "
}
],
"enabled": true,
"policyName": "Test_Alarm_2",
"description": "Creating Alarm Policy",
"executionOrder": 9999
}
Example 2: Baseline threshold condition
"entityThresholds": [
{
"metricDetails": {
"entityTypeId": "NUK_CPU",
"metricId": "Utilization",
"label": "Utilization",
"unit": "%",
"path": "nuk/22.4.00/NUK_CPU/Utilization"
},
"order": 0,
"alarmConfigurations": [
{
"condition": {
"baseline": true,
"duration": 5
},
"action": {
"severity": "MAJOR"
},
"configOrder": 0
}
],
"type": "MULTI",
"evaluationCriteria": "( agent_host_name starts-with 'clm-pun-' ) AND ( agent_os contains 'Windows' ) "
}
],
"enabled": true,
"policyName": "Baseline violation",
"description": "Metric violates the baseline value",
"executionOrder": 9999
}
Successful response
"statusCode": "200",
"resourceId": [
"fbddd7eb-9e56-495e-bb27-36c0b540553c"
]
}
Unsuccessful responses
Scenario 1
There must be exactly one space character on each side of the following elements:
• Operator
• Parenthesis
Scenario 2
"statusCode": "POLICY_ALREADY_EXIST",
"resourceId": null
}
PUT alarm_policies/<policy ID>
Important
To update an existing policy, make sure that you send the entire policy detail request payload with the required values.
This update replaces the existing policy definition similar to overwriting changes in a file.
Update an alarm policy
Authorization: Bearer <JWT_token>
For instructions on obtaining the JWT token, see Access and authentication for the REST API.
Parameter details
Request body
"entityThresholds":[
{
"metricDetails":{
"entityTypeId":"String",
"metricId":"String",
"label":"String",
"unit":"String",
"path":"String"
},
"order":Integer,
"alarmConfigurations":[
{
"condition":{
"comparison":"String",
"threshold":"String",
"duration":Integer,
"baseline":Boolean
},
"action":{
"severity":"String",
"autoClose":Boolean
},
"configOrder":Integer
}
],
"type":"String",
"evaluationCriteria":"String"
}
],
"enabled":Boolean,
"policyName":"String",
"description":"String",
"executionOrder":Integer
}
Example request body
Example 1: Static threshold condition
"id": "f835a4f5-116f-4282-b489-fcae7d46a913",
"policyName": "Test_Alarm_2",
"description": "Creating Alarm Policy",
"enabled": false,
"entityThresholds": [
{
"metricDetails": {
"entityTypeId": "IAK_WPAR",
"metricId": "UsedMemory",
"label": "Memory Used",
"unit": "MB",
"path": "iak/1.1.20/IAK_WPAR/UsedMemory"
},
"type": "MULTI",
"evaluationCriteria": "( agent_host_name starts-with 'clm-pun-' ) AND ( agent_os contains 'Windows' ) ",
"alarmConfigurations": [
{
"configId": "daf17a3b-0daa-4418-a8eb-efdb673cc4db",
"condition": {
"comparison": "above",
"threshold": 18,
"duration": 10,
"occurrence": 0,
"baseline": false
},
"action": {
"severity": "CRITICAL",
"autoClose": false
},
"configOrder": 0
}
],
"order": 0
}
],
"executionOrder": 9999
}
Example 2: Baseline threshold condition
"id": "d6155947-eb21-4797-b75b-1ffb41e83573",
"policyName": "Baseline violation",
"description": "Metric violates the baseline value",
"enabled": false,
"entityThresholds": [
{
"metricDetails": {
"entityTypeId": "NUK_CPU",
"metricId": "Utilization",
"label": "Utilization",
"unit": "%",
"path": "nuk/22.4.00/NUK_CPU/Utilization"
},
"type": "MULTI",
"evaluationCriteria": "( agent_host_name starts-with 'clm-pun-' ) AND ( agent_os contains 'Windows' ) ",
"alarmConfigurations": [
{
"configId": "d32c3620-4947-44c2-98ae-bb067ba94751",
"condition": {
"baseline": true,
"duration": 1
},
"action": {
"severity": "MINOR",
"autoClose": false,
"closeDuration": 0
},
"configOrder": 0
}
],
"order": 0
}
],
"executionOrder": 9999
}
Example 3: Add a metric to an existing policy
"id": "d6155947-eb21-4797-b75b-1ffb41e83573",
"policyName": "Service status and CPU usage",
"description": "Service status and CPU usage",
"enabled": false,
"entityThresholds": [
{
"metricDetails": {
"entityTypeId": "NT_SERVICES",
"metricId": "ServiceStatus",
"unit": "0 - Running, 1 - Ok not running, 2 - Warning not running, 3 - Alarm not running",
"label": "Service status",
"path": "psx_epd/20.05.11/NT_SERVICES/ServiceStatus"
},
"type": "MULTI",
"evaluationCriteria": "( agent_host_name string-equals 'clm-aus-vag88w' )",
"alarmConfigurations": [
{
"configId": "11a1590d-4d7d-4c4f-8f75-71fa2eb7ca09",
"condition": {
"comparison": "equal",
"threshold": 0,
"duration": 1,
"occurrence": 0,
"baseline": false
},
"action": {
"severity": "CRITICAL",
"autoClose": true,
"closeDuration": 0
},
"configOrder": 0
}
],
"order": 0
},
{
"metricDetails": {
"entityTypeId": "NUK_Process",
"metricId": "ProcessCpuUsage",
"unit": "%",
"label": "CPU used by monitored process",
"path": "nuk/22.4.11/NUK_Process/ProcessCpuUsage"
},
"type": "ALL",
"evaluationCriteria": "",
"alarmConfigurations": [
{
"configId": "b9b3c8f9-5976-4160-a602-9e0073fcc775",
"condition": {
"comparison": "above",
"threshold": 70,
"duration": 0,
"occurrence": 0,
"baseline": false
},
"action": {
"severity": "CRITICAL",
"autoClose": false,
"closeDuration": 0
},
"configOrder": 0
}
],
"order": 1
}
],
"executionOrder": 8655
}
Here, ProcessCpuUsage is the new metric that is added to the existing policy.
Successful response
"statusCode": "200",
"resourceId": [
"27391336-80e8-457c-ab6c-2ab0e27a2954"
]
}
Unsuccessful responses
Scenario 1: Policy does not exist
"statusCode": "POLICY_NOT_EXIST",
"resourceId": null
}
Scenario 2: Incorrect or invalid policy precedence
Scenario 3: The EntityTypeID parameter is empty
"statusCode": "500",
The EntityTypeId parameter cannot be empty or null.
}
Scenario 4: The EntityTypeID parameter is invalid
"statusCode": "500",
Invalid EntityTypeId.
}
Scenario 1: Invalid instance type
"statusCode": "500",
Invalid type : nIK3HXRc
}
POST alarm_policies/<policy ID>/enable
Enable an alarm policy
Authorization: Bearer <JWT_token>
For instructions on obtaining the JWT token, see Access and authentication for the REST API.
Parameter details
Successful response
"statusCode":"200"
}
Unsuccessful responses
Scenario 1: Invalid policy ID
"statusCode":"500"
Invalid UUID string: 263927105892830
}
Scenario 2: Incorrect policy ID format
"statusCode":"500"
Error at index 9 in: "d38ccf559re7"
}
POST alarm_policies/<policy ID>/disable
Disable an alarm policy
Authorization: Bearer <JWT_token>
For instructions on obtaining the JWT token, see Access and authentication for the REST API.
Parameter details
Successful response
"statusCode":"200"
}
Unsuccessful responses
Scenario 1: Invalid policy ID
"statusCode":"500"
Invalid UUID string: 263927105892830
}
Scenario 2: Incorrect policy ID format
"statusCode":"500"
Error at index 9 in: "d38ccf559re7"
}
DELETE alarm_policies/<policy ID>
Delete an alarm policy
Authorization: Bearer <JWT_token>
For instructions on obtaining the JWT token, see Access and authentication for the REST API.
Parameter details
Successful response
"statusCode":"200",
"customMsg":"[Deleted policies.]"
}
Unsuccessful responses
Scenario 1: Incorrect policy ID
"statusCode": "500"
}
Scenario 1: Invalid policy ID
"statusCode": "404"
}
Alarm policy search
You can search for alarm policies based on one of the following criterion:
- Policy ID
- Other criteria that you specify
Run the APIs in this section to search for alarm policies.
GET alarm_policies/<policy ID>
Search for an alarm policy based on the policy ID
Authorization: Bearer <JWT_token>
For instructions on obtaining the JWT token, see Access and authentication for the REST API.
Parameter details
Successful response
Example 1: Response
"responseTimeStamp": 1613549398716,
"statusCode": "200",
"statusMsg": "policy list success",
"totalRecords": 1,
"policies": [
{
"tenantId": "1786266992",
"id": "a3328dc5-3c2a-420c-a3e4-8b895eca0b87",
"policyName": "Test_Alarm_1",
"description": "",
"enabled": false,
"owner": "admin",
"createdTime": 1613542081767,
"modifiedTime": 1613542081767,
"entityThresholds": [
{
"metricDetails": {
"entityTypeId": "IAK_WPAR",
"metricId": "CPUUtilization",
"unit": "%",
"label": "CPU Utilization",
"path": "iak/1.1.20/IAK_WPAR/CPUUtilization"
},
"type": "MULTI",
"evaluationCriteria": "agent_os contains 'AIX' ",
"alarmConfigurations": [
{
"configId": "06177e2f-0a9d-482b-8fe3-35eec9adeef2",
"condition": {
"comparison": "above",
"threshold": 19,
"duration": 10,
"occurrence": 0,
"baseline": false
},
"action": {
"severity": "CRITICAL",
"autoClose": true,
"closeDuration": -1
},
"configOrder": 0
}
],
"order": 0
}
],
"executionOrder": 9999
}
]
}
Example 2: Response
"responseTimeStamp": 1613549398716,
"statusCode": "200",
"statusMsg": "policy list success",
"totalRecords": 1,
"policies": [
{
"tenantId": "1786266992",
"id": "d6155947-eb21-4797-b75b-1ffb41e83573",
"policyName": "Baseline violation",
"description": "Metric violates the baseline value",
"enabled": false,
"owner": "admin",
"createdTime": 1613542081767,
"modifiedTime": 1613542081767,
"entityThresholds": [
{
"metricDetails": {
"entityTypeId": "NUK_CPU",
"metricId": "Utilization",
"unit": "%",
"label": "Utilization",
"path": "nuk/22.4.00/NUK_CPU/Utilization"
},
"type": "MULTI",
"evaluationCriteria": "( agent_host_name starts-with 'clm-pun-' ) AND ( agent_os contains 'Windows' ) ",
"alarmConfigurations": [
{
"configId": "d32c3620-4947-44c2-98ae-bb067ba94751",
"condition": {
"baseline": true,
"duration": 1
},
"action": {
"severity": "MINOR",
"autoClose": false,
"closeDuration": 0
},
"configOrder": 0
}
],
"order": 0
}
],
"executionOrder": 9999
}
]
}
POST alarm_policies/search
Search for an alarm policy based on specified criteria
Authorization: Bearer <JWT_token>
For instructions on obtaining the JWT token, see Access and authentication for the REST API.
Parameter details
Request body
"searchString":"String",
"sortCriteria":{
"attribute":"String",
"order":"String"
}
}
Example request body
"searchString": "PATROL Knowledge Module for Linux",
"sortCriteria": {
"attribute": "modifiedTime",
"order": "DESC"
}
}
Successful response
"statusCode": "200",
"totalRecords": 1,
"policies": [
{
"tenantId": "1877651219",
"id": "6d87d1b0-ba46-4a60-a35d-3c6cd84f1fd2",
"policyName": "PATROL Knowledge Module for Linux",
"description": "Global threshold configuration policy for Collection status(Disks), Collection status(File Systems), FileSystem Mount Status(File System), Process Count Check(Process), Process Ownership Check(Process), Parent PID is 1(Process). ",
"enabled": true,
"owner": "admin",
"createdTime": 1664271514462,
"modifiedTime": 1694685867428,
"executionOrder": 9999,
"entityThresholds": [
{
"metricDetails": {
"entityTypeId": "NUK_Disk_Container",
"metricId": "_CollectionStatus",
"unit": "1 - OK, 2 - Not OK",
"label": "Collection status",
"path": "nuk/22.4.11/NUK_Disk_Container/_CollectionStatus"
},
"type": "ALL",
"evaluationCriteria": "",
"alarmConfigurations": [
{
"configId": "5b81b51f-f18c-4861-9909-c72de3915319",
"condition": {
"comparison": "equal",
"threshold": 2,
"duration": 5,
"occurrence": 0,
"baseline": false
},
"action": {
"severity": "CRITICAL",
"autoClose": true,
"closeDuration": -1
},
"configOrder": 0
}
],
"order": 0
},
{
"metricDetails": {
"entityTypeId": "NUK_FileSystem_Container",
"metricId": "_CollectionStatus",
"unit": "1 - OK, 2 - Not OK",
"label": "Collection status",
"path": "nuk/22.4.11/NUK_FileSystem_Container/_CollectionStatus"
},
"type": "ALL",
"evaluationCriteria": "",
"alarmConfigurations": [
{
"configId": "e5f025ff-610c-4cf7-b5ed-2072e2e1db52",
"condition": {
"comparison": "equal",
"threshold": 2,
"duration": 5,
"occurrence": 0,
"baseline": false
},
"action": {
"severity": "CRITICAL",
"autoClose": true,
"closeDuration": -1
},
"configOrder": 0
}
],
"order": 1
},
{
"metricDetails": {
"entityTypeId": "NUK_FileSystem",
"metricId": "MountStatus",
"unit": "0 - OK, 1 - Unmounted, 2 - Unknown",
"label": "Filesystem mount status",
"path": "nuk/22.4.11/NUK_FileSystem/MountStatus"
},
"type": "ALL",
"evaluationCriteria": "",
"alarmConfigurations": [
{
"configId": "348ea3b6-1b02-4217-9d1d-82b9a8d7a8dc",
"condition": {
"comparison": "equal",
"threshold": 1,
"duration": 5,
"occurrence": 0,
"baseline": false
},
"action": {
"severity": "CRITICAL",
"autoClose": true,
"closeDuration": -1
},
"configOrder": 0
}
],
"order": 2
},
{
"metricDetails": {
"entityTypeId": "NUK_Process",
"metricId": "ProcessCountCheck",
"unit": "0 - OK, 1 - Warning, 2 - Alarm",
"label": "Process count check",
"path": "nuk/22.4.11/NUK_Process/ProcessCountCheck"
},
"type": "ALL",
"evaluationCriteria": "",
"alarmConfigurations": [
{
"configId": "0579bbc3-736a-405a-8cd4-867fb610c4f5",
"condition": {
"comparison": "equal",
"threshold": 2,
"duration": 5,
"occurrence": 0,
"baseline": false
},
"action": {
"severity": "CRITICAL",
"autoClose": true,
"closeDuration": -1
},
"configOrder": 0
}
],
"order": 3
},
{
"metricDetails": {
"entityTypeId": "NUK_Process",
"metricId": "ProcessOwnerCheck",
"unit": "0 - OK, 1 - Warning, 2 - Alarm",
"label": "Process ownership check",
"path": "nuk/22.4.11/NUK_Process/ProcessOwnerCheck"
},
"type": "ALL",
"evaluationCriteria": "",
"alarmConfigurations": [
{
"configId": "b390e582-5fa8-40d7-aed2-680440b2bf9b",
"condition": {
"comparison": "equal",
"threshold": 2,
"duration": 5,
"occurrence": 0,
"baseline": false
},
"action": {
"severity": "CRITICAL",
"autoClose": true,
"closeDuration": -1
},
"configOrder": 0
}
],
"order": 4
},
{
"metricDetails": {
"entityTypeId": "NUK_Process",
"metricId": "ProcessParentPID1",
"unit": "0 - OK, 1 - Warning, 2 - Alarm",
"label": "Parent PID is 1",
"path": "nuk/22.4.11/NUK_Process/ProcessParentPID1"
},
"type": "ALL",
"evaluationCriteria": "",
"alarmConfigurations": [
{
"configId": "6ca0a52a-c9f7-4746-944e-53c10f2bbe09",
"condition": {
"comparison": "equal",
"threshold": 2,
"duration": 5,
"occurrence": 0,
"baseline": false
},
"action": {
"severity": "CRITICAL",
"autoClose": true,
"closeDuration": -1
},
"configOrder": 0
}
],
"order": 5
}
]
}
]
}