summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES6
-rwxr-xr-xbin/smokeping.dist5
-rw-r--r--lib/Smokeping.pm6
-rw-r--r--lib/Smokeping/probes/SSH.pm12
4 files changed, 23 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index 7b01c00..dc593d2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+* In the SSH probe let the user configure the port to use when talking to the client --tobi
+
+* Make master/slave work when slave names contain uppercase letters and full dots. -- tobi
+
+* Allow slave-name to be configured -- tobi
+
* switched to config grammar 1.10 -- tobi
* make sure reload_config reloads in any case even when the config has not changed ...
diff --git a/bin/smokeping.dist b/bin/smokeping.dist
index d5087e5..1aa365d 100755
--- a/bin/smokeping.dist
+++ b/bin/smokeping.dist
@@ -58,6 +58,11 @@ B<smokeping> [ B<--email> | B<--makepod> | B<--version> | B<--restart> ]
--master-url=s Run smokeping in slave mode. Attach to master for config.
+ --slave-name=s By default the slave will use whatever it thinks its name
+ is, when talking to its master. In some cases you may
+ probably want to override this.
+
+
--shared-secret=s File containing the shared secret for talking to the server.
--cache-dir=s Directory for temporary data storage when running in slave mode.
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index e34cab5..5a44b3e 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -1956,7 +1956,7 @@ DOC
If you want to have alerts for this target and all targets below it go to a particular address
on top of the address already specified in the alert, you can add it here. This can be a comma separated list of items.
DOC
- slaves => { _re => '[-a-z0-9]+(?:\s+[-a-z0-9]+)*',
+ slaves => { _re => '${KEYD_RE}(?:\s+${KEYD_RE})*',
_re_error => 'slave1 [slave2]',
_doc => <<DOC },
The slave names must match the slaves you have setup in the slaves section.
@@ -3712,7 +3712,7 @@ 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') or pod2usage(2);
+ 'master-url=s','cache-dir=s','shared-secret=s','slave-name=s') or pod2usage(2);
if($opt{version}) { print "$VERSION\n"; exit(0) };
if(exists $opt{man}) {
if ($opt{man}) {
@@ -3753,7 +3753,7 @@ sub main (;$) {
master_url => $opt{'master-url'},
cache_dir => $opt{'cache-dir'},
shared_secret => $secret,
- slave_name => hostname,
+ slave_name => $opt{'slave-name'} || hostname(),
};
# this should get us a config set from the server
my $new_conf = Smokeping::Slave::submit_results($slave_cfg,$cfg);
diff --git a/lib/Smokeping/probes/SSH.pm b/lib/Smokeping/probes/SSH.pm
index 7756c03..4bcad76 100644
--- a/lib/Smokeping/probes/SSH.pm
+++ b/lib/Smokeping/probes/SSH.pm
@@ -82,7 +82,7 @@ sub pingone ($){
my $host = $target->{addr};
- my $query = "$self->{properties}{binary} -t $target->{vars}->{keytype} $host";
+ my $query = "$self->{properties}{binary} -t $target->{vars}->{keytype} -p $target->{vars}->{port} $host";
my @times;
# get the user and system times before and after the test
@@ -129,10 +129,16 @@ sub targetvars {
my $class = shift;
return $class->_makevars($class->SUPER::targetvars, {
keytype => {
- _doc => "Type of key, used in ssh-keyscan -t <keytype>",
+ _doc => "Type of key, used in ssh-keyscan -t I<keytype>",
_re => "[dt]sa1*",
_example => 'dsa',
- _default => 'rsa',
+ _default => 'rsa',
+ },
+ port => {
+ _doc => "Port to use when testing the ssh connection -p I<port>",
+ _re => "\d+",
+ _example => '5000',
+ _default => '22',
},
})
}