diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Smokeping.pm | 6 | ||||
-rw-r--r-- | lib/Smokeping/probes/SSH.pm | 12 |
2 files changed, 12 insertions, 6 deletions
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', }, }) } |