summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Smokeping.pm4
-rw-r--r--lib/Smokeping/Slave.pm2
2 files changed, 4 insertions, 2 deletions
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;
}