Creating a monitoring policy using web services to configure thresholds for Agents


You can create a monitoring policy to configure BMC PATROL Agents to receive alarms from monitors. For example, you use Agents with Windows KM. You want to get warning alarms or events when the memory usage exceeds 60%, and you want to get critical alarms when the usage exceeds 80%. You want to get these warnings and alarms only for the explorer.exe process. To achieve this, you must set thresholds accordingly and specify appropriate monitor instances.

URL to create a monitoring policy to configure thresholds for Agents

https://<TSPShostname>:<port>/tsws/10.0/api/unifiedadmin/MonitoringPolicy/create

Input parameters to configure thresholds for Agents

{
{
   
           "monitoringPolicy": {
               "id": "27d1479e-4766-48ca-9582-ba436e821155",
               "name": "agentthresholdconfiguration11",
               "type": "monitoring",
               "description": "",
               "tenant": {
                   "name": "tenant1"
               },
               "precedence": 45,
               "agentSelectionCriteria": "agentOS CONTAINS \"windows\" ",
               "associatedUserGroup": "BMCTenantAdmin",
               "owner": "test3",
               "agentThresholdConfiguration": {
                   "solutionThresholds": [
                       {
                           "solutionName": "psx_epd",
                           "solutionVersion": "4.8.00",
                           "monitors": [
                               {
                                   "monitorType": "NT_MEMORY",
                                   "attributes": [
                                       {
                                           "attributeName": "MEMmemAvailableBytes",
                                           "scope": "type",
                                           "agentThresholds": [
                                               {
                                                   "instanceName": "__ANYINST__",
                                                   "thresholds": [
                                                       {
                                                           "type": "Border",
                                                           "severity": "OK",
                                                           "triggerAlarmWhen": 0,
                                                           "enable": true,
                                                           "minimum": 1,
                                                           "maximum": 10,
                                                           "alarmCount": 0
                                                       },
                                                       {
                                                           "type": "ALARM1",
                                                           "severity": "ALARM",
                                                           "triggerAlarmWhen": 0,
                                                           "enable": true,
                                                           "minimum": 2,
                                                           "maximum": 5,
                                                           "alarmCount": 0
                                                       },
                                                       {
                                                           "type": "ALARM2",
                                                           "severity": "WARN",
                                                           "triggerAlarmWhen": 1,
                                                           "enable": true,
                                                           "minimum": 7,
                                                           "maximum": 9,
                                                           "alarmCount": 2
                                                       }
                                                    ],
                                                   "regEx": false
                                               }
                                            ],
                                           "regEx": false
                                       }
                                    ]
                               }
                            ]
                       }
                    ]
               },
               "enabled": true,
               "shared": false
           }
       }

The following table lists the parameters that you must provide with the URL.

List of required parameters that must be provided to access the create API

Attributes

Description

agentThresholdConfiguration

Lists the threshold definitions for the agent

solutionThresholds

Lists the threshold definitions that are grouped by solutions

solutionName

Name of the monitoring solution

solutionVersion

Version of the specified monitoring solution

monitors

Details about the monitors

monitorType

Type of the monitor

You can use the solutions API to know the supported monitor types. For information about the solutions API, see List-of-Monitoring-Solutions-and-KMs-in-Infrastructure-Management.

attributes

Threshold definitions for the monitor attribute

attributeName

Name of the monitor attribute

scope

Scope for the threshold. The supported values are as follows:

  • monitorType
  • instances

The default value is monitorType.

agentThresholds

Threshold definitions that are grouped by instances for the specified monitor attribute

instanceName

Name of the monitor instance for which you want to apply the threshold

thresholds

Threshold definitions that are grouped by type for the specified instance

type

Type of the threshold. The supported values are as follows:

  • border
  • alarm1
  • alarm2

details

Details of the threshold

triggerAlarmWhen

Specifies when to trigger the alarm. The supported values are as follows:

  • immediatelyOnAlarm
  • afterAlarmCount
  • afterAllRecoveryActionsFail

The default value is immediatelyOnAlarm.

minimum

Minimum threshold value

maximum

Maximum threshold value

enable

Specifies whether the threshold is enabled or not. The supported values are as follows:

  • true
  • false

severity

Severity of the threshold. The supported values are as follows:

  • OK
  • WARN
  • ALARM

The default value is ALARM if the alarm range is enabled, and the default value is OK if the alarm range is disabled.

alarmCount

Specifies the alarm count for the threshold. The count numbers are in the range of 0 – 999.

agentSelectionCriteria

Set of conditions based on which the agents are identified to create the policy

The syntax is  "agentIdentifier operator \"value\""

where,

  • agentIdentifier refers to the agent attributes, based on which the agent is identified. The supported identifiers are as follows:
    • agentName—Host name of the computer on which the BMC PATROL Agent is installed
    • agentPort—Port number through which the Integration Service connects with the agent
    • agentVersion—Version of the BMC PATROL Agent
    • agentOS—Operating system of the computer on which the BMC PATROL Agent is installed
    • agentIP—IP address of the computer on which the BMC PATROL Agent is installed
    • agentTag—Tag name of the BMC PATROL Agent
    • integrationService—Display name of the Integration Service
    • childServer—Host name of the Child Server that is registered with Central Monitoring Administration

precedence

Priority for the policy. The supported values are numbers between 0 and 999 with 999 being the lowest priority and 0 being the top priority.
The default value is 900.

tenant

Details of the tenant who owns the policy. You can either provide name or the id of the tenant.

name

Name of the tenant who owns the policy. The supported values are as follows:

  • <nameOfTenant>—Indicates that the policy is applicable to the specified tenant
  • GLOBAL—Indicates that the policy is applicable to all agents
  • PROVIDER—Indicates that the policy is applicable to the cloud service provider and also to the agents that do not have any tenants

enabled

Indicates whether the policy is enabled. The supported values are as follows:

  • true
  • false

The default value is true.

name

Name of the policy

type

Type of the policy. The supported types are as follows:

  • blackout
  • monitoring

description

Brief description about the policy

shared

Supports two values:

  • true - the policy can be shared among users of specific user group
  • false - the policy cannot be shared with anybody

associatedUserGroup

Name of the user group with which you want to associate the policy

JSON response

A monitoring policy is created, and a sample response is as follows:

{
   "response": [
       {
           "name": "agentthresholdconfiguration11",
           "statusCode": "200",
           "statusMsg": "Successfully created policy",
           "policyId": "700"
       }
    ],
   "statusCode": "200",
   "statusMsg": "OK",
   "responseTimeStamp": "2012-06-20T08:36:24",
}

Related topics

Creating-a-policy-using-web-services

Managing-policies-using-web-services

Performing-infrastructure-monitoring-functions-with-web-services

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC TrueSight Infrastructure Management 11.3.04