summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@iki.fi>2008-03-04 22:57:30 +0100
committerNiko Tyni <ntyni@iki.fi>2008-03-04 22:57:30 +0100
commit31e4fcaa45fb5dca6018a1ef70b71bdfbbac4965 (patch)
tree8614d91963db5ff41cde9e916613a231dbd328df
parent06144c93db3c0cc7bc5434740a76b9eac6c23ee4 (diff)
downloadsmokeping-31e4fcaa45fb5dca6018a1ef70b71bdfbbac4965.tar.gz
smokeping-31e4fcaa45fb5dca6018a1ef70b71bdfbbac4965.tar.xz
* add an optional --pid-dir option to specify the pid directory
when running as a slave. --niko
-rw-r--r--CHANGES2
-rwxr-xr-xbin/smokeping.dist3
-rw-r--r--lib/Smokeping.pm4
-rw-r--r--lib/Smokeping/Slave.pm2
4 files changed, 9 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 83e6272..4d2c27b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+* add an optional --pid-dir option to specify the pid directory
+ when running as a slave. --niko
* slaves were not polling targets where nomasterpoll was set --tobi
2008/2/25 -- released version 2.3.2
diff --git a/bin/smokeping.dist b/bin/smokeping.dist
index c675a84..2090b05 100755
--- a/bin/smokeping.dist
+++ b/bin/smokeping.dist
@@ -67,6 +67,9 @@ B<smokeping> [ B<--email> | B<--makepod> | B<--version> | B<--restart> ]
--cache-dir=s Directory for temporary data storage when running in slave mode.
+ --pid-dir=s Directory for the PID file when running in slave mode.
+ (optional, defaults to --cache-dir)
+
=head1 DESCRIPTION
The B<smokeping> tool is the commandline part of the SmokePing system. Its
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 7263399..c7726ca 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -3949,7 +3949,8 @@ sub main (;$) {
GetOptions(\%opt, 'version', 'email', 'man:s','help','logfile=s','static-pages:s', 'debug-daemon',
'nosleep', 'makepod:s','debug','restart', 'filter=s', 'nodaemon|nodemon',
'config=s', 'check', 'gen-examples', 'reload',
- 'master-url=s','cache-dir=s','shared-secret=s','slave-name=s') or pod2usage(2);
+ 'master-url=s','cache-dir=s','shared-secret=s',
+ 'slave-name=s','pid-dir=s') or pod2usage(2);
if($opt{version}) { print "$VERSION\n"; exit(0) };
if(exists $opt{man}) {
if ($opt{man}) {
@@ -3989,6 +3990,7 @@ sub main (;$) {
$slave_cfg = {
master_url => $opt{'master-url'},
cache_dir => $opt{'cache-dir'},
+ pid_dir => $opt{'pid-dir'} || $opt{'cache-dir'},
shared_secret => $secret,
slave_name => $opt{'slave-name'} || hostname(),
};
diff --git a/lib/Smokeping/Slave.pm b/lib/Smokeping/Slave.pm
index 32ce5a4..6214817 100644
--- a/lib/Smokeping/Slave.pm
+++ b/lib/Smokeping/Slave.pm
@@ -103,7 +103,7 @@ sub submit_results {
if ($@){
warn "WARNING evaluating new config from server failed: $@ --\n$data";
} elsif (defined $config and ref $config eq 'HASH'){
- $config->{General}{piddir} = $slave_cfg->{cache_dir};
+ $config->{General}{piddir} = $slave_cfg->{pid_dir};
Smokeping::do_log("Sent data to Server and got new config in response.");
return $config;
}