Page tree

You can create a monitoring policy to configure agents to receive alarms from monitors. For example, you use BMC PATROL 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

http://<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",
                    "id": "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

AttributesDescription
agentThresholdConfigurationLists the threshold definitions for the agent
solutionThresholdsLists the threshold definitions that are grouped by solutions
solutionNameName of the monitoring solution
solutionVersionVersion of the specified monitoring solution
monitorsDetails 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 Listing the available monitor solutions.

attributesThreshold definitions for the monitor attribute
attributeNameName of the monitor attribute
scope

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

  • monitorType
  • instances

The default value is monitorType.

agentThresholdsThreshold definitions that are grouped by instances for the specified monitor attribute
instanceNameName of the monitor instance for which you want to apply the threshold
thresholdsThreshold definitions that are grouped by type for the specified instance
type

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

  • border
  • alarm1
  • alarm2
detailsDetails of the threshold
triggerAlarmWhen

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

  • immediatelyOnAlarm
  • afterAlarmCount
  • afterAllRecoveryActionsFail

The default value is immediatelyOnAlarm.

minimumMinimum threshold value
maximumMaximum 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.

alarmCountSpecifies the alarm count for the threshold. The count numbers are in the range of 0 – 999.
agentSelectionCriteriaSet 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
precedencePriority 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 999.
tenantDetails 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.

nameName of the policy
type

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

  • blackout
  • monitoring
descriptionBrief 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
associatedUserGroupName 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 Central Monitoring Administration functions with web services