Puppet Class: smokeping

Defined in:
manifests/init.pp

Summary

Manage SmokePing

Overview

Parameters:

  • mode (Enum['master', 'slave', 'standalone'])

    SmokePing mode: master, slave, or standalone

  • master_url (Stdlib::HTTPUrl)

    URL to master cgi for slave mode

  • shared_secret (Stdlib::Absolutepath) (defaults to: '/etc/smokeping/slavesecrets.conf')

    Path to slavesecrets file

  • slave_secrets (Stdlib::Absolutepath) (defaults to: '/etc/smokeping/smokeping_secrets')

    Path to smokeping_secrets file

  • slave_name (String[1]) (defaults to: $facts['networking']['hostname'])

    Name of slave. Only used in slave mode

  • slave_dir (Stdlib::Absolutepath) (defaults to: '/etc/smokeping/config.d/slaves.d')

    Path to slave definitions on master

  • slave_location (Optional[String[1]]) (defaults to: undef)

    Location of slave

  • slave_display_name (Optional[String[1]]) (defaults to: undef)

    Name of slave, displayed on Webpage

  • slave_color (Optional[Integer[0]]) (defaults to: undef)

    Color of slave in the graph, as a RRGGBB hex integer.

  • master_name (String[1]) (defaults to: 'default')

    Name of the master, in case of more than one SmokePing Master/Slave

  • owner (String[1]) (defaults to: 'Peter Random')

    Owner of this SmokePing instance

  • contact (Stdlib::Email) (defaults to: 'root@localhost')

    Contact E-Mail of this SmokePing instance

  • mailhost (Optional[Stdlib::Host]) (defaults to: undef)

    Where to send mails to

  • cgiurl (Stdlib::HTTPUrl)

    URL of SmokePing CGI

  • syslogfacility (Stdlib::Syslogfacility) (defaults to: 'local0')

    Syslog Facility

  • probes (Array[Hash]) (defaults to: [])

    Probe definitions as Array of Hashes

  • default_probe (String[1]) (defaults to: 'FPing')

    Default Probe

  • alerts_to (Stdlib::Email) (defaults to: 'root@localhost')

    E-Mail address or tool to send Alerts to

  • alerts_from (Stdlib::Email) (defaults to: 'root@localhost')

    Sender E-Mail of Alerts

  • alerts (Array[Hash]) (defaults to: [ { name => 'someloss', alert_type => 'loss', pattern => '>0%,*12*,>0%,*12*,>0%', edgetrigger => false, comment => 'loss 3 times in a row', }, ])

    Alert definitions as Array of Hashes

  • cgi_remark_top (String[1]) (defaults to: 'Welcome to the SmokePing website of xxx Company. Here you will learn all about the latency of our network.')

    Remark on Website

  • cgi_title_top (String[1]) (defaults to: 'Network Latency Grapher')

    Title on Website

  • targets_dir (Stdlib::Absolutepath) (defaults to: '/etc/smokeping/config.d/targets.d')

    Where to save target definitions

  • targets (Hash) (defaults to: {})

    Target definitions as a Hash of Smokeping::Target

  • daemon_user (String[1])

    User to run SmokePing

  • daemon_group (String[1])

    Group of SmokePing

  • path_sendmail (Stdlib::Absolutepath) (defaults to: '/usr/sbin/sendmail')

    Path to sendmail binary

  • webserver_user (String[1])

    User of webserver, owner of image-files

  • webserver_group (String[1])

    Group of webserver

  • path_imgcache (Stdlib::Absolutepath)

    Path to image cache dir

  • path_imgurl (String[1])

    URL path to images for CGI

  • path_datadir (Stdlib::Absolutepath)

    Path to smokeping data

  • path_piddir (Stdlib::Absolutepath) (defaults to: '/var/run/smokeping')

    Path to PID file

  • path_smokemail (Stdlib::Absolutepath) (defaults to: '/etc/smokeping/smokemail')

    Path to smokemail binary

  • path_tmail (Stdlib::Absolutepath) (defaults to: '/etc/smokeping/tmail')

    Path to tmail binary

  • version (String[1]) (defaults to: 'present')

    Version which should be installed

  • enable (Boolean) (defaults to: true)

    Should the service be enabled during boot time?

  • start (Boolean) (defaults to: true)

    Should the service be started by Puppet?

  • manage_apache (Boolean) (defaults to: false)

    Should we manage the Apache config with puppetlabs/apache?

  • manage_firewall (Boolean) (defaults to: false)

    Should we manage a firewall rule for Smokeping with puppetlabs/firewall?

  • manage_selinux (Boolean) (defaults to: false)

    Should we load an SELinux policy to allow Smokeping to work on Red Hat distros?

  • manage_datadir (Boolean) (defaults to: true)

    Should we manage the data directory?

  • manage_imgcache (Boolean) (defaults to: true)

    Should we manage the permissions on the imgcache directory?

  • package_perldoc (String[1])
  • syslogpriority (String[1]) (defaults to: 'info')
  • default_slaves (Array[String[1]]) (defaults to: [])
  • servername (Stdlib::Fqdn) (defaults to: $facts['networking']['fqdn'])


