The command-line client

The Ceilometer command-line client tool is critical when troubleshooting this service. It is often the quickest way to test and identify issues within the service. Typing ceilometer help in the terminal will give you a list of the available commands. While covering all the Ceilometer commands is beyond the scope of this book, the commands that follow will aid your troubleshooting process.

The meter list command

The meter list command will allow you to see each of the meters tracked by Ceilometer. This command is also a good way to confirm that Ceilometer is working as expected. Errors or empty values returned from this command are clues to issues with the service or its configuration. When Ceilometer is working as expected, the meter-list command will return one or more meters, as shown in the following screenshot:

The meter list command

If your meter list is empty, there are several troubleshooting steps that you should take. I recommend that you start with Glance and confirm whether Ceilometer is receiving metering data for the image service or not.

Glance meters

Assuming that Glance is installed and working, you will need to modify the glance-api.conf and glance-registry.conf files, which are typically located in the /etc/glance directory. You need to set the notification_driver and notifier_strategy in each of these files:

notification_driver = messagingv2

Once these settings have been added to the glance-api.conf and glance-registry.conf files, you will need to restart the glance-api and glance-registry processes for the configuration changes to take effect. After you have updated this setting, execute the meter-list command again and you should see the image meters appear.

Nova meters

Similar to Glance, Nova needs a few configuration updates if you want the service to provide metering data for Ceilometer. In the /etc/nova/nova.conf and /etc/nova/nova-compute.conf files:

instance_usage_audit = True 
instance_usage_audit_period = hour 
notify_on_state_change = vm_and_task_state 
notification_driver = messagingv2

After you have made these modifications to the configuration files, restart the Nova service so that the configuration changes take effect. Try running the Ceilometer meter-list command again, and you should see values from OpenStack Compute.

The sample list

Another useful Ceilometer command is the sample-list command. This command will list the collection data representing samples for each meter. The command can be useful to check each of your meters and to ensure that you are receiving the data samples that you expect.

The sample list

The sample-list command also allows you to do some basic filtering and querying by passing the --meter and --query commands, respectively. For example, to see a sample list for all the instance meters for a particular resource, you could run the following command:

The sample list

For more complex queries against the sample data, you can leverage the Ceilometer query-sample command.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset