summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2007-07-09 21:31:54 +0200
committerTobi Oetiker <tobi@oetiker.ch>2007-07-09 21:31:54 +0200
commit700759a76d39dc1cfd729414508f542fd37f66ed (patch)
tree28fb370e691ab264bba0df873c98b7c892d17239
parentff0a9573f019d834a3fa1525ab27ff0fc2e5f474 (diff)
downloadsmokeping-700759a76d39dc1cfd729414508f542fd37f66ed.tar.gz
smokeping-700759a76d39dc1cfd729414508f542fd37f66ed.tar.xz
added override section
-rw-r--r--doc/smokeping_master_slave.pod9
-rw-r--r--lib/Smokeping.pm20
2 files changed, 27 insertions, 2 deletions
diff --git a/doc/smokeping_master_slave.pod b/doc/smokeping_master_slave.pod
index ac2e00f..76c31a8 100644
--- a/doc/smokeping_master_slave.pod
+++ b/doc/smokeping_master_slave.pod
@@ -57,8 +57,11 @@ reboots if it is located on non-volatile storage.
=head2 Master Configuration
To configure a master/slave setup, add a slaves section to your smokeping
-configuration file. The secret and timeout parameters will be inherited
-by the slave config sections and can be overwritten if required.
+configuration file. The secret and timeout parameters will be inherited by
+the slave config sections and can be overwritten if required. If some
+configuration parameter must be set to a special value for the slave, use an
+override section to configure this.
+
*** slaves ****
secrets=/etc/smokeping/slavesecrets.conf
@@ -66,6 +69,8 @@ by the slave config sections and can be overwritten if required.
+slave1
url=http://....
timeout=60
+ ++override
+ Probes.FPing.binary = /usr/bin/fping
...
Then in the targets section you can define slaves at every lvel. Again the
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 7c65a17..7361c20 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -13,12 +13,14 @@ use Config::Grammar;
use RRDs;
use Sys::Syslog qw(:DEFAULT setlogsock);
use Smokeping::Colorspace;
+use Smokeping::MasterSlave;
setlogsock('unix')
if grep /^ $^O $/xo, ("linux", "openbsd", "freebsd", "netbsd");
# make sure we do not end up with , in odd places where one would expect a '.'
# we set the environment variable so that our 'kids' get the benefit too
+
$ENV{LC_NUMERIC}='C';
if (POSIX::setlocale(&POSIX::LC_NUMERIC,"") ne "C") {
die("Resetting LC_NUMERIC failed - try removing LC_ALL from the environment");
@@ -2797,6 +2799,7 @@ END_DOC
_vars => [ qw(url timeout) ],
_mandatory => [ qw(url) ],
_inherited => [ qw(timeout) ],
+ _sections => [ qw(override) ],
_doc => <<END_DOC,
Define some basic properties for the slave.
END_DOC
@@ -2812,6 +2815,23 @@ END_DOC
_doc => <<END_DOC,
The url where the master can find its slave host.
END_DOC
+ override => {
+ _doc => <<END_DOC,
+If part of the configuration information must be overwritten to match the
+settings of the you can specify this in this section. A setting is
+overwritten by giveing the full path of the configuration variable. If you
+have this configuration in the Probes section:
+
+ *** Probes ***
+ +FPing
+ binary = /usr/sepp/bin/fping
+
+You can override it for a particular slave like this:
+
+ ++override
+ Probes.FPing.binary = /usr/bin/fping
+END_DOC
+ _vars => [ '/\S+/' ],
}
},
Targets => {_doc => <<DOC,