aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Yarwood <lyarwood@redhat.com>2015-10-06 11:18:31 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-10-15 12:29:13 +0100
commit18fa0dfa139ec2504ad0b0d83c12c3ae45c07d71 (patch)
treeb1c76b7ab55cf9d3b43768c8c3dec71e79624467
parent6752cce877a70d9e2a393db92f363d5acc66e665 (diff)
downloadsos-18fa0dfa139ec2504ad0b0d83c12c3ae45c07d71.tar.gz
[openstack_ceilometer] Limit log collection to .log files by default
Also introduce the global all_logs and log_size options within the plugin. Allowing users to control when all logs are collected and limit the overall size of the logs collected. Resolves #440 Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
-rw-r--r--sos/plugins/openstack_ceilometer.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/sos/plugins/openstack_ceilometer.py b/sos/plugins/openstack_ceilometer.py
index f0ac2426..15a1b08e 100644
--- a/sos/plugins/openstack_ceilometer.py
+++ b/sos/plugins/openstack_ceilometer.py
@@ -26,14 +26,18 @@ class OpenStackCeilometer(Plugin):
plugin_name = "openstack_ceilometer"
profiles = ('openstack', 'openstack_controller', 'openstack_compute')
- option_list = [("log", "gathers openstack-ceilometer logs", "slow", False)]
+ option_list = []
def setup(self):
# Ceilometer
- self.add_copy_spec([
- "/etc/ceilometer/",
- "/var/log/ceilometer"
- ])
+ self.limit = self.get_option("log_size")
+ if self.get_option("all_logs"):
+ self.add_copy_spec_limit("/var/log/ceilometer/",
+ sizelimit=self.limit)
+ else:
+ self.add_copy_spec_limit("/var/log/ceilometer/*.log",
+ sizelimit=self.limit)
+ self.add_copy_spec("/etc/ceilometer/")
def postproc(self):
protect_keys = [