summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--lib/Smokeping/probes/TelnetJunOSPing.pm12
2 files changed, 10 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index de1dca5..33b32ba 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+* fix for telneJunOSPing by Christian Hahn -- tobi
+
* fixed FPing regression created in r680 it broke the proper handling of old
version of fping. Found by Celedonio Miranda Torresano -- tobi
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";
}