From 700759a76d39dc1cfd729414508f542fd37f66ed Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Mon, 9 Jul 2007 19:31:54 +0000 Subject: added override section --- doc/smokeping_master_slave.pod | 9 +++++++-- lib/Smokeping.pm | 20 ++++++++++++++++++++ 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 => < < { + _doc => < [ '/\S+/' ], } }, Targets => {_doc => <