Ask Your Question
2

Running my own script for ceilometer alarm

asked 2015-02-19 11:13:37 -0500

bb gravatar image

I am using heat to autoscale instances based on ceilometer-alarm. Everything works fine but i additionally would like to perform few other activities based on autoscale of the instances.

Is there a way for ceilometer to call a my own script based on the alarm ?.

edit retag flag offensive close merge delete

Comments

hello I the same question. So it seems that I can create sample for custom metric but after taht how can i manage the communication betwen the outputs of my script and ceilometer.In other words when and where i call the cript file ?

binou gravatar imagebinou ( 2015-05-07 05:47:45 -0500 )edit

6 answers

Sort by ยป oldest newest most voted
0

answered 2017-03-27 09:32:37 -0500

zaneb gravatar image

The answer above is correct, but there are now a couple more options:

  • Have your script run by a web server as above. Ceilometer can call it directly via the alarm_action webhook.
  • Have your script listen on a Zaqar queue. Ceilometer can use a custom URL type as the action to post messages to the queue.
  • Write your script as a Mistral workflow. Set up as for the Zaqar queue above, and configure a subscription on the queue that triggers the workflow.

There is an example Heat template (requires Ocata) for the latter case.

edit flag offensive delete link more
-1

answered 2017-03-25 04:00:50 -0500

ShubhamMeshram gravatar image

How can I use Ceilometers alarm service to perform a custom task like, if the cpu_util metric is really high on one of the node, then perform migration of the VMs to another node (run the migrate command to perform migration) ?

edit flag offensive delete link more
0

answered 2015-05-07 05:44:46 -0500

binou gravatar image

hello I the same question. So it seems that I can create sample for custom metric but after taht how can i manage the communication betwen the outputs of my script and ceilometer.In other words when and where i call the cript file ?

edit flag offensive delete link more
2

answered 2015-02-23 06:27:08 -0500

NoNoNoo gravatar image

Ceilometer alllows to invoke a web url when an alarm change state. You can see the ceilometer alarm creation options( http://docs.openstack.org/user-guide-... ):

--alarm-action <Webhook URL>
URL to invoke when state transitions to alarm. May be used multiple times. Defaults to None.

--ok-action <Webhook URL>
URL to invoke when state transitions to OK. May be used multiple times. Defaults to None.

You can use also Heat in order to set the alarm-action and the ok-action url as you can see in Heat documentation.

http://docs.openstack.org/developer/h...

You have also to develop a web application that expose an url that you can invoke from ceilometer alarm. The language used for your application depends on your programming skill on different languages. You can see some of these solutions:

  • A J2EE application server like tomcat
  • A light web server(nginx or apache) with a php script
  • A javascript web appplication wroted using Node.js
edit flag offensive delete link more
0

answered 2015-02-23 02:18:48 -0500

Darsh29 gravatar image

Yes you can. At first, you need to create a metering label, then add this metering label for a specific tenant and finally add your customised rules to it. This works as simple as manual installation does.

edit flag offensive delete link more

Comments

And in concrete terms how can we process.I am a new user of openstack and have the same issue

binou gravatar imagebinou ( 2015-05-07 09:56:35 -0500 )edit
-1

answered 2015-02-21 11:11:29 -0500

bb gravatar image

From my search till now, there is no way for ceilometer to notify our custom script. This is probably a good have feature.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-02-19 11:13:37 -0500

Seen: 671 times

Last updated: Mar 27 '17