Skip to content

Commit

Permalink
allow to set the cleanup options
Browse files Browse the repository at this point in the history
  • Loading branch information
Koaxiel committed May 6, 2021
1 parent 4e4e25f commit 9e00951
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions templates/default/config.php.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>';
Expand Down

0 comments on commit 9e00951

Please sign in to comment.