With this module its possible to completely manage SmokePing, including Master/Slave configuration and the menu hierarchy.
It uses exported resources to collect the slave definitions on the master.
Because SmokePing does not support configuration directories (f.e.
include /etc/smokeping/conf.d) we need to include every single file with
To achieve that I make use of the Concat module, written by R.I.Pienaar.
Examples on how to use this module can be found on Github in the Readme file.
How it works
It’s basically a simple module, installing a package, a service definition and some configuration files, defined with templates. The tricky parts are the slave and target definitions:
Slaves are SmokePing instances without any local files or configuration, they get their configuration from the master, connecting via HTTP to the CGI,
and reporting back the probe results. They authenticate themself with a shared secret.
Using the class
smokeping, with the mode set to
slave, configures SmokePing to connect to
generates a shared secret and exports its configuration with exported resources. They are then collected by the instance which mode is set to master.
To implement the target definitions with hierarchies I use concat to tie the configuration files together. Using the
parameter it’s possible to build a menu hierarchy.
Levels higher than 1 need also the parameter
hierarchy_parent to specify it’s parent.
The level is used as prefix for the file name (f.e.
2-Google) and it includes to lower level files using
This creates the following content in
/etc/smokeping/config.d/targets.d/1-World (which is included in
+ World menu = World title = Connection to the World alerts = bigloss,noloss @include /etc/smokeping/config.d/targets.d/2-GoogleCH
++ GoogleCH menu = google.ch title = Google @include /etc/smokeping/config.d/targets.d/3-GoogleCHIPv4 @include /etc/smokeping/config.d/targets.d/3-GoogleCHIPv6
The files starting with
3- include the final target host definition:
+++ GoogleCHIPv4 menu = google.ch IPv4 title = google.ch IPv4 host = google.ch slaves = slave1
+++ GoogleCHIPv6 probe = FPing6 menu = google.ch IPv6 title = google.ch IPv6 host = google.ch slaves = slave1