summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2008-06-08 23:41:37 +0200
committerTobi Oetiker <tobi@oetiker.ch>2008-06-08 23:41:37 +0200
commit55a86f815d5f60e4d734be4f67d7968eb1a67281 (patch)
tree4591f886853e786fd8f90e561e69509920c4aa59 /lib
parent400065442d62705a6cebcf6f5c5aa53a3bccf34f (diff)
downloadsmokeping-55a86f815d5f60e4d734be4f67d7968eb1a67281.tar.gz
smokeping-55a86f815d5f60e4d734be4f67d7968eb1a67281.tar.xz
fixed telnetJunOSPing
Diffstat (limited to 'lib')
-rw-r--r--lib/Smokeping/probes/TelnetJunOSPing.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Smokeping/probes/TelnetJunOSPing.pm b/lib/Smokeping/probes/TelnetJunOSPing.pm
index 8e6ca5d..ee5604e 100644
--- a/lib/Smokeping/probes/TelnetJunOSPing.pm
+++ b/lib/Smokeping/probes/TelnetJunOSPing.pm
@@ -148,7 +148,7 @@ sub pingone ($$){
# print OUTF "target => $dest\nsource => $source\nuser => $login\n";
my $ok = $telnet->open(Host => $source,
Port => $port);
- print OUTF "Connection is a $ok\n";
+ # print OUTF "Connection is a $ok\n";
#Authenticate
$telnet->waitfor('/(ogin):.*$/');
@@ -160,16 +160,20 @@ sub pingone ($$){
$telnet->waitfor('/[\@\w\-\.]+[>#][ ]*$/');
$telnet->print("set cli screen-length 0");
$telnet->waitfor('/[\@\w\-\.]+[>#][ ]*$/');
- @output = $telnet->cmd("ping $dest count $pings size $bytes source $psource");
+ if ( $psource ) {
+ @output = $telnet->cmd("ping $dest count $pings size $bytes source $psource");
+ } else {
+ @output = $telnet->cmd("ping $dest count $pings size $bytes");
+ }
$telnet->print("quit");
$telnet->close;
- print OUTF "closed Telnet connection\n";
+ # print OUTF "closed Telnet connection\n";
my @times = ();
while (@output) {
my $outputline = shift @output;
chomp($outputline);
- print OUTF "$outputline\n";
+ # print OUTF "$outputline\n";
$outputline =~ /^\d+ bytes from $dest: icmp_seq=\d+ ttl=\d+ time=(\d+\.\d+) ms$/ && push(@times,$1);
#print OUTF "$outputline => $1\n";
}