diff options
author | Niko Tyni <ntyni@iki.fi> | 2008-03-04 22:57:30 +0100 |
---|---|---|
committer | Niko Tyni <ntyni@iki.fi> | 2008-03-04 22:57:30 +0100 |
commit | 31e4fcaa45fb5dca6018a1ef70b71bdfbbac4965 (patch) | |
tree | 8614d91963db5ff41cde9e916613a231dbd328df /lib | |
parent | 06144c93db3c0cc7bc5434740a76b9eac6c23ee4 (diff) | |
download | smokeping-31e4fcaa45fb5dca6018a1ef70b71bdfbbac4965.tar.gz smokeping-31e4fcaa45fb5dca6018a1ef70b71bdfbbac4965.tar.xz |
* add an optional --pid-dir option to specify the pid directory
when running as a slave. --niko
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Smokeping.pm | 4 | ||||
-rw-r--r-- | lib/Smokeping/Slave.pm | 2 |
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; } |