Ask Your Question

In ceilometer, alarm for cpu-util meter is not working?

asked 2015-06-09 02:34:56 -0500

neelabhsingh gravatar image

I have created alarm for cpu-util meter but it is not working, In Resource usage under Usage Report, please see the cpu-util, Here cup-util is 0.19 %,

Project    Service  Meter        Description                  Day       Value (Avg)  Unit 
  demo      Nova    cpu_util    Average CPU utilisation     2015-06-09  0.192517552447  %

And Alarm will be trigger if cpu-util is less than 10.

 ceilometer alarm-threshold-create --name lowcpu --description "trigger if cpu util is < 10 for 2 min" --project-id 2436c6ec-fe8c-4371-939d-636b62c4744c --user-id dfbd9f354f5b480683b3cc4c4b9eca6f --alarm-action 'log:///tmp/alarm.txt' --ok-action 'log:///tmp/alarm1.txt' --insufficient-data-action 'log:///tmp/alarm1.txt' --meter-name cpu-util --period 120 --evaluation-periods 1 --statistic avg --comparison-operator lt --threshold 10.0 --repeat-actions True

I did not create alarm1.txt file in tmp, because I thinks I will create automatically, I am wrong plz let me know. I created alarm as above but I am not any alarm logs still my cup-util is less than 10 %

ceilometer-alarm-notifier logs

2015-06-09 05:39:31.768 4050 DEBUG ceilometer.openstack.common.service [-] database.sqlite_db             = oslo.sqlite log_opt_values /usr/lib/python2.7/site-packages/oslo_config/
2015-06-09 05:39:31.768 4050 DEBUG ceilometer.openstack.common.service [-] database.sqlite_synchronous    = True log_opt_values /usr/lib/python2.7/site-packages/oslo_config/
2015-06-09 05:39:31.769 4050 DEBUG ceilometer.openstack.common.service [-] database.use_db_reconnect      = False log_opt_values /usr/lib/python2.7/site-packages/oslo_config/
2015-06-09 05:39:31.769 4050 DEBUG ceilometer.openstack.common.service [-] ******************************************************************************** log_opt_values /usr/lib/python2.7/site-packages/oslo_config/
2015-06-09 05:39:31.769 4050 DEBUG oslo_messaging._drivers.amqp [-] Pool creating new connection create /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/
2015-06-09 05:39:32.108 4050 INFO oslo_messaging._drivers.impl_rabbit [-] Connecting to AMQP server on
2015-06-09 05:39:32.120 4050 INFO oslo_messaging._drivers.impl_rabbit [-] Connected to AMQP server on
meter-acompute   20$(L) ceilometer-alarm-notifier*  21-$(L) ceilometer-alarm-eva


2015-06-09 08:30:34.512 4037 DEBUG ceilometer.coordination [-] Members of group: ['718217be-2fd7-4d0f-8db2-5834642071cd'] extract_my_subset /opt/stack/ceilometer/ceilometer/
2015-06-09 08:30:34.514 4037 DEBUG ceilometer.coordination [-] My subset: [<Alarm {u'alarm_actions': [u'log:///tmp/alarm.txt'], u'ok_actions': [u'log:///tmp/alarm1.txt'], u'name': u'lowcpu', u'timestamp': u'2015-06-09T05:48:35.562000', u'description': u'trigger if cpu util is < 10 for 2 min', u'time_constraints': [], u'enabled': True, u'state_timestamp': u'2015-06-09T05:48:35.562000', u'threshold_rule': {u'meter_name': u'cpu-util', u'evaluation_periods': 1, u'period': 120, u'statistic': u'avg', u'threshold': 10.0, u'query': [{u'field': u'project_id', u'value': u'2436c6ec-fe8c-4371-939d-636b62c4744c', u'op': u'eq'}], u'comparison_operator': u'lt', u'exclude_outliers': False}, u'alarm_id': u'fe90abc5-ba8d-4711-8a0d-a978fdcea0e5', u'state': u'insufficient data', u'insufficient_data_actions': [u'log:///tmp/alarm1.txt'], u'repeat_actions': True, u'user_id': u'dfbd9f354f5b480683b3cc4c4b9eca6f', u'project_id': u'2436c6ec-fe8c-4371-939d-636b62c4744c', u'type': u'threshold', u'severity': u'low'}>] extract_my_subset /opt/stack/ceilometer/ceilometer/
2015-06-09 08:30:34.515 4037 INFO ceilometer.alarm.service [-] initiating evaluation cycle on 1 alarms
2015-06-09 08:30:34 ...
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-06-10 00:53:56 -0500

yprokule gravatar image

My 2 cents: 'log' action from 'ok|alarm|insufficient data' just logs message to the log, not to file. Please set '--ok|alarm|insufficient-data-action' to 'log://'

To make troubleshooting easier - can U add '--query' option to your alarm? Smth like: --query 'resource_id=<yourinstanceid>'

edit flag offensive delete link more

answered 2015-06-09 13:01:32 -0500

Ranjit gravatar image

updated 2015-06-09 13:02:34 -0500

change this --meter-name cpu-util to --meter-name cpu_util in alarm-threshold-create command

edit flag offensive delete link more


@Ranjit, Thanks for reply, but still alarm is not working and state | insufficient data, and I just want to clear that log:///tmp/alarm1.txt will automatically created or we have to create in tmp directory, Thanks waiting for your reply.....

neelabhsingh gravatar imageneelabhsingh ( 2015-06-10 00:14:03 -0500 )edit

See the answer from @yprokule. You will see the alarm state change information from ceilometer log.

Ranjit gravatar imageRanjit ( 2015-06-10 01:21:55 -0500 )edit

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


Asked: 2015-06-09 02:34:56 -0500

Seen: 1,052 times

Last updated: Jun 10 '15