系统报警主题 (System Alarm)

QuerySNSTopic  name=system-alarm
{
    "inventories": [
        {
            "createDate": "Jan 10, 2018 12:11:09 AM",
            "description": "topic for reporting system defined alarms",
            "lastOpDate": "Jan 10, 2018 12:11:09 AM",
            "name": "system-alarm",
            "state": "Enabled",
            "uuid": "e7d6f5e23bb74e99a2777126078b551c"
        }
    ],
    "success": true
}

ZWatch预定义的报警器会将报警信息发送到该主题。用户也可以直接使用该主题作为自定义报警器的主题。

使用系统HTTP endpoint接收系统报警主题消息

内部系统(通常是UI),需要一个方式接收来自系统报警主题消息。系统HTTP endpoint可以完成这个工作,只需要在zstack.properties中配置如下字段即可:

sns.systemTopic.endpoints.http.url = 接收POST消息的HTTP URL
sns.systemTopic.endpoints.http.url.username = HTTP请求用户名(可选)
sns.systemTopic.endpoints.http.url.password = HTTP请求密码(可选)

如果需要设置用户名/密码,两个字段都需要同时设置,否则不生效。收到HTTP消息JSON格式跟HTTP endpint一样。无论系统报警主题状态如何(Enabled/Disabled),该endpoint都会接收到消息,不受消息主题状态影响。

Note:

可以时用zstack-configure命令配置上述字段