diff options
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | Makefile | 6 | ||||
-rwxr-xr-x | bin/smokeping.dist | 2 | ||||
-rwxr-xr-x | bin/tSmoke.dist | 2 | ||||
-rwxr-xr-x | htdocs/smokeping.cgi.dist | 2 | ||||
-rw-r--r-- | lib/Smokeping.pm | 9 | ||||
-rw-r--r-- | lib/Smokeping/probes/FTPtransfer.pm | 42 |
7 files changed, 40 insertions, 25 deletions
@@ -1,3 +1,5 @@ + +* some touchups to the graph comments to be a bit less 'ping' focussed -- tobi * configuration option mailtemplate lets you configure the alert message content -- tobi * added new method ProbeUnit to base.pm in support of FTPtransfer.pm -- tobi * new probe FTPtransfer.pm added. It measures available bandwidth by @@ -1,11 +1,11 @@ SHELL = /bin/sh -VERSION = 2.1.0 +VERSION = 2.0.901 ############ A is for features ############ B is for bugfixes ############ V.AAABBB ############ 2.000001 ############ 2.000002 -NUMVERSION = 2.001000 +NUMVERSION = 2.000901 IGNORE = ~|CVS|var/|smokeping-$(VERSION)/smokeping-$(VERSION)|cvsignore|rej|orig|DEAD|pod2htm[di]\.tmp|.svn GROFF = groff PERL = perl @@ -148,7 +148,7 @@ doc: killdoc ref examples man html txt rename-man # patch first so Smokeping.pm is older than smokeping_config.pod in the tarball tar: patch doc -ln -s . smokeping-$(VERSION) - find smokeping-$(VERSION)/* -type f -follow -o -type l | egrep -v '$(IGNORE)' | gtar -T - -czvf smokeping-$(VERSION).tar.gz + find smokeping-$(VERSION)/* -type f -follow -o -type l | egrep -v '$(IGNORE)' | tar -T - -czvf smokeping-$(VERSION).tar.gz rm smokeping-$(VERSION) commit: diff --git a/bin/smokeping.dist b/bin/smokeping.dist index 091f0c2..657af22 100755 --- a/bin/smokeping.dist +++ b/bin/smokeping.dist @@ -4,7 +4,7 @@ use lib qw(/usr/pack/rrdtool-1.0.49-to/lib/perl); use lib qw(lib); -use Smokeping 2.001000; +use Smokeping 2.000901; Smokeping::main("etc/config.dist"); diff --git a/bin/tSmoke.dist b/bin/tSmoke.dist index 745a858..888e294 100755 --- a/bin/tSmoke.dist +++ b/bin/tSmoke.dist @@ -53,7 +53,7 @@ use strict; use lib qw(lib); use lib "/usr/local/rrdtool-1.0.39/lib/perl"; -use Smokeping 20060829; +use Smokeping 2.000901; use Net::SMTP; use Getopt::Long; use Pod::Usage; diff --git a/htdocs/smokeping.cgi.dist b/htdocs/smokeping.cgi.dist index 67f9e55..f38fbe4 100755 --- a/htdocs/smokeping.cgi.dist +++ b/htdocs/smokeping.cgi.dist @@ -5,7 +5,7 @@ use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl); use lib qw(/home/oetiker/data/projects/AADJ-smokeping/dist/lib); use CGI::Carp qw(fatalsToBrowser); -use Smokeping 20060829; +use Smokeping 2.000901; Smokeping::cgi("/home/oetiker/data/projects/AADJ-smokeping/dist/etc/config"); diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 417f10e..a26fc0e 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -28,7 +28,7 @@ use Smokeping::RRDtools; # globale persistent variables for speedy use vars qw($cfg $probes $VERSION $havegetaddrinfo $cgimode); -$VERSION="2.001000"; +$VERSION="2.000901"; # we want opts everywhere my %opt; @@ -413,7 +413,6 @@ sub init_target_tree ($$$$) { ($name.".rrd", "--step",$step, "DS:uptime:GAUGE:".(2*$step).":0:U", "DS:loss:GAUGE:".(2*$step).":0:".$pings, - # 180 Seconds is the max rtt we consider valid ... "DS:median:GAUGE:".(2*$step).":0:180", (map { "DS:ping${_}:GAUGE:".(2*$step).":0:180" } 1..$pings), @@ -885,7 +884,7 @@ sub get_detail ($$$$){ my $swidth = $max->{$start} / $cfg->{Presentation}{detail}{height}; my @median = ("DEF:median=${rrd}:median:AVERAGE", "CDEF:ploss=loss,$pings,/,100,*", - "GPRINT:median:AVERAGE:Median Ping RTT (%.1lf %ss avg) ", + "GPRINT:median:AVERAGE:Median RTT (%.1lf %ss avg) ", "LINE1:median#202020" ); my @lossargs = (); @@ -993,8 +992,8 @@ sub get_detail ($$$$){ ()), 'HRULE:0#000000', 'COMMENT:\s', - "COMMENT:Probe${BS}: $pings $ProbeDesc every $step seconds", - 'COMMENT:created on '.$date.'\j' ); + "COMMENT:Probe${BS}: $pings $ProbeDesc every ${step}s", + 'COMMENT:'.$date.'\j' ); # do_log ("***** begin task ***** <br />"); # do_log (@task); diff --git a/lib/Smokeping/probes/FTPtransfer.pm b/lib/Smokeping/probes/FTPtransfer.pm index c4c39e8..52a7717 100644 --- a/lib/Smokeping/probes/FTPtransfer.pm +++ b/lib/Smokeping/probes/FTPtransfer.pm @@ -51,6 +51,10 @@ specific `min_interval' variable ($DEFAULTINTERVAL by default). Many variables can be specified either in the probe or in the target definition, the target-specific variable will override the prove-specific variable. + +If your transfer takes a lot of time, you may want to make sure to set the +B<timeout> and B<max_rtt> properly so that smokeping does not abort the +transfers of limit the graph size. DOC authors => <<'DOC', Tobias Oetiker <tobi@oetiker.ch> sponsored by Virtela @@ -58,16 +62,23 @@ DOC bugs => <<DOC, This probe has the capability for saturating your links, so don't use it unless you know what you are doing. + +The FTPtransfer probe measures bandwidth, but we report the number of +seconds it took to transfer the 'reference' file. This is because curently +the notion of I<Round Trip Time> is at the core of the application. It would +take some re-egineering to split this out in plugins and thus make it +configurable ... DOC } } sub ProbeDesc ($) { - return "File transfers (FTP)"; -} - -sub ProbeUnit ($) { - return "Bytes/Second"; + my $self = shift; + my $srcfile = $self->{properties}{srcfile}; + my $destfile = $self->{properties}{destfile}; + my $mode = $self->{properties}{mode}; + my $size = $mode eq 'get' ? -s $destfile : -s $srcfile; + return sprintf("FTP File transfers (%.0f KB)",$size/1024); } sub new { @@ -102,7 +113,7 @@ sub pingone { push (@options, LocalAddr => $vars->{localaddr} ) if $vars->{localaddr}; push (@options, Passive => 1 ) if $vars->{passive} and $vars->{passive} eq 'yes'; - my @rates; + my @times; my $elapsed; for (1..$self->pings($target)) { @@ -111,30 +122,29 @@ sub pingone { sleep $timeleft if $timeleft > 0; } my $ftp = Net::FTP->new($host, @options) or - $self->do_debug("Problem with $host: ftp session $@"), return; + $self->do_log("Problem with $host: ftp session $@"), return; $ftp->login($username,$password) or - $self->do_debug("Problem with $host: ftp login ".$ftp->message), return; + $self->do_log("Problem with $host: ftp login ".$ftp->message), return; my $start = gettimeofday(); my $ok; my $size; if ($mode eq 'get'){ $ok = $ftp->get($srcfile,$destfile) or - $self->do_debug("Problem with $host: ftp get ".$ftp->message); + $self->do_log("Problem with $host: ftp get ".$ftp->message); $size = -s $destfile; } else { $ok = $ftp->put($srcfile,$destfile) or - $self->do_debug("Problem with $host: ftp put ".$ftp->message); + $self->do_log("Problem with $host: ftp put ".$ftp->message); $size = -s $srcfile; } my $end = gettimeofday(); $ftp->quit; $elapsed = ( $end - $start ); $ok or next; - my $speed = $size / $elapsed; - $self->do_debug("$host: ftp $mode $speed Bytes/s"); - push @rates, $speed; + $self->do_debug("$host - $mode mode transfered $size Bytes in ${elapsed}s"); + push @times, $elapsed; } - return sort { $a <=> $b } @rates; + return sort { $a <=> $b } @times; } sub probevars { @@ -145,6 +155,10 @@ sub probevars { The timeout is the maximum amount of time you will allow the probe to transfer the file. If the probe does not succeed to transfer in the time specified, it will get killed and a 'loss' will be loged. + +Since FTPtransfer is an invasive probe you should make sure you do not load +the link for more than a few seconds anyway. Smokeping curently has a hard +limit of 180 seconds for any RTT. DOC return $class->_makevars($h, { |