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.
http://<TSPShostname:port#>/tsws/10.0/api/unifiedadmin/MonitoringPolicy/create
{ { "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
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 Listing the available monitor solutions. |
attributes | Threshold definitions for the monitor attribute |
attributeName | Name of the monitor attribute |
scope | Scope for the threshold. The supported values are as follows:
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:
|
details | Details of the threshold |
triggerAlarmWhen | Specifies when to trigger the alarm. The supported values are as follows:
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:
|
severity | Severity of the threshold. The supported values are as follows:
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,
|
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 999. |
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:
|
enabled | Indicates whether the policy is enabled. The supported values are as follows:
The default value is true. |
name | Name of the policy |
type | Type of the policy. The supported types are as follows:
|
description | Brief description about the policy |
shared | Supports two values:
|
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", }
Creating a policy using web services
Managing policies using web services
Performing Central Monitoring Administration functions with web services