131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'manifests/init.pp', line 131

class smokeping (
  Stdlib::HTTPUrl $cgiurl,
  Stdlib::HTTPUrl $master_url,
  String[1] $path_imgurl,
  String[1] $daemon_user,
  String[1] $daemon_group,
  String[1] $webserver_user,
  String[1] $webserver_group,
  String[1] $package_perldoc,
  Stdlib::Absolutepath $path_imgcache,
  Stdlib::Absolutepath $path_datadir,
  Enum['master', 'slave', 'standalone'] $mode,
  Stdlib::Absolutepath $shared_secret = '/etc/smokeping/slavesecrets.conf',
  Stdlib::Absolutepath $slave_secrets = '/etc/smokeping/smokeping_secrets',
  String[1] $slave_name = $facts['networking']['hostname'],
  Stdlib::Absolutepath $slave_dir = '/etc/smokeping/config.d/slaves.d',
  Optional[String[1]] $slave_location = undef,
  Optional[String[1]] $slave_display_name = undef,
  Optional[Integer[0]] $slave_color = undef,
  String[1] $master_name = 'default',
  String[1] $owner = 'Peter Random',
  Stdlib::Email $contact = 'root@localhost',
  Optional[Stdlib::Host] $mailhost = undef,
  Stdlib::Syslogfacility $syslogfacility = 'local0',
  String[1] $syslogpriority = 'info',
  Array[Hash] $probes = [],
  String[1] $default_probe = 'FPing',
  Array[String[1]] $default_slaves = [],
  Stdlib::Email $alerts_to = 'root@localhost',
  Stdlib::Email $alerts_from = 'root@localhost',
  Array[Hash] $alerts = [
    {
      name        => 'someloss',
      alert_type  => 'loss',
      pattern     => '>0%,*12*,>0%,*12*,>0%',
      edgetrigger => false,
      comment     => 'loss 3 times in a row',
    },
  ],
  String[1] $cgi_remark_top = 'Welcome to the SmokePing website of xxx Company. Here you will learn all about the latency of our network.',
  String[1] $cgi_title_top = 'Network Latency Grapher',
  Stdlib::Absolutepath $targets_dir = '/etc/smokeping/config.d/targets.d',
  Hash $targets = {},
  Stdlib::Absolutepath $path_sendmail = '/usr/sbin/sendmail',
  Stdlib::Absolutepath $path_piddir = '/var/run/smokeping',
  Stdlib::Absolutepath $path_smokemail = '/etc/smokeping/smokemail',
  Stdlib::Absolutepath $path_tmail = '/etc/smokeping/tmail',
  String[1] $version = 'present',
  Boolean $enable = true,
  Boolean $start = true,
  Boolean $manage_apache = false,
  Boolean $manage_firewall = false,
  Boolean $manage_selinux = false,
  Boolean $manage_datadir = true,
  Boolean $manage_imgcache = true,
  Stdlib::Fqdn $servername = $facts['networking']['fqdn'],
) {
  if $manage_apache {
    include smokeping::apache
  }

  if $manage_firewall {
    firewall { '100-smokeping-http':
      proto  => 'tcp',
      dport  => '80',
      action => 'accept',
    }
    firewall { '100-smokeping-https':
      proto  => 'tcp',
      dport  => '443',
      action => 'accept',
    }
  }

  if $manage_selinux {
    if $facts['os']['family'] == 'RedHat' {
      selinux::module { 'local_smokeping':
        ensure    => 'present',
        source_te => 'puppet:///modules/smokeping/local_smokeping.te',
      }
    }
  }

  contain smokeping::install
  contain smokeping::config
  contain smokeping::service

  Class['smokeping::install']
  -> Class['smokeping::config']
  ~> Class['smokeping::service']
}