全部产品
Search
文档中心

资源编排:ALIYUN::CMS::MonitoringAgent

更新时间:Jul 26, 2024

ALIYUN::CMS::MonitoringAgent类型用于为指定阿里云主机安装云监控插件。

语法

{
  "Type": "ALIYUN::CMS::MonitoringAgent",
  "Properties": {
    "Force": Boolean,
    "InstallCommand": String,
    "InstanceIds": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Force

Boolean

是否强制安装云监控插件。

取值:

  • true(默认值):强制安装。

  • false:不强制安装。

InstallCommand

String

为当前阿里云账号下的所有阿里云主机安装云监控插件。

取值:

  • onlyInstallNotHasAgent: 仅为未安装云监控插件的阿里云主机安装最新版本插件。

  • onlyUpgradeAgent:仅为已安装非最新版本云监控插件的阿里云主机升级插件。

  • installAndUpgrade:不仅为未安装云监控插件的阿里云主机安装最新版本插件,且为已安装非最新版本云监控插件的阿里云主机升级插件。

InstanceIds

List

阿里云主机 ID。

最多支持10个。

说明

InstallCommandInstanceIds必须二选一。

返回值

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"
        }
      }
    }
  }
}