ALIYUN::CMS::MonitoringAgent类型用于为指定阿里云主机安装云监控插件。
语法
{
  "Type": "ALIYUN::CMS::MonitoringAgent",
  "Properties": {
    "Force": Boolean,
    "InstallCommand": String,
    "InstanceIds": List
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| Force | Boolean | 否 | 否 | 是否强制安装云监控插件。 | 取值: 
 | 
| InstallCommand | String | 否 | 否 | 为当前阿里云账号下的所有阿里云主机安装云监控插件。 | 取值: 
 | 
| InstanceIds | List | 否 | 否 | 阿里云主机 ID。 | 最多支持10个。 说明  
 | 
返回值
Fn::GetAtt
无
示例
YAML
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Force:
    Description:
      en: 'Specifies whether to install the CloudMonitor agent. Valid values:
        true (default value): yes
        false: no'
    Required: false
    Type: Boolean
  InstanceIds:
    Description:
      en: 'Alibaba Cloud host ID.
        The range of n: 1 ~ 10.
        Explain that InstallCommand and InstanceIds must be selected one by one.'
    MaxLength: 10
    MinLength: 1
    Required: false
    Type: Json
Resources:
  MonitoringAgent:
    Properties:
      Force:
        Ref: Force
      InstanceIds:
        Ref: InstanceIds
    Type: ALIYUN::CMS::MonitoringAgent
                        JSON
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Force": {
      "Type": "Boolean",
      "Description": {
        "en": "Specifies whether to install the CloudMonitor agent. Valid values:\ntrue (default value): yes\nfalse: no"
      },
      "Required": false
    },
    "InstanceIds": {
      "Type": "Json",
      "Description": {
        "en": "Alibaba Cloud host ID.\nThe range of n: 1 ~ 10.\nExplain that InstallCommand and InstanceIds must be selected one by one."
      },
      "Required": false,
      "MinLength": 1,
      "MaxLength": 10
    }
  },
  "Resources": {
    "MonitoringAgent": {
      "Type": "ALIYUN::CMS::MonitoringAgent",
      "Properties": {
        "Force": {
          "Ref": "Force"
        },
        "InstanceIds": {
          "Ref": "InstanceIds"
        }
      }
    }
  }
}
                        该文章对您有帮助吗?