Creating a monitoring policy to configure configuration variables


You can create a monitoring policy to configure configuration variables. For example, you want to apply PCONFIG variable-specific configuration on an agent. To achieve this, you can configure configuration variables using a monitoring policy.

URL to create a monitoring policy to configure configuration variables

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

Input parameters to create a monitoring policy to configure configuration variables

{
{
           "monitoringPolicy": {
               "id": "8d2629bd-be50-4031-89bb-80d54c32be96",
               "name": "configvar11",
               "type": "monitoring",
               "description": "",
               "tenant": {
                   "name": "tenant1",
                   "id": "tenant1"
               },
               "precedence": 12,
               "agentSelectionCriteria": "agentOS CONTAINS \"linux\" ",
               "associatedUserGroup": "BMCTenantAdmin",
               "owner": "test3",
               "rulesetConfiguration": {
                   "rulesets": [
                       {
                           "variable": "/AgentSetup/Identification/Tags/TAG",
                           "operation": "REPLACE",
                           "value": "linux:linux"
                       }
                    ]
               },
               "enabled": true,
               "shared": true
           }
    }

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

rulesetConfiguration

List of rules for the PCONFIG variables that you want to apply on the agent

rulesets

List of rules for each PCONFIG variable

variable

The PCONFIG variable to which you want to define the rule

operation

Operation that you want to perform on the agent. The supported operations are as follows:

  • REPLACE—Replaces the value of the variable in the agent
  • DELETE—Deletes the value of the variable in the agent
  • DELVAR —Deletes the variable from the agent

The default value is REPLACE.

value

Value that you want to set for the variable

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:

  • <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

agentSelectionCriteria

Set of conditions based on which the agents are identified to apply 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

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

Note

Rule aliases are not supported when you configure configuration variables.

JSON response

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

{
   "response": [
       {
           "name": "configvar11",
           "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

 

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