搜索

5.5. 示例:监控实例的磁盘活动

download PDF

以下示例演示了如何使用 aodh 警报来监控特定项目中包含的所有实例的累积磁盘活动。

流程

  1. 检查现有项目,再选择您要监控的项目的适当 UUID。本例使用 admin 租户:

    $ openstack project list
    +----------------------------------+----------+
    | ID                               | Name     |
    +----------------------------------+----------+
    | 745d33000ac74d30a77539f8920555e7 | admin    |
    | 983739bb834a42ddb48124a38def8538 | services |
    | be9e767afd4c4b7ead1417c6dfedde2b | demo     |
    +----------------------------------+----------+
  2. 使用项目 UUID 创建警报,以分析 admin 租户中实例生成的所有读取请求的 sum ()。您可以使用 --query 参数进一步限制查询:

    # openstack alarm create --type gnocchi_aggregation_by_resources_threshold --name iops-monitor-read-requests --metric disk.read.requests.rate --threshold 42000 --aggregation-method sum --resource-type instance --query '{"=": {"project_id": "745d33000ac74d30a77539f8920555e7"}}'
    +---------------------------+-----------------------------------------------------------+
    | Field                     | Value                                                     |
    +---------------------------+-----------------------------------------------------------+
    | aggregation_method        | sum                                                       |
    | alarm_actions             | []                                                        |
    | alarm_id                  | 192aba27-d823-4ede-a404-7f6b3cc12469                      |
    | comparison_operator       | eq                                                        |
    | description               | gnocchi_aggregation_by_resources_threshold alarm rule     |
    | enabled                   | True                                                      |
    | evaluation_periods        | 1                                                         |
    | granularity               | 60                                                        |
    | insufficient_data_actions | []                                                        |
    | metric                    | disk.read.requests.rate                                   |
    | name                      | iops-monitor-read-requests                                |
    | ok_actions                | []                                                        |
    | project_id                | 745d33000ac74d30a77539f8920555e7                          |
    | query                     | {"=": {"project_id": "745d33000ac74d30a77539f8920555e7"}} |
    | repeat_actions            | False                                                     |
    | resource_type             | instance                                                  |
    | severity                  | low                                                       |
    | state                     | insufficient data                                         |
    | state_timestamp           | 2016-11-08T23:41:22.919000                                |
    | threshold                 | 42000.0                                                   |
    | time_constraints          | []                                                        |
    | timestamp                 | 2016-11-08T23:41:22.919000                                |
    | type                      | gnocchi_aggregation_by_resources_threshold                |
    | user_id                   | 8c4aea738d774967b4ef388eb41fef5e                          |
    +---------------------------+-----------------------------------------------------------+
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.