From 9e00951e55eda6869bdfb84ac756c73ec6ddd359 Mon Sep 17 00:00:00 2001 From: Robin Douine Date: Thu, 6 May 2021 09:27:12 +0200 Subject: [PATCH] allow to set the cleanup options --- attributes/default.rb | 8 ++++++++ recipes/default.rb | 6 ++++++ templates/default/config.php.erb | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/attributes/default.rb b/attributes/default.rb index 114ca4b..d4e9224 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -135,3 +135,11 @@ # Syslog default['librenms']['syslog']['enabled'] = false + +# Cleanup options +default['librenms']['syslog_purge'] = 30 +default['librenms']['eventlog_purge'] = 30 +default['librenms']['authlog_purge'] = 30 +default['librenms']['device_perf_purge'] = 7 +default['librenms']['rrd_purge'] = false +default['librenms']['ports_purge'] = false diff --git a/recipes/default.rb b/recipes/default.rb index 10a5731..1c0cc2d 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -377,6 +377,12 @@ radius_default_lvl: node['librenms']['auth_radius']['default_level'], add_conf_file_path: node['librenms']['add_config_file']['path'], rrddir: node['librenms']['rrd_dir'], + syslog_purge: node['librenms']['syslog_purge'], + eventlog_purge: node['librenms']['eventlog_purge'], + authlog_purge: node['librenms']['authlog_purge'], + device_perf_purge: node['librenms']['device_perf_purge'], + rrd_purge: node['librenms']['rrd_purge'], + ports_purge: node['librenms']['ports_purge'], ) end diff --git a/templates/default/config.php.erb b/templates/default/config.php.erb index bbce356..a1809fd 100644 --- a/templates/default/config.php.erb +++ b/templates/default/config.php.erb @@ -71,6 +71,13 @@ $config['radius']['default_level'] = <%= @radius_default_lvl %>; $config['auth_mechanism'] = "mysql"; # default, other options: ldap, http-auth <% end %> +$config['syslog_purge'] = <%= @syslog_purge %>; +$config['eventlog_purge'] = <%= @eventlog_purge %>; +$config['authlog_purge'] = <%= @authlog_purge %>; +$config['device_perf_purge'] = <%= @device_perf_purge %>; +$config['rrd_purge'] = <%= @rrd_purge %>; +$config['ports_purge'] = <%= @ports_purge %>; + <% if ( @add_conf_file_path != '' ) %> if(file_exists( __DIR__ . DIRECTORY_SEPARATOR . '<%= @add_conf_file_path %>')) { include __DIR__ . DIRECTORY_SEPARATOR . '<%= @add_conf_file_path %>';