setup notifier actions in aodh alarm

Aodh alarm NOTIFIER ==>

alarm_actions URL: http://<host>/<action>

NOTIFIER will resolve the URL and post the data to http server

setup a Http server ==>

such as: python -m SimpleHTTPServer 8000

link: https://docs.python.org/2/library/simplehttpserver.html

NOTE: this case only receive the posted data, but not handle it.

such as:

[email protected]:~$ cat reflect.py
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)

from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser

class RequestHandler(BaseHTTPRequestHandler):

    def do_GET(self):

        request_path = self.path

        print("\n----- Request Start ----->\n")
        print(request_path)
        print(self.headers)
        print("<----- Request End -----\n")

        self.send_response(200)
        self.send_header("Set-Cookie", "foo=bar")

    def do_POST(self):

        request_path = self.path

        print("\n----- Request Start ----->\n")
        print(request_path)

        request_headers = self.headers
        content_length = request_headers.getheaders(‘content-length‘)
        length = int(content_length[0]) if content_length else 0

        print(request_headers)
        print(self.rfile.read(length))
        print("<----- Request End -----\n")

        self.send_response(200)

    do_PUT = do_POST
    do_DELETE = do_GET

def main():
    port = 8000
    print(‘Listening on localhost:%s‘ % port)
    server = HTTPServer((‘0.0.0.0‘, port), RequestHandler)
    server.serve_forever()

if __name__ == "__main__":
    parser = OptionParser()
    parser.usage = ("Creates an http-server that will echo out any GET or POST parameters\n"
                    "Run:\n\n"
                    "   reflect")
    (options, args) = parser.parse_args()

    main()
时间: 2024-10-11 05:00:41

setup notifier actions in aodh alarm的相关文章

aodh M版本新特性 - queue between alarm evaluator and alarm notifier

之前alarm evaluator service and alarm notifier services之间的通信采用RPC的方式,消耗较大,增加work queue的方式可以获得更好的性能, + if conf.ipc_protocol == 'rpc': + self.ipc = 'rpc' + self.rpc_server = messaging.get_rpc_server( + conf, transport, conf.notifier_rpc_topic, self) + el

mysql下面的INSTALL-BINARY的内容,所有的mysql的配置内容都在这

2.2 Installing MySQL on Unix/Linux Using Generic Binaries Oracle provides a set of binary distributions of MySQL. These include binary distributions in the form of compressed tar files (files with a .tar.gz extension) for a number of platforms, as we

controller.pp 各组件的安装顺序

controller 属性: admin_address => $controller_node_address, public_address => $controller_node_public, public_interface => $::public_int, private_interface => $::use_quantum ? { true=>false, default=>$::fuel_settings['fixed_interface']}, i

[转]the service mysql57 failed the most recent status[/br]mysql57 was not found解决办法

转自:http://forums.mysql.com/read.php?169,622722,622877#msg-622877 安装完mysql5.7.12后想要stop或者restart都会出现以上信息. 解决办法如下: right click on MySQL Notifier -> Actions -> Manage Monitored Items highlight the MySQL56 entry and click the delete button -> windows

OpenStack Q版本新功能以及各核心组件功能对比

OpenStack Q版本已经发布了一段时间了.今天, 小编来总结一下OpenStack Q版本核心组件的各项主要新功能, 再来汇总一下最近2年来OpenStack N.O.P.Q各版本核心组件的主要新功能.仅供参考, 如有遗漏.错误请指正. 1.1         Q版新功能总结 Q版相对于P版, 主要还是各功能的增强和优化, 其中主要功能有: 计算组件中的vGPU支持.冷迁移至指定主机.PCI NUMA亲和性.卷共享等,镜像组件中的web方式导入镜像, 网络组件中的浮动IP QoS.DVR/

How To Setup ASM & ASMLIB On Native Linux Multipath Mapper disks?

(文档 ID 602952.1) Applies to: Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.1.0.2 [Release 10.1 to 12.1]Linux x86Linux x86-64Linux Itanium***Checked for relevance on 08-Oct-2013*** Goal The present document provides an example about ho

linux内核notifier机制 linux通知链

在linux内核系统中,各个模块.子系统之间是相互独立的.Linux内核可以通过通知链机制来获取由其它模块或子系统产生的它感兴趣的某些事件.使用notifier由通知者可以传递给被通知者长整型参数与指针.在linux中有许多地方用到,比如reboot通知,cpu调频通知,网卡事件,电池低电警报等等.熟悉使用notifier有助于linux内核驱动开发. notifier_block结构: struct notifier_block { int (*notifier_call)(struct no

ansible模块yum、services、setup

ansible模块 yum: [[email protected] ~]# ansible-doc -s yum less 436 Copyright (C) 1984-2009 Mark Nudelman less comes with NO WARRANTY, to the extent permitted by law. For information about the terms of redistribution, see the file named README in the l

Setup Oracle 11gR2 for Redhat Linux AS 4 Update 7 x64

Setup Oracle 11gR2 for Redhat Linux AS 4 Update 7 x64 1. checking linux version. [[email protected] ~]# uname -aLinux redhat4.7 2.6.9-78.EL #1 Wed Jul 9 15:26:38 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux 2. linking oracle installing document. http://do