ceilometer alarm server handler

asked 2014-11-24 08:48:01 -0600

chitranshi-shubham gravatar image


I have created an alarm from the CLI that checks if the cpu_util is greater than a threshold for a VM, I have given a http url in my alarm action as "http://localhost:8080", in order to test the web hook i have created a simple python server using SimpleHTTPServer and CGIRequestHandler, but I am not getting any response in json or XML. Does the alarm uses POST or PUT ? Simply put How to get the response json from alarm ? A simple code snippet would be a great help.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-12-13 07:55:55 -0600

chitranshi-shubham gravatar image

updated 2014-12-15 07:22:59 -0600

simply put, this is not a question for ceilometer alarm, but a question on how web hook work. the ceilometer alarm POST on the URL provided, in JSON, we can listen on the URL and get response. this is how we can do it. as a simple example, use python-flask, a micro framework. here is a code snippet that listens on port 8080 and returns the JSON

from flask import Flask
from flask import request

app = Flask(__name__)

@app.route("/", methods = ['POST'])
def alarm():
    return "thanks ceilometer alarm for the notification"


this is a ceilometer alarm notification handler.!!

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-11-24 08:48:01 -0600

Seen: 168 times

Last updated: Dec 15 '14