summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping/probes
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@iki.fi>2005-02-18 21:55:29 +0100
committerNiko Tyni <ntyni@iki.fi>2005-02-18 21:55:29 +0100
commit2206afb0d6aaf857ecf739ae0b639bf215106294 (patch)
tree2754f58bc44d1b74a3a8c45a19f4bf079fd0c123 /lib/Smokeping/probes
parentf6d4093e0dc827fbc853ed21ad3cb0ab1f898704 (diff)
downloadsmokeping-2206afb0d6aaf857ecf739ae0b639bf215106294.tar.gz
smokeping-2206afb0d6aaf857ecf739ae0b639bf215106294.tar.xz
* complain if pings < 3
* show the smoke for pings == 3 too, not only if >3
Diffstat (limited to 'lib/Smokeping/probes')
-rw-r--r--lib/Smokeping/probes/base.pm6
-rw-r--r--lib/Smokeping/probes/basefork.pm6
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/Smokeping/probes/base.pm b/lib/Smokeping/probes/base.pm
index dab2979..8cc4def 100644
--- a/lib/Smokeping/probes/base.pm
+++ b/lib/Smokeping/probes/base.pm
@@ -279,6 +279,12 @@ DOC
},
pings => {
_re => '\d+',
+ _sub => sub {
+ my $val = shift;
+ return "ERROR: The pings value must be at least 3."
+ if $val < 3;
+ return undef;
+ },
_example => 20,
_doc => <<DOC,
How many pings should be sent to each target, if different from the global
diff --git a/lib/Smokeping/probes/basefork.pm b/lib/Smokeping/probes/basefork.pm
index b7b5554..4f50467 100644
--- a/lib/Smokeping/probes/basefork.pm
+++ b/lib/Smokeping/probes/basefork.pm
@@ -125,6 +125,12 @@ sub targetvars {
return $class->_makevars($class->SUPER::targetvars, {
pings => {
_re => '\d+',
+ _sub => sub {
+ my $val = shift;
+ return "ERROR: The pings value must be at least 3."
+ if $val < 3;
+ return undef;
+ },
_example => 5,
_doc => <<DOC,
How many pings should be sent to each target, if different from the global