当前位置 博文首页 > 小小之食人魔:openstack-ceilometer服务告警创建 2019-05-17

    小小之食人魔:openstack-ceilometer服务告警创建 2019-05-17

    作者:[db:作者] 时间:2021-08-04 18:35

    创建命令:

    [root@controller ~]# ceilometer alarm-threshold-create --name test --description 'test' --meter-name cpu_util --threshold 10.0 --comparison-operator gt --statistic avg --period 100 --evaluation-periods 3 --alarm-action 'log://' --query resource_id=03d9ccd4-cf42-4dbe-b391-469e086cfc83
    

    参数解析:

    ceilometer alarm-threshold-create
    --name test #告警名字
    --description 'test' #描述
    --meter-name cpu_util #测量值名称(监控的项目)
    --threshold 10.0 #阈值
    --comparison-operator gt #比对方式:大于
    --statistic avg #统计方式:平均值
    --period 100 #周期:100秒
    --evaluation-periods 3 周期内统计次数:3
    --alarm-action 'log://' #转为告警状态时提交的url
    --query resource_id=insecure_id #资源ID;云主机ID

    告警列表:

    [root@controller ~]# ceilometer alarm-list 
    +--------------------------------------+----------+-------------------+----------+---------+------------+---------------------------------------+------------------+
    | Alarm ID                             | Name     | State             | Severity | Enabled | Continuous | Alarm condition                       | Time constraints |
    +--------------------------------------+----------+-------------------+----------+---------+------------+---------------------------------------+------------------+
    | 5017937d-a813-4847-9542-cf1d4d834e2b | mem_test | insufficient data | low      | True    | False      | avg(memory) > 4096.0 during 10 x 100s | None             |
    | 671606f1-d49c-4413-8697-ca5444ea00dd | test     | insufficient data | low      | True    | False      | avg(cpu_util) > 10.0 during 3 x 100s  | None             |
    +--------------------------------------+----------+-------------------+----------+---------+------------+---------------------------------------+------------------+
    
    cs