From 154964019bb5d6d4f8777d5406d96660c6e5de7f Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Thu, 9 May 2019 15:46:58 -0400 Subject: [PATCH] Reduce the collectd samples retention period Collectd creates a samples database within the InfluxDB database which is stored in the rootfs. The current 4 week retention period is too long for larger systems and could lead to the rootfs filling up. This update reduces that retention perid to 1 week to protect the rootfs from being filled up with sample data until the samples database is moved to a more appropriate location. Change-Id: Ic59712849fa228f19d15919594d23edc43109a0b Closes-Bug: 1827301 Signed-off-by: Eric MacDonald --- collectd-extensions/centos/build_srpm.data | 2 +- collectd-extensions/src/fm_notifier.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/collectd-extensions/centos/build_srpm.data b/collectd-extensions/centos/build_srpm.data index fd67b99..4ab794d 100644 --- a/collectd-extensions/centos/build_srpm.data +++ b/collectd-extensions/centos/build_srpm.data @@ -22,4 +22,4 @@ COPY_LIST="$PKG_BASE/src/LICENSE \ $PKG_BASE/src/ptp.conf \ $PKG_BASE/src/example.py \ $PKG_BASE/src/example.conf" -TIS_PATCH_VER=10 +TIS_PATCH_VER=11 diff --git a/collectd-extensions/src/fm_notifier.py b/collectd-extensions/src/fm_notifier.py index 360729e..c18e2df 100755 --- a/collectd-extensions/src/fm_notifier.py +++ b/collectd-extensions/src/fm_notifier.py @@ -283,7 +283,7 @@ class PluginObject: collectd.info('%s %s : %s' % (PLUGIN, self.plugin, string)) def _llog(self, string): - """Create a collectd notifier info log with the string param if debug_lists""" + """Create a collectd notifier info log when debug_lists not empty""" if debug_lists: collectd.info('%s %s : %s' % (PLUGIN, self.plugin, string)) @@ -1077,7 +1077,7 @@ def _database_setup(database): # TODO: Read current retention period from service parameter # Make it a puppet implementation. # - # Create a 1 month samples retention policy + # Create a '1 week' samples retention policy # ----------------------------------------- # name = 'collectd samples' # duration = set retention period in time @@ -1092,14 +1092,14 @@ def _database_setup(database): ############################################################ PluginObject.dbObj.create_retention_policy( - DATABASE_NAME, '4w', 1, database, True) + DATABASE_NAME, '1w', 1, database, True) except Exception as ex: if str(ex) == 'database already exists': try: collectd.info("%s influxdb:collectd %s" % (PLUGIN, str(ex))) PluginObject.dbObj.create_retention_policy( - DATABASE_NAME, '4w', 1, database, True) + DATABASE_NAME, '1w', 1, database, True) except Exception as ex: if str(ex) == 'retention policy already exists': collectd.info("%s influxdb:collectd %s" %