Skip to content

Commit

Permalink
Add ping and steps configuration
Browse files Browse the repository at this point in the history
Database ping and steps were not configurable because they were
hardcoded. Now it's a parameter.
  • Loading branch information
Max Vernimmen committed Aug 1, 2024
1 parent 34cf1bf commit 79982a1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
$syslogpriority = $smokeping::syslogpriority
$daemon_user = $smokeping::daemon_user
$daemon_group = $smokeping::daemon_group
$databasestep = $smokeping::databasestep
$databasepings = $smokeping::databasepings

# The owner of the image files (written by the webserver)
$webserver_user = $smokeping::webserver_user
Expand Down
8 changes: 8 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@
#
# @param manage_imgcache
# Should we manage the permissions on the imgcache directory?
#
# @param databasestep
# The stepsize to configure the RRD Database files with. You must delete the RRD files if you change this later.
#
# @param databasepings
# The number of pings to be able to store in the RRD Database files.
class smokeping (
Stdlib::HTTPUrl $cgiurl,
Stdlib::HTTPUrl $master_url,
Expand Down Expand Up @@ -184,6 +190,8 @@
Boolean $manage_datadir = true,
Boolean $manage_imgcache = true,
Stdlib::Fqdn $servername = $facts['networking']['fqdn'],
Integer $databasestep = 300,
Integer $databasepings = 20,
) {
if $manage_apache {
include smokeping::apache
Expand Down
11 changes: 11 additions & 0 deletions templates/database.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
*** Database ***

# THIS FILE IS MANAGED BY PUPPET

<% if @databasestep -%>
step = <%= @databasestep %>
<% else -%>
step = 300
<% end -%>

<% if @databasepings -%>
pings = <%= @databasepings %>
<% else -%>
pings = 20
<% end -%>

# consfn mrhb steps total

Expand Down

0 comments on commit 79982a1

Please sign in to comment.