找回密码
 注册
查看: 755|回复: 0

openstack aodh添加告警列表

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-6-11 21:58:36 | 显示全部楼层 |阅读模式
八、添加告警规则! Q* t3 o9 z6 P/ ?
参考:+ m2 o8 c" M/ B' v* d# r
https://docs.openstack.org/aodh/ ... lemetry-alarms.html
2 `3 h/ U+ ]! y* M" a, t8.1 添加instance类型资源利用率告警: e2 h6 O, a7 }2 X
7 ^% [, Q. u$ z4 ~6 W0 Y- Y
root@controller-01:~# aodh alarm create   --name cpu_hi  --type gnocchi_resources_threshold --description 'instance running hot' --metric cpu_util --threshold 1.0   --comparison-operator gt   --aggregation-method mean  --granularity 60 --evaluation-periods 3   --alarm-action 'log://'  --resource-id 6583b3b0-96fd-45fa-bd75-fa7b0ae389e3  --resource-type instance
* G6 K- q" |% X0 k3 F9 v
. q/ Z, N* Y" g$ s  A, H* F2 J; p- V: t! q; i7 s9 |& K+ R3 n6 f
root@controller-01:~# aodh alarm list! o; ]$ [9 c7 S6 F
+--------------------------------------+-----------------------------+--------+-------+----------+---------+* t# D3 K; I7 d5 {7 @' g6 u* d
| alarm_id                             | type                        | name   | state | severity | enabled |
6 ?5 A3 U- e5 s" w+--------------------------------------+-----------------------------+--------+-------+----------+---------+
0 ~2 X, W  K7 s5 z1 c9 E| c5fd0a6e-b389-414e-826c-e830c9448261 | gnocchi_resources_threshold | cpu_hi | ok    | low      | True    |
3 K$ d0 k$ T+ E+--------------------------------------+-----------------------------+--------+-------+----------+---------+
: t' ?5 N8 |1 P& K: vTIPs:insufficient表示尚未通过该告警规则的苹果周期,无法判定是否告警。8 V7 m' Z& s4 }1 @& |% E+ _
' H; J. ?0 C0 e. T8 o( g+ A
8.2 更新alarm的告警阈值为75%
8 }$ N7 Z" W! C, y5 V  X* p, T. s+ k
root@controller-01:~# aodh alarm update 566ef2f3-3302-4244-8b11-e49888fa732f --threshold 75
9 U' G" J+ z1 \$ ]. n8 u# |8.3 设定alarm告警规则状态' q; G7 ?+ ]+ Y' m
1 T& m( ~& T2 _0 i
root@controller-01:~# aodh  alarm state get 566ef2f3-3302-4244-8b11-e49888fa732f8 S7 P) {3 v) J
+-------+-------------------+
/ z- d- _3 |* A) I: A; I| Field | Value             |7 m4 y" j! G( d" l, q* V
+-------+-------------------+' i/ k; i+ s1 X% j- r1 U2 C+ K( S4 N
| state | ok                |
* A. s" ~& ~7 l- u- G& _- q9 t. w+-------+-------------------+6 e' C0 j  G0 v8 J
8.4 查看alarm告警规则告警历史
4 l* Q( B6 Z0 P) n
) f/ X8 J. Z# r3 z. }/ Yaodh alarm-history show c5fd0a6e-b389-414e-826c-e830c94482619 g7 J/ ~3 |9 Z" l4 y( S$ K; Y- j6 o
+----------------------------+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+
0 {: m) G8 k# i8 Z/ b9 s+ N| timestamp                  | type             | detail                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | event_id                             |
( P; ~$ }& _/ {. C( f: \( O: b+----------------------------+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+
# ^4 a- \+ p* I) Q/ ~| 2021-03-22T10:04:34.355141 | state transition | {"transition_reason": "aggregation mean does not exist for metric cpu of resource f4bf417d-c2cc-4e8f-be65-f2e4e4f13d11", "state": "insufficient data"}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | 412bc50f-342e-4b14-beda-0bf62b27cf53 |
; o3 p  J' l; ?0 c) t: n| 2021-03-22T10:03:40.313080 | state transition | {"state": "ok", "state_reason": "Manually set via API"}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | ae4d7b6d-9e15-42df-96a0-5e3833b09bf1 |* N1 f; _/ z& N& E3 @- C
| 2021-03-22T09:51:51.297369 | creation         | {"state_reason": "Not evaluated yet", "user_id": "1d51703e805548d99cb35b0c3fb83a58", "name": "cpu_hi", "state": "insufficient data", "timestamp": "2021-03-22T09:51:51.297369", "description": "instance running hot", "enabled": true, "state_timestamp": "2021-03-22T09:51:51.297369", "rule": {"evaluation_periods": 3, "metric": "cpu", "resource_id": "f4bf417d-c2cc-4e8f-be65-f2e4e4f13d11", "aggregation_method": "mean", "granularity": 10, "threshold": 1.0, "comparison_operator": "gt", "resource_type": "instance"}, "alarm_id": "c5fd0a6e-b389-414e-826c-e830c9448261", "time_constraints": [], "insufficient_data_actions": [], "repeat_actions": false, "ok_actions": [], "project_id": "15b1010426194e309cd8f3de6bf63e1a", "type": "gnocchi_resources_threshold", "alarm_actions": ["log://"], "severity": "low"} | 8afa9dd9-8e9c-42fe-a867-d3e87c91e4fa |
7 q) Y+ D. i4 R6 R2 q+----------------------------+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+" A0 ]$ P' E+ m+ B2 l0 n0 L# e
+----------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+* v) U. [2 k& K1 R+ {4 I
9 _; }0 W" _; T4 `" o

( {% V; R; e0 R: v
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:04 , Processed in 0.012967 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表