From blair at orcaware.com Tue Feb 4 12:04:55 2003 From: blair at orcaware.com (blair at orcaware.com) Date: Tue, 4 Feb 2003 12:04:55 -0800 Subject: [Orca-checkins] rev 200 - trunk/orca/data_gatherers/orcallator Message-ID: <200302042004.h14K4tbD007589@orcaware.com> Author: blair Date: 2003-02-04 12:04:21 -0800 (Tue, 04 Feb 2003) New Revision: 200 Modified: trunk/orca/data_gatherers/orcallator/orcallator.cfg.in Log: * data_gatherers/orcallator/orcallator.cfg.in: Add a new plot, the system uptime, showing the number of days that the system has been up. Modified: trunk/orca/data_gatherers/orcallator/orcallator.cfg.in ============================================================================== --- trunk/orca/data_gatherers/orcallator/orcallator.cfg.in (original) +++ trunk/orca/data_gatherers/orcallator/orcallator.cfg.in 2003-02-04 12:04:45.000000000 -0800 @@ -131,6 +131,18 @@ } plot { +title %g Uptime +source orcallator +data uptime / 86400 +line_type area +legend Uptime +y_legend Days +data_min 0 +plot_min 0 +href http://www.orcaware.com/orca/docs/orcallator.html#system_uptime +} + +plot { title %g Average # Processes in Run Queue (Load Average) source orcallator data 1runq From blair at orcaware.com Thu Feb 20 15:24:05 2003 From: blair at orcaware.com (blair at orcaware.com) Date: Thu, 20 Feb 2003 15:24:05 -0800 Subject: [Orca-checkins] rev 201 - in trunk/orca: . packages packages/rrdtool-1.0.41 packages/rrdtool-1.0.41/src packages/rrdtool-1.0.41/contrib/rrdfetchnames packages/rrdtool-1.0.41/contrib/rrdlastds packages/rrdtool-1.0.41/contrib/add_ds packages/rrdtool-1.0.41/perl-piped packages/rrdtool-1.0.41/doc packages/rrdtool-1.0.41/perl-shared packages/rrdtool-1.0.41/gd1.3 Message-ID: <200302202324.h1KNO5rX004988@orcaware.com> Author: blair Date: 2003-02-20 12:13:18 -0800 (Thu, 20 Feb 2003) New Revision: 201 Added: trunk/orca/packages/rrdtool-1.0.41/ Removed: trunk/orca/packages/rrdtool-1.0.40/ Modified: trunk/orca/INSTALL trunk/orca/configure.in trunk/orca/packages/rrdtool-1.0.41/CHANGES trunk/orca/packages/rrdtool-1.0.41/CONTRIBUTORS trunk/orca/packages/rrdtool-1.0.41/Makefile.am trunk/orca/packages/rrdtool-1.0.41/Makefile.in trunk/orca/packages/rrdtool-1.0.41/configure trunk/orca/packages/rrdtool-1.0.41/configure.in trunk/orca/packages/rrdtool-1.0.41/contrib/add_ds/batch.pl trunk/orca/packages/rrdtool-1.0.41/contrib/rrdfetchnames/rrdfetchnames.pl trunk/orca/packages/rrdtool-1.0.41/contrib/rrdlastds/rrdlastds.pl trunk/orca/packages/rrdtool-1.0.41/doc/RRDp.html trunk/orca/packages/rrdtool-1.0.41/doc/RRDp.txt trunk/orca/packages/rrdtool-1.0.41/doc/RRDs.html trunk/orca/packages/rrdtool-1.0.41/doc/RRDs.txt trunk/orca/packages/rrdtool-1.0.41/doc/bin_dec_hex.html trunk/orca/packages/rrdtool-1.0.41/doc/bin_dec_hex.txt trunk/orca/packages/rrdtool-1.0.41/doc/cdeftutorial.html trunk/orca/packages/rrdtool-1.0.41/doc/cdeftutorial.txt trunk/orca/packages/rrdtool-1.0.41/doc/rpntutorial.html trunk/orca/packages/rrdtool-1.0.41/doc/rpntutorial.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdcgi.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdcgi.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdcreate.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdcreate.pod trunk/orca/packages/rrdtool-1.0.41/doc/rrdcreate.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrddump.html trunk/orca/packages/rrdtool-1.0.41/doc/rrddump.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdfetch.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdfetch.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdgraph.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdgraph.pod trunk/orca/packages/rrdtool-1.0.41/doc/rrdgraph.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdinfo.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdinfo.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdlast.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdlast.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdresize.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdresize.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdrestore.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdrestore.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdtool.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdtool.pod trunk/orca/packages/rrdtool-1.0.41/doc/rrdtool.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdtune.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdtune.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.es.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.es.pod trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.es.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdupdate.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdupdate.txt trunk/orca/packages/rrdtool-1.0.41/doc/rrdxport.html trunk/orca/packages/rrdtool-1.0.41/doc/rrdxport.txt trunk/orca/packages/rrdtool-1.0.41/gd1.3/gd.c trunk/orca/packages/rrdtool-1.0.41/perl-piped/RRDp.pm trunk/orca/packages/rrdtool-1.0.41/perl-shared/RRDs.pm trunk/orca/packages/rrdtool-1.0.41/rrdtool.spec trunk/orca/packages/rrdtool-1.0.41/src/gdpng.c trunk/orca/packages/rrdtool-1.0.41/src/gifsize.c trunk/orca/packages/rrdtool-1.0.41/src/parsetime.c trunk/orca/packages/rrdtool-1.0.41/src/pngsize.c trunk/orca/packages/rrdtool-1.0.41/src/rrd.h trunk/orca/packages/rrdtool-1.0.41/src/rrd_cgi.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_create.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_diff.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_dump.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_error.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_fetch.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_format.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_format.h trunk/orca/packages/rrdtool-1.0.41/src/rrd_graph.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_graph.h trunk/orca/packages/rrdtool-1.0.41/src/rrd_info.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_last.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_open.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_resize.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_restore.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_tool.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_tool.h trunk/orca/packages/rrdtool-1.0.41/src/rrd_tune.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_update.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_xport.c trunk/orca/packages/rrdtool-1.0.41/src/rrd_xport.h Log: Update rrdtool from 1.0.40 to 1.0.41. This should fix the problem seen on Solaris systems where rrdtool's configure script cannot handle when Perl's C compiler is set to 'gcc -B/usr/ccs/bin'. * configure.in: Bump the required RRDs Perl VERSION number from 1.000401 to 1.000411 and update the directory to find rrdtool in from rrdtool-1.0.40 to rrdtool-1.0.41. * INSTALL (Determine which Perl modules need compiling and installing): Bump the required RRDs Perl VERSION number from 1.000401 to 1.000411 and update the RRDs package version from 1.0.40 to 1.0.41. * packages/rrdtool-1.0.41: Renamed from packages/rrdtool-1.0.40. Directory contents updated from rrdtool-1.0.41.tar.gz. Modified: trunk/orca/configure.in ============================================================================== --- trunk/orca/configure.in (original) +++ trunk/orca/configure.in 2003-02-20 15:23:56.000000000 -0800 @@ -37,8 +37,8 @@ DIGEST_MD5_VER=2.23 MATH_INTERVALSEARCH_DIR=Math-Interpolate-1.05 MATH_INTERVALSEARCH_VER=1.05 -RRDTOOL_DIR=rrdtool-1.0.40 -RRDTOOL_VER=1.000401 +RRDTOOL_DIR=rrdtool-1.0.41 +RRDTOOL_VER=1.000411 STORABLE_DIR=Storable-2.06 STORABLE_VER=2.06 TIME_HIRES_DIR=Time-HiRes-1.42 Modified: trunk/orca/INSTALL ============================================================================== --- trunk/orca/INSTALL (original) +++ trunk/orca/INSTALL 2003-02-20 15:23:56.000000000 -0800 @@ -174,7 +174,7 @@ Devel::DProf Not required by Orca 19990108 Digest::MD5 >= 2.23 >= 2.23 2.23 Math::IntervalSearch >= 1.05 >= 1.05 1.05 - RRDs >= 1.000401 >= 1.0.40 1.0.40 + RRDs >= 1.000411 >= 1.0.41 1.0.41 Storable >= 2.06 >= 2.06 2.06 Time::HiRes Not required by Orca 1.42 Copied: rrdtool-1.0.41 (from rev 200, trunk/orca/packages/rrdtool-1.0.40) Modified: trunk/orca/packages/rrdtool-1.0.41/configure ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/configure (original) +++ trunk/orca/packages/rrdtool-1.0.41/configure 2003-02-20 15:23:56.000000000 -0800 @@ -11,7 +11,7 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: -ac_default_prefix=/usr/local/rrdtool-1.0.40 +ac_default_prefix=/usr/local/rrdtool-1.0.41 ac_help="$ac_help --with-tcllib=DIR location of the tclConfig.sh" ac_help="$ac_help @@ -799,7 +799,7 @@ PACKAGE=rrdtool -VERSION=1.0.40 +VERSION=1.0.41 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -948,7 +948,7 @@ echo "$ac_t""$SO_EXT" 1>&6 echo $ac_n "checking for the C compiler perl wants to use to build its modules""... $ac_c" 1>&6 echo "configure:951: checking for the C compiler perl wants to use to build its modules" >&5 - PROBLEMCC=`$PERL -e 'use Config; exit 0 if -x $Config{cc}; map {if (-x "$_/$Config{cc}"){exit 0}} split /:/, $ENV{PATH};print $Config{cc}'` + PROBLEMCC=`$PERL -e 'use Config; ($cc = $Config{cc}) =~ s/\s.*//; exit 0 if -x $cc; map {if (-x "$_/$cc"){exit 0}} split /:/, $ENV{PATH};print $Config{cc}'` if test x$PROBLEMCC != x; then echo "$ac_t""no" 1>&6 echo Could not find the Compiler: '"'$PROBLEMCC'"' @@ -3421,10 +3421,10 @@ else echo "$ac_t""no" 1>&6 - CFLAGS="$_cflags -OPT:IEEE_comparisons=ON" - echo $ac_n "checking if IEEE math works with the -OPT:IEEE_comparisons=ON switch""... $ac_c" 1>&6 -echo "configure:3427: checking if IEEE math works with the -OPT:IEEE_comparisons=ON switch" >&5 -if eval "test \"`echo '$''{'rd_cv_ieee_ieeecmpswitch'+set}'`\" = set"; then + CFLAGS="$_cflags -OPT:IEEE_NaN_inf=ON" + echo $ac_n "checking if IEEE math works with the -OPT:IEEE_NaN_inf=ON switch""... $ac_c" 1>&6 +echo "configure:3427: checking if IEEE math works with the -OPT:IEEE_NaN_inf=ON switch" >&5 +if eval "test \"`echo '$''{'rd_cv_ieee_ieeenaninfswitch'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then @@ -3501,6 +3501,103 @@ EOF if { (eval echo configure:3503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then + rd_cv_ieee_ieeenaninfswitch=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + rd_cv_ieee_ieeenaninfswitch=no +fi +rm -fr conftest* +fi + +fi + +if test x${rd_cv_ieee_ieeenaninfswitch} = "xyes"; then + echo "$ac_t""yes" 1>&6 + +else + echo "$ac_t""no" 1>&6 + CFLAGS="$_cflags -OPT:IEEE_comparisons=ON" + echo $ac_n "checking if IEEE math works with the -OPT:IEEE_comparisons=ON switch""... $ac_c" 1>&6 +echo "configure:3524: checking if IEEE math works with the -OPT:IEEE_comparisons=ON switch" >&5 +if eval "test \"`echo '$''{'rd_cv_ieee_ieeecmpswitch'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#endif + +#if HAVE_FLOAT_H +# include +#endif + +#if HAVE_IEEEFP_H +# include +#endif + +#if HAVE_FP_CLASS_H +# include +#endif + +/* Solaris */ +#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) +# define HAVE_ISINF 1 +# define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) +#endif + +/* Digital UNIX */ +#if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) +# define HAVE_ISINF 1 +# define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) +#endif + +/* AIX */ +#if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) +# define HAVE_ISINF 1 +# define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) +#endif + +#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) +# define HAVE_ISINF 1 +# define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) +#endif + +#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) +# define HAVE_ISINF 1 +# define isinf(a) (fpclassify(a) == FP_INFINITE) +#endif + +#include +int main(void){ + double nan,inf,c,zero; + ; + /* some math to see if we get a floating point exception */ + zero=sin(0.0); /* don't let the compiler optimize us away */ + nan=0.0/zero; /* especially here */ + inf=1.0/zero; /* and here. I want to know if it can do the magic */ + /* at run time without sig fpe */ + c = inf + nan; + c = inf / nan; + if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;} + if (nan == nan) {printf ("nan == nan ... "); return 1;} + if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;} + if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;} + if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} + if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} + return 0; + } +EOF +if { (eval echo configure:3600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then rd_cv_ieee_ieeecmpswitch=yes else echo "configure: failed program was:" >&5 @@ -3519,8 +3616,8 @@ else echo "$ac_t""no" 1>&6 CFLAGS=$_cflags - echo $ac_n "checking if IEEE math works with fpsetmask(0)""... $ac_c" 1>&6 -echo "configure:3524: checking if IEEE math works with fpsetmask(0)" >&5 + echo $ac_n "checking if IEEE math works with fpsetmask(0)""... $ac_c" 1>&6 +echo "configure:3621: checking if IEEE math works with fpsetmask(0)" >&5 if eval "test \"`echo '$''{'rd_cv_ieee_mask'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3528,7 +3625,7 @@ : else cat > conftest.$ac_ext < @@ -3596,7 +3693,7 @@ return 0; } EOF -if { (eval echo configure:3600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then rd_cv_ieee_mask=yes else @@ -3616,11 +3713,11 @@ #define MUST_DISABLE_FPMASK 1 EOF - PERLFLAGS="CCFLAGS=-DMUST_DISABLE_FPMASK" + PERLFLAGS="CCFLAGS=-DMUST_DISABLE_FPMASK" else echo "$ac_t""no" 1>&6 echo $ac_n "checking if IEEE math works with signal(SIGFPE,SIG_IGN)""... $ac_c" 1>&6 -echo "configure:3624: checking if IEEE math works with signal(SIGFPE,SIG_IGN)" >&5 +echo "configure:3721: checking if IEEE math works with signal(SIGFPE,SIG_IGN)" >&5 if eval "test \"`echo '$''{'rd_cv_ieee_sigfpe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3628,7 +3725,7 @@ : else cat > conftest.$ac_ext < @@ -3696,7 +3793,7 @@ return 0; } EOF -if { (eval echo configure:3700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then rd_cv_ieee_sigfpe=yes else @@ -3716,7 +3813,7 @@ #define MUST_DISABLE_SIGFPE 1 EOF - PERLFLAGS="CCFLAGS=-DMUST_DISABLE_SIGFPE" + PERLFLAGS="CCFLAGS=-DMUST_DISABLE_SIGFPE" else echo "$ac_t""no" 1>&6 { echo "configure: error: @@ -3751,6 +3848,9 @@ fi +fi + + trap '' 1 2 15 @@ -4209,7 +4309,7 @@ echo $ac_n "checking in""... $ac_c" 1>&6 -echo "configure:4213: checking in" >&5 +echo "configure:4313: checking in" >&5 echo "$ac_t""and out again" 1>&6 echo $ac_n "ordering CD from http://people.ee.ethz.ch/~oetiker/wish $ac_c" 1>&6 Modified: trunk/orca/packages/rrdtool-1.0.41/Makefile.in ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/Makefile.in (original) +++ trunk/orca/packages/rrdtool-1.0.41/Makefile.in 2003-02-20 15:23:57.000000000 -0800 @@ -92,7 +92,7 @@ # the following files are not mentioned in any other Makefile -EXTRA_DIST = COPYRIGHT CHANGES NT-BUILD-TIPS.txt TODO CONTRIBUTORS rrdtool.spec perl-piped/MANIFEST perl-piped/README perl-piped/rrdpl.ds? perl-piped/RRDp.pm perl-piped/Makefile.PL perl-piped/t/base.t perl-shared/MANIFEST perl-shared/README perl-shared/RRDs.xs perl-shared/ntmake.pl perl-shared/Makefile.PL.in perl-shared/t/base.t perl-shared/rrdpl.ds? perl-shared/RRDs.pm +EXTRA_DIST = COPYRIGHT CHANGES NT-BUILD-TIPS.txt TODO CONTRIBUTORS rrdtool.spec perl-piped/MANIFEST perl-piped/README perl-piped/rrdpl.ds? perl-piped/RRDp.pm perl-piped/Makefile.PL perl-piped/t/base.t perl-shared/MANIFEST perl-shared/README perl-shared/RRDs.xs perl-shared/ntmake.pl perl-shared/Makefile.PL.in perl-shared/t/base.t perl-shared/rrdpl.ds? perl-shared/RRDs.pm rrdtool.spec CLEANFILES = config.cache @@ -427,7 +427,7 @@ (cd website && wmk-1.7.4 -f manual tutorial contributors.wml && ./site-sync ) to-versync: - perl -i -p -e '"$(VERSION)" =~ /(\d+)\.(\d+)\.(\d+)/; $$v=sprintf("%1d.%02d0%02d1" ,$${1},$${2},$${3}); s|VERSION\s*=\s*[\d.]+|VERSION = $$v|' perl-*/RRD?.pm + perl -i -p -e '"$(VERSION)" =~ /(\d+)\.(\d+)\.(\d+)/; $$v=sprintf("%1d.%02d0%02d1" ,$${1},$${2},$${3}); s|VERSION\s*=\s*[\d.]+|VERSION = $$v|' perl-*/RRD?.pm rrdtool.spec perl -i -p -e 's|RRDtool\s+\d+\.\d+\.\d+ |RRDtool $(VERSION) |' src/*.[ch] to-dist: to-docs dist @@ -435,7 +435,7 @@ to-scp: to-dist cp CHANGES archive/$(PACKAGE)-$(VERSION).tar.gz /home/oetiker/public_html/webtools/rrdtool/pub/ - (cd /home/oetiker/public_html/webtools/rrdtool/pub; rm $(PACKAGE).tar.gz; ln -s $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE).tar.gz) + (cd /home/oetiker/public_html/webtools/rrdtool/pub; rm $(PACKAGE).tar.gz; ln -s $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE).tar.gz;gmd5sum $(PACKAGE).tar.gz >$(PACKAGE).tar.gz.md5; pgps $(PACKAGE).tar.gz.md5) # $(RSYNC) CHANGES archive/$(PACKAGE)-$(VERSION).tar.gz tobi at ipn.caida.org:/ipn/web/Tools/RRDtool/pub/ Modified: trunk/orca/packages/rrdtool-1.0.41/configure.in ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/configure.in (original) +++ trunk/orca/packages/rrdtool-1.0.41/configure.in 2003-02-20 15:23:57.000000000 -0800 @@ -5,6 +5,14 @@ dnl dnl +dnl Disable user's CDPATH, otherwise expressions of the form: +dnl cd $var && pwd +dnl generate double output, ie. cd command reports the new +dnl directory location in addition to the pwd command. See +dnl missing_dir= below. This in turn generates an unterminated +dnl 's' command for sed when generating the Makefiles. +unset CDPATH + dnl make sure we are being executed in the right place AC_INIT(src/rrd_tool.c) @@ -16,11 +24,11 @@ AC_CANONICAL_SYSTEM dnl tell automake the this script is for rrdtool -AM_INIT_AUTOMAKE(rrdtool, 1.0.40) +AM_INIT_AUTOMAKE(rrdtool, 1.0.41) AC_SUBST(VERSION) dnl where we install our stuff ... -AC_PREFIX_DEFAULT( /usr/local/rrdtool-1.0.40 ) +AC_PREFIX_DEFAULT( /usr/local/rrdtool-1.0.41 ) dnl tell automake which file to use as config header AM_CONFIG_HEADER(config/config.h) @@ -51,7 +59,7 @@ SO_EXT=`$PERL -e 'use Config; if (defined $Config{so} and $Config{so} ne 'a') {print "$Config{so}\n"} else {print "so\n"};'` AC_MSG_RESULT($SO_EXT) AC_MSG_CHECKING(for the C compiler perl wants to use to build its modules) - PROBLEMCC=`$PERL -e 'use Config; exit 0 if -x $Config{cc}; map {if (-x "$_/$Config{cc}"){exit 0}} split /:/, $ENV{PATH};print $Config{cc}'` + PROBLEMCC=`$PERL -e 'use Config; ($cc = $Config{cc}) =~ s/\s.*//; exit 0 if -x $cc; map {if (-x "$_/$cc"){exit 0}} split /:/, $ENV{PATH};print $Config{cc}'` if test x$PROBLEMCC != x; then AC_MSG_RESULT(no) echo Could not find the Compiler: '"'$PROBLEMCC'"' @@ -299,22 +307,24 @@ AC_IEEE([with the -mieee switch], mswitch, , , , [CFLAGS="$_cflags -q float=rndsngl" AC_IEEE([with the -q float=rndsngl switch], qswitch, , , , - [CFLAGS="$_cflags -OPT:IEEE_comparisons=ON" - AC_IEEE([with the -OPT:IEEE_comparisons=ON switch], ieeecmpswitch, , , , - [CFLAGS=$_cflags - AC_IEEE([with fpsetmask(0)], mask, - [#include ], [fpsetmask(0)], - [AC_DEFINE(MUST_DISABLE_FPMASK) - PERLFLAGS="CCFLAGS=-DMUST_DISABLE_FPMASK"], - [AC_IEEE([with signal(SIGFPE,SIG_IGN)], sigfpe, - [#include ], [signal(SIGFPE,SIG_IGN)], - [AC_DEFINE(MUST_DISABLE_SIGFPE) - PERLFLAGS="CCFLAGS=-DMUST_DISABLE_SIGFPE"], - AC_MSG_ERROR([ + [CFLAGS="$_cflags -OPT:IEEE_NaN_inf=ON" + AC_IEEE([with the -OPT:IEEE_NaN_inf=ON switch], ieeenaninfswitch, , , , + [CFLAGS="$_cflags -OPT:IEEE_comparisons=ON" + AC_IEEE([with the -OPT:IEEE_comparisons=ON switch], ieeecmpswitch, , , , + [CFLAGS=$_cflags + AC_IEEE([with fpsetmask(0)], mask, + [#include ], [fpsetmask(0)], + [AC_DEFINE(MUST_DISABLE_FPMASK) + PERLFLAGS="CCFLAGS=-DMUST_DISABLE_FPMASK"], + [AC_IEEE([with signal(SIGFPE,SIG_IGN)], sigfpe, + [#include ], [signal(SIGFPE,SIG_IGN)], + [AC_DEFINE(MUST_DISABLE_SIGFPE) + PERLFLAGS="CCFLAGS=-DMUST_DISABLE_SIGFPE"], + AC_MSG_ERROR([ Your Compiler does not do propper IEEE math ... Please find out how to make IEEE math work with your compiler and let me know (oetiker at ee.ethz.ch). Check config.log to see what went wrong ... -]))])])])])])])])]) +]))])])])])])])])])]) AC_OUTPUT(cgilib-0.4/Makefile \ Modified: trunk/orca/packages/rrdtool-1.0.41/src/gifsize.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/gifsize.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/gifsize.c 2003-02-20 15:23:57.000000000 -0800 @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 **************************************************************************** * gifsize.c provides the function gifsize which determines the size of a gif ****************************************************************************/ Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_info.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_info.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_info.c 2003-02-20 15:23:57.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_info Get Information about the configuration of an RRD *****************************************************************************/ Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_last.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_last.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_last.c 2003-02-20 15:23:57.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_last.c ***************************************************************************** Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_dump.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_dump.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_dump.c 2003-02-20 15:23:57.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_dump Display a RRD ***************************************************************************** Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_diff.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_diff.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_diff.c 2003-02-20 15:23:57.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1999 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1999 * This code is stolen from rateup (mrtg-2.x) by Dave Rand ***************************************************************************** * diff calculate the difference between two very long integers available as Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_xport.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_xport.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_xport.c 2003-02-20 15:23:57.000000000 -0800 @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 **************************************************************************** * rrd_xport.c export RRD data ****************************************************************************/ Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_tool.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_tool.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_tool.c 2003-02-20 15:23:57.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2001 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2001 ***************************************************************************** * rrd_tool.c Startup wrapper *****************************************************************************/ @@ -20,7 +20,7 @@ { char help_main[] = - "RRDtool 1.0.40 Copyright 1997-2001 by Tobias Oetiker \n\n" + "RRDtool 1.0.41 Copyright 1997-2001 by Tobias Oetiker \n\n" "Usage: rrdtool [options] command command_options\n\n"; char help_list[] = @@ -319,7 +319,7 @@ strcmp("v", argv[1]) == 0 || strcmp("-v", argv[1]) == 0 || strcmp("-version", argv[1]) == 0 ) - printf("RRDtool 1.0.40 Copyright (C) 1997-2001 by Tobias Oetiker \n"); + printf("RRDtool 1.0.41 Copyright (C) 1997-2001 by Tobias Oetiker \n"); else if (strcmp("restore", argv[1]) == 0) rrd_restore(argc-1, &argv[1]); else if (strcmp("resize", argv[1]) == 0) Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_xport.h ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_xport.h (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_xport.h 2003-02-20 15:23:58.000000000 -0800 @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 **************************************************************************** * rrd_xport.h contains XML related constants ****************************************************************************/ Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_update.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_update.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_update.c 2003-02-20 15:23:58.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_update.c RRD Update Function ***************************************************************************** @@ -32,7 +32,7 @@ main(int argc, char **argv){ rrd_update(argc,argv); if (rrd_test_error()) { - printf("RRDtool 1.0.40 Copyright 1997-2000 by Tobias Oetiker \n\n" + printf("RRDtool 1.0.41 Copyright 1997-2000 by Tobias Oetiker \n\n" "Usage: rrdupdate filename\n" "\t\t\t[--template|-t ds-name:ds-name:...]\n" "\t\t\ttime|N:value[:value...]\n\n" Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_tool.h ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_tool.h (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_tool.h 2003-02-20 15:23:58.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_tool.h Common Header File ***************************************************************************** Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd.h ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd.h (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd.h 2003-02-20 15:23:58.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997,1998, 1999 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997,1998, 1999 ***************************************************************************** * rrdlib.h Public header file for librrd ***************************************************************************** Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_format.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_format.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_format.c 2003-02-20 15:23:58.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1999 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1999 ***************************************************************************** * rrd_format.c RRD Database Format helper functions ***************************************************************************** Modified: trunk/orca/packages/rrdtool-1.0.41/src/gdpng.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/gdpng.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/gdpng.c 2003-02-20 15:23:58.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * gdpng.c add PNG output routine to gd library *****************************************************************************/ Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_fetch.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_fetch.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_fetch.c 2003-02-20 15:23:58.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_fetch.c read date from an rrd to use for further processing ***************************************************************************** @@ -179,12 +179,13 @@ * rrd.rra_def[i].row_cnt * rrd.stat_head->pdp_step)); + /* we need step difference in either full or partial case */ + tmp_step_diff = labs(*step - (rrd.stat_head->pdp_step + * rrd.rra_def[i].pdp_cnt)); full_match = *end -*start; /* best full match */ if(cal_end >= *end && cal_start <= *start){ - tmp_step_diff = labs(*step - (rrd.stat_head->pdp_step - * rrd.rra_def[i].pdp_cnt)); if (first_full || (tmp_step_diff < best_step_diff)){ first_full=0; best_step_diff = tmp_step_diff; @@ -198,9 +199,13 @@ tmp_match -= (cal_start-*start); if (cal_end<*end) tmp_match -= (*end-cal_end); - if (first_part || best_match < tmp_match){ + if (first_part || + (best_match < tmp_match) || + (best_match == tmp_match && + tmp_step_diff < best_step_diff)){ first_part=0; best_match = tmp_match; + best_step_diff = tmp_step_diff; best_part_rra =i; } } Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_error.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_error.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_error.c 2003-02-20 15:23:58.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_error.c Common Header File ***************************************************************************** Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_format.h ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_format.h (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_format.h 2003-02-20 15:23:58.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997, 1998, 1999 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997, 1998, 1999 ***************************************************************************** * rrd_format.h RRD Database Format header *****************************************************************************/ Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_open.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_open.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_open.c 2003-02-20 15:23:58.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_open.c Open an RRD File ***************************************************************************** Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_resize.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_resize.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_resize.c 2003-02-20 15:23:58.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_resize.c Alters size of an RRA ***************************************************************************** Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_graph.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_graph.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_graph.c 2003-02-20 15:23:58.000000000 -0800 @@ -1,6 +1,6 @@ /**************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 **************************************************************************** * rrd__graph.c make creates ne rrds ****************************************************************************/ @@ -967,7 +967,7 @@ } else { int rpi_ptr = im->gdes[gdi].rpnp[rpi].ptr; int ds_cnt = im->gdes[gdi].rpnp[rpi].ds_cnt; - stack[++stptr] = im->gdes[rpi_ptr].data[dataidx*ds_cnt+rpi_ptr]; + stack[++stptr] = im->gdes[rpi_ptr].data[dataidx*ds_cnt+im->gdes[rpi_ptr].ds]; } break; case OP_UNKN: @@ -1478,7 +1478,6 @@ readability. I could thus not use the normal gd functions to write, but had to embed a slightly compressed bitmap version into the code. */ - int li[]={0,0,1, 0,4,5, 0,8,9, 0,12,14, 0,17,17, 0,21,21, 0,24,24, 0,34,34, 0,40,42, 0,45,45, 0,48,49, 0,52,54, 0,61,61, 0,64,66, 0,68,70, 0,72,74, 0,76,76, 0,78,78, @@ -1647,16 +1646,16 @@ int leg_c = 0; int leg_x = border, leg_y = im->ygif; int leg_cc; - int glue = 0; + int glue = 0, useglue = 1; int i,ii, mark = 0; char prt_fctn; /*special printfunctions */ int *legspace; - if( !(im->extra_flags & NOLEGEND) ) { - if ((legspace = malloc(im->gdes_c*sizeof(int)))==NULL){ - rrd_set_error("malloc for legspace"); - return -1; - } + if( !(im->extra_flags & NOLEGEND) ) { + if ((legspace = malloc(im->gdes_c*sizeof(int)))==NULL){ + rrd_set_error("malloc for legspace"); + return -1; + } for(i=0;igdes_c;i++){ fill_last = fill; @@ -1695,9 +1694,13 @@ legspace[i]=0; } /* who said there was a special tag ... ?*/ - if (prt_fctn=='g') { + if (prt_fctn=='J') { + useglue = 0; + prt_fctn = '\0'; + } else if (prt_fctn=='g') { prt_fctn = '\0'; - } + } + if (prt_fctn == '\0') { if (i == im->gdes_c -1 ) prt_fctn ='l'; @@ -1719,9 +1722,9 @@ if (prt_fctn != '\0'){ leg_x = border; - if (leg_c >= 2 && prt_fctn == 'j') { - glue = (im->xgif - fill - 2* border) / (leg_c-1); - /* if (glue > 2 * SmallFont->w) glue = 0; */ + if (leg_c >= 2 && prt_fctn == 'j' && useglue) { + glue = (im->xgif - fill - 2* border) / (leg_c-1); + /* if (glue > 2 * SmallFont->w) glue = 0; */ } else { glue = 0; } @@ -1849,7 +1852,6 @@ gridstep = im->ygridstep; labfact = im->ylabfact; } - polyPoints[0].x=im->xorigin; polyPoints[1].x=im->xorigin+im->xsize; @@ -1892,15 +1894,18 @@ polyPoints[0].x+2,polyPoints[0].y,graph_col[GRC_MGRID].i); gdImageLine(gif, polyPoints[1].x-2,polyPoints[0].y, polyPoints[1].x+2,polyPoints[0].y,graph_col[GRC_MGRID].i); - } else { + + gdImageLine(gif, polyPoints[0].x,polyPoints[0].y, + polyPoints[1].x,polyPoints[0].y,gdStyled); + } else if ( !(im->extra_flags & NOMINOR) ) { gdImageSetStyle(gif, styleMinor, 2); gdImageLine(gif, polyPoints[0].x-1,polyPoints[0].y, polyPoints[0].x+1,polyPoints[0].y,graph_col[GRC_GRID].i); gdImageLine(gif, polyPoints[1].x-1,polyPoints[0].y, polyPoints[1].x+1,polyPoints[0].y,graph_col[GRC_GRID].i); + gdImageLine(gif, polyPoints[0].x,polyPoints[0].y, + polyPoints[1].x,polyPoints[0].y,gdStyled); } - gdImageLine(gif, polyPoints[0].x,polyPoints[0].y, - polyPoints[1].x,polyPoints[0].y,gdStyled); } } /* if(im->minval * im->maxval < 0){ @@ -2090,6 +2095,8 @@ polyPoints[1].y = im->yorigin-im->ysize; /* paint the minor grid */ + if ( !(im->extra_flags & NOMINOR )) + { for(ti = find_first_time(im->start, im->xlab_user.gridtm, im->xlab_user.gridst); @@ -2111,6 +2118,7 @@ gdImageLine(gif, polyPoints[0].x,polyPoints[1].y-1, polyPoints[0].x,polyPoints[1].y+1,graph_col[GRC_GRID].i); } + } /* paint the major grid */ for(ti = find_first_time(im->start, @@ -2841,12 +2849,13 @@ {"imgformat", required_argument, 0, 'a'}, {"lazy", no_argument, 0, 'z'}, {"no-legend", no_argument, 0, 'g'}, - {"alt-y-grid", no_argument, 0, 257 }, - {"alt-autoscale", no_argument, 0, 258 }, - {"alt-autoscale-max", no_argument, 0, 259 }, - {"units-exponent",required_argument, 0, 260}, - {"step", required_argument, 0, 261}, - {"alt-y-mrtg", no_argument, 0, 262 }, + {"alt-y-grid", no_argument, 0, 'Y'}, + {"no-minor", no_argument, 0, 'N'}, + {"alt-autoscale", no_argument, 0, 'A'}, + {"alt-autoscale-max", no_argument, 0, 'M'}, + {"units-exponent",required_argument, 0, 'X'}, + {"step", required_argument, 0, 'S'}, + {"alt-y-mrtg", no_argument, 0, 'R'}, {"background", required_argument, 0, 'B'}, {"overlay", required_argument, 0, 'O'}, {"unit", required_argument, 0, 'U'}, @@ -2856,32 +2865,35 @@ opt = getopt_long(argc, argv, - "s:e:x:y:v:w:h:iu:l:rb:oc:t:f:a:zgB:O:U:", + "s:e:x:y:v:w:h:iu:l:rb:oc:t:f:a:zgYAMX:S:RB:O:U:", long_options, &option_index); if (opt == EOF) break; switch(opt) { - case 257: + case 'Y': im.extra_flags |= ALTYGRID; break; - case 258: + case 'N': + im.extra_flags |= NOMINOR; + break; + case 'A': im.extra_flags |= ALTAUTOSCALE; break; - case 259: + case 'M': im.extra_flags |= ALTAUTOSCALE_MAX; break; case 'g': im.extra_flags |= NOLEGEND; break; - case 260: + case 'X': im.unitsexponent = atoi(optarg); break; - case 261: + case 'S': im.step = atoi(optarg); break; - case 262: + case 'R': im.extra_flags |= ALTYMRTG; break; case 's': @@ -3358,9 +3370,9 @@ if (*ptr == '.') ptr++; while (*ptr >= '0' && *ptr <= '9') ptr++; - /* Either 'le' or 'lf' must follow here */ + /* Either 'le', 'lf' or 'lg' must follow here */ if (*ptr++ != 'l') return 1; - if (*ptr == 'e' || *ptr == 'f') ptr++; + if (*ptr == 'e' || *ptr == 'f' || *ptr == 'g') ptr++; else return 1; n++; } Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_cgi.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_cgi.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_cgi.c 2003-02-20 15:23:59.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_cgi.c RRD Web Page Generator *****************************************************************************/ @@ -128,9 +128,9 @@ server_url = getenv("SERVER_URL"); } - if (optind != argc-1) { - fprintf(stderr, "ERROR: expected a filename\n"); - exit(1); +if ( (optind != argc-2 && strstr( getenv("SERVER_SOFTWARE"),"Apache/2") != NULL) && optind != argc-1) { + fprintf(stderr, "ERROR: expected a filename\n"); + exit(1); } else { length = readfile(argv[optind], &buffer, 1); } Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_create.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_create.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_create.c 2003-02-20 15:23:59.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_create.c creates new rrds *****************************************************************************/ Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_graph.h ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_graph.h (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_graph.h 2003-02-20 15:23:59.000000000 -0800 @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 **************************************************************************** * rrd__graph.h ****************************************************************************/ @@ -206,6 +206,7 @@ #define ALTAUTOSCALE_MAX 0x04 /* use alternative algorithm to find upper bounds */ #define NOLEGEND 0x08 /* use no legend */ #define ALTYMRTG 0x10 /* simulate mrtg's scaling */ +#define NOMINOR 0x20 /* Turn off minor gridlines */ #endif Modified: trunk/orca/packages/rrdtool-1.0.41/src/pngsize.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/pngsize.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/pngsize.c 2003-02-20 15:23:59.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * pngsize.c determine the size of a PNG image *****************************************************************************/ Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_tune.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_tune.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_tune.c 2003-02-20 15:23:59.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * change header parameters of an rrd ***************************************************************************** Modified: trunk/orca/packages/rrdtool-1.0.41/src/parsetime.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/parsetime.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/parsetime.c 2003-02-20 15:23:59.000000000 -0800 @@ -450,10 +450,10 @@ /* - * expect() gets a token and complins if it's not the token we want + * expect2() gets a token and complins if it's not the token we want */ static char * -expect(int desired, char *complain_fmt, ...) +expect2(int desired, char *complain_fmt, ...) { va_list ap; va_start( ap, complain_fmt ); @@ -463,7 +463,7 @@ va_end( ap ); return TIME_OK; -} /* expect */ +} /* expect2 */ /* @@ -481,7 +481,7 @@ if( doop >= 0 ) { op = doop; - try(expect(NUMBER,"There should be number after '%c'", op == PLUS ? '+' : '-')); + try(expect2(NUMBER,"There should be number after '%c'", op == PLUS ? '+' : '-')); prev_multiplier = -1; /* reset months-minutes guessing mechanics */ } /* if doop is < 0 then we repeat the previous op @@ -581,7 +581,7 @@ return TIME_OK; } if (sc_tokid == COLON ) { - try(expect(NUMBER, + try(expect2(NUMBER, "Parsing HH:MM syntax, expecting MM as number, got none")); minute = atoi(sc_token); if (minute > 59) { @@ -678,7 +678,7 @@ /* do month mday [year] */ mon = (sc_tokid-JAN); - try(expect(NUMBER, + try(expect2(NUMBER, "the day of the month should follow month name")); mday = atol(sc_token); if (token() == NUMBER) { @@ -733,11 +733,11 @@ if (mon <= 31 && (sc_tokid == SLASH || sc_tokid == DOT)) { int sep; sep = sc_tokid; - try(expect(NUMBER,"there should be %s number after '%c'", + try(expect2(NUMBER,"there should be %s number after '%c'", sep == DOT ? "month" : "day", sep == DOT ? '.' : '/')); mday = atol(sc_token); if (token() == sep) { - try(expect(NUMBER,"there should be year number after '%c'", + try(expect2(NUMBER,"there should be year number after '%c'", sep == DOT ? '.' : '/')); year = atol(sc_token); token(); Modified: trunk/orca/packages/rrdtool-1.0.41/src/rrd_restore.c ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/src/rrd_restore.c (original) +++ trunk/orca/packages/rrdtool-1.0.41/src/rrd_restore.c 2003-02-20 15:23:59.000000000 -0800 @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.40 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.0.41 Copyright Tobias Oetiker, 1997 - 2000 ***************************************************************************** * rrd_restore.c creates new rrd from data dumped by rrd_dump.c *****************************************************************************/ @@ -278,7 +278,7 @@ FILE *rrd_file=NULL; if (strcmp("-",file_name)==0){ - *rrd_file= *stdout; + rrd_file= stdout; } else { int fd = open(file_name,O_RDWR|O_CREAT|O_EXCL,0666); if (fd == -1 || (rrd_file = fdopen(fd,"wb")) == NULL) { Modified: trunk/orca/packages/rrdtool-1.0.41/CONTRIBUTORS ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/CONTRIBUTORS (original) +++ trunk/orca/packages/rrdtool-1.0.41/CONTRIBUTORS 2003-02-20 15:23:59.000000000 -0800 @@ -56,6 +56,7 @@ Christophe Van Ginneken (--no-legend) Milan Obuch background unit GD overlay --y-alt-mrtg Wolfgang Schrimm xport function + Travis Brown Documentation Modified: trunk/orca/packages/rrdtool-1.0.41/contrib/rrdfetchnames/rrdfetchnames.pl ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/contrib/rrdfetchnames/rrdfetchnames.pl (original) +++ trunk/orca/packages/rrdtool-1.0.41/contrib/rrdfetchnames/rrdfetchnames.pl 2003-02-20 15:23:59.000000000 -0800 @@ -6,7 +6,7 @@ use lib qw( ../../perl-shared/blib/lib ../../perl-shared/blib/arch ); #makes programm work AFTER install -use lib qw( /usr/local/rrdtool-1.0.39/lib/perl ../lib/perl ); +use lib qw( /usr/local/rrdtool-1.0.41/lib/perl ../lib/perl ); use vars qw(@ISA $loaded); Modified: trunk/orca/packages/rrdtool-1.0.41/contrib/rrdlastds/rrdlastds.pl ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/contrib/rrdlastds/rrdlastds.pl (original) +++ trunk/orca/packages/rrdtool-1.0.41/contrib/rrdlastds/rrdlastds.pl 2003-02-20 15:23:59.000000000 -0800 @@ -13,7 +13,7 @@ #makes things work when run without install use lib qw( ../../perl-shared/blib/lib ../../perl-shared/blib/arch ); # this is for after install -use lib qw( /usr/local/rrdtool-1.0.39/lib/perl ../lib/perl ); +use lib qw( /usr/local/rrdtool-1.0.41/lib/perl ../lib/perl ); use RRDs; Modified: trunk/orca/packages/rrdtool-1.0.41/contrib/add_ds/batch.pl ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/contrib/add_ds/batch.pl (original) +++ trunk/orca/packages/rrdtool-1.0.41/contrib/add_ds/batch.pl 2003-02-20 15:23:59.000000000 -0800 @@ -43,7 +43,7 @@ ########### USER CONFIGURABLE SECTION ####################### my $newdir = "xml"; -my $rrdtool = "/usr/local/rrdtool-1.0.39/bin/rrdtool"; +my $rrdtool = "/usr/local/rrdtool-1.0.41/bin/rrdtool"; my $add_ds = "./add_ds.pl"; # path to add_ds.pl script ########### END CONFIGURE SECTION ########################### Modified: trunk/orca/packages/rrdtool-1.0.41/perl-piped/RRDp.pm ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/perl-piped/RRDp.pm (original) +++ trunk/orca/packages/rrdtool-1.0.41/perl-piped/RRDp.pm 2003-02-20 15:23:59.000000000 -0800 @@ -110,7 +110,7 @@ sub end (); sub read (); -$VERSION = 1.000401 ; +$VERSION = 1.000411 ; sub start ($){ croak "rrdtool is already running" Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.es.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdtutorial.es.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.es.html 2003-02-20 15:23:59.000000000 -0800 @@ -1,80 +1,86 @@ - - -rrdtutorial.es - - + + + +rrdtutorial.es + + - + - +

-

-

NAME

-

rrdtutorial - Tutorial sobre RRDtool por Alex van den Bogaerdt -(Traducido al castellano por Jes?s Couto Fandi?o)

-
Versi?n PDF

-


-

DESCRIPTION / DESCRIPCI?N

-

RRDtool es un programa escrito por Tobias Oetiker con la +

+

+

NAME

+

rrdtutorial - Tutorial sobre RRDtool por Alex van den Bogaerdt +(Traducido al castellano por Jes?s Couto Fandi?o)

+
Versi?n PDF

+

+
+

DESCRIPTION

+

RRDtool es un programa escrito por Tobias Oetiker con la colaboraci?n de muchas personas en diversas partes del mundo. Alex van den Bogaerdt escribi? este documento para ayudarte a entender que es -RRDtool y que es lo que puede hacer por ti.

-

La documentaci?n que viene con RRDtool puede ser demasiado t?cnica +RRDtool y que es lo que puede hacer por ti.

+

La documentaci?n que viene con RRDtool puede ser demasiado t?cnica para algunos. Este tutorial existe para ayudarte a entender las funciones b?sicas de RRdtool. Debe servirte de preparaci?n para leer la documentaci?n, y adem?s explica algunas ideas generales sobre -estad?stica, con un enfoque particular hacia las redes.

-

-


-

TUTORIAL

-

-

Importante

-

?Por favor, no te adelantes en la lectura de este documento! Esta +estad?stica, con un enfoque particular hacia las redes.

+

+

+
+

TUTORIAL

+

+

+

Importante

+

?Por favor, no te adelantes en la lectura de este documento! Esta primera parte explica los fundamentos b?sicos. Puede ser aburrida, pero si te saltas los fundamentos, los ejemplos no te van a tener -mucho sentido.

-

-

?Qu? es RRDtool?

-

RRDtool significa ``herramienta de bases de datos en round robin''. +mucho sentido.

+

+

+

?Qu? es RRDtool?

+

RRDtool significa ``herramienta de bases de datos en round robin''. ``Round robin'' es una t?cnica que implica un n?mero fijo de datos, y un apuntador al elemento m?s reciente. Piensa en un circulo con unos cuantos puntos dibujados alrededor del borde; estos puntos son los @@ -87,14 +93,15 @@ proceso empieza a reutilizar las antiguas. De esta forma, la base de datos no crece en tama?o y, por lo tanto, no requiere ning?n mantenimiento. RRDtool trabaja con estas bases de datos en ``round-robin'', guardando y -recuperando datos de ellas.

-

-

?Qu? datos pueden guardarse en una RRD?

-

Lo que se te ocurra. Debes poder medir alg?n valor dado en distintos +recuperando datos de ellas.

+

+

+

?Qu? datos pueden guardarse en una RRD?

+

Lo que se te ocurra. Debes poder medir alg?n valor dado en distintos momentos en el tiempo y proveer a RRDtool de estos valores. Si puedes hacer esto, RRDtool puede guardar los datos. Los valores tienen que -ser num?ricos, pero no necesariamente enteros, como en MRTG.

-

Muchos ejemplos mencionan SNMP, que es el acr?nimo de +ser num?ricos, pero no necesariamente enteros, como en MRTG.

+

Muchos ejemplos mencionan SNMP, que es el acr?nimo de ``Simple Network Management Protocol'' (Protocolo Simple de Administraci?n de Redes). Lo de ``simple'' se refiere al protocolo - no se supone que sea f?cil administrar o monitorizar una red. Cuando @@ -103,10 +110,11 @@ SNMP. Por ahora, simplemente considera a SNMP como una forma de preguntarle a los dispositivos por los valores de ciertos contadores que mantienen. Son estos valores -de estos contadores los que vamos a almacenar en la RRD.

-

-

?Qu? puedo hacer con esta herramienta?

-

RRDtool se deriva de MRTG (Multi Router +de estos contadores los que vamos a almacenar en la RRD.

+

+

+

?Qu? puedo hacer con esta herramienta?

+

RRDtool se deriva de MRTG (Multi Router Traffic Grapher, Graficador De Tr?fico de M?ltiples Enrutadores). MRTG empez? como un peque?o script para poder graficar el uso de una conexi?n a la Internet. Luego evolucion?, @@ -126,48 +134,51 @@ aeropuerto, la temperatura en tu lugar de vacaciones favorito, o en la nevera, o cualquier otra cosa que te puedas imaginar, mientras tengas alg?n sensor con el cual medir los datos y seas capaz de -pasarle los n?meros a RRDtool.

-

-

?Y si a?n tengo problemas despu?s de leer este documento?

-

Lo primero, ?l?elo otra vez!. Puede que te hayas perdido de algo. +pasarle los n?meros a RRDtool.

+

+

+

?Y si a?n tengo problemas despu?s de leer este documento?

+

Lo primero, ?l?elo otra vez!. Puede que te hayas perdido de algo. Si no puedes compilar el c?digo fuente y usas un sistema operativo bastante com?n, casi seguro que no es la culpa de RRDtool. Probablemente consigas versiones pre-compiladas por la Internet. Si provienen de una fuente confiable, ?salas. Si, por otro lado, el programa funciona, pero no te da los resultados que tu esperabas, puede ser un problema con la configuraci?n; rev?sala y -comp?rala con los ejemplos.

-

Hay una lista de correo electr?nico y una archivo de la misma. Lee +comp?rala con los ejemplos.

+

Hay una lista de correo electr?nico y una archivo de la misma. Lee la lista durante unas cuantas semanas, y busca en el archivo. Es descort?s hacer una pregunta sin haber revisado el archivo; ?puede que tu problema ya haya sido resuelto antes! Normalmente ocurre as? en todas las listas de correo, no s?lo esta. Examina la documentaci?n que vino -con RRDtool para ver donde est? el archivo y como usarlo.

-

Te sugiero que te tomes un momento y te subscribas a la lista ahora -mismo, enviando un mensaje a rrd-users-request at list.ee.ethz.ch -con t?tulo subscribe. Si eventualmente deseas salirte de la lista, -env?a otro correo a la misma direcci?n, con t?tulo unsubscribe.

-

-

?C?mo me vas a ayudar?

-

D?ndote descripciones y ejemplos detallados. Asumimos que el seguir +con RRDtool para ver donde est? el archivo y como usarlo.

+

Te sugiero que te tomes un momento y te subscribas a la lista ahora +mismo, enviando un mensaje a rrd-users-request at list.ee.ethz.ch +con t?tulo subscribe. Si eventualmente deseas salirte de la lista, +env?a otro correo a la misma direcci?n, con t?tulo unsubscribe.

+

+

+

?C?mo me vas a ayudar?

+

D?ndote descripciones y ejemplos detallados. Asumimos que el seguir las instrucciones en el orden en que se presentan aqu? te dar? suficiente conocimiento de RRDtool como para que experimentes por tu cuenta. Si no funciona a la primera, puede que te hallas saltado algo; siguiendo los ejemplos obtendr?s algo de experiencia pr?ctica y, lo que es m?s importante, un poco de informaci?n sobre como funciona el -programa.

-

Necesitar?s saber algo sobre n?meros hexadecimales. Si no, empieza -por leer ``bin_dec_hex'' antes de continuar.

-

-

Tu primera base de datos en round-robin

-

En mi opini?n, la mejor forma de aprender algo es haci?ndolo. ?Por +programa.

+

Necesitar?s saber algo sobre n?meros hexadecimales. Si no, empieza +por leer ``bin_dec_hex'' antes de continuar.

+

+

+

Tu primera base de datos en round-robin

+

En mi opini?n, la mejor forma de aprender algo es haci?ndolo. ?Por qu? no empezamos ya? Vamos a crear una base de datos, poner unos cuantos valores en ella y extraerlos despu?s. La salida que obtengas debe ser -igual a la que aparece en este documento.

-

Empezaremos con algo f?cil, comparando un coche con un enrutador, o +igual a la que aparece en este documento.

+

Empezaremos con algo f?cil, comparando un coche con un enrutador, o por decirlo de otra forma, comparando kil?metros con bits y bytes. A -nosotros nos da lo mismo; son unos n?meros obtenidos en un espacio de tiempo.

-

Asumamos que tenemos un dispositivo que transfiere bytes desde y +nosotros nos da lo mismo; son unos n?meros obtenidos en un espacio de tiempo.

+

Asumamos que tenemos un dispositivo que transfiere bytes desde y hacia la Internet. Este dispositivo tiene un contador que empieza en 0 al encenderse y se incrementa con cada byte transferido. Este contador tiene un valor m?ximo; si ese valor se alcanza y se cuenta un byte @@ -182,70 +193,71 @@ 4294967295. Usaremos estos valores en los ejemplos. El dispositivo, cuando le preguntamos, retorna el valor actual del contador. Como sabemos el tiempo transcurrido desde la ?ltima vez que le preguntamos, sabemos -cuantos bytes se han transferido ***en promedio*** por +cuantos bytes se han transferido ***en promedio*** por segundo. Esto no es muy dif?cil de calcular; primero en palabras, -luego en operaciones:

-
    -
  1. +luego en operaciones:

    +
      +
    1. Toma el valor actual del contador y r?stale el valor anterior -

      -
    2. +

      +
    3. Haz lo mismo con la fecha -

      -
    4. +

      +
    5. Divide el resultado del paso (1) por el resultado del paso (2). El resultado es la cantidad de bytes por segundo. Si lo multiplicas por ocho obtienes la cantidad de bits por segundo -

    -
    -  bps = (contador_actual - contador_anterior) / (fecha_actual - fecha_anterior) * 8
    -

    Para algunos ser? de ayuda traducir esto a un ejemplo automotor. +

+
+  bps = (contador_actual - contador_anterior) / (fecha_actual - fecha_anterior) * 8
+

Para algunos ser? de ayuda traducir esto a un ejemplo automotor. No prueben estas velocidades en la pr?ctica, y si lo hacen, no me -echen la culpa por los resultados.

-

Usaremos las siguientes abreviaturas:

-
+echen la culpa por los resultados.

+

Usaremos las siguientes abreviaturas:

+
  M:    metros
  KM:   kil?metros (= 1000 metros).
  H:    horas
  S:    segundos
  KM/H: kil?metros por hora
- M/S:  metros por segundo
-

Vas conduciendo un coche. A las 12:05, miras el contador en el + M/S: metros por segundo

+

Vas conduciendo un coche. A las 12:05, miras el contador en el salpicadero y ves que el coche ha recorrido 12345 KM. A las 12:10 vuelves a mirar otra vez, y dice 12357 KM. Quiere decir, que has recorrido 12 KM en cinco minutos. Un cient?fico convertir?a esto en metros por segundos; esto es bastante parecido al problema de -pasar de bytes transferidos en 5 minutos a bits por segundo.

-

Viajamos 12 kil?metros, que son 12000 metros. Tardamos 5 minutos, o -sea 300 segundos. Nuestra velocidad es 12000M / 300S igual a 40 M/S.

-

Tambi?n podemos calcular la velocidad en KM/H: 12 veces 5 minutos +pasar de bytes transferidos en 5 minutos a bits por segundo.

+

Viajamos 12 kil?metros, que son 12000 metros. Tardamos 5 minutos, o +sea 300 segundos. Nuestra velocidad es 12000M / 300S igual a 40 M/S.

+

Tambi?n podemos calcular la velocidad en KM/H: 12 veces 5 minutos es una hora, as? que multiplicando los 12 KM por 12 obtenemos 144 -KM/H. No intentes esto en casa, o por donde vivo :-)

-

Recuerda que estos n?meros son tan s?lo promedios. No hay forma de +KM/H. No intentes esto en casa, o por donde vivo :-)

+

Recuerda que estos n?meros son tan s?lo promedios. No hay forma de deducir, viendo s?lo los n?meros, si fuiste a una velocidad constante. -Hay un ejemplo m?s adelante en el tutorial que explica esto.

-

Espero que entiendas que no hay diferencia entre calcular la +Hay un ejemplo m?s adelante en el tutorial que explica esto.

+

Espero que entiendas que no hay diferencia entre calcular la velocidad en M/S o bps; s?lo la forma en que recogemos los datos es distinta. Inclusive, la K de kilo en este -caso es exactamente la misma, ya que en redes k es 1000

-

Ahora vamos a crear una base de datos en la que guardar todos estos +caso es exactamente la misma, ya que en redes k es 1000

+

Ahora vamos a crear una base de datos en la que guardar todos estos interesantes valores. El m?todo a usar para arrancar el programa puede variar de un sistema de operaci?n a otro, pero asumamos que lo puedes resolver tu mismo en caso que se diferente en el sistema que usas. Aseg?rate de no sobreescribir ning?n archivo en tu sistema al ejecutarlo y escribe todo como una sola l?nea (tuve que partirlo para -que fuera legible), salt?ndote todos los caracteres '\'

-
+que fuera legible), salt?ndote todos los caracteres '\'

+
    rrdtool create test.rrd             \
             --start 920804400          \
             DS:speed:COUNTER:600:U:U   \
             RRA:AVERAGE:0.5:1:24       \
-            RRA:AVERAGE:0.5:6:10
-

(o sea, escribe: rrdtool create test.rrd --start 920804400 DS ...)

-

-

?Qu? hemos creado?

-

Hemos creado una base de datos en round robin llamada test + RRA:AVERAGE:0.5:6:10

+

(o sea, escribe: rrdtool create test.rrd --start 920804400 DS ...)

+

+

+

?Qu? hemos creado?

+

Hemos creado una base de datos en round robin llamada test (test.rrd), que empieza desde el mediod?a del d?a en que empec? a escribir este documento (7 de marzo de 1999). En ella se guarda una fuente de datos (DS), llamada ``speed'', que se @@ -254,21 +266,21 @@ sea, no hay nada que promediar), y mantiene 24 muestras (24 por 5 minutos = 2 horas de muestras). El otro promedia 6 muestras (media hora), y guarda 10 de estos promedios (o sea, 5 horas). Las opciones -restantes las veremos m?s adelante.

-

RRDtool usa un formato de ``fecha'' especial que viene del mundo de +restantes las veremos m?s adelante.

+

RRDtool usa un formato de ``fecha'' especial que viene del mundo de UNIX. Estas ``fechas'' son el n?mero de segundos que han pasado desde el primero de enero de 1970, zona UTC. Este n?mero de segundos se convierte luego en la fecha local, por lo que -varia seg?n la franja horaria.

-

Lo m?s probable es que tu no vivas en la misma parte del mundo que +varia seg?n la franja horaria.

+

Lo m?s probable es que tu no vivas en la misma parte del mundo que yo, por lo que tu franja horaria ser? diferente. En los ejemplos, cuando mencione horas, puede que no sean las mismas para ti; esto no afecta mucho los resultados, s?lo tienes que corregir las horas mientras lees. Por ejemplo, las 12:05 para m? son las 11:05 para los -amigos en la Gran Breta?a.

-

Ahora tenemos que llenar nuestra base de datos con valores. Vamos a -suponer que le?mos estos datos:

-
+amigos en la Gran Breta?a.

+

Ahora tenemos que llenar nuestra base de datos con valores. Vamos a +suponer que le?mos estos datos:

+
  12:05  12345 KM
  12:10  12357 KM
  12:15  12363 KM
@@ -283,35 +295,31 @@
  13:00  12415 KM
  13:05  12420 KM
  13:10  12422 KM
- 13:15  12423 KM
-

Llenaremos la base de datos as?:

-
+ 13:15  12423 KM
+

Llenaremos la base de datos as?:

+
  rrdtool update test.rrd 920804700:12345 920805000:12357 920805300:12363
  rrdtool update test.rrd 920805600:12363 920805900:12363 920806200:12373
  rrdtool update test.rrd 920806500:12383 920806800:12393 920807100:12399
  rrdtool update test.rrd 920807400:12405 920807700:12411 920808000:12415
- rrdtool update test.rrd 920808300:12420 920808600:12422 920808900:12423
-

Lo que significa: actualiza nuestra base de datos test con los -siguientes valores:

-
+ rrdtool update test.rrd 920808300:12420 920808600:12422 920808900:12423
+

Lo que significa: actualiza nuestra base de datos test con los +siguientes valores:

+
  fecha 920804700, valor 12345
  fecha 920805000, valor 12357
-
-
-
- etc?tera.
-

Como ves, pueden introducirse m?s de un valor en la base de datos + + etc?tera.

+

Como ves, pueden introducirse m?s de un valor en la base de datos por ejecuci?n del comando. Yo los agrupo de tres en tres para hacerlo -legible, pero en realidad el m?ximo depende del sistema de operaci?n.

-

Ahora podemos recuperar los datos usando ``rrdtool fetch'':

-
- rrdtool fetch test.rrd AVERAGE --start 920804400 --end 920809200
-

Debes obtener esto como salida:

-
+legible, pero en realidad el m?ximo depende del sistema de operaci?n.

+

Ahora podemos recuperar los datos usando ``rrdtool fetch'':

+
+ rrdtool fetch test.rrd AVERAGE --start 920804400 --end 920809200
+

Debes obtener esto como salida:

+
                     speed
-
-
-
+ 
  920804400:        NaN
  920804700:        NaN
  920805000: 4.0000000000e-02
@@ -328,49 +336,51 @@
  920808300: 1.6666666667e-02
  920808600: 6.6666666667e-03
  920808900: 3.3333333333e-03
- 920809200:        NaN
-

Si no, hay algo mal. Probablemente tu sistema de operaci?n muestre ``NaN'' + 920809200: NaN

+

Si no, hay algo mal. Probablemente tu sistema de operaci?n muestre ``NaN'' de otra forma; representa ``Not a Number'', o sea ``No es un n?mero''. Si aparece ``U'' o ``UNKN'' o algo parecido, es lo mismo. Si hay alguna otra diferencia, probablemente te equivocaste al introducir alg?n P valor (asumiendo que mi tutorial est? bien, por supuesto :-). En ese caso, borra -la base de datos y prueba de nuevo.

-

Lo que representa exactamente esta salida lo vamos m?s adelante en el tutorial.

-

-

Hora de hacer algunos gr?ficos

-

Prueba este comando:

-
+la base de datos y prueba de nuevo.

+

Lo que representa exactamente esta salida lo vamos m?s adelante en el tutorial.

+

+

+

Hora de hacer algunos gr?ficos

+

Prueba este comando:

+
  rrdtool graph speed.gif                                 \
          --start 920804400 --end 920808000               \
          DEF:myspeed=test.rrd:speed:AVERAGE              \
-         LINE2:myspeed#FF0000
-

Este comando crea speed.gif, un gr?fico de los datos desde las + LINE2:myspeed#FF0000

+

Este comando crea speed.gif, un gr?fico de los datos desde las 12:00 hasta las 13:00. Contiene una definici?n de la variable myspeed y define el color como rojo. Notar?s que el gr?fico no comienza exactamente a las 12:00 sino a las 12:05, y es porque no tenemos datos suficientes como para calcular el promedio de velocidad antes de ese momento. Esto s?lo ocurre en caso de que se pierdan alg?n muestreo, lo -que esperamos que no debe ocurrir muy a menudo.

-

Si ha funcionado, ?felicitaciones!. Si no, revisa qu? puede estar mal.

-

La definici?n de colores se construye a partir del rojo, verde y +que esperamos que no debe ocurrir muy a menudo.

+

Si ha funcionado, ?felicitaciones!. Si no, revisa qu? puede estar mal.

+

La definici?n de colores se construye a partir del rojo, verde y azul. Especificas cuanto de cada uno de estos componentes vas a usar en hexadecimal: 00 significa ``nada de este color'' y FF significa ``este color a m?xima intensidad''. El ``color'' blanco es la mezcla del rojo, verde y azul a toda intensidad: -FFFFFF; el negro es la ausencia de todos los colores: 000000.

-
+FFFFFF; el negro es la ausencia de todos los colores: 000000.

+
    rojo    #FF0000
    verde   #00FF00
    azul    #0000FF
    violeta #FF00FF     (mezcla de rojo y azul)
-   gris    #555555     (un tercio de cada uno de los colores)
-

El archivo GIF que acabas de crear puede + gris #555555 (un tercio de cada uno de los colores)

+

El archivo GIF que acabas de crear puede verse con tu visor de archivos de imagen favorito. Los navegadores lo mostrar?n usando la URL -``file://el/camino/de/directorios/hasta/speed.gif''

-

-

Gr?ficos con un poco de matem?tica

-

Cuando veas la imagen, notar?s que el eje horizontal tiene unas +``file://el/camino/de/directorios/hasta/speed.gif''

+

+

+

Gr?ficos con un poco de matem?tica

+

Cuando veas la imagen, notar?s que el eje horizontal tiene unas etiquetas marcando las 12:10, 12:20, 12:30, 12:40 y 12:50. Los otros dos momentos (12:00 y 13:00) no se pueden mostrar bien por falta de datos, as? que el programa se los salta. El eje vertical muestra el rango de los valores que @@ -380,41 +390,41 @@ 0.04, lo que RRDtool muestra como ``40m'', o sea ``40/1000''. ?La ``m''' no tiene nada que ver con metros, kil?metros o mil?metros!. RRDtool no sabe nada de unidades, el s?lo trabaja con n?meros, no con -metros.

-

Donde nos equivocamos fue en que debimos medir en metros. As?, -(12357000-12345000)/300 = 12000/300 = 40.

-

Vamos a corregirlo. Podr?amos recrear la base de datos con los +metros.

+

Donde nos equivocamos fue en que debimos medir en metros. As?, +(12357000-12345000)/300 = 12000/300 = 40.

+

Vamos a corregirlo. Podr?amos recrear la base de datos con los valores correctos, pero hay una forma mejor: ?haciendo los c?lculos -mientras creamos el archivo gif!

-
+mientras creamos el archivo gif!

+
    rrdtool graph speed2.gif                           \
       --start 920804400 --end 920808000               \
       --vertical-label m/s                            \
       DEF:myspeed=test.rrd:speed:AVERAGE              \
       CDEF:realspeed=myspeed,1000,*                   \
-      LINE2:realspeed#FF0000
-

Cuando veas esta imagen, notar?s que la ``m'' ha desaparecido, y + LINE2:realspeed#FF0000

+

Cuando veas esta imagen, notar?s que la ``m'' ha desaparecido, y ahora tienes los resultados correctos. Adem?s hemos a?adido una -etiqueta a la imagen. Apartando esto, el archivo GIF es el mismo.

-

Las operaciones est?n en la secci?n del CDEF +etiqueta a la imagen. Apartando esto, el archivo GIF es el mismo.

+

Las operaciones est?n en la secci?n del CDEF y est?n escritas en Notaci?n Polaca Inversa (Reverse Polish Notation o ``RPN''). En palabras, dice: ``toma la fuente de datos myspeed y el numero 1000, y multipl?calos''. No te molestes en meterte con RPN todav?a, la veremos con m?s detalle m?s adelante. Adem?s, puede que quieras leer mi tutorial sobre -los CDEF y el tutorial de Steve Rader sobre RPN, pero primero terminemos con este.

-

?Un momento! Si podemos multiplicar los valores por mil, entonces, +los CDEF y el tutorial de Steve Rader sobre RPN, pero primero terminemos con este.

+

?Un momento! Si podemos multiplicar los valores por mil, entonces, ?tambi?n deber?a ser posible el mostrar la velocidad en kil?metros por -hora usando los mismos datos!

-

Para cambiar el valor que medimos en metros por segundo, calculamos +hora usando los mismos datos!

+

Para cambiar el valor que medimos en metros por segundo, calculamos los metros por hora (valor * 3600) y dividimos entre 1000 para sacar los kil?metros por hora. Todo junto hace valor * (3600/1000) == valor -* 3.6.

-

Como en nuestra base de datos cometimos un error guardando los +* 3.6.

+

Como en nuestra base de datos cometimos un error guardando los valores en kil?metros, debemos compensar por ello, multiplicando por -100, por lo que al aplicar esta correcci?n nos queda valor * 3600.

-

Ahora vamos a crear este gif, agre?ndole un poco m?s de magia...

-
+100, por lo que al aplicar esta correcci?n nos queda valor * 3600.

+

Ahora vamos a crear este gif, agre?ndole un poco m?s de magia...

+
    rrdtool graph speed3.gif                           \
       --start 920804400 --end 920808000               \
       --vertical-label km/h                           \
@@ -424,24 +434,25 @@
       CDEF:good=kmh,100,GT,0,kmh,IF                   \
       HRULE:100#0000FF:"Maximum allowed"              \
       AREA:good#00FF00:"Good speed"                   \
-      AREA:fast#FF0000:"Too fast"
-

Esto luce mucho mejor. La velocidad en KM/H, + AREA:fast#FF0000:"Too fast"

+

Esto luce mucho mejor. La velocidad en KM/H, y adem?s tenemos una l?nea extra mostrando la velocidad m?xima permitida (en el camino por donde conduzco). Tambi?n le cambie los -colores de la velocidad, y ahora paso de ser una l?nea a un ?rea.

-

Los c?lculos son m?s complejos ahora. Para calcular la velocidad ``aceptable'':

-
+colores de la velocidad, y ahora paso de ser una l?nea a un ?rea.

+

Los c?lculos son m?s complejos ahora. Para calcular la velocidad ``aceptable'':

+
    Verifica si la velocidad en kmh es mayor que 100     ( kmh,100 ) GT           
-   Si es as?, retorna 0, si no, retorna la velocidad    ((( kmh,100 ) GT ), 0, kmh) IF
-

Para calcular la parte de velocidad ``excesiva'':

-
+   Si es as?, retorna 0, si no, retorna la velocidad    ((( kmh,100 ) GT ), 0, kmh) IF
+

Para calcular la parte de velocidad ``excesiva'':

+
    Verifica si la velocidad en kmh es mayor que 100     ( kmh,100 ) GT
-   Si es as?, retorna la velocidad, si no, retorna 0    ((( kmh,100) GT ), kmh, 0) IF
-

-

Magia gr?fica

-

Me gusta creer que virtualmente no hay limites para lo que RRDtool puede -hacer con los datos. No voy a explicarlo en detalle, pero mira este GIF:

-
+   Si es as?, retorna la velocidad, si no, retorna 0    ((( kmh,100) GT ), kmh, 0) IF
+

+

+

Magia gr?fica

+

Me gusta creer que virtualmente no hay limites para lo que RRDtool puede +hacer con los datos. No voy a explicarlo en detalle, pero mira este GIF:

+
    rrdtool graph speed4.gif                           \
       --start 920804400 --end 920808000               \
       --vertical-label km/h                           \
@@ -453,48 +464,50 @@
       HRULE:100#0000FF:"Maximum allowed"              \
       AREA:good#00FF00:"Good speed"                   \
       AREA:fast#550000:"Too fast"                     \
-      STACK:over#FF0000:"Over speed"
-

Vamos a crear una p?gina HTML simple para ver los tres archivos GIF:

-
+      STACK:over#FF0000:"Over speed"
+

Vamos a crear una p?gina HTML simple para ver los tres archivos GIF:

+
    <HTML><HEAD><TITLE>Velocidad</TITLE></HEAD><BODY>
    <IMG src="speed2.gif" alt="Speed in meters per second">
    <BR>
    <IMG src="speed3.gif" alt="Speed in kilometers per hour">
    <BR>
    <IMG src="speed4.gif" alt="Traveled too fast?">
-   </BODY></HTML>
-

Gu?rdalo como ``speed.html'' o algo parecido, y exam?nalo con un navegador.

-

Ahora, todo lo que tienes que hacer es medir los datos regularmente + </BODY></HTML>

+

Gu?rdalo como ``speed.html'' o algo parecido, y exam?nalo con un navegador.

+

Ahora, todo lo que tienes que hacer es medir los datos regularmente y actualizar la base de datos. Cuando quieras verlos, vuelve a crear los archivos GIF y aseg?rate que se carguen de nuevo en tu navegador (Nota: presionar el bot?n de ``refrescar'' puede no ser suficiente; en particular, Netscape tiene un problema al respecto, por lo que -necesitaras darle al bot?n mientras presionas la tecla de may?sculas.

-

-

Actualizaciones de verdad

-

Ya hemos usado el comando ``update''; vimos que recibia uno o m?s +necesitaras darle al bot?n mientras presionas la tecla de may?sculas.

+

+

+

Actualizaciones de verdad

+

Ya hemos usado el comando ``update''; vimos que recibia uno o m?s par?metros en el formato: ``<fecha>:<valor>''. Para facilitarte las cosas, puedes obtener la fecha actual colocando ``N'' en la fecha. Tambi?n podr?as usar la funci?n ``time'' de Perl para obtenerla. El ejemplo m?s corto de todo el -tutorial :)

-
-   perl -e 'print time, "\n" '
-

Ahora, la forma de poner a correr un programa a intervalos +tutorial :)

+
+   perl -e 'print time, "\n" '
+

Ahora, la forma de poner a correr un programa a intervalos regulares de tiempo depende del sistema de operaci?n. La -actualizaci?n, en pseudo-c?digo, ser?a:

-
+actualizaci?n, en pseudo-c?digo, ser?a:

+
    Toma el valor, col?calo en la variable "$speed"
-   rrdtool update speed.rrd N:$speed
-

(Pero no lo hagas sobre nuestra base de datos de pruebas, que a?n -la vamos a usar en otros ejemplos.

-

Eso es todo. Ejecutando este script cada 5 minutos, lo ?nico que + rrdtool update speed.rrd N:$speed

+

(Pero no lo hagas sobre nuestra base de datos de pruebas, que a?n +la vamos a usar en otros ejemplos.

+

Eso es todo. Ejecutando este script cada 5 minutos, lo ?nico que tienes que hacer para ver los gr?ficos actuales es correr los ejemplos anteriores, que tambi?n puedes poner en un script. Luego de correrlo, -basta con cargar index.html

-

-

Unas palabras sobre SNMP

-

Me imagino que muy pocas personas ser?n capaces de obtener en su +basta con cargar index.html

+

+

+

Unas palabras sobre SNMP

+

Me imagino que muy pocas personas ser?n capaces de obtener en su ordenador datos reales de su coche cada 5 minutos; los dem?s nos tendremos que conformar con alg?n otro contador. Puedes, por ejemplo, medir la cantidad de p?ginas que ha hecho una impresora, cuanto caf? @@ -508,23 +521,23 @@ como recoger los datos. Hay quien dir? que hay herramientas que pueden recoger estos datos por ti. ?Es cierto! Pero, creo que es importante darse cuenta de que no son necesarias. Cuando tienes que determinar -porqu? algo no funciona, necesitas saber c?mo funciona en primer lugar.

-

Una herramienta que mencionamos brevemente al principio del +porqu? algo no funciona, necesitas saber c?mo funciona en primer lugar.

+

Una herramienta que mencionamos brevemente al principio del documento es SNMP. SNMP es una forma de comunicarse con tus equipos. La herramienta particular que voy a usar m?s adelante se llama -``snmpget'', y funciona as?:

-
-   snmpget dispositivo clave OID
-

En ``dispositivo'' colocas el nombre o direcci?n IP del equipo a +``snmpget'', y funciona as?:

+
+   snmpget dispositivo clave OID
+

En ``dispositivo'' colocas el nombre o direcci?n IP del equipo a monitorizar. En clave, colocas la ``cadena de caracteres de la comunidad de lectura'', como se le denomina en el mundillo SNMP. Muchos dispositivos aceptar?n ``public'' como cadena por defecto, pero por razones de privacidad y seguridad esta clave puede estar deshabilitada. Consulta la documentaci?n -correspondiente al dispositivo o programa.

-

Luego esta el tercer par?metro, llamado OID -(Object IDentifier, identificador de objeto).

-

Al principio, cuando empiezas a aprender sobre SNMP, parece muy +correspondiente al dispositivo o programa.

+

Luego esta el tercer par?metro, llamado OID +(Object IDentifier, identificador de objeto).

+

Al principio, cuando empiezas a aprender sobre SNMP, parece muy confuso. No lo es tanto cuando le hechas una ojeada a los ``MIB'' (Manager Information Base, o Base de Informaci?n Administrativa). Es un ?rbol invertido que describe los @@ -533,115 +546,111 @@ rama tiene un nombre, y forman un camino que nos lleva hasta el fondo del ?rbol. En este ejemplo, las ramas que vamos a tomar se llaman iso, org, dod, internet, mgmt y mib-2. Tambi?n pueden accederse por su -n?mero relativo; en este caso, estos n?meros son 1, 3, 6, 1, 2 y 1:

-
-   iso.org.dod.internet.mgmt.mib-2 (1.3.6.1.2.1)
-

En algunos programas se usa un punto al iniciar el OID. Esto puede +n?mero relativo; en este caso, estos n?meros son 1, 3, 6, 1, 2 y 1:

+
+   iso.org.dod.internet.mgmt.mib-2 (1.3.6.1.2.1)
+

En algunos programas se usa un punto al iniciar el OID. Esto puede ser confuso; no hay ning?n punto inicial en la especificaci?n de los OID... sin embargo, algunos programas usan por defecto un prefijo inicial. Para indicar la diferencia entre los OID abreviados (o sea, a los que se le pondr? el prefijo inicial) y los completos, estos programas necesitan que los OID completos empiecen por un punto. Para -empeorar las cosas, se usan varios prefijos distintos...

-

De acuerdo, sigamos con el inicio de nuestro OID: ten?amos +empeorar las cosas, se usan varios prefijos distintos...

+

De acuerdo, sigamos con el inicio de nuestro OID: ten?amos 1.3.6.1.2.1 . Ahora, nos interesa la rama ``interfaces'', que tiene el -n?mero dos (o sea, 1.3.6.1.2.1.2, o 1.3.6.1.2.1.interfaces).

-

Lo primero es hacernos con un programa SNMP. Busca alg?n +n?mero dos (o sea, 1.3.6.1.2.1.2, o 1.3.6.1.2.1.interfaces).

+

Lo primero es hacernos con un programa SNMP. Busca alg?n paquete pre-compilado para tu plataforma, si no, puedes buscar el c?digo fuente y compilarlo tu mismo. En Internet encontrar?s muchos programas, b?scalos con un motor de b?squeda o como prefieras. -Mi sugerencia es que busques el paquete CMU-SNMP, que esta bastante difundido.

-

Asumamos que ya tienes el programa. Empecemos por tomar ciertos +Mi sugerencia es que busques el paquete CMU-SNMP, que esta bastante difundido.

+

Asumamos que ya tienes el programa. Empecemos por tomar ciertos datos que est?n disponibles en la mayor?a de los sistemas. Recuerda: -hay un nombre abreviado para la parte del ?rbol que m?s nos interesa.

-

Voy a usar la versi?n corta, ya que creo que este documento ya es +hay un nombre abreviado para la parte del ?rbol que m?s nos interesa.

+

Voy a usar la versi?n corta, ya que creo que este documento ya es lo bastante largo. Si no te funciona, a??dele el prefijo .1.3.6.1.2.1 y prueba de nuevo. O prueba leyendo el manual; s?ltate las partes que no entiendas a?n, y busca las secciones que hablan de como arrancar y -usar el programa.

-
-   snmpget myrouter public system.sysdescr.0
-

El dispositivo deber? contestarte con una descripci?n, probablemente +usar el programa.

+
+   snmpget myrouter public system.sysdescr.0
+

El dispositivo deber? contestarte con una descripci?n, probablemente vac?a, de s? mismo. Si no consigues una respuesta v?lida, prueba con otra ``clave'' u otro dispositivo; no podemos seguir hasta tener un -resultado.

-
-   snmpget myrouter public interfaces.ifnumber.0
-

Con suerte, usando este comando obtendr?s un n?mero como resultado: +resultado.

+
+   snmpget myrouter public interfaces.ifnumber.0
+

Con suerte, usando este comando obtendr?s un n?mero como resultado: el n?mero de interfaces del dispositivo. Si es as?, seguiremos -adelante con otro programa, llamado ``snmpwalk''

-
-   snmpwalk myrouter public interfaces.iftable.ifentry.ifdescr
-

Si obtienes una lista de interfaces, ya casi hemos llegado. Aqu? -tienes un ejemplo del resultado:

-
+adelante con otro programa, llamado ``snmpwalk''

+
+   snmpwalk myrouter public interfaces.iftable.ifentry.ifdescr
+

Si obtienes una lista de interfaces, ya casi hemos llegado. Aqu? +tienes un ejemplo del resultado:

+
    [user at host /home/alex]$ snmpwalk cisco public 2.2.1.2   
    interfaces.ifTable.ifEntry.ifDescr.1 = "BRI0: B-Channel 1"
    interfaces.ifTable.ifEntry.ifDescr.2 = "BRI0: B-Channel 2"
    interfaces.ifTable.ifEntry.ifDescr.3 = "BRI0" Hex: 42 52 49 30
    interfaces.ifTable.ifEntry.ifDescr.4 = "Ethernet0"
-   interfaces.ifTable.ifEntry.ifDescr.5 = "Loopback0"
-

En este equipo CISCO, quiero monitorizar la interfaz ``Ethernet0''. -Viendo que es la cuarta, pruebo con:

-
+   interfaces.ifTable.ifEntry.ifDescr.5 = "Loopback0"
+

En este equipo CISCO, quiero monitorizar la interfaz ``Ethernet0''. +Viendo que es la cuarta, pruebo con:

+
    [user at host /home/alex]$ snmpget cisco public 2.2.1.10.4 2.2.1.16.4
-
-
-
+ 
    interfaces.ifTable.ifEntry.ifInOctets.4 = 2290729126
-   interfaces.ifTable.ifEntry.ifOutOctets.4 = 1256486519
-

Entonces, tengo 2 OIDs que monitorizar, y son (en el formato largo, ahora):

-
+   interfaces.ifTable.ifEntry.ifOutOctets.4 = 1256486519
+

Entonces, tengo 2 OIDs que monitorizar, y son (en el formato largo, ahora):

+
    1.3.6.1.2.1.2.2.1.10
-
-
-
-        y
-
-
-   1.3.6.1.2.1.2.2.1.16
-

, ambas con el n?mero de interfaz de 4

-

No te enga?es, esto no lo logre yo al primer intento. Me tom? un + + y + + 1.3.6.1.2.1.2.2.1.16

+

, ambas con el n?mero de interfaz de 4

+

No te enga?es, esto no lo logre yo al primer intento. Me tom? un tiempo entender lo que significaban todos estos n?meros; ayuda cuando se traducen en un texto descriptivo... por lo menos, cuando oigas hablar de MIBs y OIDs, ahora sabr?s de qu? se trata. No te olvides del n?mero de interfaz (0 si el valor no depende de una interfaz), y -prueba con snmpwalk si no obtienes una respuesta clara con snmpget.

-

Si entendiste todo esto, y obtienes resultados del dispositivo con +prueba con snmpwalk si no obtienes una respuesta clara con snmpget.

+

Si entendiste todo esto, y obtienes resultados del dispositivo con el que est?s probando, sigue adelante con el tutorial. Si no, vuelve a -leer esta secci?n; es importante

-

-

Un ejemplo real

-

Ok, empecemos con la diversi?n. Primero, crea una base de datos +leer esta secci?n; es importante

+

+

+

Un ejemplo real

+

Ok, empecemos con la diversi?n. Primero, crea una base de datos nueva. Vamos a guardar en ella 2 contadores, ``input'' y ``ouput''. Los datos los vamos a guardar en archivos que los promediar?n, tomando grupos de 1, 6, 24 o 288 muestras. Tambi?n archivaremos los valores m?ximos. Lo explicaremos con m?s detalle despu?s. El intervalo de -tiempo entre las muestras ser? de 300 segundos (5 minutos).

-
+tiempo entre las muestras ser? de 300 segundos (5 minutos).

+
  1 muestra "promediada" sigue siendo 1 muestra cada 5 minutos
  6 muestras promediadas son un promedio de cada 30 minutos
  24 muestras promediadas son un promedio de cada 2 horas
- 288 muestras promediadas son un promedio de cada d?a
-

Vamos a tratar de ser compatibles con MRTG, que guarda m?s o menos -esta cantidad de datos:

-
+ 288 muestras promediadas son un promedio de cada d?a
+

Vamos a tratar de ser compatibles con MRTG, que guarda m?s o menos +esta cantidad de datos:

+
  600 muestras de 5 minutos:          2 d?as y 2 horas
  600 promedios de 30 minutos:        12.5 d?as
  600 promedios de 2 horas:           50 d?as
- 600 promedios de 1 d?a:             732 d?as
-

Uniendo todos estos rangos tenemos que en total guardamos datos de + 600 promedios de 1 d?a: 732 d?as

+

Uniendo todos estos rangos tenemos que en total guardamos datos de unos 797 d?as. RRDtool guarda los datos de una forma distinta a MRTG; no empieza el archivo ``semanal'' donde acaba el ``diario'', sino que ambos archivos contienen la informaci?n m?s reciente, ?por lo que con -RRDtool archivamos m?s datos que con MRTG!

-

Necesitaremos:

-
+RRDtool archivamos m?s datos que con MRTG!

+

Necesitaremos:

+
  600 muestras de 5 minutos    (2 d?as y 2 horas)
  700 entradas de 30 minutos   (2 d?as y 2 horas, m?s 12.5 d?as)
  775 entradas de 2 horas      (lo anterior + 50 d?as)
- 797 entradas de 1 d?a        (lo anterior + 732 d?as, redondeando)
-
+ 797 entradas de 1 d?a        (lo anterior + 732 d?as, redondeando)
+
    rrdtool create myrouter.rrd         \
             DS:input:COUNTER:600:U:U   \
             DS:output:COUNTER:600:U:U  \
@@ -652,11 +661,11 @@
             RRA:MAX:0.5:1:600          \
             RRA:MAX:0.5:6:700          \
             RRA:MAX:0.5:24:775         \
-            RRA:MAX:0.5:288:797
-

Lo siguiente es recoger los datos y guardarlos, como en el ejemplo + RRA:MAX:0.5:288:797

+

Lo siguiente es recoger los datos y guardarlos, como en el ejemplo siguiente. Esta parcialmente en pseudo-c?digo, por lo que tendr?s que -buscar exactamente como hacerlo funcionar en tu sistema operativo.

-
+buscar exactamente como hacerlo funcionar en tu sistema operativo.

+
    mientras no sea el fin del universo
    hacer
       tomar el resultado de 
@@ -667,34 +676,35 @@
       en la variable $out
       rrdtool update myrouter.rrd N:$in:$out
       esperar 5 minutos
-   hecho
-

Luego, tras recoger datos por un d?a, crea una imagen, usando:

-
+   hecho
+

Luego, tras recoger datos por un d?a, crea una imagen, usando:

+
    rrdtool graph myrouter-day.gif --start -86400 \
             DEF:inoctets=myrouter.rrd:input:AVERAGE \
             DEF:outoctets=myrouter.rrd:output:AVERAGE \
             AREA:inoctets#00FF00:"In traffic" \
-            LINE1:outoctets#0000FF:"Out traffic"
-

Este comando debe producir un gr?fico del tr?fico del d?a. Un d?a + LINE1:outoctets#0000FF:"Out traffic"

+

Este comando debe producir un gr?fico del tr?fico del d?a. Un d?a son 24 horas, de 60 minutos, de 60 segundos: 24*60*60=86400, o sea que empezamos a ``ahora'' menos 86400 segundos. Definimos (con los DEFs) ``inoctets'' y ``outoctets'' como los valores promedio de la base da datos myrouter.rrd, dibujando un ?rea para el tr?fico de entrada y una l?nea -para el tr?fico de salida.

-

Mira la imagen y sigue recogiendo datos por unos cuantos d?as. Si +para el tr?fico de salida.

+

Mira la imagen y sigue recogiendo datos por unos cuantos d?as. Si lo deseas, puedes probar con los ejemplos de la base de datos de pruebas y ver si puedes hacer trabajar las diversas opciones y -operaciones.

-

Sugerencia:

-

Haz un gr?fico que muestre el tr?fico en bytes por segundo y en +operaciones.

+

Sugerencia:

+

Haz un gr?fico que muestre el tr?fico en bytes por segundo y en bits por segundo. Colorea el tr?fico Ethernet rojo si sobrepasa los -cuatro megabits por segundo.

-

-

Funciones de consolidaci?n

-

Unos cuantos p?rrafos atr?s habl?bamos sobre la posibilidad de +cuatro megabits por segundo.

+

+

+

Funciones de consolidaci?n

+

Unos cuantos p?rrafos atr?s habl?bamos sobre la posibilidad de guardar el valor m?ximo en vez del promedio. Profundicemos un poco en -este tema.

-

Recordemos lo que habl?bamos sobre la velocidad de un coche. +este tema.

+

Recordemos lo que habl?bamos sobre la velocidad de un coche. Supongamos que manejamos a 144 KM/H durante 5 minutos y luego nos detiene la polic?a durante unos 25 minutos. Al finalizar el rega?o, tomamos nuestro port?til y creamos una imagen @@ -702,13 +712,13 @@ creamos, tendremos el promedio de 6 muestreos. Las velocidades registradas serian 144+0+0+0+0+0=144, lo que en promedio nos da una velocidad de 24 KM/H., con lo que nos igual nos -pondr?an una multa, s?lo que no por exceso de velocidad.

-

Obviamente, en este caso, no deber?amos tomar en cuenta los +pondr?an una multa, s?lo que no por exceso de velocidad.

+

Obviamente, en este caso, no deber?amos tomar en cuenta los promedios. Estos son ?tiles en varios casos. Por ejemplo, si queremos ver cuantos KM hemos viajado, este ser?a el gr?fico m?s indicado. Pero por otro lado, para ver la velocidad ha la -que hemos viajado, los valores m?ximos son m?s adecuados.

-

Es lo mismo con los datos que recogemos. Si quieres saber la +que hemos viajado, los valores m?ximos son m?s adecuados.

+

Es lo mismo con los datos que recogemos. Si quieres saber la cantidad total, mira los promedios. Si quieres ver la velocidad, mira los m?ximos. Con el tiempo, ambas cantidades se separan cada vez m?s. En la ?ltima base de datos que creamos, hab?a dos archivos que @@ -716,12 +726,12 @@ mostrar? valores bajos, mientras que el de m?ximos mostrar? valores m?s altos. Para mi coche, mostrar?a valores promedio de 96/24=4 KM/H (viajo unos 96 kil?metros por d?a), y m?ximos de 1220 KM/H (la -velocidad m?xima que alcanzo cada d?a)

-

Como ves, una gran diferencia. No mires el segundo gr?fico para +velocidad m?xima que alcanzo cada d?a)

+

Como ves, una gran diferencia. No mires el segundo gr?fico para estimar la distancia que recorro, ni al primero para estimar la velocidad a la que voy. Esto s?lo funciona con muestras muy cercanas, -pero no si sacas promedios.

-

Algunas veces, hago un viaje largo. Si hago un recorrido por +pero no si sacas promedios.

+

Algunas veces, hago un viaje largo. Si hago un recorrido por Europa, conduciendo por unas 12 horas, el primer gr?fico subir? a unos 60 KM/H. El segundo mostrar? unos 180 KM/H. Esto significa que recorr? unos 60 KM/H por 24 horas = 1440 KM. Muestra adem?s que fui a @@ -739,33 +749,35 @@ esto nos lleva unas 12 muestras por hora, o 288 al d?a, lo cual es mucho para guardar por un periodo de tiempo largo. Por lo tanto, sacamos el promedio, guardando eventualmente un solo valor por d?a. -Con este ?nico valor, no podemos ver mucho.

-

Es importante comprender lo que expuesto en estos ?ltimos p?rrafos. +Con este ?nico valor, no podemos ver mucho.

+

Es importante comprender lo que expuesto en estos ?ltimos p?rrafos. Unos ejes y unas l?neas no tienen ning?n valor por si mismos; hay que saber que representan e interpretar correctamente los valores -obtenidos. Sean cuales sean los datos, esto siempre ser? cierto.

-

El mayor error que puedes cometer es usar los datos recogidos para +obtenidos. Sean cuales sean los datos, esto siempre ser? cierto.

+

El mayor error que puedes cometer es usar los datos recogidos para algo para lo cual no sirven. En ese caso, seria hasta mejor no tener -gr?fico alguno.

-

-

Repasemos lo que sabemos

-

Ahora ya sabes como crear una base de datos. Puedes guardar valores +gr?fico alguno.

+

+

+

Repasemos lo que sabemos

+

Ahora ya sabes como crear una base de datos. Puedes guardar valores en ella, extraerlos creando un gr?fico, hacer operaciones matem?ticas con ellos desde la base de datos y visualizar los resultados de estas en vez de los datos originales. Vimos la diferencia entre los promedios y los m?ximos y cuando debemos usar cada uno (o al menos una -idea de ello)

-

RRDtool puede hacer m?s de lo que hemos visto hasta ahora. Pero +idea de ello)

+

RRDtool puede hacer m?s de lo que hemos visto hasta ahora. Pero antes de continuar, te recomiendo que releas el texto desde el principio y pruebes a hacerle algunas modificaciones a los ejemplos. Aseg?rate de entenderlo todo. El esfuerzo valdr? la pena, y te ayudar?, no s?lo con el resto del documento, sino en tu trabajo diario de -monitorizaci?n, mucho despu?s de terminar con esta introducci?n.

-

-

Tipos de fuentes de datos

-

De acuerdo, quieres continuar. Bienvenido de vuelta otra vez y -prep?rate; voy a ir m?s r?pido con los ejemplos y explicaciones.

-

Ya vimos que, para ver el cambio de un contador a lo largo del +monitorizaci?n, mucho despu?s de terminar con esta introducci?n.

+

+

+

Tipos de fuentes de datos

+

De acuerdo, quieres continuar. Bienvenido de vuelta otra vez y +prep?rate; voy a ir m?s r?pido con los ejemplos y explicaciones.

+

Ya vimos que, para ver el cambio de un contador a lo largo del tiempo, tenemos que tomar dos n?meros y dividir la diferencia entre el tiempo transcurrido entre las mediciones. Para los ejemplos que hemos visto es lo l?gico, pero hay otras posibilidades. Por ejemplo, mi @@ -774,8 +786,8 @@ ventilaci?n. Estos valores no son contadores; si tomo los valores de dos muestreos y lo divido entre 300 segundos, obtendr? el cambio de temperatura por segundo. ?Esperemos que sea cero, o tendr?amos un -incendio en el cuarto de ordenadores! :)

-

Entonces, ?que hacemos? Podemos decirle a RRDtool que guarde los +incendio en el cuarto de ordenadores! :)

+

Entonces, ?que hacemos? Podemos decirle a RRDtool que guarde los valores tal como los medimos (esto no es exactamente as?, pero se aproxima bastante a la verdad). As?, los gr?ficos se ver?n mucho mejor. Puedo ver cuando el enrutador est? trabajando m?s (en serio, @@ -786,13 +798,13 @@ temperatura en la entrada de aire del enrutador), etc. Antes usamos un tipo de datos de ``contador'', ahora usaremos un tipo de datos diferente, con un nombre diferente, GAUGE. -Tenemos otros tipos:

-
+Tenemos otros tipos:

+
  - COUNTER este ya lo conocemos
  - GAUGE   este acabamos de verlo
  - DERIVE
- - ABSOLUTE
-

Los otros dos tipos son DERIVE y ABSOLUTE. ABSOLUTE puede usarse + - ABSOLUTE

+

Los otros dos tipos son DERIVE y ABSOLUTE. ABSOLUTE puede usarse igual que COUNTER, con una diferencia; RRDtool asume que el contador se reinicia cada vez que se lee. O en otras palabras; el delta entre los valores no hay que calcularlo, mientras que con COUNTER RRDtool @@ -800,9 +812,9 @@ (12345, 12357, 12363, 12363), ser?a (unknown, 12, 6, 0) en ABSOLUTE. El otro tipo, DERIVE, es como COUNTER, pero al contrario de COUNTER, este valor tambi?n puede decrecer, por lo que puede tenerse un delta -negativo.

-

Vamos a probarlos todos:

-
+negativo.

+

Vamos a probarlos todos:

+
    rrdtool create all.rrd --start 978300900 \
             DS:a:COUNTER:600:U:U \
             DS:b:GAUGE:600:U:U \
@@ -824,47 +836,48 @@
             DEF:linea=all.rrd:a:AVERAGE LINE3:linea#FF0000:"Line A" \
             DEF:lineb=all.rrd:b:AVERAGE LINE3:lineb#00FF00:"Line B" \
             DEF:linec=all.rrd:c:AVERAGE LINE3:linec#0000FF:"Line C" \
-            DEF:lined=all.rrd:d:AVERAGE LINE3:lined#000000:"Line D"
-

-

RRDtool bajo el microscopio

-
    -
  • + DEF:lined=all.rrd:d:AVERAGE LINE3:lined#000000:"Line D"
+

+

+

RRDtool bajo el microscopio

+
    +
  • La l?nea A es un contador, por lo que debe incrementarse continuamente y RRDtool tiene que calcular las diferencias. Adem?s RRDtool tiene que dividir la diferencia entre el tiempo transcurrido. Esto deber?a terminar con una l?nea recta en 1 (los deltas son 300, y los intervalos son de 300) -

    -
  • +

    +
  • La l?nea B es de tipo GAUGE. Estos son los valores ``reales'', as? que el gr?fico debe mostrar lo mismo que los valores que introducimos: una especie de onda -

    -
  • +

    +
  • La l?nea C es de tipo DERIVE. Es un contador, y puede decrecer. Va entre 2400 y 0, con 1800 en el medio. -

    -
  • +

    +
  • La l?nea D es de tipo ABSOLUTE. Esto es, es un contador pero no hay que calcular las diferencias. Los n?meros son iguales a la l?nea A, y espero que puedas ver la diferencia en los gr?ficos. -

-

Esto equivale a los valores siguientes, empezando a las 23:10 y -terminando a las 00:10 (las U significan desconocido).

-
+

+

Esto equivale a los valores siguientes, empezando a las 23:10 y +terminando a las 00:10 (las U significan desconocido).

+
  - L?nea  A:  u  u  1  1  1  1  1  1  1  1  1  u
  - L?nea  B:  u  1  3  5  3  1  2  4  6  4  2  u
  - L?nea  C:  u  u  2  2  2  0 -2 -6  2  0  2  u
- - L?nea  D:  u  1  2  3  4  5  6  7  8  9 10  u
-

Si tu archivo GIF muestra todo esto, has + - L?nea D: u 1 2 3 4 5 6 7 8 9 10 u

+

Si tu archivo GIF muestra todo esto, has entrado los datos correctamente, tu programa RRDtool est? funcionando bien, el visor de gr?ficos no te enga?a y hemos entrado en el 2000 sin -problemas :) Puedes probar el mismo ejemplo cuatro veces, una por cada l?nea.

-

Revisemos los datos otra vez:

-
    -
  • +problemas :) Puedes probar el mismo ejemplo cuatro veces, una por cada l?nea.

    +

    Revisemos los datos otra vez:

    +
      +
    • L?nea A: 300, 600, 900 , etc. La diferencia del contador es siempre 300, igual que el intervalo de tiempo transcurrido entre mediciones. Por lo tanto, el promedio @@ -873,13 +886,13 @@ base de datos? ?Si! Pero no ten?amos un valor inicial para calcular la diferencia. Ser?a un error asumir que el contador empezaba en 0, as? que no conocemos el valor de la diferencia -

      -
    • +

      +
    • L?nea B: No hay nada que calcular, los valores son los mismos que se introdujeron en la base de datos. -

      -
    • +

      +
    • L?nea C: De nuevo, no conocemos el valor inicial antes de la primera medici?n, as? que se aplica el mismo @@ -889,8 +902,8 @@ A, el gr?fico ser?a el mismo. Al contrario que COUNTER, el valor puede decrecer, y espero mostrarte m?s adelante el por que de la diferencia entre ambos tipos. -

      -
    • +

      +
    • L?nea D: En este caso, el dispositivo nos da las diferencias por s? mismo. Por lo tanto, conocemos la diferencia inicial, y podemos graficarla. Tenemos los mismos @@ -899,10 +912,11 @@ este caso, las diferencias se incrementan en 300 cada vez, mientras que el intervalo de tiempo permanece constante en 300 segundos, por lo que la divisi?n nos da resultados cada vez mayores. -

    -

    -

    Reinicializaci?n de los contadores

    -

    Todav?a nos quedan algunas cosas por ver. Nos quedan algunas +

+

+

+

Reinicializaci?n de los contadores

+

Todav?a nos quedan algunas cosas por ver. Nos quedan algunas opciones importantes por cubrir, y aun no hemos hablado de la reinicializaci?n de contadores. Empecemos por ah?: Estamos en nuestro coche, vemos el contador y muestra 999987. Andamos unos 20 KM, as? que @@ -916,24 +930,22 @@ contador. ?C?mo funciona? Los valores tipo COUNTER no deben decrecer nunca, ?por lo que RRDtool asume en ese caso que el contador se ha reinicializado! Si la diferencia es negativa, esto se compensa sumando -el valor m?ximo del contador + 1. Para nuestro coche, tendr?amos:

-
+el valor m?ximo del contador + 1. Para nuestro coche, tendr?amos:

+
  Delta = 7 - 999987 = -999980    (en vez de 1000007-999987=20)
-
-
-
- Delta real= -999980 + 999999 + 1 = 20
-

Al momento de escribir este documento, RRDtool maneja contadores de + + Delta real= -999980 + 999999 + 1 = 20

+

Al momento de escribir este documento, RRDtool maneja contadores de 32 o 64 bits de tama?o. Estos contadores pueden manejar los siguientes -valores:

-
+valores:

+
  - 32 bits: 0 ..           4294967295
- - 64 bits: 0 .. 18446744073709551615
-

Si estos valores te parecen raros, podemos verlos en formato hexadecimal:

-
+ - 64 bits: 0 .. 18446744073709551615
+

Si estos valores te parecen raros, podemos verlos en formato hexadecimal:

+
  - 32 bits: 0 ..         FFFFFFFF
- - 64 bits: 0 .. FFFFFFFFFFFFFFFF
-

RRDtool maneja ambos contadores de la misma manera. Si ocurre un + - 64 bits: 0 .. FFFFFFFFFFFFFFFF

+

RRDtool maneja ambos contadores de la misma manera. Si ocurre un desbordamiento y la diferencia es negativa, RRDtool le suma primero el m?ximo del contador ``menor'' (32 bits) + 1 a la diferencia. Si a?n as? la diferencia es negativa, entonces el contador reinicializado era @@ -948,34 +960,30 @@ lo que de ocurrir es muy probable que halla varios problemas m?s en la configuraci?n y no merezca la pena preocuparse s?lo por este. A?n as?, he incluido un ejemplo de este caso para que lo puedas juzgar por -ti mismo.

-

A continuaci?n, unos ejemplos de reinicializaci?n de los +ti mismo.

+

A continuaci?n, unos ejemplos de reinicializaci?n de los contadores. Prueba de hacer los c?lculos por ti mismo, o acepta mis -resultados si tu calculadora no puede con los n?meros :)

-

N?meros de correcci?n:

-
+resultados si tu calculadora no puede con los n?meros :)

+

N?meros de correcci?n:

+
  - 32 bits: (4294967295+1) =                                 4294967296
  - 64 bits: (18446744073709551615+1)-correction1 = 18446744069414584320
-
-
-
+ 
  Antes:          4294967200
  Incremento:            100
  Deber?a ser:    4294967300
  Pero es:                 4
  Diferencia:    -4294967196
- Correcci?n #1: -4294967196 + 4294967296 = 100
-
-
+ Correcci?n #1: -4294967196 + 4294967296 = 100
+ 
  Antes:          18446744073709551000
  Incremento:                      800
  Deber?a ser:    18446744073709551800
  Pero es:                         184
  Diferencia:    -18446744073709550816
  Correcci?n #1: -18446744073709550816 +4294967296 = -18446744069414583520
- Correcci?n #2: -18446744069414583520 +18446744069414584320 = 800
-
-
+ Correcci?n #2: -18446744069414583520 +18446744069414584320 = 800
+ 
  Antes:          18446744073709551615 ( valor m?ximo )
  Incremento:     18446744069414584320 ( incremento absurdo, 
  Deber?a ser:    36893488143124135935   m?nimo para que 
@@ -983,17 +991,16 @@
  Diferencia:              -4294967296
  Correcci?n #1:  -4294967296 + 4294967296 = 0 (positivo,
                                                por tanto no se hace 
-                                               la segunda correcci?n)
-
-
+                                               la segunda correcci?n)
+ 
  Antes:          18446744073709551615 ( valor m?ximo )
  Incremento:     18446744069414584319 
  Deber?a ser:    36893488143124135934
  Pero es:        18446744069414584318
  Diferencia:              -4294967297
  Correcci?n #1:  -4294967297 +4294967296 = -1
- Correcci?n #2:  -1 +18446744069414584320 = 18446744069414584319
-

Como puede verse en los ?ltimos ejemplos, necesitas unos valores + Correcci?n #2: -1 +18446744069414584320 = 18446744069414584319

+

Como puede verse en los ?ltimos ejemplos, necesitas unos valores bastante extra?os para hacer que RRDtool falle (asumiendo que no tenga ning?n error el programa, por supuesto), as? que esto no deber?a ocurrir. Sin embargo, SNMP o cualquier otro @@ -1012,15 +1019,16 @@ Cualquier otra cosa ser?a un error. Pero recuerda, lo contrario no es cierto: si los valores pasan este examen no quiere decir que sean los correctos. Siempre examina bien el gr?fico si los valores parecen -extra?os.

-

-

Remuestreo de los datos

-

Hay una funcionalidad importante de RRDtool que no hemos explicado +extra?os.

+

+

+

Remuestreo de los datos

+

Hay una funcionalidad importante de RRDtool que no hemos explicado todav?a: es virtualmente imposible recoger los datos y pasarselos a RRDtool a intervalos exactos de tiempo. Por tanto, RRDtool interpola los datos a los intervalos exactos. Si no sabes que significa esto o -como se hace, he aqu? la ayuda que necesitas:

-

Supongamos un contador se incremente exactamente en 1 cada segundo. +como se hace, he aqu? la ayuda que necesitas:

+

Supongamos un contador se incremente exactamente en 1 cada segundo. Queremos medirlo cada 300 segundos, por lo que deber?amos tener valores separados exactamente en 300. Sin embargo, por varias circunstancias llegamos unos segundos tarde y el intervalo es 303. La @@ -1031,30 +1039,30 @@ en 300 segundos. Digamos que la pr?xima vez llegamos justo a tiempo; por tanto, el intervalo actual es 297 segundos, por lo que el contador deber?a ser 297. De nuevo, RRDtool altera el valor y guarda 300, como -debe ser.

-
+debe ser.

+
          en RRD                     en realidad
  tiempo+000:   0 delta="U"    tiempo+000:   0 delta="U" 
  tiempo+300: 300 delta=300    tiempo+300: 300 delta=300
  tiempo+600: 600 delta=300    tiempo+603: 603 delta=303
- tiempo+900: 900 delta=300    tiempo+900: 900 delta=297
-

Creemos dos bases de datos id?nticas. He escogido el rango de -tiempo entre 920805000 y 920805900.

-
+ tiempo+900: 900 delta=300    tiempo+900: 900 delta=297
+

Creemos dos bases de datos id?nticas. He escogido el rango de +tiempo entre 920805000 y 920805900.

+
    rrdtool create seconds1.rrd   \
       --start 920804700          \
       DS:seconds:COUNTER:600:U:U \
-      RRA:AVERAGE:0.5:1:24
-
+      RRA:AVERAGE:0.5:1:24
+
    para Unix: cp seconds1.rrd seconds2.rrd
    para DOS: copy seconds1.rrd seconds2.rrd
-   para VMS:  y yo que s? :)
-
+   para VMS:  y yo que s? :)
+
    rrdtool update seconds1.rrd \
       920805000:000 920805300:300 920805600:600 920805900:900
    rrdtool update seconds2.rrd \
-      920805000:000 920805300:300 920805603:603 920805900:900
-
+      920805000:000 920805300:300 920805603:603 920805900:900
+
    rrdtool graph seconds1.gif                       \
       --start 920804700 --end 920806200             \
       --height 200                                  \
@@ -1070,40 +1078,44 @@
       DEF:seconds=seconds2.rrd:seconds:AVERAGE      \
       CDEF:unknown=seconds,UN                       \
       LINE2:seconds#0000FF                          \
-      AREA:unknown#FF0000
-

Los dos gr?ficos debe ser iguales.

-

-


-

RESUMEN

-

Es hora de concluir este documento. Ahora debes conocer lo b?sico + AREA:unknown#FF0000

+

Los dos gr?ficos debe ser iguales.

+

+

+
+

RESUMEN

+

Es hora de concluir este documento. Ahora debes conocer lo b?sico como para trabajar con RRDtool y leer la documentaci?n. A?n hay mucho m?s por descubrir acerca de RRDtool, y le encontrar?s; m?s y m?s usos para la herramienta. Con los ejemplos y la herramienta puedes crear f?cilmente muchos gr?ficos; tambi?n puedes usar las interfaces -disponibles.

-

-


-

LISTA DE CORREO

-

Recuerda subscribirte a la lista de correo. Aunque no contestes los +disponibles.

+

+

+
+

LISTA DE CORREO

+

Recuerda subscribirte a la lista de correo. Aunque no contestes los correos que aparecen en ella, te servir? de ayuda a ti y a los dem?s. Mucho de lo que se sobre MRTG (y por tanto sobre RRDtool), lo aprend? tan s?lo con leer la lista, sin escribir. No hay por que preguntar las preguntas b?sicas, que ya tienen su respuesta en la FAQ (?l?ela!). Con miles de usuarios a lo largo del mundo, siempre hay preguntas que tu -puedes responder con lo aprendido en este y otros documentos.

-

-


-

VER TAMBI?N

-

Las p?ginas del manual de RRDtool

-

-


-

AUTOR

-

Espero que hayas disfrutado con los ejemplos y las descripciones. +puedes responder con lo aprendido en este y otros documentos.

+

+

+
+

VER TAMBI?N

+

Las p?ginas del manual de RRDtool

+

+

+
+

AUTOR

+

Espero que hayas disfrutado con los ejemplos y las descripciones. Si es as?, ayuda a otros refiri?ndolos a este documento cuando te hagan preguntas b?sicas. No s?lo obtendr?n la respuesta, sino que -aprender?n muchas otras cosas.

-

Alex van den Bogaerdt <alex at ergens.op.het.net>

+aprender?n muchas otras cosas.

+

Alex van den Bogaerdt <alex at ergens.op.het.net>

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdtune.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdtune.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdtune.html 2003-02-20 15:24:00.000000000 -0800 @@ -1,91 +1,109 @@ - - -rrdtune - - + + + +rrdtune + + - + - +

-

-

NAME

-

rrdtool tune - Modify some basic properties of a Round Robin Database

-
PDF version.

-


-

SYNOPSIS

-

rrdtool tune filename -[--heartbeat|-h ds-name:heartbeat] -[--minimum|-i ds-name:min] -[--maximum|-a ds-name:max] -[--data-source-type|-d ds-name:DST] -[--data-source-rename|-r old-name:new-name]

-

-


-

DESCRIPTION

-

The tune option allows you to alter some of the basic configuration -values stored in the header area of a Round Robin Database (RRD). +

+

+

NAME

+

rrdtool tune - Modify some basic properties of a Round Robin Database

+
PDF version.

+

+
+

SYNOPSIS

+

rrdtool tune filename +[--heartbeat|-h ds-name:heartbeat] +[--minimum|-i ds-name:min] +[--maximum|-a ds-name:max] +[--data-source-type|-d ds-name:DST] +[--data-source-rename|-r old-name:new-name]

+

+

+
+

DESCRIPTION

+

The tune option allows you to alter some of the basic configuration +values stored in the header area of a Round Robin Database (RRD). All these tunable parameters together decide when data fed into an -RRD is to be regarded as invalid. Invalid data is entered into the -database as *UNKNOWN*.

-

The main application of the tune function is to relax the -validation rules on an RRD. This allows to fill a new RRD with +RRD is to be regarded as invalid. Invalid data is entered into the +database as *UNKNOWN*.

+

The main application of the tune function is to relax the +validation rules on an RRD. This allows to fill a new RRD with data available in larger intervals than what you would normally want -to permit.

-
-
filename
-
-The name of the RRD you want to tune. -

-
--heartbeat|-h ds-name:heartbeat
-
-modify the heartbeat of a data source. By setting this to a high +to permit.

+
+
filename
+
+
+The name of the RRD you want to tune. +
+

+
--heartbeat|-h ds-name:heartbeat
+
+
+modify the heartbeat of a data source. By setting this to a high value the rrd will accept things like one value per day ... -

-
--minimum|-i ds-name:min
-
+
+

+
--minimum|-i ds-name:min
+
+
alter the minimum value acceptable as input from the data source. -Setting min to 'U' will disable this limit. -

-
--maximum|-a ds-name:max
-
+Setting min to 'U' will disable this limit. +
+

+
--maximum|-a ds-name:max
+
+
alter the maximum value acceptable as input from the data source. -Setting max to 'U' will disable this limit. -

-
--data-source-type|-d ds-name:DST
-
-alter the type DST of a data source. -

-
[--data-source-rename|-r old-name:new-name]
-
+Setting max to 'U' will disable this limit. +
+

+
--data-source-type|-d ds-name:DST
+
+
+alter the type DST of a data source. +
+

+
[--data-source-rename|-r old-name:new-name]
+
+
rename a data source -

-

-


-

EXAMPLE

-

rrdtool tune data.rrd -h in:100000 -h out:100000 -h through:100000

-

Set the minimum required heartbeat for data sources 'in', 'out' +

+

+

+

+
+

EXAMPLE

+

rrdtool tune data.rrd -h in:100000 -h out:100000 -h through:100000

+

Set the minimum required heartbeat for data sources 'in', 'out' and 'through' to 10000 seconds which is a little over one day in data.rrd. This would allow to feed old data from mrtg-2.0 right into -rrdtool without generating *UNKNOWN* entries.

-

-


-

AUTHOR

-

Tobias Oetiker <oetiker at ee.ethz.ch>

+rrdtool without generating *UNKNOWN* entries.

+

+

+
+

AUTHOR

+

Tobias Oetiker <oetiker at ee.ethz.ch>

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdresize.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdresize.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdresize.txt 2003-02-20 15:24:00.000000000 -0800 @@ -2,35 +2,35 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE rrdtool resize - alters the size of an RRA and creates new .rrd file -SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS - rrrrrrrrddddttttoooooooollll rrrreeeessssiiiizzzzeeee _f_i_l_e_n_a_m_e _r_r_a_-_n_u_m GGGGRRRROOOOWWWW_|SSSSHHHHRRRRIIIINNNNKKKK _r_o_w_s +SSYYNNOOPPSSIISS + rrrrddttooooll rreessiizzee _f_i_l_e_n_a_m_e _r_r_a_-_n_u_m GGRROOWW_|SSHHRRIINNKK _r_o_w_s -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN - The rrrreeeessssiiiizzzzeeee function is used to modify the number of rows - in an RRRRRRRRAAAA. +DDEESSCCRRIIPPTTIIOONN + The rreessiizzee function is used to modify the number of rows + in an RRRRAA. _f_i_l_e_n_a_m_e - the name of the RRRRRRRRDDDD you want to alter. + the name of the RRRRDD you want to alter. - _r_r_a_-_n_u_m the RRRRRRRRAAAA you want to alter. You can find the number - using rrrrrrrrddddttttoooooooollll iiiinnnnffffoooo. + _r_r_a_-_n_u_m the RRRRAA you want to alter. You can find the number + using rrrrddttooooll iinnffoo. - GGGGRRRROOOOWWWW used if you want to add extra rows to an RRA. The + GGRROOWW used if you want to add extra rows to an RRA. The extra rows will be inserted as the rows that are oldest. - SSSSHHHHRRRRIIIINNNNKKKK used if you want to remove rows from an RRA. The + SSHHRRIINNKK used if you want to remove rows from an RRA. The rows that will be removed are the oldest rows. _r_o_w_s the number of rows you want to add or remove. -NNNNOOOOTTTTEEEESSSS +NNOOTTEESS The new .rrd file, with the modified RRAm, is written to - the file rrrreeeessssiiiizzzzeeee....rrrrrrrrdddd in the current directory. The origi- + the file rreessiizzee..rrrrdd in the current directory. The origi- nal .rrd file is not modified. It is possible to abuse this tool and get strange results @@ -39,9 +39,9 @@ thus end up with unknown data in one RRA while at the same timestamp this data is available in another RRA. -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR Alex van den Bogaerdt -2002-07-05 1.0.40 RRDRESIZE(1) +1.0.41 2002-07-05 RRDRESIZE(1) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdcreate.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdcreate.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdcreate.txt 2003-02-20 15:24:00.000000000 -0800 @@ -2,62 +2,62 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE rrdtool create - Set up a new Round Robin Database -SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS - rrrrrrrrddddttttoooooooollll ccccrrrreeeeaaaatttteeee _f_i_l_e_n_a_m_e [--------ssssttttaaaarrrrtttt|----bbbb _s_t_a_r_t _t_i_m_e] - [--------sssstttteeeepppp|----ssss _s_t_e_p] [DDDDSSSS::::_d_s_-_n_a_m_e::::_D_S_T::::_h_e_a_r_t_b_e_a_t::::_m_i_n::::_m_a_x] - [RRRRRRRRAAAA::::_C_F::::_x_f_f::::_s_t_e_p_s::::_r_o_w_s] +SSYYNNOOPPSSIISS + rrrrddttooooll ccrreeaattee _f_i_l_e_n_a_m_e [----ssttaarrtt|--bb _s_t_a_r_t _t_i_m_e] + [----sstteepp|--ss _s_t_e_p] [DDSS::_d_s_-_n_a_m_e::_D_S_T::_h_e_a_r_t_b_e_a_t::_m_i_n::_m_a_x] + [RRRRAA::_C_F::_x_f_f::_s_t_e_p_s::_r_o_w_s] -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN +DDEESSCCRRIIPPTTIIOONN The create function of the RRDtool lets you set up new - Round Robin Database (RRRRRRRRDDDD) files. The file is created at + Round Robin Database (RRRRDD) files. The file is created at its final, full size and filled with _*_U_N_K_N_O_W_N_* data. _f_i_l_e_n_a_m_e - The name of the RRRRRRRRDDDD you want to create. RRRRRRRRDDDD files - should end with the extension _._r_r_d. However, rrrrrrrrdddd---- - ttttoooooooollll will accept any filename. + The name of the RRRRDD you want to create. RRRRDD files + should end with the extension _._r_r_d. However, rrrrdd-- + ttooooll will accept any filename. - --------ssssttttaaaarrrrtttt|----bbbb _s_t_a_r_t _t_i_m_e (default: now - 10s) + ----ssttaarrtt|--bb _s_t_a_r_t _t_i_m_e (default: now - 10s) Specifies the time in seconds since 1970-01-01 UTC - when the first value should be added to the RRRRRRRRDDDD. - rrrrrrrrddddttttoooooooollll will not accept any data timed before or + when the first value should be added to the RRRRDD. + rrrrddttooooll will not accept any data timed before or at the time specified. See also AT-STYLE TIME SPECIFICATION section in the _r_r_d_f_e_t_c_h documentation for more ways to spec- ify time. - --------sssstttteeeepppp|----ssss _s_t_e_p (default: 300 seconds) + ----sstteepp|--ss _s_t_e_p (default: 300 seconds) Specifies the base interval in seconds with which - data will be fed into the RRRRRRRRDDDD. + data will be fed into the RRRRDD. - DDDDSSSS::::_d_s_-_n_a_m_e::::_D_S_T::::_h_e_a_r_t_b_e_a_t::::_m_i_n::::_m_a_x - A single RRRRRRRRDDDD can accept input from several data - sources (DDDDSSSS). (e.g. Incoming and Outgoing traffic - on a specific communication line). With the DDDDSSSS + DDSS::_d_s_-_n_a_m_e::_D_S_T::_h_e_a_r_t_b_e_a_t::_m_i_n::_m_a_x + A single RRRRDD can accept input from several data + sources (DDSS). (e.g. Incoming and Outgoing traffic + on a specific communication line). With the DDSS configuration option you must define some basic properties of each data source you want to use to - feed the RRRRRRRRDDDD. + feed the RRRRDD. _d_s_-_n_a_m_e is the name you will use to reference this - particular data source from an RRRRRRRRDDDD. A _d_s_-_n_a_m_e must - be 1 to 19 characters long in the characters [a- - zA-Z0-9_]. + particular data source from an RRRRDD. A _d_s_-_n_a_m_e must + be 1 to 19 characters long in the characters + [a-zA-Z0-9_]. _D_S_T defines the Data Source Type. See the section on "How to Measure" below for further insight. The Datasource Type must be one of the following: - GGGGAAAAUUUUGGGGEEEE + GGAAUUGGEE is for things like temperatures or number of people in a room or value of a RedHat share. - CCCCOOOOUUUUNNNNTTTTEEEERRRR + CCOOUUNNTTEERR is for continuous incrementing counters like - the InOctets counter in a router. The CCCCOOOOUUUUNNNNTTTTEEEERRRR + the InOctets counter in a router. The CCOOUUNNTTEERR data source assumes that the counter never decreases, except when a counter overflows. The update function takes the overflow into @@ -67,18 +67,18 @@ or 64bit border and acts accordingly by adding an appropriate value to the result. - DDDDEEEERRRRIIIIVVVVEEEE + DDEERRIIVVEE will store the derivative of the line going from the last to the current value of the data source. This can be useful for gauges, for example, to measure the rate of people enter- ing or leaving a room. Internally, derive - works exaclty like COUNTER but without over- + works exactly like COUNTER but without over- flow checks. So if your counter does not reset at 32 or 64 bit you might want to use DERIVE and combine it with a MIN value of 0. - AAAABBBBSSSSOOOOLLLLUUUUTTTTEEEE + AABBSSOOLLUUTTEE is for counters which get reset upon reading. This is used for fast counters which tend to overflow. So instead of reading them normally @@ -100,7 +100,7 @@ _*_U_N_K_N_O_W_N_*. If you do not know or care about min and max, set them to U for unknown. Note that min and max always refer to the processed values of - the DS. For a traffic-CCCCOOOOUUUUNNNNTTTTEEEERRRR type DS this would + the DS. For a traffic-CCOOUUNNTTEERR type DS this would be the max and min data-rate expected from the device. @@ -110,20 +110,20 @@ _s_a_n_i_t_y _c_h_e_c_k _o_n _t_h_e _d_a_t_a _s_u_p_p_l_i_e_d _w_h_e_n _r_u_n_n_i_n_g _u_p_d_a_t_e_. - RRRRRRRRAAAA::::_C_F::::_x_f_f::::_s_t_e_p_s::::_r_o_w_s - The purpose of an RRRRRRRRDDDD is to store data in the - round robin archives (RRRRRRRRAAAA). An archive consists of + RRRRAA::_C_F::_x_f_f::_s_t_e_p_s::_r_o_w_s + The purpose of an RRRRDD is to store data in the + round robin archives (RRRRAA). An archive consists of a number of data values from all the defined data- - sources (DDDDSSSS) and is defined with an RRRRRRRRAAAA line. + sources (DDSS) and is defined with an RRRRAA line. - When data is entered into an RRRRRRRRDDDD, it is first fit - into time slots of the length defined with the ----ssss + When data is entered into an RRRRDD, it is first fit + into time slots of the length defined with the --ss option becoming a _p_r_i_m_a_r_y _d_a_t_a _p_o_i_n_t. The data is also consolidated with the consolida- tion function (_C_F) of the archive. The following - consolidation functions are defined: AAAAVVVVEEEERRRRAAAAGGGGEEEE, MMMMIIIINNNN, - MMMMAAAAXXXX, LLLLAAAASSSSTTTT. + consolidation functions are defined: AAVVEERRAAGGEE, MMIINN, + MMAAXX, LLAASSTT. _x_f_f The xfiles factor defines what part of a con- solidation interval may be made up from _*_U_N_K_N_O_W_N_* @@ -135,9 +135,9 @@ which then goes into the archive. _r_o_w_s defines how many generations of data values - are kept in an RRRRRRRRAAAA. + are kept in an RRRRAA. -TTTThhhheeee HHHHEEEEAAAARRRRTTTTBBBBEEEEAAAATTTT aaaannnndddd tttthhhheeee SSSSTTTTEEEEPPPP +TThhee HHEEAARRTTBBEEAATT aanndd tthhee SSTTEEPP Here is an explanation by Don Baarda on the inner workings of rrdtool. It may help you to sort out why all this *UNKNOWN* data is popping up in your databases: @@ -180,7 +180,7 @@ entire day period being set to the same average rate. _-_- _D_o_n _B_a_a_r_d_a _<_d_o_n_._b_a_a_r_d_a_@_b_a_e_s_y_s_t_e_m_s_._c_o_m_> -HHHHOOOOWWWW TTTTOOOO MMMMEEEEAAAASSSSUUUURRRREEEE +HHOOWW TTOO MMEEAASSUURREE Here are a few hints on how to measure: Temperature @@ -188,7 +188,7 @@ get the temperature. The temperature is not realy connected with a time. The only connection is that the temperature reading happened at a certain time. You - can use the GGGGAAAAUUUUGGGGEEEE data source type for this. RRRtool + can use the GGAAUUGGEE data source type for this. RRRtool will the record your reading together with the time. Mail Messages @@ -196,7 +196,7 @@ sages transported by your mailserver in a certain amount of time, this give you data like '5 messages in the last 65 seconds'. If you look at the count of 5 - like and AAAABBBBSSSSOOOOLLLLUUUUTTTTEEEE datatype you can simply update the + like and AABBSSOOLLUUTTEE datatype you can simply update the rrd with the number 5 and the end time of your moni- toring period. RRDtool will then record the number of messages per second. If at some later stage you want @@ -223,13 +223,13 @@ graph you see for example GB on the y axis, days on the x axis and one bar for each day). -EEEEXXXXAAAAMMMMPPPPLLLLEEEE +EEXXAAMMPPLLEE "rrdtool create temperature.rrd --step 300 DS:temp:GAUGE:600:-273:5000 RRA:AVERAGE:0.5:1:1200 RRA:MIN:0.5:12:2400 RRA:MAX:0.5:12:2400 RRA:AVER- AGE:0.5:12:2400" - This sets up an RRRRRRRRDDDD called _t_e_m_p_e_r_a_t_u_r_e_._r_r_d which accepts + This sets up an RRRRDD called _t_e_m_p_e_r_a_t_u_r_e_._r_r_d which accepts one temperature value every 300 seconds. If no new data is supplied for more than 600 seconds, the temperature becomes _*_U_N_K_N_O_W_N_*. The minimum acceptable value is -273 @@ -243,9 +243,9 @@ RRA's do the same for the maximum and average temperature, respectively. -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR Tobias Oetiker -2002-05-02 1.0.40 RRDCREATE(1) +1.0.41 2002-12-20 RRDCREATE(1) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/bin_dec_hex.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/bin_dec_hex.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/bin_dec_hex.html 2003-02-20 15:24:00.000000000 -0800 @@ -1,37 +1,40 @@ - - -bin_dec_hex - - + + + +bin_dec_hex + + - + - +

-

-

NAME

-

Binary Decimal Hexadecimal - How does it work

-
PDF version.

-


-

DESCRIPTION

-

Most people use the decimal numbering system. This system uses ten +

+

+

NAME

+

Binary Decimal Hexadecimal - How does it work

+
PDF version.

+

+
+

DESCRIPTION

+

Most people use the decimal numbering system. This system uses ten symbols to represent numbers. When those ten symbols are used up, they start all over again and increment the position just before this. The digit 0 is only shown if it is the only symbol in the sequence, or if -it is not the first one.

-

If this sounds as crypto to you, this is what I've said in numbers:

-
+it is not the first one.

+

If this sounds as crypto to you, this is what I've said in numbers:

+
      0
      1
      2
@@ -45,19 +48,19 @@
     10
     11
     12
-    13
-

and so on.

-

Each time the digit nine should be incremented, it is reset to 0 and the + 13

+

and so on.

+

Each time the digit nine should be incremented, it is reset to 0 and the position before is incremented. Then number 9 can be seen as ``00009'' and when we should increment 9, we reset it to zero and increment the digit just before the 9 so the number becomes ``00010''. For zero's we write a space if it is not the only digit (so: number 0) and if it is the first -digit: ``00010'' -> `` 0010'' -> `` 010'' -> `` 10''. It is not `` 1 ''.

-

This was pretty basic, you already knew this. Why did I tell it ? +digit: ``00010'' -> `` 0010'' -> `` 010'' -> `` 10''. It is not `` 1 ''.

+

This was pretty basic, you already knew this. Why did I tell it ? Well, computers do not represent numbers with 10 different digits. They know of only two different symbols, being 0 and 1. Apply the same rules -to this set of digits and you get the binary numbering system:

-
+to this set of digits and you get the binary numbering system:

+
      0
      1
     10
@@ -71,46 +74,46 @@
   1010
   1011
   1100
-  1101
-

and so on.

-

If you count the number of rows, you'll see that these are again 14 + 1101

+

and so on.

+

If you count the number of rows, you'll see that these are again 14 different numbers. The numbers are the same and mean the same. It is only a different representation. This means that you have to know the representation used, or as it is called the numbering system or base. Normally if we do not speak about the numbering system used, we're using the decimal system. If we are talking about another numbering system, we'll have to make that clear. There are a few wide-spread -methods to do so. One common form is to write 1010(2) which means that +methods to do so. One common form is to write 1010(2) which means that you wrote down a number in the binary form. It is the number ten. -If you would write 1010 it means the number one thousand and ten.

-

In books, another form is most used. It uses subscript (little chars, +If you would write 1010 it means the number one thousand and ten.

+

In books, another form is most used. It uses subscript (little chars, more or less in between two rows). You can leave out the parentheses in that case and write down the number in normal characters followed -with a little two just behind it.

-

The numbering system used is also called the base. We talk of the number -1100 base 2, the number 12 base 10.

-

For the binary system, is is common to write leading zero's. The numbers +with a little two just behind it.

+

The numbering system used is also called the base. We talk of the number +1100 base 2, the number 12 base 10.

+

For the binary system, is is common to write leading zero's. The numbers are written down in series of four, eight or sixteen depending on the -context.

-

We can use the binary form when talking to computers (...programming...) +context.

+

We can use the binary form when talking to computers (...programming...) but the numbers will have large representations. The number 65535 would -be written down as 1111111111111111(2) which is 16 times the digit 1. +be written down as 1111111111111111(2) which is 16 times the digit 1. This is difficult and prone to errors. Therefore we normally would use another base, called hexadecimal. It uses 16 different symbols. First the symbols from the decimal system are used, thereafter we continue with the alphabetic characters. We get 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F. This system is chosen because the hexadecimal form -can be converted into the binary system very easy (and back).

-

There is yet another system in use, called the octal system. This was +can be converted into the binary system very easy (and back).

+

There is yet another system in use, called the octal system. This was more common in the old days but not anymore. You will find it in use on some places so get used to it. The same story applies, but now with -only eight different symbols.

-
+only eight different symbols.

+
  Binary      (2)
  Octal       (8)
  Decimal     (10)
- Hexadecimal (16)
-
+ Hexadecimal (16)
+
  (2)    (8) (10) (16)
  00000   0    0    0
  00001   1    1    1
@@ -133,24 +136,24 @@
  10010  22   18   12
  10011  23   19   13
  10100  24   20   14
- 10101  25   21   15
-

Most computers used nowadays are using bytes of eight bits. This means + 10101 25 21 15

+

Most computers used nowadays are using bytes of eight bits. This means that they store eight bits at a time. You can see why the octal system is not the most preferred for that: You'd need three digits to represent the eight bits and this means that you'd have to use one complete digit to represent only two bits (2+3+3=8). This is a waste. For hexadecimal -digits, you need only two digits which are used completely:

-
+digits, you need only two digits which are used completely:

+
  (2)      (8)  (10) (16)
- 11111111 377  255   FF
-

You can see why binary and hexadecimal can be converted quickly: + 11111111 377 255 FF

+

You can see why binary and hexadecimal can be converted quickly: For each hexadecimal digit there are exactly four binary digits. Take a binary number. Each time take four digits from the right and make a hexadecimal digit from it (see the table above). Stop when there are no more digits. Other way around: Take a hexadecimal number. For each digit, write down -its binary equivalent.

-

Computers (or rather the parsers running on them) would have a hard time +its binary equivalent.

+

Computers (or rather the parsers running on them) would have a hard time converting a number like 1234(16). Therefore hexadecimal numbers get a prefix. This prefix depends on the language you're writing in. Some of the prefixes are ``0x'' for C, ``$'' for Pascal, ``#'' for HTML. @@ -158,75 +161,75 @@ It does not matter what is used as long as you know what it is. I will use ``0x'' for hexadecimal, ``%'' for binary and ``0'' for octal. The following numbers are all the same, just the way they are written is -different: 021 0x11 17 %00010001

-

To do arithmetics and conversions you need to understand one more thing. -It is something you already know but perhaps you do not ``see'' it yet:

-

If you write down 1234, (so it is decimal) you are talking about the -number one thousand, two hundred and thirty four. In sort of a formula:

-
+different:  021  0x11  17  %00010001

+

To do arithmetics and conversions you need to understand one more thing. +It is something you already know but perhaps you do not ``see'' it yet:

+

If you write down 1234, (so it is decimal) you are talking about the +number one thousand, two hundred and thirty four. In sort of a formula:

+
  1 * 1000 = 1000
  2 *  100 =  200
  3 *   10 =   30
- 4 *    1 =    4
-

This can also be written as:

-
+ 4 *    1 =    4
+

This can also be written as:

+
  1 * 10^3
  2 * 10^2
  3 * 10^1
- 4 * 10^0
-

where ^ means ``to the power of''.

-

We are using the base 10, and the positions 0,1,2 and 3. + 4 * 10^0

+

where ^ means ``to the power of''.

+

We are using the base 10, and the positions 0,1,2 and 3. The right-most position should NOT be multiplied with 10. The second from the right should be multiplied one time with 10. The third from the right is multiplied with 10 two times. This continues for whatever -positions are used.

-

It is the same in all other representations:

-

0x1234 will be

-
+positions are used.

+

It is the same in all other representations:

+

0x1234 will be

+
  1 * 16^3
  2 * 16^2
  3 * 16^1
- 4 * 16^0
-

01234 would be

-
+ 4 * 16^0
+

01234 would be

+
  1 * 8^3
  2 * 8^2
  3 * 8^1
- 4 * 8^0
-

This example can not be done for binary as that system can only use two -symbols. Another example:

-

%1010 would be

-
+ 4 * 8^0
+

This example can not be done for binary as that system can only use two +symbols. Another example:

+

%1010 would be

+
  1 * 2^3
  0 * 2^2
  1 * 2^1
- 0 * 2^0
-

It would have been more easy to convert it to its hexadecimal form and + 0 * 2^0

+

It would have been more easy to convert it to its hexadecimal form and just translate %1010 into 0xA. After a while you get used to it. You will -not need to do any calculations anymore but just know that 0xA means 10.

-

To convert a decimal number into a hexadecimal one you could use the next +not need to do any calculations anymore but just know that 0xA means 10.

+

To convert a decimal number into a hexadecimal one you could use the next method. It will take some time to be able to do the estimates but it will be more and more easy when you use the system more frequent. Another way -is presented to you thereafter.

-

First you will need to know how many positions will be used in the other +is presented to you thereafter.

+

First you will need to know how many positions will be used in the other system. To do so, you need to know the maximum numbers. Well, that's not so hard as it looks. In decimal, the maximum number that you can form with two digits is ``99''. The maximum for three: ``999''. The next number would need an extra position. Reverse this idea and you will see that the number can be found by taking 10^3 (10*10*10 is 1000) minus 1 or -10^2 minus one.

-

This can be done for hexadecimal too:

-
+10^2 minus one.

+

This can be done for hexadecimal too:

+
  16^4 = 0x10000 = 65536
  16^3 =  0x1000 =  4096
  16^2 =   0x100 =   256
- 16^1 =    0x10 =    16
-

If a number is smaller than 65536 it will thus fit in four positions. + 16^1 = 0x10 = 16

+

If a number is smaller than 65536 it will thus fit in four positions. If the number is bigger than 4095, you will need to use position 4. How many times can you take 4096 from the number without going below zero is the first digit you write down. This will always be a number -from 1 to 15 (0x1 to 0xF). Do the same for the other positions.

-

Number is 41029. It is smaller than 16^4 but bigger than 16^3-1. This +from 1 to 15 (0x1 to 0xF). Do the same for the other positions.

+

Number is 41029. It is smaller than 16^4 but bigger than 16^3-1. This means that we have to use four positions. We can subtract 16^3 from 41029 ten times without going below zero. The leftmost digit will be ``A'' so we have 0xA????. @@ -235,27 +238,27 @@ is therefore ``0'' and we know 0xA0??. 69 is smaller than 16^2 and bigger than 16^1-1. We can subtract 16^1 (which is just plain 16) four times and write down ``4'' to get 0xA04?. -Take 64 from 69 (69 - 4*16) and the last digit is 5 --> 0xA045.

-

The other method builds the number from the right. Take again 41029. -Divide by 16 and do not use fractions (only whole numbers).

-
+Take 64 from 69 (69 - 4*16) and the last digit is 5 --> 0xA045.

+

The other method builds the number from the right. Take again 41029. +Divide by 16 and do not use fractions (only whole numbers).

+
  41029 / 16 is 2564 with a remainder of 5. Write down 5.
  2564 / 16 is 160 with a remainder of 4. Write the 4 before the 5.
  160 / 16 is 10 with no remainder. Prepend 45 with 0.
- 10 / 16 is below one. End here and prepend 0xA. End up with 0xA045.
-

Which method to use is up to you. Use whatever works for you. Personally + 10 / 16 is below one. End here and prepend 0xA. End up with 0xA045.

+

Which method to use is up to you. Use whatever works for you. Personally I use them both without being able to tell what method I use in each case, it just depends on the number, I think. Fact is, some numbers will occur frequently while programming, if the number is close then I will use the first method (like 32770, translate into 32768 + 2 and -just know that it is 0x8000 + 0x2 = 0x8002).

-

For binary the same approach can be used. The base is 2 and not 16, +just know that it is 0x8000 + 0x2 = 0x8002).

+

For binary the same approach can be used. The base is 2 and not 16, and the number of positions will grow rapidly. Using the second method has the advantage that you can see very simple if you should write down a zero or a one: if you divide by two the remainder will be zero if it was an even number and one if it was an odd number: -

-
+

+
 
  41029 / 2 = 20514 remainder 1
  20514 / 2 = 10257 remainder 0
@@ -272,17 +275,17 @@
     10 / 2 =     5 remainder 0
      5 / 2 =     2 remainder 1
      2 / 2 =     1 remainder 0
-     1 / 2 below 0 remainder 1
-

Write down the results from right to left: %1010000001000101

-

Group by four:

-
+     1 / 2 below 0 remainder 1
+

Write down the results from right to left: %1010000001000101

+

Group by four:

+
  %1010000001000101
  %101000000100 0101
  %10100000 0100 0101
- %1010 0000 0100 0101
-

Convert into hexadecimal: 0xA045

-

Group %1010000001000101 by three and convert into octal:

-
+ %1010 0000 0100 0101
+

Convert into hexadecimal: 0xA045

+

Group %1010000001000101 by three and convert into octal:

+
  %1010000001000101
  %1010000001000 101
  %1010000001 000 101
@@ -290,23 +293,23 @@
  %1010 000 001 000 101
  %1 010 000 001 000 101
  %001 010 000 001 000 101
-    1   2   0   1   0   5 --> 0120105
-
+    1   2   0   1   0   5 --> 0120105
+
  So: %1010000001000101 = 0120105 = 0xA045 = 41029
  Or: 1010000001000101(2) = 120105(8) = A045(16) = 41029(10)
- Or: 1010000001000101(2) = 120105(8) = A045(16) = 41029
-

At first while adding numbers, you'll convert them to their decimal + Or: 1010000001000101(2) = 120105(8) = A045(16) = 41029

+

At first while adding numbers, you'll convert them to their decimal form and then back into their original form after doing the addition. If you use the other numbering system often, you will see that you'll be able to do arithmetics in the base that is used. In any representation it is the same, add the numbers on the right, write down the rightmost digit from the result, remember the other digits and use them in the next round. Continue with the second digits -from the right and so on:

-
-    %1010 + %0111 --> 10 + 7 --> 17 --> %00010001
-

will become

-
+from the right and so on:

+
+    %1010 + %0111 --> 10 + 7 --> 17 --> %00010001
+

will become

+
     %1010
     %0111 +
      ||||
@@ -316,30 +319,32 @@
      +----- add 1 + 0 + 1(remembered), result = 0, remember 1
             nothing to add, 1 remembered, result = 1
  --------
-   %10001 is the result, I like to write it as %00010001
-

For low values, try to do the calculations yourself, check them with + %10001 is the result, I like to write it as %00010001

+

For low values, try to do the calculations yourself, check them with a calculator. The more you do the calculations yourself, the more you find that you didn't make mistakes. In the end, you'll do calculi in -other bases as easy as you do in decimal.

-

When the numbers get bigger, you'll have to realize that a computer is +other bases as easy as you do in decimal.

+

When the numbers get bigger, you'll have to realize that a computer is not called a computer just to have a nice name. There are many different calculators available. Use them. For Unix you could use ``bc'' which is called so as it is short for Binary Calculator. It calculates not only -in decimal, but in all bases you'll ever use (among them Binary).

-

For people on Windows: +in decimal, but in all bases you'll ever use (among them Binary).

+

For people on Windows: Start the calculator (start->programs->accessories->calculator) and if necessary click view->scientific. You now have a scientific -calculator and can compute in binary or hexadecimal.

-

-


-

AUTHOR

-

I hope you enjoyed the examples and their descriptions. If you do, help +calculator and can compute in binary or hexadecimal.

+

+

+
+

AUTHOR

+

I hope you enjoyed the examples and their descriptions. If you do, help other people by pointing them to this document when they are asking basic questions. They will not only get their answer but at the same -time learn a whole lot more.

-

Alex van den Bogaerdt -<alex at ergens.op.het.net>

+time learn a whole lot more.

+

Alex van den Bogaerdt +<alex at ergens.op.het.net> +

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdcreate.pod ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdcreate.pod (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdcreate.pod 2003-02-20 15:24:00.000000000 -0800 @@ -76,7 +76,7 @@ will store the derivative of the line going from the last to the current value of the data source. This can be useful for gauges, for example, to measure the rate of people entering or leaving a -room. Internally, derive works exaclty like COUNTER but without +room. Internally, derive works exactly like COUNTER but without overflow checks. So if your counter does not reset at 32 or 64 bit you might want to use DERIVE and combine it with a MIN value of 0. Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdupdate.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdupdate.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdupdate.html 2003-02-20 15:24:00.000000000 -0800 @@ -1,90 +1,108 @@ - - -rrdupdate - - + + + +rrdupdate + + - + - +

-

-

NAME

-

rrdtool update - Store a new set of values into the rrd

-
PDF version.

-


-

SYNOPSIS

-

rrdtool update filename -[--template|-t ds-name[:ds-name]...] -N|timestamp:value[:value...] -[timestamp:value[:value...] ...]

-

-


-

DESCRIPTION

-

The update function feeds new data values into an RRD. The -data gets time aligned according to the properties of the RRD to -which the data is written.

-
-
filename
-
-The name of the RRD you want to update. -

-
--template|-t ds-name[:ds-name]...
-
+

+

+

NAME

+

rrdtool update - Store a new set of values into the rrd

+
PDF version.

+

+
+

SYNOPSIS

+

rrdtool update filename +[--template|-t ds-name[:ds-name]...] +N|timestamp:value[:value...] +[timestamp:value[:value...] ...]

+

+

+
+

DESCRIPTION

+

The update function feeds new data values into an RRD. The +data gets time aligned according to the properties of the RRD to +which the data is written.

+
+
filename
+
+
+The name of the RRD you want to update. +
+

+
--template|-t ds-name[:ds-name]...
+
+
by default, the update function expects the data input in the order, the data sources are defined in the RRD. This is not very error resistant, as you might be sending the wrong data into a RRD. -

The template switch allows you to specify which data sources you are +

+
+

The template switch allows you to specify which data sources you are going to update and in which order. If the data sources specified in the template are not available in the rrd file, the update process -will abort with an error message.

-

-
N|timestamp:value[:value...]
-
+will abort with an error message.

+
+

+
N|timestamp:value[:value...]
+
+
The data used for updating the RRD was acquired at a certain time. This time can either be defined in seconds since 1970-01-01. Or by using the letter 'N' the update time is set to be the current time. Negative time values are subtracted from the current time. Getting the timing right to the second is especially -important when you are working with data-sources of type COUNTER, -DERIVE or ABSOLUTE. -

The remaining elements of the argument are DS updates. The order of this list is +important when you are working with data-sources of type COUNTER, +DERIVE or ABSOLUTE. +

+
+

The remaining elements of the argument are DS updates. The order of this list is the same as the order the data sources were defined in the rra. If there is no data for a certain data-source, the letter -U (eg. N:0.1:U:1) can be defined.

-

The format of the value acquired from the data source is dependent of the +U (eg. N:0.1:U:1) can be defined.

+
+
+

The format of the value acquired from the data source is dependent of the data source type chosen. Normally it will be numeric, but the data acquisition modules may impose their very own parsing of this parameter as long as the colon -(:) remains the data source value separator.

-

-

-


-

EXAMPLE

-

rrdtool update demo1.rrd N:3.44:3.15:U:23

-

Update the database file demo1.rrd with 3 known and one *UNKNOWN* -value. Use the current time as the update time.

-

rrdtool update demo2.rrd 887457267:U 887457521:22 88745790:2.7

-

Update the database file demo2.rrd which expects data from a single -data-source, three times. First with an *UNKNOWN* value then with two -normal readings. The update interval seems to be around 300 seconds.

-

-


-

AUTHOR

-

Tobias Oetiker <oetiker at ee.ethz.ch>

+(:) remains the data source value separator.

+
+

+

+

+
+

EXAMPLE

+

rrdtool update demo1.rrd N:3.44:3.15:U:23

+

Update the database file demo1.rrd with 3 known and one *UNKNOWN* +value. Use the current time as the update time.

+

rrdtool update demo2.rrd 887457267:U 887457521:22 88745790:2.7

+

Update the database file demo2.rrd which expects data from a single +data-source, three times. First with an *UNKNOWN* value then with two +normal readings. The update interval seems to be around 300 seconds.

+

+

+
+

AUTHOR

+

Tobias Oetiker <oetiker at ee.ethz.ch>

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.es.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdtutorial.es.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.es.txt 2003-02-20 15:24:00.000000000 -0800 @@ -2,11 +2,11 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE rrdtutorial - Tutorial sobre RRDtool por Alex van den Bogaerdt (Traducido al castellano por Jes'us Couto Fandi~no) -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN //// DDDDEEEESSSSCCCCRRRRIIIIPPPPCCCCIIII''OO''OONNNN +DDEESSCCRRIIPPTTIIOONN RRDtool es un programa escrito por Tobias Oetiker con la colaboraci'on de muchas personas en diversas partes del mundo. Alex van den Bogaerdt escribi'o este documento para @@ -20,15 +20,15 @@ explica algunas ideas generales sobre estad'istica, con un enfoque particular hacia las redes. -TTTTUUUUTTTTOOOORRRRIIIIAAAALLLL - IIIImmmmppppoooorrrrttttaaaannnntttteeee +TTUUTTOORRIIAALL + IImmppoorrttaannttee ,iPor favor, no te adelantes en la lectura de este docu- mento! Esta primera parte explica los fundamentos b'asicos. Puede ser aburrida, pero si te saltas los fundamentos, los ejemplos no te van a tener mucho sentido. - ''cc''ccQQQQuuuu''ee''ee eeeessss RRRRRRRRDDDDttttoooooooollll???? + ''ccQQuu''ee eess RRRRDDttooooll?? RRDtool significa "herramienta de bases de datos en round robin". "Round robin" es una t'ecnica que implica un @@ -48,7 +48,7 @@ con estas bases de datos en "round-robin", guardando y recuperando datos de ellas. - ''cc''ccQQQQuuuu''ee''ee ddddaaaattttoooossss ppppuuuueeeeddddeeeennnn gggguuuuaaaarrrrddddaaaarrrrsssseeee eeeennnn uuuunnnnaaaa RRRRRRRRDDDD???? + ''ccQQuu''ee ddaattooss ppuueeddeenn gguuaarrddaarrssee eenn uunnaa RRRRDD?? Lo que se te ocurra. Debes poder medir alg'un valor dado en distintos momentos en el tiempo y proveer a RRDtool de @@ -68,7 +68,7 @@ mantienen. Son estos valores de estos contadores los que vamos a almacenar en la RRD. - ''cc''ccQQQQuuuu''ee''ee ppppuuuueeeeddddoooo hhhhaaaacccceeeerrrr ccccoooonnnn eeeessssttttaaaa hhhheeeerrrrrrrraaaammmmiiiieeeennnnttttaaaa???? + ''ccQQuu''ee ppuueeddoo hhaacceerr ccoonn eessttaa hheerrrraammiieennttaa?? RRDtool se deriva de MRTG (Multi Router Traffic Grapher, Graficador De Tr'afico de M'ultiples Enrutadores). MRTG @@ -95,7 +95,7 @@ medir los datos y seas capaz de pasarle los n'umeros a RRD- tool. - ''cc''ccYYYY ssssiiii aaaa''uu''uunnnn tttteeeennnnggggoooo pppprrrroooobbbblllleeeemmmmaaaassss ddddeeeessssppppuuuu''ee''eessss ddddeeee lllleeeeeeeerrrr eeeesssstttteeee ddddooooccccuuuummmmeeeennnnttttoooo???? + ''ccYY ssii aa''uunn tteennggoo pprroobblleemmaass ddeessppuu''eess ddee lleeeerr eessttee ddooccuummeennttoo?? Lo primero, ,il'eelo otra vez!. Puede que te hayas perdido de algo. Si no puedes compilar el c'odigo fuente y usas un @@ -116,12 +116,12 @@ con RRDtool para ver donde est'a el archivo y como usarlo. Te sugiero que te tomes un momento y te subscribas a la - lista ahora mismo, enviando un mensaje a rrd-users- - request at list.ee.ethz.ch con t'itulo "subscribe". Si even- - tualmente deseas salirte de la lista, env'ia otro correo a - la misma direcci'on, con t'itulo "unsubscribe". + lista ahora mismo, enviando un mensaje a + rrd-users-request at list.ee.ethz.ch con t'itulo "subscribe". + Si eventualmente deseas salirte de la lista, env'ia otro + correo a la misma direcci'on, con t'itulo "unsubscribe". - ''cc''ccCCCC''oo''oommmmoooo mmmmeeee vvvvaaaassss aaaa aaaayyyyuuuuddddaaaarrrr???? + ''ccCC''oommoo mmee vvaass aa aayyuuddaarr?? D'andote descripciones y ejemplos detallados. Asumimos que el seguir las instrucciones en el orden en que se presen- @@ -135,7 +135,7 @@ Necesitar'as saber algo sobre n'umeros hexadecimales. Si no, empieza por leer "bin_dec_hex" antes de continuar. - TTTTuuuu pppprrrriiiimmmmeeeerrrraaaa bbbbaaaasssseeee ddddeeee ddddaaaattttoooossss eeeennnn rrrroooouuuunnnndddd----rrrroooobbbbiiiinnnn + TTuu pprriimmeerraa bbaassee ddee ddaattooss eenn rroouunndd--rroobbiinn En mi opini'on, la mejor forma de aprender algo es haci'endolo. 'cPor qu'e no empezamos ya? Vamos a crear una @@ -241,7 +241,7 @@ (o sea, escribe: "rrdtool create test.rrd --start 920804400 DS ...") - ''cc''ccQQQQuuuu''ee''ee hhhheeeemmmmoooossss ccccrrrreeeeaaaaddddoooo???? + ''ccQQuu''ee hheemmooss ccrreeaaddoo?? Hemos creado una base de datos en round robin llamada test (test.rrd), que empieza desde el mediod'ia del d'ia en que @@ -357,7 +357,7 @@ Lo que representa exactamente esta salida lo vamos m'as adelante en el tutorial. - HHHHoooorrrraaaa ddddeeee hhhhaaaacccceeeerrrr aaaallllgggguuuunnnnoooossss ggggrrrr''aa''aaffffiiiiccccoooossss + HHoorraa ddee hhaacceerr aallgguunnooss ggrr''aaffiiccooss Prueba este comando: @@ -397,7 +397,7 @@ mostrar'an usando la URL ``file://el/camino/de/directo- rios/hasta/speed.gif'' - GGGGrrrr''aa''aaffffiiiiccccoooossss ccccoooonnnn uuuunnnn ppppooooccccoooo ddddeeee mmmmaaaatttteeeemmmm''aa''aattttiiiiccccaaaa + GGrr''aaffiiccooss ccoonn uunn ppooccoo ddee mmaatteemm''aattiiccaa Cuando veas la imagen, notar'as que el eje horizontal tiene unas etiquetas marcando las 12:10, 12:20, 12:30, 12:40 y @@ -488,8 +488,7 @@ Verifica si la velocidad en kmh es mayor que 100 ( kmh,100 ) GT Si es as'i, retorna la velocidad, si no, retorna 0 ((( kmh,100) GT ), kmh, 0) IF - - MMMMaaaaggggiiiiaaaa ggggrrrr''aa''aaffffiiiiccccaaaa + MMaaggiiaa ggrr''aaffiiccaa Me gusta creer que virtualmente no hay limites para lo que RRDtool puede hacer con los datos. No voy a explicarlo en @@ -531,7 +530,7 @@ taras darle al bot'on mientras presionas la tecla de may'usculas. - AAAAccccttttuuuuaaaalllliiiizzzzaaaacccciiiioooonnnneeeessss ddddeeee vvvveeeerrrrddddaaaadddd + AAccttuuaalliizzaacciioonneess ddee vveerrddaadd Ya hemos usado el comando ``update''; vimos que recibia uno o m'as par'ametros en el formato: ``:''. @@ -558,7 +557,7 @@ poner en un script. Luego de correrlo, basta con cargar index.html - UUUUnnnnaaaassss ppppaaaallllaaaabbbbrrrraaaassss ssssoooobbbbrrrreeee SSSSNNNNMMMMPPPP + UUnnaass ppaallaabbrraass ssoobbrree SSNNMMPP Me imagino que muy pocas personas ser'an capaces de obtener en su ordenador datos reales de su coche cada 5 minutos; @@ -591,8 +590,8 @@ acteres de la comunidad de lectura", como se le denomina en el mundillo SNMP. Muchos dispositivos aceptar'an "pub- lic" como cadena por defecto, pero por razones de privaci- - dad y seguridad esta clave puede estar deshabilitada. - Consulta la documentaci'on correspondiente al dispositivo o + dad y seguridad esta clave puede estar deshabilitada. Con- + sulta la documentaci'on correspondiente al dispositivo o programa. Luego esta el tercer par'ametro, llamado OID (Object IDen- @@ -658,8 +657,8 @@ Con suerte, usando este comando obtendr'as un n'umero como resultado: el n'umero de interfaces del dispositivo. Si es - as'i, seguiremos adelante con otro programa, llamado "snmp- - walk" + as'i, seguiremos adelante con otro programa, llamado + "snmpwalk" snmpwalk myrouter public interfaces.iftable.ifentry.ifdescr @@ -705,7 +704,7 @@ itivo con el que est'as probando, sigue adelante con el tutorial. Si no, vuelve a leer esta secci'on; es importante - UUUUnnnn eeeejjjjeeeemmmmpppplllloooo rrrreeeeaaaallll + UUnn eejjeemmpplloo rreeaall Ok, empecemos con la diversi'on. Primero, crea una base de datos nueva. Vamos a guardar en ella 2 contadores, "input" @@ -724,6 +723,7 @@ o menos esta cantidad de datos: + 600 muestras de 5 minutos: 2 d'ias y 2 horas 600 promedios de 30 minutos: 12.5 d'ias 600 promedios de 2 horas: 50 d'ias @@ -800,7 +800,7 @@ y en bits por segundo. Colorea el tr'afico Ethernet rojo si sobrepasa los cuatro megabits por segundo. - FFFFuuuunnnncccciiiioooonnnneeeessss ddddeeee ccccoooonnnnssssoooolllliiiiddddaaaacccciiii''oo''oonnnn + FFuunncciioonneess ddee ccoonnssoolliiddaaccii''oonn Unos cuantos p'arrafos atr'as habl'abamos sobre la posibili- dad de guardar el valor m'aximo en vez del promedio. Pro- @@ -874,7 +874,7 @@ recogidos para algo para lo cual no sirven. En ese caso, seria hasta mejor no tener gr'afico alguno. - RRRReeeeppppaaaasssseeeemmmmoooossss lllloooo qqqquuuueeee ssssaaaabbbbeeeemmmmoooossss + RReeppaasseemmooss lloo qquuee ssaabbeemmooss Ahora ya sabes como crear una base de datos. Puedes guardar valores en ella, extraerlos creando un gr'afico, @@ -892,7 +892,7 @@ resto del documento, sino en tu trabajo diario de monitor- izaci'on, mucho despu'es de terminar con esta introducci'on. - TTTTiiiippppoooossss ddddeeee ffffuuuueeeennnntttteeeessss ddddeeee ddddaaaattttoooossss + TTiippooss ddee ffuueenntteess ddee ddaattooss De acuerdo, quieres continuar. Bienvenido de vuelta otra vez y prep'arate; voy a ir m'as r'apido con los ejemplos y @@ -966,8 +966,7 @@ DEF:linec=all.rrd:c:AVERAGE LINE3:linec#0000FF:"Line C" \ DEF:lined=all.rrd:d:AVERAGE LINE3:lined#000000:"Line D" - - RRRRRRRRDDDDttttoooooooollll bbbbaaaajjjjoooo eeeellll mmmmiiiiccccrrrroooossssccccooooppppiiiioooo + RRRRDDttooooll bbaajjoo eell mmiiccrroossccooppiioo +o La l'inea A es un contador, por lo que debe incremen- @@ -1039,7 +1038,7 @@ constante en 300 segundos, por lo que la divisi'on nos da resultados cada vez mayores. - RRRReeeeiiiinnnniiiicccciiiiaaaalllliiiizzzzaaaacccciiii''oo''oonnnn ddddeeee lllloooossss ccccoooonnnnttttaaaaddddoooorrrreeeessss + RReeiinniicciiaalliizzaaccii''oonn ddee llooss ccoonnttaaddoorreess Todav'ia nos quedan algunas cosas por ver. Nos quedan algu- nas opciones importantes por cubrir, y aun no hemos @@ -1053,12 +1052,12 @@ KM. Por supuesto esto no es cierto, por lo que necesitamos alguna protecci'on contra estos casos. Esta protecci'on s'olo la tenemos para el tipo COUNTER, el cual de todas formas - era el que ten'iamos que haber usado para este tipo de - contador. 'cC'omo funciona? Los valores tipo COUNTER no - deben decrecer nunca, ,ipor lo que RRDtool asume en ese - caso que el contador se ha reinicializado! Si la diferen- - cia es negativa, esto se compensa sumando el valor m'aximo - del contador + 1. Para nuestro coche, tendr'iamos: + era el que ten'iamos que haber usado para este tipo de con- + tador. 'cC'omo funciona? Los valores tipo COUNTER no deben + decrecer nunca, ,ipor lo que RRDtool asume en ese caso que + el contador se ha reinicializado! Si la diferencia es neg- + ativa, esto se compensa sumando el valor m'aximo del conta- + dor + 1. Para nuestro coche, tendr'iamos: Delta = 7 - 999987 = -999980 (en vez de 1000007-999987=20) @@ -1114,12 +1113,6 @@ Diferencia: -4294967196 Correcci'on #1: -4294967196 + 4294967296 = 100 - - - - - - Antes: 18446744073709551000 Incremento: 800 Deber'ia ser: 18446744073709551800 @@ -1169,7 +1162,7 @@ correctos. Siempre examina bien el gr'afico si los valores parecen extra~nos. - RRRReeeemmmmuuuueeeessssttttrrrreeeeoooo ddddeeee lllloooossss ddddaaaattttoooossss + RReemmuueessttrreeoo ddee llooss ddaattooss Hay una funcionalidad importante de RRDtool que no hemos explicado todav'ia: es virtualmente imposible recoger los @@ -1185,13 +1178,13 @@ tarde y el intervalo es 303. La diferencia ser'a por tanto 303. Obviamente, RRDtool no debe colocar 303 en la base de datos y dar as'i la impresi'on de que el contador se incre- - ment'o 303 en 300 segundos. Aqu'i es donde RRDtool - interpola: alter'a el valor 303 al valor que tendr'ia 3 - segundos antes y guarda 300 en 300 segundos. Digamos que - la pr'oxima vez llegamos justo a tiempo; por tanto, el - intervalo actual es 297 segundos, por lo que el contador - deber'ia ser 297. De nuevo, RRDtool altera el valor y - guarda 300, como debe ser. + ment'o 303 en 300 segundos. Aqu'i es donde RRDtool inter- + pola: alter'a el valor 303 al valor que tendr'ia 3 segundos + antes y guarda 300 en 300 segundos. Digamos que la pr'oxima + vez llegamos justo a tiempo; por tanto, el intervalo + actual es 297 segundos, por lo que el contador deber'ia ser + 297. De nuevo, RRDtool altera el valor y guarda 300, como + debe ser. en RRD en realidad tiempo+000: 0 delta="U" tiempo+000: 0 delta="U" @@ -1235,7 +1228,7 @@ Los dos gr'aficos debe ser iguales. -RRRREEEESSSSUUUUMMMMEEEENNNN +RREESSUUMMEENN Es hora de concluir este documento. Ahora debes conocer lo b'asico como para trabajar con RRDtool y leer la docu- mentaci'on. A'un hay mucho m'as por descubrir acerca de RRD- @@ -1244,7 +1237,7 @@ f'acilmente muchos gr'aficos; tambi'en puedes usar las inter- faces disponibles. -LLLLIIIISSSSTTTTAAAA DDDDEEEE CCCCOOOORRRRRRRREEEEOOOO +LLIISSTTAA DDEE CCOORRRREEOO Recuerda subscribirte a la lista de correo. Aunque no con- testes los correos que aparecen en ella, te servir'a de ayuda a ti y a los dem'as. Mucho de lo que se sobre MRTG @@ -1255,10 +1248,10 @@ siempre hay preguntas que tu puedes responder con lo aprendido en este y otros documentos. -VVVVEEEERRRR TTTTAAAAMMMMBBBBIIII''EE''EENNNN +VVEERR TTAAMMBBII''EENN Las p'aginas del manual de RRDtool -AAAAUUUUTTTTOOOORRRR +AAUUTTOORR Espero que hayas disfrutado con los ejemplos y las descripciones. Si es as'i, ayuda a otros refiri'endolos a este documento cuando te hagan preguntas b'asicas. No s'olo @@ -1269,4 +1262,4 @@ -2002-02-26 1.0.40 RRDTUTORIAL.ES(1) +1.0.41 2003-01-20 RRDTUTORIAL.ES(1) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdtune.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdtune.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdtune.txt 2003-02-20 15:24:00.000000000 -0800 @@ -2,54 +2,54 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE rrdtool tune - Modify some basic properties of a Round Robin Database -SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS - rrrrrrrrddddttttoooooooollll ttttuuuunnnneeee _f_i_l_e_n_a_m_e [--------hhhheeeeaaaarrrrttttbbbbeeeeaaaatttt|----hhhh _d_s_-_n_a_m_e:_h_e_a_r_t_b_e_a_t] - [--------mmmmiiiinnnniiiimmmmuuuummmm|----iiii _d_s_-_n_a_m_e:_m_i_n] [--------mmmmaaaaxxxxiiiimmmmuuuummmm|----aaaa _d_s_-_n_a_m_e:_m_a_x] - [--------ddddaaaattttaaaa----ssssoooouuuurrrrcccceeee----ttttyyyyppppeeee|----dddd _d_s_-_n_a_m_e:_D_S_T] [--------ddddaaaattttaaaa----ssssoooouuuurrrrcccceeee---- - rrrreeeennnnaaaammmmeeee|----rrrr _o_l_d_-_n_a_m_e:_n_e_w_-_n_a_m_e] +SSYYNNOOPPSSIISS + rrrrddttooooll ttuunnee _f_i_l_e_n_a_m_e [----hheeaarrttbbeeaatt|--hh _d_s_-_n_a_m_e:_h_e_a_r_t_b_e_a_t] + [----mmiinniimmuumm|--ii _d_s_-_n_a_m_e:_m_i_n] [----mmaaxxiimmuumm|--aa _d_s_-_n_a_m_e:_m_a_x] + [----ddaattaa--ssoouurrccee--ttyyppee|--dd _d_s_-_n_a_m_e:_D_S_T] + [----ddaattaa--ssoouurrccee--rreennaammee|--rr _o_l_d_-_n_a_m_e:_n_e_w_-_n_a_m_e] -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN +DDEESSCCRRIIPPTTIIOONN The tune option allows you to alter some of the basic con- figuration values stored in the header area of a Round - Robin Database (RRRRRRRRDDDD). All these tunable parameters - together decide when data fed into an RRRRRRRRDDDD is to be + Robin Database (RRRRDD). All these tunable parameters + together decide when data fed into an RRRRDD is to be regarded as invalid. Invalid data is entered into the database as *UNKNOWN*. - The main application of the ttttuuuunnnneeee function is to relax the - validation rules on an RRRRRRRRDDDD. This allows to fill a new RRRRRRRRDDDD + The main application of the ttuunnee function is to relax the + validation rules on an RRRRDD. This allows to fill a new RRRRDD with data available in larger intervals than what you would normally want to permit. _f_i_l_e_n_a_m_e - The name of the RRRRRRRRDDDD you want to tune. + The name of the RRRRDD you want to tune. - --------hhhheeeeaaaarrrrttttbbbbeeeeaaaatttt|----hhhh _d_s_-_n_a_m_e:_h_e_a_r_t_b_e_a_t + ----hheeaarrttbbeeaatt|--hh _d_s_-_n_a_m_e:_h_e_a_r_t_b_e_a_t modify the _h_e_a_r_t_b_e_a_t of a data source. By setting this to a high value the rrd will accept things like one value per day ... - --------mmmmiiiinnnniiiimmmmuuuummmm|----iiii _d_s_-_n_a_m_e:_m_i_n + ----mmiinniimmuumm|--ii _d_s_-_n_a_m_e:_m_i_n alter the minimum value acceptable as input from the data source. Setting _m_i_n to 'U' will disable this limit. - --------mmmmaaaaxxxxiiiimmmmuuuummmm|----aaaa _d_s_-_n_a_m_e:_m_a_x + ----mmaaxxiimmuumm|--aa _d_s_-_n_a_m_e:_m_a_x alter the maximum value acceptable as input from the data source. Setting _m_a_x to 'U' will disable this limit. - --------ddddaaaattttaaaa----ssssoooouuuurrrrcccceeee----ttttyyyyppppeeee|----dddd _d_s_-_n_a_m_e:_D_S_T - alter the type DDDDSSSSTTTT of a data source. + ----ddaattaa--ssoouurrccee--ttyyppee|--dd _d_s_-_n_a_m_e:_D_S_T + alter the type DDSSTT of a data source. - [--------ddddaaaattttaaaa----ssssoooouuuurrrrcccceeee----rrrreeeennnnaaaammmmeeee|----rrrr _o_l_d_-_n_a_m_e:_n_e_w_-_n_a_m_e] + [----ddaattaa--ssoouurrccee--rreennaammee|--rr _o_l_d_-_n_a_m_e:_n_e_w_-_n_a_m_e] rename a data source -EEEEXXXXAAAAMMMMPPPPLLLLEEEE +EEXXAAMMPPLLEE "rrdtool tune data.rrd -h in:100000 -h out:100000 -h through:100000" @@ -59,9 +59,9 @@ data from mrtg-2.0 right into rrdtool without generating *UNKNOWN* entries. -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR Tobias Oetiker -2002-02-26 1.0.40 RRDTUNE(1) +1.0.41 2002-02-26 RRDTUNE(1) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdxport.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdxport.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdxport.txt 2003-02-20 15:24:00.000000000 -0800 @@ -2,24 +2,24 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE rrdtool xport - Export data in XML format based on data from one or several RRD -SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS - rrrrrrrrddddttttoooooooollll xxxxppppoooorrrrtttt [----ssss|--------ssssttttaaaarrrrtttt _s_e_c_o_n_d_s] [----eeee|--------eeeennnndddd _s_e_c_o_n_d_s] - [----mmmm|--------mmmmaaaaxxxxrrrroooowwwwssss _r_o_w_s] [--------sssstttteeeepppp _v_a_l_u_e] [DDDDEEEEFFFF::::_v_n_a_m_e====_r_r_d::::_d_s_- - _n_a_m_e::::_C_F] [CCCCDDDDEEEEFFFF::::_v_n_a_m_e====_r_p_n_-_e_x_p_r_e_s_s_i_o_n] [XXXXPPPPOOOORRRRTTTT::::_v_n_a_m_e[::::_l_e_g_- +SSYYNNOOPPSSIISS + rrrrddttooooll xxppoorrtt [--ss|----ssttaarrtt _s_e_c_o_n_d_s] [--ee|----eenndd _s_e_c_o_n_d_s] + [--mm|----mmaaxxrroowwss _r_o_w_s] [----sstteepp _v_a_l_u_e] [DDEEFF::_v_n_a_m_e==_r_r_d::_d_s_- + _n_a_m_e::_C_F] [CCDDEEFF::_v_n_a_m_e==_r_p_n_-_e_x_p_r_e_s_s_i_o_n] [XXPPOORRTT::_v_n_a_m_e[::_l_e_g_- _e_n_d]] -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN - The xxxxppppoooorrrrtttt functions main purpose is to write XML formatted - representation of the data stored in one or several RRRRRRRRDDDDs. +DDEESSCCRRIIPPTTIIOONN + The xxppoorrtt functions main purpose is to write XML formatted + representation of the data stored in one or several RRRRDDs. It can also extract numerical reports. If no _X_P_O_R_T statements are found, there will be no output. - ----ssss|--------ssssttttaaaarrrrtttt _s_e_c_o_n_d_s (default end-1day) + --ss|----ssttaarrtt _s_e_c_o_n_d_s (default end-1day) The time when the exported range should begin. Time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default @@ -28,38 +28,38 @@ mentation for a detailed explanation on how to specify time. - ----eeee|--------eeeennnndddd _s_e_c_o_n_d_s (default now) + --ee|----eenndd _s_e_c_o_n_d_s (default now) The time when the exported range should end. Time in seconds since epoch. See also AT-STYLE TIME SPECIFI- CATION section in the _r_r_d_f_e_t_c_h documentation for a detailed explanation of ways to specify time. - ----mmmm|--------mmmmaaaaxxxxrrrroooowwwwssss _r_o_w_s (default 400 rows) - This works like the ----wwww|--------wwwwiiiiddddtttthhhh parameter of _r_r_d_g_r_a_p_h. + --mm|----mmaaxxrroowwss _r_o_w_s (default 400 rows) + This works like the --ww|----wwiiddtthh parameter of _r_r_d_g_r_a_p_h. In fact it is exactly the same, but the parameter was renamed to describe its purpose in this module. See _r_r_d_g_r_a_p_h documentation for details. - --------sssstttteeeepppp _v_a_l_u_e (default automatic) + ----sstteepp _v_a_l_u_e (default automatic) See _r_r_d_g_r_a_p_h documentation. - DDDDEEEEFFFF::::_v_n_a_m_e====_r_r_d::::_d_s_-_n_a_m_e::::_C_F + DDEEFF::_v_n_a_m_e==_r_r_d::_d_s_-_n_a_m_e::_C_F See _r_r_d_g_r_a_p_h documentation. - CCCCDDDDEEEEFFFF::::_v_n_a_m_e====_r_p_n_-_e_x_p_r_e_s_s_i_o_n + CCDDEEFF::_v_n_a_m_e==_r_p_n_-_e_x_p_r_e_s_s_i_o_n See _r_r_d_g_r_a_p_h documentation. - XXXXPPPPOOOORRRRTTTT::::_v_n_a_m_e::::::::_l_e_g_e_n_d + XXPPOORRTT::_v_n_a_m_e::::_l_e_g_e_n_d At least one _X_P_O_R_T statement should be present. The values referenced by _v_n_a_m_e are printed. Optionally add a legend. - OOOOuuuuttttppppuuuutttt ffffoooorrrrmmmmaaaatttt + OOuuttppuutt ffoorrmmaatt - The output is enclosed in a xxxxppppoooorrrrtttt element and contains two - blocks. The first block is enclosed by a mmmmeeeettttaaaa element and + The output is enclosed in a xxppoorrtt element and contains two + blocks. The first block is enclosed by a mmeettaa element and contains some meta data. The second block is enclosed by a - ddddaaaattttaaaa element and contains the data rows. + ddaattaa element and contains the data rows. Let's assume that the _x_p_o_r_t command looks like this: @@ -106,14 +106,12 @@ 1020615600NaNNaN - -EEEEXXXXAAAAMMMMPPPPLLLLEEEE 1111 +EEXXAAMMPPLLEE 11 rrdtool xport \ DEF:out=if1-inouts.rrd:outoctets:AVERAGE \ XPORT:out:"out bytes" - -EEEEXXXXAAAAMMMMPPPPLLLLEEEE 2222 +EEXXAAMMPPLLEE 22 rrdtool xport \ DEF:out1=if1-inouts.rrd:outoctets:AVERAGE \ DEF:out2=if2-inouts.rrd:outoctets:AVERAGE \ @@ -122,10 +120,9 @@ XPORT:out2:"if2 out bytes" \ XPORT:sum:"output sum" - -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR Tobias Oetiker -2002-05-29 1.0.40 RRDXPORT(1) +1.0.41 2002-05-29 RRDXPORT(1) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.es.pod ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdtutorial.es.pod (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.es.pod 2003-02-20 15:24:00.000000000 -0800 @@ -7,7 +7,7 @@ =for html -=head1 DESCRIPTION / DESCRIPCI?N +=head1 DESCRIPTION RRDtool es un programa escrito por Tobias Oetiker con la colaboraci?n de muchas personas en diversas partes del mundo. Alex van Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdfetch.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdfetch.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdfetch.html 2003-02-20 15:24:01.000000000 -0800 @@ -1,174 +1,192 @@ - - -rrdfetch - - + + + +rrdfetch + + - + - +

-

-

NAME

-

rrdtool fetch - fetch data from an rrd.

-
PDF version.

-


-

SYNOPSIS

-

rrdtool fetch filename CF -[--resolution|-r resolution] -[--start|-s start] -[--end|-e end]

-

-


-

DESCRIPTION

-

The fetch function is normally used internally by the graph function, -to get data from RRDs. fetch will analyze the RRD and +

+

+

NAME

+

rrdtool fetch - fetch data from an rrd.

+
PDF version.

+

+
+

SYNOPSIS

+

rrdtool fetch filename CF +[--resolution|-r resolution] +[--start|-s start] +[--end|-e end]

+

+

+
+

DESCRIPTION

+

The fetch function is normally used internally by the graph function, +to get data from RRDs. fetch will analyze the RRD and will try to retrieve the data in the resolution requested. -The data fetched is printed to stdout. *UNKNOWN* data is often +The data fetched is printed to stdout. *UNKNOWN* data is often represented by the string ``NaN'' depending on your OSs printf -function.

-
-
filename
-
-the name of the RRD you want to fetch the data from. -

-
CF
-
+function.

+
+
filename
+
+
+the name of the RRD you want to fetch the data from. +
+

+
CF
+
+
which consolidation function should have been applied to the data you want to fetch? (AVERAGE,MIN,MAX,LAST) -

-
--resolution|-r resolution (default is the highest resolution)
-
-what interval should the values have (seconds per value). rrdfetch will try +
+

+
--resolution|-r resolution (default is the highest resolution)
+
+
+what interval should the values have (seconds per value). rrdfetch will try to match your request, but it will return data even if no absolute -match is possible. NB. See note below. -

-
--start|-s start (default end-1day)
-
+match is possible. NB. See note below. +
+

+
--start|-s start (default end-1day)
+
+
when should the data begin. A time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default one day worth of data will be fetched. See also AT-STYLE TIME SPECIFICATION section for a detailed explanation on ways to specify start time. -

-
--end|-e end (default now)
-
+
+

+
--end|-e end (default now)
+
+
when should the data end. Time in seconds since epoch. See also AT-STYLE TIME SPECIFICATION section for a detailed explanation of how to specify end time. -

-

-

RESOLUTION INTERVAL

-

In order to get rrdtool to fetch anything other than the finest resolution RRA -both the start and end time must be specified on boundaries that are -multiples of the wanted resolution. Consider the following example:

-
+
+

+

+

+

RESOLUTION INTERVAL

+

In order to get rrdtool to fetch anything other than the finest resolution RRA +both the start and end time must be specified on boundaries that are +multiples of the wanted resolution. Consider the following example:

+
  rrdtool create subdata.rrd -s 10 DS:ds0:GAUGE:300:0:U \
   RRA:AVERAGE:0.5:30:3600 \
   RRA:AVERAGE:0.5:90:1200 \
   RRA:AVERAGE:0.5:360:1200 \
   RRA:MAX:0.5:360:1200 \
   RRA:AVERAGE:0.5:8640:600 \
-  RRA:MAX:0.5:8640:600
-

This RRD collects data every 10 seconds and stores its averages over 5 minutes, -15 minutes, 1 hour and 1 day as well as the maxima for 1 hour and 1 day.

-

Consider now that you want too fetch the 15 minute average data for last hour. -So you might try

-
- rrdtool fetch subdata.rrd AVERAGE -r 900 -s -1h
-

However, this will almost always result in a time series that is NOT in the 15 + RRA:MAX:0.5:8640:600 +

This RRD collects data every 10 seconds and stores its averages over 5 minutes, +15 minutes, 1 hour and 1 day as well as the maxima for 1 hour and 1 day.

+

Consider now that you want too fetch the 15 minute average data for last hour. +So you might try

+
+ rrdtool fetch subdata.rrd AVERAGE -r 900 -s -1h
+

However, this will almost always result in a time series that is NOT in the 15 minute RRA. Therefore the highest resolution RRA, i.e. 5 minute averages, will -be chosen which, in this case, is not what you want.

-

Hence, make sure that

-
    -
  1. +be chosen which, in this case, is not what you want.

    +

    Hence, make sure that

    +
      +
    1. both start and end time are a multiple of 900 -

      -
    2. +

      +
    3. both start and end time are within the wanted RRA -

    -

    So, if time now is called ``t'',

    -
    +

+

So, if time now is called ``t'',

+
  do end time == int(t/900)*900,
- start time == end time -1hour, resolution == 900.
-

In e.g. bash this could look as:

-
+ start time == end time -1hour, resolution == 900.
+

In e.g. bash this could look as:

+
  TIME=$(date +%s); RRDRES=900; rrdtool fetch subdata.rrd AVERAGE -r $RRDRES \
- -e $(echo $(($TIME/$RRDRES*$RRDRES))) -s e-1h
-

Or in perl:

-
+ -e $(echo $(($TIME/$RRDRES*$RRDRES))) -s e-1h
+

Or in perl:

+
  perl -e '$ctime = time; $rrdres = 900; system "rrdtool fetch subdata.rrd AVERAGE \
- -r $rrdres -e @{[int($ctime/$rrdres)*$rrdres]} -s e-1h"'
-

-

AT-STYLE TIME SPECIFICATION

-

Apart from the traditional Seconds since epoch, rrdtool does also + -r $rrdres -e @{[int($ctime/$rrdres)*$rrdres]} -s e-1h"' +

+

+

AT-STYLE TIME SPECIFICATION

+

Apart from the traditional Seconds since epoch, rrdtool does also understand at-style time specification. The specification is called -``at-style'' after Unix command at(1) that has moderately complex ways +``at-style'' after Unix command at(1) that has moderately complex ways to specify time to run your job at. The at-style specification -consists of two parts: TIME REFERENCE specification and TIME -OFFSET specification.

-

-

TIME REFERENCE SPECIFICATION

-

Time reference specification is used, well,... to establish a reference +consists of two parts: TIME REFERENCE specification and TIME +OFFSET specification.

+

+

+

TIME REFERENCE SPECIFICATION

+

Time reference specification is used, well,... to establish a reference moment in time (for time offset to be applied to). When present, -it should come first, when omitted, it defaults to now. On its own part, -time reference consists of time-of-day reference (which should come -first, if present) and day reference.

-

Time-of-day can be specified as HH:MM, HH.MM, -or just HH, you can suffix it with am or pm or use +it should come first, when omitted, it defaults to now. On its own part, +time reference consists of time-of-day reference (which should come +first, if present) and day reference.

+

Time-of-day can be specified as HH:MM, HH.MM, +or just HH, you can suffix it with am or pm or use 24-hours clock. The few special times of day are understood as well, -these include midnight (00:00), noon (12:00) and British -teatime (16:00).

-

The day can be specified as month-name day-of-the-month -and optional 2- or 4-digit year number (e.g. March 8 1999). -Alternatively, you can use day-of-week-name (e.g. Monday), -or one of the words: yesterday, today, tomorrow. -You can also specify day as a full date in several numerical formats; -these include: MM/DD/[YY]YY, DD.MM.[YY]YY, YYYYMMDD.

-

NOTE1: this is different from the original at(1) behavior, -which interprets a single-number date as MMDD[YY]YY.

-

NOTE2: if you specify day this way, the time-of-day is REQUIRED -to be present.

-

Finally, you can use words now, start, or end as your time -reference. Now refers to the current moment (and is also a default -time reference). Start (end) can be used to specify time +these include midnight (00:00), noon (12:00) and British +teatime (16:00).

+

The day can be specified as month-name day-of-the-month +and optional 2- or 4-digit year number (e.g. March 8 1999). +Alternatively, you can use day-of-week-name (e.g. Monday), +or one of the words: yesterday, today, tomorrow. +You can also specify day as a full date in several numerical formats; +these include: MM/DD/[YY]YY, DD.MM.[YY]YY, YYYYMMDD.

+

NOTE1: this is different from the original at(1) behavior, +which interprets a single-number date as MMDD[YY]YY.

+

NOTE2: if you specify day this way, the time-of-day is REQUIRED +to be present.

+

Finally, you can use words now, start, or end as your time +reference. Now refers to the current moment (and is also a default +time reference). Start (end) can be used to specify time relative to the start (end) time for those tools that use these -categories (rrdfetch, rrdgraph).

-

Month and weekday names can be used in their naturally abbreviated form -(e.g., Dec for December, Sun for Sunday, etc.). The words now, -start, end can be abbreviated to n, s, e.

-

-

TIME OFFSET SPECIFICATION

-

Time offset specification is used to add (or subtract) certain time -interval to (from) the time reference moment. It consists of sign -(+ or -) and amount. The following time units can be used -to specify the amount: years, months, weeks, days, -hours, minutes, seconds, these can be used in singular +categories (rrdfetch, rrdgraph).

+

Month and weekday names can be used in their naturally abbreviated form +(e.g., Dec for December, Sun for Sunday, etc.). The words now, +start, end can be abbreviated to n, s, e.

+

+

+

TIME OFFSET SPECIFICATION

+

Time offset specification is used to add (or subtract) certain time +interval to (from) the time reference moment. It consists of sign +(+ or -) and amount. The following time units can be used +to specify the amount: years, months, weeks, days, +hours, minutes, seconds, these can be used in singular or plural form, and abbreviated naturally or to a single letter (e.g. +3days, -1wk, -3y). Several time units can be combined together (e.g., -5mon1w2d), as well as several time offsets can be -concatenated (e.g., -5h45min = -5h-45min = -6h+15min = -7h+1h30m-15min, etc.)

-

NOTE3: If you specify time offset in days, weeks, months, or years, +concatenated (e.g., -5h45min = -5h-45min = -6h+15min = -7h+1h30m-15min, etc.)

+

NOTE3: If you specify time offset in days, weeks, months, or years, you will end with the time offset that may vary depending on you time reference, because all those time units have no single well defined time interval value (1 year contains either 365 or 366 days, 1 month @@ -177,10 +195,10 @@ To cope with this, when you use days, weeks, months, or years as your time offset units your time reference date is adjusted accordingly without taking too much further effort to ensure anything -about it (in the hope that mktime(3) will take care of this later). +about it (in the hope that mktime(3) will take care of this later). This may lead to some surprising (or even invalid!) results, e.g. 'May 31 -1month' = 'Apr 31' (meaningless) = 'May 1' -(after mktime(3) normalization); in the EET timezone +(after mktime(3) normalization); in the EET timezone '3:30am Mar 29 1999 -1 day' yields '3:30am Mar 28 1999' (Sunday) which is invalid time/date combination (because of 3am -> 4am DST forward clock adjustment, see the below example). @@ -190,54 +208,56 @@ '8:00 Mar 29 1999', but since there is 1-hour DST forward clock adjustment takes place around 3:00 Mar 28 1999, the actual time interval between 8:00 Mar 27 1999 and 8:00 Mar 29 1999 equals 47 hours; on the other hand, -'8:00 Mar 27 1999 +48 hours' = '9:00 Mar 29 1999', as expected)

-

NOTE4: The single-letter abbreviation for both months and minutes -is m. To disambiguate, the parser tries to read your mind :) -by applying the following two heuristics:

-
    -
  1. -If m is used in context of (i.e. right after the) years, -months, weeks, or days it is assumed to mean months, while +'8:00 Mar 27 1999 +48 hours' = '9:00 Mar 29 1999', as expected)

    +

    NOTE4: The single-letter abbreviation for both months and minutes +is m. To disambiguate, the parser tries to read your mind :) +by applying the following two heuristics:

    +
      +
    1. +If m is used in context of (i.e. right after the) years, +months, weeks, or days it is assumed to mean months, while in the context of hours, minutes, and seconds it means minutes. -(e.g., in -1y6m or +3w1m m means months, while in --3h20m or +5s2m m means minutes) -

      -
    2. -Out of context (i.e. right after the + or - sign) the -meaning of m is guessed from the number it directly follows. +(e.g., in -1y6m or +3w1m m means months, while in +-3h20m or +5s2m m means minutes) +

      +
    3. +Out of context (i.e. right after the + or - sign) the +meaning of m is guessed from the number it directly follows. Currently, if the number absolute value is below 25 it is assumed -that m means months, otherwise it is treated as minutes. +that m means months, otherwise it is treated as minutes. (e.g., -25m == -25 minutes, while +24m == +24 months) -

    -

    Final NOTES: Time specification is case-insensitive. +

+

Final NOTES: Time specification is case-insensitive. Whitespace can be inserted freely or omitted altogether, there are, however, cases when whitespace is required (e.g., 'midnight Thu'). In this case you should either quote the whole phrase to prevent it from being taken apart by your shell or use '_' (underscore) or ',' (comma) which also count as whitespace -(e.g., midnight_Thu or midnight,Thu)

-

-

TIME SPECIFICATION EXAMPLES

-

Oct 12 -- October 12 this year

-

-1month or -1m -- current time of day, only a month before -(may yield surprises, see the NOTE3 above)

-

noon yesterday -3hours -- yesterday morning; can be put also as 9am-1day

-

23:59 31.12.1999 -- 1 minute to the year 2000

-

12/31/99 11:59pm -- 1 minute to the year 2000 for imperialists

-

12am 01/01/01 -- start of the new millennium

-

end-3weeks or e-3w -- 3 weeks before end time -(may be used as start time specification)

-

start+6hours or s+6h -- 6 hours after start time -(may be used as end time specification)

-

931225537 -- 18:45 July 5th, 1999 -(yes, seconds since 1970 are valid as well)

-

19970703 12:45 -- 12:45 July 3th, 1997 -(not quote standard, but I love this ...)

-

-


-

AUTHOR

-

Tobias Oetiker <oetiker at ee.ethz.ch>

+(e.g., midnight_Thu or midnight,Thu)

+

+

+

TIME SPECIFICATION EXAMPLES

+

Oct 12 -- October 12 this year

+

-1month or -1m -- current time of day, only a month before +(may yield surprises, see the NOTE3 above)

+

noon yesterday -3hours -- yesterday morning; can be put also as 9am-1day

+

23:59 31.12.1999 -- 1 minute to the year 2000

+

12/31/99 11:59pm -- 1 minute to the year 2000 for imperialists

+

12am 01/01/01 -- start of the new millennium

+

end-3weeks or e-3w -- 3 weeks before end time +(may be used as start time specification)

+

start+6hours or s+6h -- 6 hours after start time +(may be used as end time specification)

+

931225537 -- 18:45 July 5th, 1999 +(yes, seconds since 1970 are valid as well)

+

19970703 12:45 -- 12:45 July 3th, 1997 +(not quote standard, but I love this ...)

+

+

+
+

AUTHOR

+

Tobias Oetiker <oetiker at ee.ethz.ch>

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/bin_dec_hex.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/bin_dec_hex.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/bin_dec_hex.txt 2003-02-20 15:24:01.000000000 -0800 @@ -2,10 +2,10 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE Binary Decimal Hexadecimal - How does it work -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN +DDEESSCCRRIIPPTTIIOONN Most people use the decimal numbering system. This system uses ten symbols to represent numbers. When those ten sym- bols are used up, they start all over again and increment @@ -74,7 +74,7 @@ the decimal system. If we are talking about another num- bering system, we'll have to make that clear. There are a few wide-spread methods to do so. One common form is to - write _1_0_1_0(2) which means that you wrote down a number in + write 1010(2) which means that you wrote down a number in the binary form. It is the number ten. If you would write 1010 it means the number one thousand and ten. @@ -94,7 +94,7 @@ We can use the binary form when talking to computers (...programming...) but the numbers will have large rep- resentations. The number 65535 would be written down as - _1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1(2) which is 16 times the digit 1. This + 1111111111111111(2) which is 16 times the digit 1. This is difficult and prone to errors. Therefore we normally would use another base, called hexadecimal. It uses 16 different symbols. First the symbols from the decimal sys- @@ -400,7 +400,7 @@ view->scientific. You now have a scientific calculator and can compute in binary or hexadecimal. -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR I hope you enjoyed the examples and their descriptions. If you do, help other people by pointing them to this docu- ment when they are asking basic questions. They will not @@ -411,4 +411,4 @@ -2002-02-26 1.0.40 BIN_DEC_HEX(1) +1.0.41 2002-02-26 BIN_DEC_HEX(1) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdinfo.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdinfo.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdinfo.html 2003-02-20 15:24:01.000000000 -0800 @@ -1,50 +1,55 @@ - - -rrdinfo - - + + + +rrdinfo + + - + - +

-

-

NAME

-

rrdtool info - extract header information from an rrd

-
PDF version.

-


-

SYNOPSIS

-

rrdtool info filename.rrd

-

-


-

DESCRIPTION

-

The info function prints the header information from an rrd in -a parsing friendly format.

-

Check the rrdcreate manpage if you are uncertain about the meaning of the -individual keys.

-

-


-

EXAMPLE

-

This is the output generated by running info on a simple rrd which +

+

+

NAME

+

rrdtool info - extract header information from an rrd

+
PDF version.

+

+
+

SYNOPSIS

+

rrdtool info filename.rrd

+

+

+
+

DESCRIPTION

+

The info function prints the header information from an rrd in +a parsing friendly format.

+

Check the rrdcreate manpage if you are uncertain about the meaning of the +individual keys.

+

+

+
+

EXAMPLE

+

This is the output generated by running info on a simple rrd which contains two datasources and one rra. Note that the number after the -last_update keyword is in seconds since 1970. The string NaN -stands for *UNKNOWN* data. In the example it means that this rrd +last_update keyword is in seconds since 1970. The string NaN +stands for *UNKNOWN* data. In the example it means that this rrd has neither minimum not maximum values defined for either of its -datasources.

-
+datasources.

+
  filename = "randome.rrd"
  rrd_version = "0001"
  step = 300
@@ -68,17 +73,20 @@
  rra[0].cdp_prep[0].value = nan
  rra[0].cdp_prep[0].unknown_datapoints = 0
  rra[0].cdp_prep[1].value = nan
- rra[0].cdp_prep[1].unknown_datapoints = 0
-
-
filename.rrd
-
-The name of the RRD you want to dump. -

-

-


-

AUTHOR

-

Tobias Oetiker <oetiker at ee.ethz.ch>

+ rra[0].cdp_prep[1].unknown_datapoints = 0
+
+
filename.rrd
+
+
+The name of the RRD you want to dump. +
+

+

+

+
+

AUTHOR

+

Tobias Oetiker <oetiker at ee.ethz.ch>

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/RRDp.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/RRDp.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/RRDp.html 2003-02-20 15:24:01.000000000 -0800 @@ -1,90 +1,109 @@ - - -RRDp - - + + + +RRDp + + - + - +

-

-

NAME

-

RRDp - Attach rrdtool from within a perl script via a set of pipes;

-

-


-

SYNOPSIS

-

use RRDp

-

RRDp::start path to rrdtool executable

-

RRDp::cmd rrdtool commandline

-

$answer = RRD::read

-

$status = RRD::end

-

$RRDp::user, $RRDp::sys, $RRDp::real

-

-


-

DESCRIPTION

-

With this module you can safely communicate with the rrdtool.

-

After every RRDp::cmd you have to issue an RRDp::read command to get -rrdtools answer to your command. The answer is returned as a pointer, +

+

+

NAME

+

RRDp - Attach rrdtool from within a perl script via a set of pipes;

+

+

+
+

SYNOPSIS

+

use RRDp

+

RRDp::start path to rrdtool executable

+

RRDp::cmd rrdtool commandline

+

$answer = RRD::read

+

$status = RRD::end

+

$RRDp::user, $RRDp::sys, $RRDp::real

+

+

+
+

DESCRIPTION

+

With this module you can safely communicate with the rrdtool.

+

After every RRDp::cmd you have to issue an RRDp::read command to get +rrdtools answer to your command. The answer is returned as a pointer, in order to speed things up. If the last command did not return any -data, RRDp::read will return an undefined variable.

-

If you import the PERFORMANCE variables into your namespace, -you can access rrdtools internal performance measurements.

-
-
use RRDp
-
+data, RRDp::read will return an undefined variable.

+

If you import the PERFORMANCE variables into your namespace, +you can access rrdtools internal performance measurements.

+
+
use RRDp
+
+
Load the RRDp::pipe module. -

-
RRDp::start path to rrdtool executable
-
+
+

+
RRDp::start path to rrdtool executable
+
+
start rrdtool. The argument must be the path to the rrdtool executable -

-
RRDp::cmd rrdtool commandline
-
+
+

+
RRDp::cmd rrdtool commandline
+
+
pass commands on to rrdtool. check the rrdtool documentation for more info on the rrdtool commands. -

-
$answer = RRDp::read
-
+
+

+
$answer = RRDp::read
+
+
read rrdtools response to your command. Note that the $answer variable will only contain a pointer to the returned data. The reason for this is, that rrdtool can potentially return quite excessive amounts of data and we don't want to copy this around in memory. So when you want to access the contents of $answer you have to use $$answer which dereferences the variable. -

-
$status = RRDp::end
-
+
+

+
$status = RRDp::end
+
+
terminates rrdtool and returns rrdtools status ... -

-
$RRDp::user, $RRDp::sys, $RRDp::real
-
+
+

+
$RRDp::user, $RRDp::sys, $RRDp::real
+
+
these variables will contain totals of the user time, system time and real time as seen by rrdtool. User time is the time rrdtool is running, System time is the time spend in system calls and real time is the total time rrdtool has been running. -

The difference between user + system and real is the time spent +

+
+

The difference between user + system and real is the time spent waiting for things like the hard disk and new input from the perl -script.

-

-

-


-

EXAMPLE

-
+script.

+
+

+

+

+
+

EXAMPLE

+
  use RRDp;
  RRDp::start "/usr/local/bin/rrdtool";
  RRDp::cmd   qw(create demo.rrd --step 100 
@@ -92,16 +111,18 @@
                RRA:AVERAGE:0.5:1:10);
  $answer = RRDp::read;
  print $$answer;
- ($usertime,$systemtime,$realtime) =  ($RRDp::user,$RRDp::sys,$RRDp::real);
-

-


-

SEE ALSO

-

For more information on how to use rrdtool, check the manpages.

-

-


-

AUTHOR

-

Tobias Oetiker <oetiker at ee.ethz.ch>

+ ($usertime,$systemtime,$realtime) = ($RRDp::user,$RRDp::sys,$RRDp::real); +

+

+
+

SEE ALSO

+

For more information on how to use rrdtool, check the manpages.

+

+

+
+

AUTHOR

+

Tobias Oetiker <oetiker at ee.ethz.ch>

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdgraph.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdgraph.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdgraph.html 2003-02-20 15:24:01.000000000 -0800 @@ -1,167 +1,219 @@ - - -rrdgraph - - + + + +rrdgraph + + - + - +

-

-

NAME

-

rrdtool graph - Create a graph based on data from one or several RRD

-
PDF version.

-


-

SYNOPSIS

-

rrdtool graph filename -[-s|--start seconds] -[-e|--end seconds] -[-x|--x-grid x-axis grid and label] -[-y|--y-grid y-axis grid and label] -[--alt-y-grid] -[--alt-y-mrtg] -[--alt-autoscale] -[--alt-autoscale-max] -[--units-exponent] value]> -[-v|--vertical-label text] -[-w|--width pixels] -[-h|--height pixels] -[-i|--interlaced] -[-f|--imginfo formatstring] -[-a|--imgformat GIF|PNG|GD] -[-B|--background value] -[-O|--overlay value] -[-U|--unit value] -[-z|--lazy] -[-o|--logarithmic] -[-u|--upper-limit value] -[-l|--lower-limit value] -[-g|--no-legend] -[-r|--rigid] -[--step value] -[-b|--base value] -[-c|--color COLORTAG#rrggbb] -[-t|--title title] -[DEF:vname=rrd:ds-name:CF] -[CDEF:vname=rpn-expression] -[PRINT:vname:CF:format] -[GPRINT:vname:CF:format] -[COMMENT:text] -[HRULE:value#rrggbb[:legend]] -[VRULE:time#rrggbb[:legend]] -[LINE{1|2|3}:vname[#rrggbb[:legend]]] -[AREA:vname[#rrggbb[:legend]]] -[STACK:vname[#rrggbb[:legend]]]

-

-


-

DESCRIPTION

-

The graph functions main purpose is to create graphical -representations of the data stored in one or several RRDs. Apart -from generating graphs, it can also extract numerical reports.

-
-
filename
-
-The name of the graph to generate. Since rrdtool outputs +

+

+

NAME

+

rrdtool graph - Create a graph based on data from one or several RRD

+
PDF version.

+

+
+

SYNOPSIS

+

rrdtool graph filename +[-s|--start seconds] +[-e|--end seconds] +[-x|--x-grid x-axis grid and label] +[-y|--y-grid y-axis grid and label] +[-Y|--alt-y-grid] +[-R|--alt-y-mrtg] +[-A|--alt-autoscale] +[-M|--alt-autoscale-max] +[-N|--no-minor] +[-X|--units-exponent] value]> +[-v|--vertical-label text] +[-w|--width pixels] +[-h|--height pixels] +[-i|--interlaced] +[-f|--imginfo formatstring] +[-a|--imgformat GIF|PNG|GD] +[-B|--background value] +[-O|--overlay value] +[-U|--unit value] +[-z|--lazy] +[-o|--logarithmic] +[-u|--upper-limit value] +[-l|--lower-limit value] +[-g|--no-legend] +[-r|--rigid] +[-S|--step value] +[-b|--base value] +[-c|--color COLORTAG#rrggbb] +[-t|--title title] +[DEF:vname=rrd:ds-name:CF] +[CDEF:vname=rpn-expression] +[PRINT:vname:CF:format] +[GPRINT:vname:CF:format] +[COMMENT:text] +[HRULE:value#rrggbb[:legend]] +[VRULE:time#rrggbb[:legend]] +[LINE{1|2|3}:vname[#rrggbb[:legend]]] +[AREA:vname[#rrggbb[:legend]]] +[STACK:vname[#rrggbb[:legend]]]

+

+

+
+

DESCRIPTION

+

The graph functions main purpose is to create graphical +representations of the data stored in one or several RRDs. Apart +from generating graphs, it can also extract numerical reports.

+
+
filename
+
+
+The name of the graph to generate. Since rrdtool outputs GIFs and PNGs, it's recommended that the filename end in either -.gif or .png. rrdtool does not enforce this, however. -If the filename is set to '-' the image file will be written +.gif or .png. rrdtool does not enforce this, however. +If the filename is set to '-' the image file will be written to standard out. All other output will get suppressed. -

PNG output is recommended, since it takes up to 40% less disk space -and 20-30% less time to generate than a GIF file.

-

If no graph functions are called, the graph will not be created.

-

-
-s|--start seconds (default end-1day)
-
+
+
+

PNG output is recommended, since it takes up to 40% less disk space +and 20-30% less time to generate than a GIF file.

+
+
+

If no graph functions are called, the graph will not be created.

+
+

+
-s|--start seconds (default end-1day)
+
+
The time when the graph should begin. Time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default one day worth of data will be graphed. -See also AT-STYLE TIME SPECIFICATION section in the rrdfetch +See also AT-STYLE TIME SPECIFICATION section in the rrdfetch documentation for a detailed explanation on how to specify time. -

-
-e|--end seconds (default now)
-
+
+

+
-e|--end seconds (default now)
+
+
The time when the graph should end. Time in seconds since epoch. -See also AT-STYLE TIME SPECIFICATION section in the rrdfetch +See also AT-STYLE TIME SPECIFICATION section in the rrdfetch documentation for a detailed explanation of ways to specify time. -

-
-x|--x-grid x-axis grid and label (default autoconfigure)
-
+
+

+
-x|--x-grid x-axis grid and label (default autoconfigure)
+
+
The x-axis label is quite complex to configure. So if you don't have very special needs, you can rely on the autoconfiguration to get this right. -

If you want no x-grid at all, use the magic setting none.

-

The x-axis label and grid can be configured, using the following format:

-

GTM:GST:MTM:MST:LTM:LST:LPR:LFM

-

You have to configure three elements making up the x-axis labels and -grid. The base grid (G??), the major grid (M??) and the labels -(L??). The configuration is based on the idea that you first -specify a well known amount of time (?TM) and then say how many -times it has to pass between each grid line or label (?ST). For the +

+
+

If you want no x-grid at all, use the magic setting none.

+
+
+

The x-axis label and grid can be configured, using the following format:

+
+
+

GTM:GST:MTM:MST:LTM:LST:LPR:LFM

+
+
+

You have to configure three elements making up the x-axis labels and +grid. The base grid (G??), the major grid (M??) and the labels +(L??). The configuration is based on the idea that you first +specify a well known amount of time (?TM) and then say how many +times it has to pass between each grid line or label (?ST). For the label you have to define two additional items: The precision of the -label in seconds (LPR) and the strftime format used to generate the -text of the label (LFM).

-

The ?TM elements must be one of the following keywords: SECOND, -MINUTE, HOUR, DAY, WEEK, MONTH or YEAR.

-

If you wanted a graph with a base grid every 10 minutes and a major +label in seconds (LPR) and the strftime format used to generate the +text of the label (LFM).

+
+
+

The ?TM elements must be one of the following keywords: SECOND, +MINUTE, HOUR, DAY, WEEK, MONTH or YEAR.

+
+
+

If you wanted a graph with a base grid every 10 minutes and a major one every hour, with labels every hour you would use the following -x-axis definition.

-

MINUTE:10:HOUR:1:HOUR:1:0:%X

-

The precision in this example is 0 because the %X format is exact. If +x-axis definition.

+
+
+

MINUTE:10:HOUR:1:HOUR:1:0:%X

+
+
+

The precision in this example is 0 because the %X format is exact. If the label was the name of the day, we would have had a precision of 24 hours, because when you say something like 'Monday' you mean the whole day and not Monday morning 00:00. Thus the label should be positioned at noon. By defining a precision of 24 hours or rather 86400 seconds, -you make sure that this happens.

-

If you want to alter the genertated text to another language, use the +you make sure that this happens.

+
+
+

If you want to alter the genertated text to another language, use the LC_TIME environment variable to set the locale you prefere prior to calling -the graph function.

-

-
-y|--y-grid grid step:label factor (default autoconfigure)
-
-Makes vertical grid lines appear at grid step interval. Every -label factor gridstep, a major grid line is printed, along with +the graph function.

+
+

+
-y|--y-grid grid step:label factor (default autoconfigure)
+
+
+Makes vertical grid lines appear at grid step interval. Every +label factor gridstep, a major grid line is printed, along with label showing the value of the grid line. -

If you want no y-grid at all set specify the magic word none.

-

-
--alt-y-grid
-
+
+
+

If you want no y-grid at all set specify the magic word none.

+
+

+
-Y|--alt-y-grid
+
+
Place Y grid dynamically based on graph Y range. Algorithm ensures that you always have grid, that there are enough but not too many grid lines and the grid is metric. That is grid lines are placed every 1, 2, 5 or 10 units. (contributed by Sasha Mikheev) -

-
--alt-y-mrtg
-
+
+

+
--no-minor
+
+
+Turn off the minor grid lines. This is partcularly useful for small +graphs which can be cluttered with the minor grid lines. (contributed +by Travis Brown) +
+

+
-R|--alt-y-mrtg
+
+
Y grid placed on graph Y range mimmics mrtg's (rateup-generated) graphs. Currently axis is split into 4 parts, just as rateup does. -

-
--alt-autoscale
-
+
+

+
-A|--alt-autoscale
+
+
Compute Y range based on function absolute minimum and maximum values. Default algorithm uses predefined set of ranges. This is good in many cases but it fails miserably when you need @@ -170,17 +222,21 @@ almost straight line. With --alt-autoscale Y range will be from slightly less the 260 - 0.001 to slightly more then 260 + 0.001 and periodic behavior will be seen. (contributed by Sasha Mikheev) -

-
--alt-autoscale-max
-
+
+

+
-M|--alt-autoscale-max
+
+
Where --alt-autoscale will modify both the absolute maximum AND minimum values, this option will only affect the maximum value. The minimum value, if not defined on the command line, will be 0. This option can be useful when graphing router traffic when the WAN line uses compression, and thus the throughput may be higher than the WAN line speed. -

-
--units-exponent value (default autoconfigure)
-
+
+

+
-X|--units-exponent value (default autoconfigure)
+
+
This sets the 10**exponent scaling of the y-axis values. Normally values will be scaled to the appropriate units (k, M, etc.). However you may wish to display units always in k (Kilo, 10e3) even if the data @@ -190,135 +246,181 @@ display the y-axis values in k (Kilo, 10e3, thousands), use -6 to display the y-axis values in u (Micro, 10e-6, millionths). Use a value of 0 to prevent any scaling of the y-axis values. -

-
-v|--vertical-label text
-
+
+

+
-v|--vertical-label text
+
+
vertical label on the left side of the graph. This is normally used to specify the units used. -

-
-w|--width pixels (default 400 pixel)
-
+
+

+
-w|--width pixels (default 400 pixel)
+
+
Width of the drawing area within the graph. This affects the size of the gif. -

-
-h|--height pixels (default 100 pixel)
-
+
+

+
-h|--height pixels (default 100 pixel)
+
+
Width of the drawing area within the graph. This affects the size of the gif. -

-
-i|--interlaced (default: false)
-
+
+

+
-i|--interlaced (default: false)
+
+
If you set this option, then the resulting GIF will be interlaced. Most web browsers display these incrementally as they load. If you do not use this option, the GIFs default to being progressive scanned. The only effect of this option is to control the format of the GIF on disk. It makes no changes to the layout or contents of the graph. -

-
-f|--imginfo formatstring
-
+
+

+
-f|--imginfo formatstring
+
+
After the image has been created, the graph function uses printf together with this format string to create output similar to the PRINT function, only that the printf is supplied with the parameters -filename, xsize and ysize. In order to generate an IMG tag +filename, xsize and ysize. In order to generate an IMG tag suitable for including the graph into a web page, the command line would look like this: -
- --imginfo '<IMG SRC="/img/%s" WIDTH="%lu" HEIGHT="%lu" ALT="Demo">'
-

-
-a|--imgformat GIF|PNG|GD (default: GIF)
-
+
+
+
+ --imginfo '<IMG SRC="/img/%s" WIDTH="%lu" HEIGHT="%lu" ALT="Demo">'
+
+

+
-a|--imgformat GIF|PNG|GD (default: GIF)
+
+
Allows you to produce PNG or GD output from rrdtool. -

-
-B|--background value
-
+
+

+
-B|--background value
+
+
You could use image in (currently only) GD format for background. It is used as background at the very beginning of graph creation. -

-
-O|--overlay value
-
+
+

+
-O|--overlay value
+
+
You could use image in (currently only) GD format as overlay. It is placed over created graph so that white pixel (color 255,255,255) is considered transparent, all other is replacing corresponding pixel in created graph. -

-
-U|--unit value
-
+
+

+
-U|--unit value
+
+
You could use unit to be displayed on y axis. It is wise to use only short units on graph, however. -

-
-z|--lazy (default: false)
-
+
+

+
-z|--lazy (default: false)
+
+
Only generate the graph, if the current gif is out of date or not existent. -

-
-u|--upper-limit value (default autoconfigure)
-
+
+

+
-u|--upper-limit value (default autoconfigure)
+
+
Defines the value normally located at the upper border of the graph. If the graph contains higher values, the upper border will move upwards to accomodate these values as well. -

If you want to define an upper-limit which will not move in any -event you have to set the --rigid option as well.

-

-
-l|--lower-limit value (default autoconfigure)
-
+
+
+

If you want to define an upper-limit which will not move in any +event you have to set the --rigid option as well.

+
+

+
-l|--lower-limit value (default autoconfigure)
+
+
This is not the lower limit of a graph. But rather, this is the maximum lower bound of a graph. For example, the value -100 will result in a graph that has a lower limit of -100 or less. Use this keyword to expand graphs down. -

-
-r|--rigid
-
+
+

+
-r|--rigid
+
+
rigid boundaries mode. Normally rrdgraph will automatically expand the lower and upper limit if the graph contains a value outside the valid range. With the r option you can disable this behavior -

-
-b|--base value
-
+
+

+
-b|--base value
+
+
if you are graphing memory (and NOT network traffic) this switch should be set to 1024 so that one Kb is 1024 byte. For traffic measurement, 1 kb/s is 1000 b/s. -

-
-o|--logarithmic
-
+
+

+
-o|--logarithmic
+
+
logarithmic y-axis scaling -

-
-c|--color COLORTAG#rrggbb (default colors)
-
-override the colors for the standard elements of the graph. The COLORTAG -must be one of the following symbolic names: BACK ground, CANVAS, -SHADEA left/top border, SHADEB right/bottom border, GRID, MGRID -major grid, FONT, FRAME and axis of the graph or ARROW. This option +
+

+
-c|--color COLORTAG#rrggbb (default colors)
+
+
+override the colors for the standard elements of the graph. The COLORTAG +must be one of the following symbolic names: BACK ground, CANVAS, +SHADEA left/top border, SHADEB right/bottom border, GRID, MGRID +major grid, FONT, FRAME and axis of the graph or ARROW. This option can be called multiple times to set several colors. -

-
-g|--no-legend
-
+
+

+
-g|--no-legend
+
+
Suppress generation of legend; only render the graph. -

-
-t|--title text (default no title)
-
+
+

+
-t|--title text (default no title)
+
+
Define a title to be written into the graph -

-
--step value (default automatic)
-
-By default rrdgraph calculates the width of one pixle in the time domain and +
+

+
-S|--step value (default automatic)
+
+
+By default rrdgraph calculates the width of one pixel in the time domain and tries to get data at that resolution from the RRD. With this switch you can override this behaviour. If you want rrdgraph to get data at 1 hour resolution from the RRD, then you can set the step to 3600 seconds. Note, -that a step smaller than 1 pixle will be silently ignored. -

-
DEF:vname=rrd:ds-name:CF
-
+that a step smaller than 1 pixel will be silently ignored. +
+

+
DEF:vname=rrd:ds-name:CF
+
+
Define virtual name for a data source. This name can then be used in the functions explained below. The -DEF call automatically chooses an RRA which contains CF consolidated data in a +DEF call automatically chooses an RRA which contains CF consolidated data in a resolution appropriate for the size of the graph to be drawn. Ideally -this means that one data point from the RRA should be represented -by one pixel in the graph. If the resolution of the RRA is higher +this means that one data point from the RRA should be represented +by one pixel in the graph. If the resolution of the RRA is higher than the resolution of the graph, the data in the RRA will be further -consolidated according to the consolidation function (CF) chosen. -

-
CDEF:vname=rpn-expression
-
+consolidated according to the consolidation function (CF) chosen. +
+

+
CDEF:vname=rpn-expression
+
+
Create a new virtual data source by evaluating a mathematical expression, specified in Reverse Polish Notation (RPN). If you have ever used a traditional HP calculator you already know RPN. The idea behind RPN notation is, @@ -326,9 +428,11 @@ you execute an operation, it takes as many data values from the stack as needed. The pushing of data is implicit, so when ever you specify a number or a variable, it gets pushed automatically. -

If this is all a big load of incomprehensible words for you, maybe an +

+
+

If this is all a big load of incomprehensible words for you, maybe an example helps (a more complete explanation is given in [1]): The -expression vname+3/2 becomes vname,3,2,/,+ in RPN. First the three +expression vname+3/2 becomes vname,3,2,/,+ in RPN. First the three values get pushed onto the stack (which now contains (the current value of) vname, a 3 and a 2). Then the / operator pops two values from the stack (3 and 2), divides the first argument by the second @@ -336,228 +440,302 @@ operator pops two values (vname and 1.5) from the stack; both values are added up and the result gets pushes back onto the stack. In the end there is only one value left on the stack: The result of the -expression.

-

The rpn-expression in the CDEF function takes both, constant values -as well as vname variables. The following operators can be used on these -values:

-
-
+, -, *, /, %
-
+expression.

+
+
+

The rpn-expression in the CDEF function takes both, constant values +as well as vname variables. The following operators can be used on these +values:

+
+
+
+, -, *, /, %
+
+
pops two values from the stack applies the selected operator and pushes the result back onto the stack. The % operator stands for the modulo operation. -

-
SIN, COS, LOG, EXP, FLOOR, CEIL
-
+
+

+
SIN, COS, LOG, EXP, FLOOR, CEIL
+
+
pops one value from the stack, applies the selected function and pushes the result back onto the stack. -

-
LT, LE, GT, GE, EQ
-
+
+

+
LT, LE, GT, GE, EQ
+
+
pops two values from the stack, compares them according to the selected condition and pushes either 1 back onto the stack if the condition is true and 0 if the condition was not true. -

-
IF
-
+
+

+
IF
+
+
pops three values from the stack. If the last value is not 0, the second value will be pushed back onto the stack, otherwise the first value is pushed back. -

If the stack contains the values A, B, C, D, E are presently on the +

+
+

If the stack contains the values A, B, C, D, E are presently on the stack, the IF operator will pop the values E D and C of the stack. It will look at C and if it is not 0 it will push D back onto the stack, otherwise -E will be sent back to the stack.

-

-
MIN, MAX
-
+E will be sent back to the stack.

+
+

+
MIN, MAX
+
+
selects the lesser or larger of the two top stack values respectively -

-
LIMIT
-
-replaces the value with *UNKNOWN* if it is outside the limits specified +
+

+
LIMIT
+
+
+replaces the value with *UNKNOWN* if it is outside the limits specified by the two values above it on the stack. -
- CDEF:a=alpha,0,100,LIMIT
-

-
DUP, EXC, POP
-
+
+
+
+ CDEF:a=alpha,0,100,LIMIT
+
+

+
DUP, EXC, POP
+
+
These manipulate the stack directly. DUP will duplicate the top of the stack, pushing the result back onto the stack. EXC will exchange the top two elements of the stack, and POP will pop off the top element of the stack. Having insufficient elements on the stack for these operations is an error. -

-
UN
-
-Pops one value off the stack, if it is *UNKNOWN*, 1 will be pushed +
+

+
UN
+
+
+Pops one value off the stack, if it is *UNKNOWN*, 1 will be pushed back otherwise 0. -

-
UNKN
-
-Push an *UNKNOWN* value onto the stack. -

-
PREV
-
-Push *UNKNOWN* if its at the first value of a data set or otherwise +
+

+
UNKN
+
+
+Push an *UNKNOWN* value onto the stack. +
+

+
PREV
+
+
+Push *UNKNOWN* if its at the first value of a data set or otherwise the value of this CDEF at the previous time step. This allows you to perform calculations across the data. -

-
PREV(vname)
-
-Push *UNKNOWN* if its at the first value of the data set named vname +
+

+
PREV(vname)
+
+
+Push *UNKNOWN* if its at the first value of the data set named vname or otherwise the value of the CDEF named vname at the previous time step. This allows you to perform complex calculations across the data. -

-
INF, NEGINF
-
+
+

+
INF, NEGINF
+
+
Push a positive or negative infinite (oo) value onto the stack. When drawing an infinite number it appears right at the top or bottom edge of the graph, depending whether you have a positive or negative infinite number. -

-
NOW
-
+
+

+
NOW
+
+
Push the current (real world) time onto the stack. -

-
TIME
-
+
+

+
TIME
+
+
Push the time the current sample was taken onto the stack. This is the number of non-skip seconds since 0:00:00 January 1, 1970. -

-
LTIME
-
-This is like TIME + current timezone offset in seconds. The current +
+

+
LTIME
+
+
+This is like TIME + current timezone offset in seconds. The current offset takes daylight saving time into account, given your OS supports this. If you were looking at a sample, in Zurich, in summer, the offset would be 2*3600 seconds, as Zurich at that time of year is 2 hours ahead of UTC. -

Note that the timezone offset is always calculated for the time the +

+
+

Note that the timezone offset is always calculated for the time the current sample was taken at. It has nuthing todo with the time you are -doing the calculation.

-

-

Please note that you may only use vname variables that you -previously defined by either DEF or CDEF. Furthermore, as of -this writing (version 0.99.25), you must use at least one vname +doing the calculation.

+
+

+

Please note that you may only use vname variables that you +previously defined by either DEF or CDEF. Furthermore, as of +this writing (version 0.99.25), you must use at least one vname per expression, that is ``CDEF:fourtytwo=2,40,+'' will yield an error -message but not a vname fourtytwo that's always equal to 42.

-
PRINT:vname:CF:format
-
-Calculate the chosen consolidation function CF over the data-source -variable vname and printf the result to stdout using format. -In the format string there should be a '%lf' or '%le' marker in the +message but not a vname fourtytwo that's always equal to 42.

+
PRINT:vname:CF:format
+
+
+Calculate the chosen consolidation function CF over the data-source +variable vname and printf the result to stdout using format. +In the format string there should be a '%lf'or '%le' marker in the place where the number should be printed. -

If an additional '%s' is found AFTER the marker, the value will be scaled +

+
+

If an additional '%s' is found AFTER the marker, the value will be scaled and an appropriate SI magnitude unit will be printed in place of the '%s' -marker. The scaling will take the '--base' argument into consideration!

-

If a '%S' is used instead of a '%s', then instead of calculating the +marker. The scaling will take the '--base' argument into consideration!

+
+
+

If a '%S' is used instead of a '%s', then instead of calculating the appropriate SI magnitude unit for this value, the previously calculated SI magnitude unit will be used. This is useful if you want all the values in a PRINT statement to have the same SI magnitude unit. If there was no previous SI magnitude calculation made, then '%S' behaves like a '%s', unless the value is 0, in which case it does not remember a SI magnitude unit and a SI magnitude unit will only be calculated when the next '%s' is -seen or the next '%S' for a non-zero value.

-

If you want to put a '%' into your PRINT string, use '%%' instead.

-

-
GPRINT:vname:CF:format
-
-Same as PRINT but the result is printed into the graph below the legend. -

-

Caveat: When using the PRINT and GRPRINT functions to +seen or the next '%S' for a non-zero value.

+ +
+

If you want to put a '%' into your PRINT string, use '%%' instead.

+
+

+
GPRINT:vname:CF:format
+
+
+Same as PRINT but the result is printed into the graph below the legend. +
+

+

Caveat: When using the PRINT and GRPRINT functions to calculate data summaries over time periods bounded by the current time, it is important to note that the last sample will almost always yield a value of UNKNOWN as it lies after the last update time. This -can result in slight data skewing, particularly with the AVERAGE +can result in slight data skewing, particularly with the AVERAGE function. In order to avoid this, make sure that your end time is at -least one heartbeat prior to the current time.

-
-
COMMENT:text
-
-Like GPRINT but the text is simply printed into the graph. -

-
HRULE:value#rrggbb[:legend]
-
+least one heartbeat prior to the current time.

+
+
COMMENT:text
+
+
+Like GPRINT but the text is simply printed into the graph. +
+

+
HRULE:value#rrggbb[:legend]
+
+
Draw a horizontal rule into the graph and optionally add a legend -

-
VRULE:time#rrggbb[:legend]
-
+
+

+
VRULE:time#rrggbb[:legend]
+
+
Draw a vertical rule into the graph and optionally add a legend -

-
LINE{1|2|3}:vname[#rrggbb[:legend]]
-
+
+

+
LINE{1|2|3}:vname[#rrggbb[:legend]]
+
+
Plot for the requested data, using the color specified. Write a legend -into the graph. The 3 possible keywords LINE1, LINE2, and LINE3 +into the graph. The 3 possible keywords LINE1, LINE2, and LINE3 generate increasingly wide lines. If no color is defined, the drawing is done 'blind' this is useful in connection with the -STACK function when you want to ADD the values of two +STACK function when you want to ADD the values of two data-sources without showing it in the graph. -

-
AREA:vname[#rrggbb[:legend]]
-
-Does the same as LINE?, but the area between 0 and +
+

+
AREA:vname[#rrggbb[:legend]]
+
+
+Does the same as LINE?, but the area between 0 and the graph will be filled with the color specified. -

-
STACK:vname[#rrggbb[:legend]]
-
-Does the same as LINE?, but the graph gets stacked on top of the previous -LINE?, AREA or STACK graph. Depending on the type of the -previous graph, the STACK will be either a LINE? or an AREA. -This obviously implies that the first STACK must be preceded by an -AREA or LINE? -- you need something to stack something onto in +
+

+
STACK:vname[#rrggbb[:legend]]
+
+
+Does the same as LINE?, but the graph gets stacked on top of the previous +LINE?, AREA or STACK graph. Depending on the type of the +previous graph, the STACK will be either a LINE? or an AREA. +This obviously implies that the first STACK must be preceded by an +AREA or LINE? -- you need something to stack something onto in the first place ;) -

Note, that when you STACK onto *UNKNOWN* data, rrdtool will not draw +

+
+

Note, that when you STACK onto *UNKNOWN* data, rrdtool will not draw any graphics ... *UNKNOWN* is not zero ... if you want it to zero then you might want to use a CDEF argument with IF and UN functions to -turn *UNKNOWN* into zero ...

-

-

-


-

NOTES on legend arguments

-

-

Escaping the colon

-

In a ':' in a legend argument will mark the end of the legend. To +turn *UNKNOWN* into zero ...

+
+

+

+

+
+

NOTES on legend arguments

+

+

+

Escaping the colon

+

In a ':' in a legend argument will mark the end of the legend. To enter a ':' into a legend, the colon must be escaped with a backslash '\:'. Beware, that many environments look for backslashes themselves, so it may -be necessary to write two backslashes so that one is passed onto rrd_graph.

-

-

String Formatting

-

The text printed below the actual graph can be formated by appending special +be necessary to write two backslashes so that one is passed onto rrd_graph.

+

+

+

String Formatting

+

The text printed below the actual graph can be formated by appending special escaped characters at the end of a text. When ever such a character occurs, all pending text is pushed onto the graph according to the character -specified.

-

Valid markers are: \j for justified, \l for left aligned, \r for -right aligned and \c for centered. In the next section there is an -example showing how to use centered formating.

-

Normally there are two space characters inserted between every two items +specified.

+

Valid markers are: \j for justified, \l for left aligned, \r for +right aligned and \c for centered. In the next section there is an +example showing how to use centered formating.

+

Normally there are two space characters inserted between every two items printed into the graph. The space following a string can be suppressed by -putting a \g at the end of the string. The \g also squshes any space +putting a \g at the end of the string. The \g also squshes any space inside the string if it is at the very end of the string. This can be used -in connection with %s to supress empty unit strings.

-
- GPRINT:a:MAX:%lf%s\g
-

A special case is COMMENT:\s this inserts some additional vertical space -before placing the next row of legends.

-

-


-

NOTE on Return Values

-

Whenever rrd_graph gets called, it prints a line telling the size of -the gif it has just created to STDOUT. This line looks like this: XSIZExYSIZE.

-

-


-

EXAMPLE 1

-
+in connection with %s to supress empty unit strings.

+
+ GPRINT:a:MAX:%lf%s\g
+

A special case is COMMENT:\s this inserts some additional vertical space +before placing the next row of legends.

+

When text has to be formated without special instructions from your side, +rrdtool will automatically justify the text as soon as one string goes over +the right edge. If you want to prevent the justification without forcing a +newline, you can use the special tag \J at the end of the string to +disable the auto justification.

+

+

+
+

NOTE on Return Values

+

Whenever rrd_graph gets called, it prints a line telling the size of +the gif it has just created to STDOUT. This line looks like this: XSIZExYSIZE.

+

+

+
+

EXAMPLE 1

+
   rrdtool graph demo.gif --title="Demo Graph" \
           DEF:cel=demo.rrd:exhaust:AVERAGE \
           "CDEF:far=cel,1.8,*,32,+"" \
           LINE2:cel#00a000:"D. Celsius" \
-          LINE2:far#ff0000:"D. Fahrenheit\c"
-

-


-

EXAMPLE 2

-

This example demonstrates the syntax for using IF and UN to set -*UNKNOWN* values to 0. This technique is useful if you are + LINE2:far#ff0000:"D. Fahrenheit\c"

+

+

+
+

EXAMPLE 2

+

This example demonstrates the syntax for using IF and UN to set +*UNKNOWN* values to 0. This technique is useful if you are aggregating interface data where the start dates of the data sets -doesn't match.

-
+doesn't match.

+
   rrdtool graph demo.gif --title="Demo Graph" \
          DEF:idat1=interface1.rrd:ds0:AVERAGE \
          DEF:idat2=interface2.rrd:ds0:AVERAGE \
@@ -567,24 +745,23 @@
          CDEF:aggoutput=odat1,UN,0,odat1,IF,odat2,UN,0,odat2,IF,+,8,* \
          AREA:agginput#00cc00:Input Aggregate \
          LINE1:aggoutput#0000FF:Output Aggregate
-
-
-
-Assuming that idat1 has a data value of I<*UNKNOWN*>, the CDEF expression
-
- idat1,UN,0,idat1,IF
-

leaves us with a stack with contents of 1,0,NaN and the IF function + +Assuming that idat1 has a data value of I<*UNKNOWN*>, the CDEF expression

+
+ idat1,UN,0,idat1,IF
+

leaves us with a stack with contents of 1,0,NaN and the IF function will pop off the 3 values and replace them with 0. If idat1 had a real value like 7942099, then the stack would have 0,0,7942099 and the -real value would be the replacement.

-

-


-

EXAMPLE 3

-

This example shows two ways to use the INF function. First it makes +real value would be the replacement.

+

+

+
+

EXAMPLE 3

+

This example shows two ways to use the INF function. First it makes the background change color during half of the hours. Then, it uses AREA and STACK to draw a picture. If one of the inputs was UNKNOWN, -all inputs are overlaid with another AREA.

-
+all inputs are overlaid with another AREA.

+
   rrdtool graph example.png --title="INF demo" \
          DEF:val1=some.rrd:ds0:AVERAGE \
          DEF:val2=some.rrd:ds1:AVERAGE \
@@ -597,30 +774,32 @@
          STACK:val2#00C000:Value2 \
          STACK:val3#FFFF00:Value3 \
          STACK:val4#FFC000:Value4 \
-         AREA:wipeout#FF0000:Unknown
-

The first CDEF uses val4 as a dummy value. It's value is removed immediately + AREA:wipeout#FF0000:Unknown

+

The first CDEF uses val4 as a dummy value. It's value is removed immediately from the stack. Then a decision is made based on the time that a sample was taken. If it is an even hour (UTC time !) then the area will be filled. If -it is not, the value is set to UNKN and is not plotted.

-

The second CDEF looks if any of val1,val2,val3,val4 is unknown. It does so by +it is not, the value is set to UNKN and is not plotted.

+

The second CDEF looks if any of val1,val2,val3,val4 is unknown. It does so by checking the outcome of sum(val1,val2,val3,val4). Again, INF is returned when -the condition is true, UNKN is used to not plot the data.

-

The different items are plotted in a particular order. First do the background, then use a +the condition is true, UNKN is used to not plot the data.

+

The different items are plotted in a particular order. First do the background, then use a normal area to overlay it with data. Stack the other data until they are all plotted. Last but not least, overlay everything with eye-hurting red -to signal any unknown data.

-

Note that this example assumes that your data is in the positive half of the y-axis +to signal any unknown data.

+

Note that this example assumes that your data is in the positive half of the y-axis otherwhise you would would have to add NEGINF in order to extend the coverage -of the rea to whole graph.

-

-


-

AUTHOR

-

Tobias Oetiker <oetiker at ee.ethz.ch>

-

-


-

REFERENCES

-

[1] http://www.dotpoint.com/xnumber/rpn_or_adl.htm

+of the rea to whole graph.

+

+

+
+

AUTHOR

+

Tobias Oetiker <oetiker at ee.ethz.ch>

+

+

+
+

REFERENCES

+

[1] http://www.dotpoint.com/xnumber/rpn_or_adl.htm

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdtutorial.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.html 2003-02-20 15:24:01.000000000 -0800 @@ -1,78 +1,84 @@ - - -rrdtutorial - - + + + +rrdtutorial + + - + - +

-

-

NAME

-

rrdtutorial - Alex van den Bogaerdt's RRDtool tutorial

-
PDF version.

-


-

DESCRIPTION

-

RRDtool is written by Tobias Oetiker <oetiker at ee.ethz.ch> with +

+

+

NAME

+

rrdtutorial - Alex van den Bogaerdt's RRDtool tutorial

+
PDF version.

+

+
+

DESCRIPTION

+

RRDtool is written by Tobias Oetiker <oetiker at ee.ethz.ch> with contributions from many people all around the world. This document is -written by Alex van den Bogaerdt <alex at ergens.op.het.net> to help you -understand what RRDtool is and what it can do for you.

-

The documentation provided with RRDtool can be too technical for some +written by Alex van den Bogaerdt <alex at ergens.op.het.net> to help you +understand what RRDtool is and what it can do for you.

+

The documentation provided with RRDtool can be too technical for some people. This tutorial is here to help you understand the basics of RRDtool. It should prepare you to read the documentation yourself. It also explains the general things about statistics with a focus on -networking.

-

-


-

TUTORIAL

-

-

Important

-

Please don't skip ahead in this document! The first part of this +networking.

+

+

+
+

TUTORIAL

+

+

+

Important

+

Please don't skip ahead in this document! The first part of this document explains the basics and may be boring. But if you don't -understand the basics, the examples will not be as meaningful to you.

-

-

What is RRDtool ?

-

RRDtool refers to Round Robin Database tool. +understand the basics, the examples will not be as meaningful to you.

+

+

+

What is RRDtool ?

+

RRDtool refers to Round Robin Database tool. Round robin is a technique that works with a fixed amount of data, and a pointer to the current element. Think of a circle with some dots plotted on the edge, these dots are the places where data can be stored. Draw an @@ -83,23 +89,25 @@ the process automatically reuses old locations. This way, the database will not grow in size and therefore requires no mainenance. RRDtool works with with Round Robin Databases (RRDs). It stores and retrieves -data from them.

-

-

What data can be put into an RDD ?

-

You name it, it will probably fit. You should be able to measure some value +data from them.

+

+

+

What data can be put into an RDD ?

+

You name it, it will probably fit. You should be able to measure some value at several points in time and provide this information to RRDtool. If you can do this, RRDtool will be able to store it. The values need to be -numerical but don't have to be, as opposed to MRTG, integers.

-

Many examples talk about SNMP which is an acronym for +numerical but don't have to be, as opposed to MRTG, integers.

+

Many examples talk about SNMP which is an acronym for Simple Network Management Protocol. ``Simple'' refers to the protocol -- it does not mean it is simple to manage or monitor a network. After working your way through this document, you should know enough to be able to understand what people are talking about. For now, just realize that SNMP is a way to ask devices for the values of counters they keep. -It is the value from those counters that are kept in the RRD.

-

-

What can I do with this tool ?

-

RRDtool originated from MRTG (Multi Router Traffic Grapher). MRTG started +It is the value from those counters that are kept in the RRD.

+

+

+

What can I do with this tool ?

+

RRDtool originated from MRTG (Multi Router Traffic Grapher). MRTG started as a tiny little script for graphing the use of a connection to the Internet. MRTG evolved into a tool for graphing other data sources including temperature, speed, voltage, number of printouts and @@ -114,48 +122,51 @@ consumption, number of visitors at an exhibition, noise levels near an airport, temperature on your favorite holiday location, temperature in the fridge and whatever you imagination can come up with. You need a sensor to -measure the data and be able to feed the numbers to RRDtool.

-

-

What if I still have problems after reading this document ?

-

First of all: read it again! You may have missed something. +measure the data and be able to feed the numbers to RRDtool.

+

+

+

What if I still have problems after reading this document ?

+

First of all: read it again! You may have missed something. If you are unable to compile the sources and you have a fairly common OS, it will probably not be the fault of RRDtool. There may be precompiled versions around on the Internet. If they come from trusted sources, get one of those. If on the other hand the program works but does not give you the expected results, it will be a problem with configuring it. Review -your configuration and compare it with the examples that follow.

-

There is a mailing list and an archive of it. Read the list for a few +your configuration and compare it with the examples that follow.

+

There is a mailing list and an archive of it. Read the list for a few weeks and search the archive. It is considered rude to just ask a question without searching the archives: your problem may already have been solved for somebody else! This is true for most, if not all, mailing lists and not only for this particular list! Look in the documentation that -came with RRDtool for the location and usage of the list.

-

I suggest you take a moment to subscribe to the mailing list right now -by sending an email to <rrd-users-request at list.ee.ethz.ch> with a +came with RRDtool for the location and usage of the list.

+

I suggest you take a moment to subscribe to the mailing list right now +by sending an email to <rrd-users-request at list.ee.ethz.ch> with a subject of ``subscribe''. If you ever want to leave this list, you write -an email to the same address but now with a subject of ``unsubscribe''.

-

-

How will you help me ?

-

By giving you some detailed descriptions with detailed examples. +an email to the same address but now with a subject of ``unsubscribe''.

+

+

+

How will you help me ?

+

By giving you some detailed descriptions with detailed examples. It is assumed that following the instructions in the order presented will give you enough knowledge of RRDtool to experiment for yourself. If it doesn't work the first time, don't give up. Reread the stuff that you did understand, you may have missed something. By following the examples you get some hands-on experience and, even -more important, some background information of how it works.

-

You will need to know something about hexadecimal numbers. If you don't -then start with reading the bin_dec_hex manpage before you continue here.

-

-

Your first Round Robin Database

-

In my opinion the best way to learn something is to actually do it. +more important, some background information of how it works.

+

You will need to know something about hexadecimal numbers. If you don't +then start with reading the bin_dec_hex manpage before you continue here.

+

+

+

Your first Round Robin Database

+

In my opinion the best way to learn something is to actually do it. Why not start right now? We will create a database, put some values in it and extract this data again. Your output should be the same -as the output that is included in this document.

-

We will start with some easy stuff and compare a car with a router, +as the output that is included in this document.

+

We will start with some easy stuff and compare a car with a router, or compare kilometers (miles if you wish) with bits and bytes. It's -all the same: some number over some time.

-

Assume we have a device that transfers bytes to and from the Internet. +all the same: some number over some time.

+

Assume we have a device that transfers bytes to and from the Internet. This device keeps a counter that starts at zero when it is turned on, increasing with every byte that is transfered. This counter will have a maximum value, if that value is reached and an extra byte is counted, @@ -169,69 +180,70 @@ The device, when asked, returns the current value of the counter. We know the time that has passes since we last asked so we now know how many bytes have been transfered ***on average*** per second. This is -not very hard to calculate. First in words, then in calculations:

-
    -
  1. +not very hard to calculate. First in words, then in calculations:

    +
      +
    1. Take the current counter, subtract the previous value from it. -

      -
    2. +

      +
    3. Do the same with the current time and the previous time. -

      -
    4. +

      +
    5. Divide the outcome of (1) by the outcome of (2), the result is the amount of bytes per second. Multiply by eight to get the number of bits per second (bps). -

    -
    -  bps = (counter_now - counter_before) / (time_now - time_before) * 8
    -

    For some people it may help to translate this to a automobile example: -Do not try this example, and if you do, don't blame me for the results.

    -

    People who are not used to think in kilometers per hour can translate +

+
+  bps = (counter_now - counter_before) / (time_now - time_before) * 8
+

For some people it may help to translate this to a automobile example: +Do not try this example, and if you do, don't blame me for the results.

+

People who are not used to think in kilometers per hour can translate most into miles per hour by dividing km by 1.6 (close enough). -I will use the following abbreviations:

-
+I will use the following abbreviations:

+
  M:    meter
  KM:   kilometer (= 1000 meters).
  H:    hour
  S:    second
  KM/H: kilometers per hour
- M/S:  meters per second
-

You're driving a car. At 12:05 you read the counter in the dashboard + M/S: meters per second

+

You're driving a car. At 12:05 you read the counter in the dashboard and it tells you that the car has moved 12345 KM until that moment. At 12:10 you look again, it reads 12357 KM. This means you have traveled 12 KM in five minutes. A scientist would translate that into meters per second and this makes a nice comparison towards the -problem of (bytes per five minutes) versus (bits per second).

-

We traveled 12 kilometers which is 12000 meters. We did that in five +problem of (bytes per five minutes) versus (bits per second).

+

We traveled 12 kilometers which is 12000 meters. We did that in five minutes which translates into 300 seconds. Our speed is 12000M / 300S -equals 40 M/S.

-

We could also calculate the speed in KM/H: 12 times five minutes +equals 40 M/S.

+

We could also calculate the speed in KM/H: 12 times five minutes is an hour so we have to multiply 12 KM by 12 to get 144 KM/H. For our native English speaking friends: that's 90 MPH so don't -try this example at home or where I live :)

-

Remember: these numbers are averages only. There is no way to figure out +try this example at home or where I live :)

+

Remember: these numbers are averages only. There is no way to figure out from the numbers, if you drove at a constant speed. There is an example -later on in this tutorial that explains this.

-

I hope you understand that there is no difference in calculating M/S or +later on in this tutorial that explains this.

+

I hope you understand that there is no difference in calculating M/S or bps; only the way we collect the data is different. Even the K from kilo -is the same as in networking terms k also means 1000.

-

We will now create a database where we can keep all these interesting +is the same as in networking terms k also means 1000.

+

We will now create a database where we can keep all these interesting numbers. The method used to start the program may differ slightly from OS to OS but I assume you can figure it out if it works different on your OS. Make sure you do not overwrite any file on your system when executing the following command and type the whole line as one long line (I had to split it for readability) -and skip all of the '\' characters.

-
+and skip all of the '\' characters.

+
    rrdtool create test.rrd             \
             --start 920804400          \
             DS:speed:COUNTER:600:U:U   \
             RRA:AVERAGE:0.5:1:24       \
-            RRA:AVERAGE:0.5:6:10
-

(So enter: rrdtool create test.rrd --start 920804400 DS ...)

-

-

What has been created ?

-

We created the round robin database called test (test.rrd) + RRA:AVERAGE:0.5:6:10

+

(So enter: rrdtool create test.rrd --start 920804400 DS ...)

+

+

+

What has been created ?

+

We created the round robin database called test (test.rrd) which starts at noon the day I started (7th of march, 1999) writing this document. It holds one data source (DS) named ``speed'' that gets built from a counter. This counter is read every five minutes (default) @@ -239,19 +251,19 @@ averages the data every time it is read (eg there's nothing to average) and keeps 24 samples (24 times 5 minutes is 2 hours). The other averages 6 values (half hour) and contains 10 of such averages (eg 5 hours) -The remaining options will be discussed later on.

-

RRDtool works with special time stamps coming from the UNIX world. +The remaining options will be discussed later on.

+

RRDtool works with special time stamps coming from the UNIX world. This time stamp is the number of seconds that passed since January 1st 1970 UTC. This time stamp is translated into local time and -it will therefore look different for the different time zones.

-

Chances are that you are not in the same part of the world as I am. +it will therefore look different for the different time zones.

+

Chances are that you are not in the same part of the world as I am. This means your time zone is different. In all examples where I talk about time, the hours may be wrong for you. This has little effect on the results of the examples, just correct the hours while reading. -As an example: where I will see ``12:05'' the UK folks will see ``11:05''.

-

We now have to fill our database with some numbers. We'll pretend to -have read the following numbers:

-
+As an example: where I will see ``12:05'' the UK folks will see ``11:05''.

+

We now have to fill our database with some numbers. We'll pretend to +have read the following numbers:

+
  12:05  12345 KM
  12:10  12357 KM
  12:15  12363 KM
@@ -266,29 +278,29 @@
  13:00  12415 KM
  13:05  12420 KM
  13:10  12422 KM
- 13:15  12423 KM
-

We fill the database as follows:

-
+ 13:15  12423 KM
+

We fill the database as follows:

+
  rrdtool update test.rrd 920804700:12345 920805000:12357 920805300:12363
  rrdtool update test.rrd 920805600:12363 920805900:12363 920806200:12373
  rrdtool update test.rrd 920806500:12383 920806800:12393 920807100:12399
  rrdtool update test.rrd 920807400:12405 920807700:12411 920808000:12415
- rrdtool update test.rrd 920808300:12420 920808600:12422 920808900:12423
-

This reads: update our test database with the following numbers

-
+ rrdtool update test.rrd 920808300:12420 920808600:12422 920808900:12423
+

This reads: update our test database with the following numbers

+
  time 920804700, value 12345
- time 920805000, value 12357
-

etcetera.

-

As you can see, it is possible to feed more than one value into the + time 920805000, value 12357

+

etcetera.

+

As you can see, it is possible to feed more than one value into the database in one command. I had to stop at three for readability but -the real maximum is OS dependent.

-

We can now retrieve the data from our database using ``rrdtool fetch'':

-
- rrdtool fetch test.rrd AVERAGE --start 920804400 --end 920809200
-

It should return the following output:

-
-                speed
-
+the real maximum is OS dependent.

+

We can now retrieve the data from our database using ``rrdtool fetch'':

+
+ rrdtool fetch test.rrd AVERAGE --start 920804400 --end 920809200
+

It should return the following output:

+
+                speed
+
  920804700:       NaN
  920805000:      0.04
  920805300:      0.02
@@ -304,48 +316,50 @@
  920808300:      0.02
  920808600:      0.01
  920808900:      0.00
- 920809200:       NaN
-

If it doesn't, something may be wrong. Perhaps your OS will print + 920809200: NaN

+

If it doesn't, something may be wrong. Perhaps your OS will print ``NaN'' in a different form. It represents ``Not A Number''. If your OS writes ``U'' or ``UNKN'' or something similar that's okay. If something else is wrong, it will probably be due to an error you made (assuming that my tutorial is correct of course :-). In that case: delete the -database and try again.

-

What this output represents will become clear in the rest of the tutorial.

-

-

It is time to create some graphics

-

Try the following command:

-
+database and try again.

+

What this output represents will become clear in the rest of the tutorial.

+

+

+

It is time to create some graphics

+

Try the following command:

+
  rrdtool graph speed.gif                                 \
          --start 920804400 --end 920808000               \
          DEF:myspeed=test.rrd:speed:AVERAGE              \
-         LINE2:myspeed#FF0000
-

This will create speed.gif which starts at 12:00 and ends at 13:00. + LINE2:myspeed#FF0000

+

This will create speed.gif which starts at 12:00 and ends at 13:00. There is a definition of variable myspeed, it is the data from RRA ``speed'' out of database ``test.rrd''. The line drawn is 2 pixels high, and comes from variable myspeed. The color is red. You'll notice that the start of the graph is not at 12:00 but at 12:05 and this is because we have insufficient data to tell the average before that time. This will only happen when you miss some samples, this will -not happen a lot, hopefully.

-

If this has worked: congratulations! If not, check what went wrong.

-

The colors are built up from red, green and blue. For each of the +not happen a lot, hopefully.

+

If this has worked: congratulations! If not, check what went wrong.

+

The colors are built up from red, green and blue. For each of the components, you specify how much to use in hexadecimal where 00 means not included and FF means fully included. The ``color'' white is a mixture of red, green and blue: FFFFFF -The ``color'' black is all colors off: 000000

-
+The ``color'' black is all colors off: 000000

+
    red     #FF0000
    green   #00FF00
    blue    #0000FF
    magenta #FF00FF     (mixed red with blue)
-   gray    #555555     (one third of all components)
-

The GIF you just created can be displayed using your favorite image + gray #555555 (one third of all components)

+

The GIF you just created can be displayed using your favorite image viewer. Web browsers will display the GIF via the URL -``file://the/path/to/speed.gif''

-

-

Graphics with some math

-

When looking at the image, you notice that the horizontal axis is labeled +``file://the/path/to/speed.gif''

+

+

+

Graphics with some math

+

When looking at the image, you notice that the horizontal axis is labeled 12:10, 12:20, 12:30, 12:40 and 12:50. The two remaining times (12:00 and 13:00) would not be displayed nicely so they are skipped. The vertical axis displays the range we entered. We provided kilometers @@ -353,38 +367,38 @@ the first value was 12 (12357-12345) and divided by 300 this makes 0.04, which is displayed by RRDtool as ``40 m'' meaning ``40/1000''. The ``m'' has nothing to do with meters, kilometers or millimeters! RRDtool doesn't -know about all this, it just works with numbers and not with meters...

-

What we did wrong was that we should have measured in meters, this would -have been (12357000-12345000)/300 = 12000/300 = 40.

-

Let's correct that. We could recreate our database and store the correct +know about all this, it just works with numbers and not with meters...

+

What we did wrong was that we should have measured in meters, this would +have been (12357000-12345000)/300 = 12000/300 = 40.

+

Let's correct that. We could recreate our database and store the correct data but there is a better way: do some calculations while creating the -gif file !

-
+gif file !

+
    rrdtool graph speed2.gif                           \
       --start 920804400 --end 920808000               \
       --vertical-label m/s                            \
       DEF:myspeed=test.rrd:speed:AVERAGE              \
       CDEF:realspeed=myspeed,1000,*                   \
-      LINE2:realspeed#FF0000
-

After viewing this GIF, you notice the ``m'' has disappeared. This it what + LINE2:realspeed#FF0000

+

After viewing this GIF, you notice the ``m'' has disappeared. This it what the correct result would be. Also, a label has been added to the image. -Apart from the things mentioned above, the GIF should be the same.

-

The calculations are in the CDEF part and are in Reverse Polish Notation +Apart from the things mentioned above, the GIF should be the same.

+

The calculations are in the CDEF part and are in Reverse Polish Notation (``RPN''). What it says is: ``take the data source myspeed and the number 1000; multiply those''. Don't bother with RPN yet, it will be explained later on in more detail. Also, you may want to read my tutorial on CDEFs -and Steve Rader's tutorial on RPN. But first finish this tutorial.

-

Hang on! If we can multiply values with 1000, it should also be possible -to display kilometers per hour from the same data!

-

To change a value that is measured in meters per second: +and Steve Rader's tutorial on RPN. But first finish this tutorial.

+

Hang on! If we can multiply values with 1000, it should also be possible +to display kilometers per hour from the same data!

+

To change a value that is measured in meters per second: -*- Calculate meters per hour: value * 3600 -*- Calculate kilometers per hour: value / 1000 - -*- Together this makes: value * (3600/1000) == value * 3.6

-

In our example database we made a mistake and we need to compensate for + -*- Together this makes: value * (3600/1000) == value * 3.6

+

In our example database we made a mistake and we need to compensate for this by multiplying with 1000. Applying that correction: - -*- value * 3.6 *1000 == value * 3600

-

Now let's create this GIF, and add some more magic ...

-
+ -*- value * 3.6  *1000 == value * 3600

+

Now let's create this GIF, and add some more magic ...

+
    rrdtool graph speed3.gif                           \
       --start 920804400 --end 920808000               \
       --vertical-label km/h                           \
@@ -394,24 +408,25 @@
       CDEF:good=kmh,100,GT,0,kmh,IF                   \
       HRULE:100#0000FF:"Maximum allowed"              \
       AREA:good#00FF00:"Good speed"                   \
-      AREA:fast#FF0000:"Too fast"
-

This looks much better. Speed in KM/H and even an extra line with the + AREA:fast#FF0000:"Too fast"

+

This looks much better. Speed in KM/H and even an extra line with the maximum allowed speed (on the road I travel at). I also changed the -colors used to display speed and changed it from a line into an area.

-

The calculations are more complex now. For the ``good'' speed they are:

-
+colors used to display speed and changed it from a line into an area.

+

The calculations are more complex now. For the ``good'' speed they are:

+
    Check if kmh is greater than 100    ( kmh,100 ) GT
-   If so, return 0, else kmh           ((( kmh,100 ) GT ), 0, kmh) IF
-

For the other speed:

-
+   If so, return 0, else kmh           ((( kmh,100 ) GT ), 0, kmh) IF
+

For the other speed:

+
    Check if kmh is greater than 100    ( kmh,100 ) GT
-   If so, return kmh, else return 0    ((( kmh,100) GT ), kmh, 0) IF
-

-

Graphics Magic

-

I like to believe there are virtually no limits to how RRDtool graph + If so, return kmh, else return 0 ((( kmh,100) GT ), kmh, 0) IF

+

+

+

Graphics Magic

+

I like to believe there are virtually no limits to how RRDtool graph can manipulate data. I will not explain how it works, but look at the -following GIF:

-
+following GIF:

+
    rrdtool graph speed4.gif                           \
       --start 920804400 --end 920808000               \
       --vertical-label km/h                           \
@@ -423,43 +438,45 @@
       HRULE:100#0000FF:"Maximum allowed"              \
       AREA:good#00FF00:"Good speed"                   \
       AREA:fast#550000:"Too fast"                     \
-      STACK:over#FF0000:"Over speed"
-

Let's create a quick and dirty HTML page to view three GIFs:

-
+      STACK:over#FF0000:"Over speed"
+

Let's create a quick and dirty HTML page to view three GIFs:

+
    <HTML><HEAD><TITLE>Speed</TITLE></HEAD><BODY>
    <IMG src="speed2.gif" alt="Speed in meters per second">
    <BR>
    <IMG src="speed3.gif" alt="Speed in kilometers per hour">
    <BR>
    <IMG src="speed4.gif" alt="Traveled too fast?">
-   </BODY></HTML>
-

Name the file ``speed.html'' or similar, and view it.

-

Now, all you have to do is measure the values regularly and update the + </BODY></HTML>

+

Name the file ``speed.html'' or similar, and view it.

+

Now, all you have to do is measure the values regularly and update the database. When you want to view the data, recreate the GIFs and make sure to refresh them in your browser. (Note: just clicking reload may not be enough; Netscape in particular has a problem doing so and you'll -need to click reload while pressing the shift key).

-

-

Updates in Reality

-

We've already used the ``update'' command: it took one or more parameters +need to click reload while pressing the shift key).

+

+

+

Updates in Reality

+

We've already used the ``update'' command: it took one or more parameters in the form of ``<time>:<value>''. You'll be glad to know that you can get the current time by filling in a ``N'' as the time. If you wish, you can also use the ``time'' function in perl. -The shortest example in this doc :)

-
-   perl -e 'print time, "\n" '
-

How you can run a program on regular intervals is OS specific. But here's -an example in pseudo code:

-
+The shortest example in this doc :)

+
+   perl -e 'print time, "\n" '
+

How you can run a program on regular intervals is OS specific. But here's +an example in pseudo code:

+
    Get the value, put it in variable "$speed"
-   rrdtool update speed.rrd N:$speed
-

(Do not try this with our test database, it is used in further examples)

-

This is all. Run this script every five minutes. When you need to know + rrdtool update speed.rrd N:$speed

+

(Do not try this with our test database, it is used in further examples)

+

This is all. Run this script every five minutes. When you need to know what the graphics look like, run the examples above. You could put them -in a script. After running that script, view index.html

-

-

Some words on SNMP

-

I can imagine very few people will be able to get real data from their +in a script. After running that script, view index.html

+

+

+

Some words on SNMP

+

I can imagine very few people will be able to get real data from their car every five minutes, all other people will have to settle for some other kind of counter. You could measure the number of pages printed by a printer, the coffee made by the coffee machine, a device that counts @@ -472,128 +489,129 @@ Some people will make a remark that there are tools who can do this data collection for you. They are right! However, I feel it is important that you understand they are not necessary. When you have to determine why -things went wrong you need to know how they work.

-

One tool used in the example has been talked about very briefly in the +things went wrong you need to know how they work.

+

One tool used in the example has been talked about very briefly in the beginning of this document, it is called SNMP. It is a way of talking to equipment. The tool I use below is called ``snmpget'' and this is how it -works:

-
-   snmpget device password OID
-

For device you substitute the name, or the IP address, of your device. +works:

+
+   snmpget device password OID
+

For device you substitute the name, or the IP address, of your device. For password you use the ``community read string'' as it is called in the SNMP world. For some devices the default of ``public'' might work, however this can be disabled, altered or protected for privacy and security -reasons. Read the documentation that comes with your device or program.

-

Then there is this third parameter, called OID, which means ``object -identifier''.

-

When you start to learn about SNMP it looks very confusing. It isn't +reasons. Read the documentation that comes with your device or program.

+

Then there is this third parameter, called OID, which means ``object +identifier''.

+

When you start to learn about SNMP it looks very confusing. It isn't all that difficult when you look at the Management Information Base (``MIB''). It is an upside-down tree that describes data, with a single node as the root and from there a number of branches. These branches end up in another node, they branch out, etc. All the branches have a name and they form the path that we follow all the way down. The branches that we follow are named: iso, org, dod, internet, mgmt and mib-2. -These names can also be written down as numbers and are 1 3 6 1 2 1.

-
-   iso.org.dod.internet.mgmt.mib-2 (1.3.6.1.2.1)
-

There is a lot of confusion about the leading dot that some programs +These names can also be written down as numbers and are 1 3 6 1 2 1.

+
+   iso.org.dod.internet.mgmt.mib-2 (1.3.6.1.2.1)
+

There is a lot of confusion about the leading dot that some programs use. There is *no* leading dot in an OID. However, some programs can use above part of OIDs as a default. To indicate the difference between abbreviated OIDs and full OIDs they need a leading dot when you specify the complete OID. Often those programs will leave out the default portion when returning the data to you. To make things -worse, they have several default prefixes ...

-

Right, lets continue to the start of our OID: we had 1.3.6.1.2.1 +worse, they have several default prefixes ...

+

Right, lets continue to the start of our OID: we had 1.3.6.1.2.1 From there, we are especially interested in the branch ``interfaces'' -which has number 2 (eg 1.3.6.1.2.1.2 or 1.3.6.1.2.1.interfaces).

-

First, we have to get some SNMP program. First look if there is a +which has number 2 (eg 1.3.6.1.2.1.2 or 1.3.6.1.2.1.interfaces).

+

First, we have to get some SNMP program. First look if there is a pre-compiled package available for your OS. This is the preferred way. If not, you will have to get yourself the sources and compile those. The Internet is full of sources, programs etc. Find information using a search engine or whatever you prefer. As a suggestion: look for -CMU-SNMP. It is commonly used.

-

Assume you got the program. First try to collect some data that is +CMU-SNMP. It is commonly used.

+

Assume you got the program. First try to collect some data that is available on most systems. Remember: there is a short name for the -part of the tree that interests us most in the world we live in!

-

I will use the short version as I think this document is large enough +part of the tree that interests us most in the world we live in!

+

I will use the short version as I think this document is large enough as it is. If that doesn't work for you, prefix with .1.3.6.1.2.1 and try again. Also, Read The Fine Manual. Skip the parts you cannot understand yet, you should be able to find out how to start the -program and use it.

-
-   snmpget myrouter public system.sysDescr.0
-

The device should answer with a description of itself, perhaps empty. +program and use it.

+
+   snmpget myrouter public system.sysDescr.0
+

The device should answer with a description of itself, perhaps empty. Until you got a valid answer from a device, perhaps using a different -``password'', or a different device, there is no point in continuing.

-
-   snmpget myrouter public interfaces.ifNumber.0
-

Hopefully you get a number as a result, the number of interfaces. -If so, you can carry on and try a different program called ``snmpwalk''.

-
-   snmpwalk myrouter public interfaces.iftable.ifentry.ifdescr
-

If it returns with a list of interfaces, you're almost there. +``password'', or a different device, there is no point in continuing.

+
+   snmpget myrouter public interfaces.ifNumber.0
+

Hopefully you get a number as a result, the number of interfaces. +If so, you can carry on and try a different program called ``snmpwalk''.

+
+   snmpwalk myrouter public interfaces.iftable.ifentry.ifdescr
+

If it returns with a list of interfaces, you're almost there. Here's an example: - [user at host /home/alex]$ snmpwalk cisco public 2.2.1.2

-
+   [user at host /home/alex]$ snmpwalk cisco public 2.2.1.2

+
    interfaces.ifTable.ifEntry.ifDescr.1 = "BRI0: B-Channel 1"
    interfaces.ifTable.ifEntry.ifDescr.2 = "BRI0: B-Channel 2"
    interfaces.ifTable.ifEntry.ifDescr.3 = "BRI0" Hex: 42 52 49 30
    interfaces.ifTable.ifEntry.ifDescr.4 = "Ethernet0"
-   interfaces.ifTable.ifEntry.ifDescr.5 = "Loopback0"
-

On this cisco equipment, I would like to monitor the ``Ethernet0'' -interface and see that it is number four. I try:

-
-   [user at host /home/alex]$ snmpget cisco public 2.2.1.10.4 2.2.1.16.4
-
+   interfaces.ifTable.ifEntry.ifDescr.5 = "Loopback0"
+

On this cisco equipment, I would like to monitor the ``Ethernet0'' +interface and see that it is number four. I try:

+
+   [user at host /home/alex]$ snmpget cisco public 2.2.1.10.4 2.2.1.16.4
+
    interfaces.ifTable.ifEntry.ifInOctets.4 = 2290729126
-   interfaces.ifTable.ifEntry.ifOutOctets.4 = 1256486519
-

So now I have two OIDs to monitor and they are (in full, this time):

-
-   1.3.6.1.2.1.2.2.1.10
-

and

-
-   1.3.6.1.2.1.2.2.1.16
-

both with an interface number of 4.

-

Don't get fooled, this wasn't my first try. It took some time for me too + interfaces.ifTable.ifEntry.ifOutOctets.4 = 1256486519

+

So now I have two OIDs to monitor and they are (in full, this time):

+
+   1.3.6.1.2.1.2.2.1.10
+

and

+
+   1.3.6.1.2.1.2.2.1.16
+

both with an interface number of 4.

+

Don't get fooled, this wasn't my first try. It took some time for me too to understand what all these numbers mean, it does help a lot when they get translated into descriptive text... At least, when people are talking about MIBs and OIDs you know what it's all about. Do not forget the interface number (0 if it is not interface dependent) -and try snmpwalk if you don't get an answer from snmpget.

-

If you understand above part, and get numbers from your device, continue -on with this tutorial. If not, then go back and re-read this part.

-

-

A Real World Example

-

Let the fun begin. First, create a new database. It contains data from +and try snmpwalk if you don't get an answer from snmpget.

+

If you understand above part, and get numbers from your device, continue +on with this tutorial. If not, then go back and re-read this part.

+

+

+

A Real World Example

+

Let the fun begin. First, create a new database. It contains data from two counters, called input and output. The data is put into archives that average it. They take 1, 6, 24 or 288 samples at a time. They also go into archives that keep the maximum numbers. This will be explained later on. The time in-between samples is 300 seconds, a good -starting point, which is the same as five minutes.

-
+starting point, which is the same as five minutes.

+
  1 sample "averaged" stays 1 period of 5 minutes
  6 samples averaged become one average on 30 minutes
  24 samples averaged become one average on 2 hours
- 288 samples averaged become one average on 1 day
-

Lets try to be compatible with MRTG: -MRTG stores about the following amount of data:

-
+ 288 samples averaged become one average on 1 day
+

Lets try to be compatible with MRTG: +MRTG stores about the following amount of data:

+
  600 5-minute samples:    2   days and 2 hours
  600 30-minute samples:  12.5 days
  600 2-hour samples:     50   days
- 732 1-day samples:     732   days
-

These ranges are appended so the total amount of data kept is approximately + 732 1-day samples: 732 days

+

These ranges are appended so the total amount of data kept is approximately 797 days. RRDtool stores the data differently, it doesn't start the ``weekly'' archive where the ``daily'' archive stopped. For both archives the most recent data will be near ``now'' and therefore we will need to keep more data than -MRTG does!

-

We will need:

-
+MRTG does!

+

We will need:

+
  600 samples of 5 minutes  (2 days and 2 hours)
  700 samples of 30 minutes (2 days and 2 hours, plus 12.5 days)
  775 samples of 2 hours    (above + 50 days)
- 797 samples of 1 day      (above + 732 days, rounded up to 797)
-
+ 797 samples of 1 day      (above + 732 days, rounded up to 797)
+
    rrdtool create myrouter.rrd         \
             DS:input:COUNTER:600:U:U   \
             DS:output:COUNTER:600:U:U  \
@@ -604,11 +622,11 @@
             RRA:MAX:0.5:1:600          \
             RRA:MAX:0.5:6:700          \
             RRA:MAX:0.5:24:775         \
-            RRA:MAX:0.5:288:797
-

Next thing to do is collect data and store it. Here is an example. + RRA:MAX:0.5:288:797

+

Next thing to do is collect data and store it. Here is an example. It is written partially in pseudo code so you will have to find out what -to do exactly on your OS to make it work.

-
+to do exactly on your OS to make it work.

+
    while not the end of the universe
    do
       get result of
@@ -616,49 +634,50 @@
       into variable $in
       get result of
          snmpget router community 2.2.1.16.4
-      into variable $out
-
-      rrdtool update myrouter.rrd N:$in:$out
-
+      into variable $out
+
+      rrdtool update myrouter.rrd N:$in:$out
+
       wait for 5 minutes
-   done
-

Then, after collecting data for a day, try to create an image using:

-
+   done
+

Then, after collecting data for a day, try to create an image using:

+
    rrdtool graph myrouter-day.gif --start -86400 \
             DEF:inoctets=myrouter.rrd:input:AVERAGE \
             DEF:outoctets=myrouter.rrd:output:AVERAGE \
             AREA:inoctets#00FF00:"In traffic" \
-            LINE1:outoctets#0000FF:"Out traffic"
-

This should produce a picture with one day worth of traffic. + LINE1:outoctets#0000FF:"Out traffic"

+

This should produce a picture with one day worth of traffic. One day is 24 hours of 60 minutes of 60 seconds: 24*60*60=86400, we start at now minus 86400 seconds. We define (with DEFs) inoctets and outoctets as the average values from the database myrouter.rrd and draw -an area for the ``in'' traffic and a line for the ``out'' traffic.

-

View the image and keep logging data for a few more days. +an area for the ``in'' traffic and a line for the ``out'' traffic.

+

View the image and keep logging data for a few more days. If you like, you could try the examples from the test database and -see if you can get various options and calculations working.

-

Suggestion:

-

Display in bytes per second and in bits per second. Make the Ethernet -graphics go red if they are over four megabits per second.

-

-

Consolidation Functions

-

A few paragraphs back I mentioned the possibility of keeping +see if you can get various options and calculations working.

+

Suggestion:

+

Display in bytes per second and in bits per second. Make the Ethernet +graphics go red if they are over four megabits per second.

+

+

+

Consolidation Functions

+

A few paragraphs back I mentioned the possibility of keeping the maximum values instead of the average values. Let's go -into this a bit more.

-

Recall all the stuff about the speed of the car. Suppose we drove at 144 +into this a bit more.

+

Recall all the stuff about the speed of the car. Suppose we drove at 144 KM/H during 5 minutes and then were stopped by the police for 25 minutes. At the end of the lecture we would take our laptop and create+view the image taken from the database. If we look at the second RRA we did create, we would have the average from 6 samples. The samples measured would be 144+0+0+0+0+0=144, divided by 30 minutes, corrected for the error by 1000, translated into KM/H, with a result of 24 KM/H. -I would still get a ticket but not for speeding anymore :)

-

Obviously, in this case, we shouldn't look at the averages. In some +I would still get a ticket but not for speeding anymore :)

+

Obviously, in this case, we shouldn't look at the averages. In some cases they are handy. If you want to know how much KM you had traveled, the picture would be the right one to look at. On the other hand, for the speed that we traveled at, the maximum number seen is much more -valuable. (later we will see more types)

-

It is the same for data. If you want to know the amount, look at the +valuable. (later we will see more types)

+

It is the same for data. If you want to know the amount, look at the averages. If you want to know the rate, look at the maximum. Over time, they will grow apart more and more. In the last database we have created, there are two archives that keep data per day. The @@ -666,12 +685,12 @@ shows maxima will have higher numbers. For my car this would translate in averages per day of 96/24=4 KM/H (as I travel about 94 kilometers on a day) during week days, and -maximum of 120 KM/H on weekdays (my top speed that I reach every day).

-

Big difference. Do not look at the second graph to estimate the +maximum of 120 KM/H on weekdays (my top speed that I reach every day).

+

Big difference. Do not look at the second graph to estimate the distances that I travel and do not look at the first graph to estimate my speed. This will work if the samples are close together, -as they are in five minutes, but not if you average.

-

On some days, I go for a long ride. If I go across Europe and travel +as they are in five minutes, but not if you average.

+

On some days, I go for a long ride. If I go across Europe and travel for over 12 hours, the first graph will rise to about 60 KM/H. The second one will show 180 KM/H. This means that I traveled a distance of 60 KM/H times 24 H = 1440 KM. I did this with a higher speed and @@ -688,31 +707,33 @@ higher, so you can see more. However, this takes 12 samples per hour, or 288 values per day, so it would be too much to keep for a long period of time. Therefore we average it, eventually to one value per -day. From this one value, we cannot see much detail.

-

Make sure you understand the last few paragraphs. There is no value +day. From this one value, we cannot see much detail.

+

Make sure you understand the last few paragraphs. There is no value in only a line and a few axis, you need to know what they mean and -interpret the data in a good way. This is true for all data.

-

The biggest mistake you can make is to use the collected data for +interpret the data in a good way. This is true for all data.

+

The biggest mistake you can make is to use the collected data for something that it is not suitable for. You would be better off if -you would not have the graphics at all in that case.

-

-

Let's review what you now should know.

-

You now know how to create a database. You can put the numbers in it, +you would not have the graphics at all in that case.

+

+

+

Let's review what you now should know.

+

You now know how to create a database. You can put the numbers in it, get them out again by creating an image, do math on the data from the database and view the outcome instead of the raw data. You know about the difference between averages and maxima, and when -to use which (or at least you have an idea).

-

RRDtool can do more than what we have learned up to now. Before you +to use which (or at least you have an idea).

+

RRDtool can do more than what we have learned up to now. Before you continue with the rest of this doc, I recommend that you reread from the start and try some modifications on the examples. Make sure you fully understand everything. It will be worth the effort and helps you not only with the rest of this doc but also in your day to day -monitoring long after you read this introduction.

-

-

Data Source Types

-

All right, you feel like continuing. Welcome back and get ready -for an increased speed in the examples and explanation.

-

You know that in order to view a counter over time, you have to +monitoring long after you read this introduction.

+

+

+

Data Source Types

+

All right, you feel like continuing. Welcome back and get ready +for an increased speed in the examples and explanation.

+

You know that in order to view a counter over time, you have to take two numbers and divide the difference of them between the time lapsed. This makes sense for the examples I gave you but there are other possibilities. For instance, I'm able to retrieve the @@ -720,8 +741,8 @@ so called hot-spot and the exhaust. These values are not counters. If I take the difference of the two samples and divide that by 300 seconds I would be asking for the temperature change per second. -Hopefully this is zero! If not, the computerroom is on fire :)

-

So, what can we do ? We can tell RRDtool to store the values we measure +Hopefully this is zero! If not, the computerroom is on fire :)

+

So, what can we do ? We can tell RRDtool to store the values we measure directly as they are (this is not entirely true but close enough). The graphs we make will look much better, they will show a rather constant value. I know when the router is busy (it @@ -731,13 +752,13 @@ computer room -> the inlet temperature rises) etc. The data type we use when creating the database before was counter, we now have a different data type and thus a different name for it. It is called -GAUGE. There are more such data types:

-
+GAUGE. There are more such data types:

+
  - COUNTER   we already know this one
  - GAUGE     we just learned this one
  - DERIVE
- - ABSOLUTE
-

The two new types are DERIVE and ABSOLUTE. Absolute can be used like + - ABSOLUTE

+

The two new types are DERIVE and ABSOLUTE. Absolute can be used like counter with one difference: RRDtool assumes the counter is reset when it's read. That is: its delta is known without calculation by RRDtool whereas RRDtool needs to calculate it for the counter type. @@ -745,9 +766,9 @@ unknown, 12, 6, 0. The rest of the calculations stay the same. The other one, derive, is like counter. Unlike counter, it can also decrease so it can have a negative delta. Again, the rest of the -calculations stay the same.

-

Let's try them all:

-
+calculations stay the same.

+

Let's try them all:

+
    rrdtool create all.rrd --start 978300900 \
             DS:a:COUNTER:600:U:U \
             DS:b:GAUGE:600:U:U \
@@ -769,44 +790,45 @@
             DEF:linea=all.rrd:a:AVERAGE LINE3:linea#FF0000:"Line A" \
             DEF:lineb=all.rrd:b:AVERAGE LINE3:lineb#00FF00:"Line B" \
             DEF:linec=all.rrd:c:AVERAGE LINE3:linec#0000FF:"Line C" \
-            DEF:lined=all.rrd:d:AVERAGE LINE3:lined#000000:"Line D"
-

-

RRDtool under the Microscope

-
    -
  • + DEF:lined=all.rrd:d:AVERAGE LINE3:lined#000000:"Line D"
+

+

+

RRDtool under the Microscope

+
    +
  • Line A is a counter so it should continuously increment and RRDtool should calculate the differences. Also, RRDtool needs to divide the difference by the amount of time lapsed. This should end up as a straight line at 1 (the deltas are 300, the time is 300). -

    -
  • +

    +
  • Line B is of type gauge. These are ``real'' values so they should match what we put in: a sort of a wave. -

    -
  • +

    +
  • Line C is derive. It should be a counter that can decrease. It does so between 2400 and 0, with 1800 in-between. -

    -
  • +

    +
  • Line D is of type absolute. This is like counter but it works on values without calculating the difference. The numbers are the same and as you can see (hopefully) this has a different result. -

-

This translates in the following values, starting at 23:10 and ending -at 00:10 the next day (where U means unknown/unplotted):

-
+

+

This translates in the following values, starting at 23:10 and ending +at 00:10 the next day (where U means unknown/unplotted):

+
  - Line A:  u  u  1  1  1  1  1  1  1  1  1  u
  - Line B:  u  1  3  5  3  1  2  4  6  4  2  u
  - Line C:  u  u  2  2  2  0 -2 -6  2  0  2  u
- - Line D:  u  1  2  3  4  5  6  7  8  9 10  u
-

If your GIF shows all this, you know you have typed the data correct, + - Line D: u 1 2 3 4 5 6 7 8 9 10 u

+

If your GIF shows all this, you know you have typed the data correct, the RRDtool executable is working properly, your viewer doesn't fool you and you successfully entered the year 2000 :) You could try the same example four times, each time with only one of -the lines.

-

Let's go over the data again:

-
    -
  • +the lines.

    +

    Let's go over the data again:

    +
      +
    • Line A: 300,600,900 and so on. The counter delta is a constant 300 and so it the time delta. A number divided by itself is always 1 (except when dividing by zero which is undefined/illegal). @@ -814,29 +836,30 @@ the database ? True ! But we didn't have a value to calculate the delta from so we don't know where we started. It would be wrong to assume we started at zero so we don't ! -

      -
    • +

      +
    • Line B: There is nothing to calculate. The numbers are as is. -

      -
    • +

      +
    • Line C: Again, the start-out value is unknown. The same story is valid like for line A. In this case the deltas are not constant so the line is not. If we would put the same numbers in the database as we did for line A, we would have gotten the same line. Unlike type counter, this type can decrease and I hope to show you later on why there is a difference. -

      -
    • +

      +
    • Line D: Here the device calculates the deltas. Therefore we DO know the first delta and it is plotted. We had the same input as with line A but the meaning of this input is different. Therefore the line is different. In this case the deltas increase each time with 300. The time delta stays at a constant 300 and therefore the division of the two gives increasing results. -

    -

    -

    Counter Wraps

    -

    There are a few more basics to show. Some important options are still to +

+

+

+

Counter Wraps

+

There are a few more basics to show. Some important options are still to be covered and we haven't look at counter wraps yet. First the counter wrap: In our car we notice that our counter shows 999987. We travel 20 KM and the counter should go to 1000007. Unfortunately, there are only six digits @@ -847,23 +870,23 @@ anyways. How does it work ? Type counter should never decrease and therefore RRDtool must assume it wrapped if it does decrease ! If the delta is negative, this can be compensated for by adding the -maximum value of the counter + 1. For our car this would be:

-
- Delta = 7 - 999987 = -999980    (instead of 1000007-999987=20)
-
- Real delta = -999980 + 999999 + 1 = 20
-

At the time of writing this document, RRDtool knows of counters that +maximum value of the counter + 1. For our car this would be:

+
+ Delta = 7 - 999987 = -999980    (instead of 1000007-999987=20)
+
+ Real delta = -999980 + 999999 + 1 = 20
+

At the time of writing this document, RRDtool knows of counters that are either 32 bits or 64 bits of size. These counters can handle the -following different values:

-
+following different values:

+
  - 32 bits: 0 ..           4294967295
- - 64 bits: 0 .. 18446744073709551615
-

If these numbers look strange to you, you would like to view them in -their hexadecimal form:

-
+ - 64 bits: 0 .. 18446744073709551615
+

If these numbers look strange to you, you would like to view them in +their hexadecimal form:

+
  - 32 bits: 0 ..         FFFFFFFF
- - 64 bits: 0 .. FFFFFFFFFFFFFFFF
-

RRDtool handles both counters the same. If an overflow occurs and + - 64 bits: 0 .. FFFFFFFFFFFFFFFF

+

RRDtool handles both counters the same. If an overflow occurs and the delta would be negative, RRDtool first adds the maximum of a small counter + 1 to the delta. If the delta is still negative, it had to be the large counter that wrapped. Add the maximum possible value of the @@ -875,46 +898,46 @@ counter value for that to happen so chances are you would have several other problems as well and this particular problem would not even be worth thinking about. Even though I did include an example of it so you -can judge that for yourself.

-

The next section gives you some numerical examples for counter-wraps. +can judge that for yourself.

+

The next section gives you some numerical examples for counter-wraps. Try to do the calculations yourself or just believe me if your calculator -can't handle the numbers :)

-

Correction numbers:

-
+can't handle the numbers :)

+

Correction numbers:

+
  - 32 bits: (4294967295+1) =                                 4294967296
- - 64 bits: (18446744073709551615+1)-correction1 = 18446744069414584320
-
+ - 64 bits: (18446744073709551615+1)-correction1 = 18446744069414584320
+
  Before:        4294967200
  Increase:             100
  Should become: 4294967300
  But really is:          4
  Delta:        -4294967196
- Correction1:  -4294967196 +4294967296 = 100
-
+ Correction1:  -4294967196 +4294967296 = 100
+
  Before:        18446744073709551000
  Increase:                       800
  Should become: 18446744073709551800
  But really is:                  184
  Delta:        -18446744073709550816
  Correction1:  -18446744073709550816 +4294967296 = -18446744069414583520
- Correction2:  -18446744069414583520 +18446744069414584320 = 800
-
+ Correction2:  -18446744069414583520 +18446744069414584320 = 800
+
  Before:        18446744073709551615 ( maximum value )
  Increase:      18446744069414584320 ( absurd increase, minimum for
  Should become: 36893488143124135935             this example to work )
  But really is: 18446744069414584319
  Delta:                  -4294967296
  Correction1:  -4294967296 + 4294967296 = 0
- (not negative -> no correction2)
-
+ (not negative -> no correction2)
+
  Before:        18446744073709551615 ( maximum value )
  Increase:      18446744069414584319 ( one less increase )
  Should become: 36893488143124135934
  But really is: 18446744069414584318
  Delta:                  -4294967297
  Correction1:  -4294967297 +4294967296 = -1
- Correction2:  -1 +18446744069414584320 = 18446744069414584319
-

As you can see from the last two examples, you need strange numbers + Correction2: -1 +18446744069414584320 = 18446744069414584319

+

As you can see from the last two examples, you need strange numbers for RRDtool to fail (provided it's bug free of course) so this should not happen. However, SNMP or whatever method you choose to collect the data might also report wrong numbers occasionally. We can't prevent all @@ -931,15 +954,16 @@ expect numbers to be higher than 230. Anything else, and there must have been an error. Remember: the opposite is not true, if the numbers pass this check it doesn't mean that they are correct. Always judge the -graph with a healthy dose of paranoia if it looks weird.

-

-

Data Resampling

-

One important feature of RRDtool has not been explained yet: +graph with a healthy dose of paranoia if it looks weird.

+

+

+

Data Resampling

+

One important feature of RRDtool has not been explained yet: It is virtually impossible to collect the data and feed it into RRDtool on exact intervals. RRDtool therefore interpolates the data so it is on exact intervals. If you do not know what this means or how it works, -then here's the help you seek:

-

Suppose a counter increases with exactly one for every second. You want +then here's the help you seek:

+

Suppose a counter increases with exactly one for every second. You want to measure it in 300 seconds intervals. You should retrieve values that are exactly 300 apart. However, due to various circumstances you are a few seconds late and the interval is 303. The delta will also be @@ -949,31 +973,31 @@ would have been stored earlier and it will be 300 in 300 seconds. Next time you are at exactly the right time. This means that the current interval is 297 seconds and also the counter increased with 297. Again -RRDtool alters the value and stores 300 as it should be.

-
-      in the RDD                 in reality
-
+RRDtool alters the value and stores 300 as it should be.

+
+      in the RDD                 in reality
+
  time+000:   0 delta="U"   time+000:    0 delta="U"
  time+300: 300 delta=300   time+300:  300 delta=300
  time+600: 600 delta=300   time+603:  603 delta=303
- time+900: 900 delta=300   time+900:  900 delta=297
-

Let's create two identical databases. I've chosen the time range 920805000 -to 920805900 as this goes very well with the example numbers.

-
+ time+900: 900 delta=300   time+900:  900 delta=297
+

Let's create two identical databases. I've chosen the time range 920805000 +to 920805900 as this goes very well with the example numbers.

+
    rrdtool create seconds1.rrd   \
       --start 920804700          \
       DS:seconds:COUNTER:600:U:U \
-      RRA:AVERAGE:0.5:1:24
-
+      RRA:AVERAGE:0.5:1:24
+
    for Unix: cp seconds1.rrd seconds2.rrd
    for Dos:  copy seconds1.rrd seconds2.rrd
-   for vms:  how would I know :)
-
+   for vms:  how would I know :)
+
    rrdtool update seconds1.rrd \
       920805000:000 920805300:300 920805600:600 920805900:900
    rrdtool update seconds2.rrd \
-      920805000:000 920805300:300 920805603:603 920805900:900
-
+      920805000:000 920805300:300 920805603:603 920805900:900
+
    rrdtool graph seconds1.gif                       \
       --start 920804700 --end 920806200             \
       --height 200                                  \
@@ -989,21 +1013,23 @@
       DEF:seconds=seconds2.rrd:seconds:AVERAGE      \
       CDEF:unknown=seconds,UN                       \
       LINE2:seconds#0000FF                          \
-      AREA:unknown#FF0000
-

Both graphs should show the same.

-

-


-

WRAPUP

-

It's time to wrap up this document. You now know all the basics to be + AREA:unknown#FF0000

+

Both graphs should show the same.

+

+

+
+

WRAPUP

+

It's time to wrap up this document. You now know all the basics to be able to work with RRDtool and to read the documentation available. There is plenty more to discover about RRDtool and you will find more and more uses for the package. You could create easy graphics using just the examples provided and using only RRDtool. You could also use the front -ends that are available.

-

-


-

MAILINGLIST

-

Remember to subscribe to the mailing-list. Even if you are not answering +ends that are available.

+

+

+
+

MAILINGLIST

+

Remember to subscribe to the mailing-list. Even if you are not answering the mails that come by, it helps both you and the rest. A lot of the stuff that I know about MRTG (and therefore about RRDtool) I've learned while just reading the list without posting to it. I did not need to ask the @@ -1011,21 +1037,23 @@ in various mails by other users. With thousands of users all over the world, there will always be people who ask questions that you can answer because you read this and other -documentation and they didn't.

-

-


-

SEE ALSO

-

The RRDtool manpages

-

-


-

AUTHOR

-

I hope you enjoyed the examples and their descriptions. If you do, help +documentation and they didn't.

+

+

+
+

SEE ALSO

+

The RRDtool manpages

+

+

+
+

AUTHOR

+

I hope you enjoyed the examples and their descriptions. If you do, help other people by pointing them to this document when they are asking basic questions. They will not only get their answer but at the same -time learn a whole lot more.

-

Alex van den Bogaerdt -<alex at ergens.op.het.net>

+time learn a whole lot more.

+

Alex van den Bogaerdt +<alex at ergens.op.het.net>

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdlast.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdlast.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdlast.html 2003-02-20 15:24:01.000000000 -0800 @@ -1,47 +1,54 @@ - - -rrdlast - - + + + +rrdlast + + - + - +

-

-

NAME

-

rrdtool last - Return the date of the last data sample in an RRD

-
PDF version.

-


-

SYNOPSIS

-

rrdtool last filename

-

-


-

DESCRIPTION

-

The last function returns the UNIX timestamp when the RRD was last -updated.

-
-
filename
-
-The name of the RRD that contains the data. -

-

-


-

AUTHOR

-

Russ Wright <rwwright at home.com>

+

+

+

NAME

+

rrdtool last - Return the date of the last data sample in an RRD

+
PDF version.

+

+
+

SYNOPSIS

+

rrdtool last filename

+

+

+
+

DESCRIPTION

+

The last function returns the UNIX timestamp when the RRD was last +updated.

+
+
filename
+
+
+The name of the RRD that contains the data. +
+

+

+

+
+

AUTHOR

+

Russ Wright <rwwright at home.com>

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdfetch.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdfetch.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdfetch.txt 2003-02-20 15:24:01.000000000 -0800 @@ -2,37 +2,37 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE rrdtool fetch - fetch data from an rrd. -SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS - rrrrrrrrddddttttoooooooollll ffffeeeettttcccchhhh _f_i_l_e_n_a_m_e _C_F [--------rrrreeeessssoooolllluuuuttttiiiioooonnnn|----rrrr _r_e_s_o_l_u_t_i_o_n] - [--------ssssttttaaaarrrrtttt|----ssss _s_t_a_r_t] [--------eeeennnndddd|----eeee _e_n_d] - -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN - The ffffeeeettttcccchhhh function is normally used internally by the - graph function, to get data from RRRRRRRRDDDDs. ffffeeeettttcccchhhh will analyze - the RRRRRRRRDDDD and will try to retrieve the data in the resolu- +SSYYNNOOPPSSIISS + rrrrddttooooll ffeettcchh _f_i_l_e_n_a_m_e _C_F [----rreessoolluuttiioonn|--rr _r_e_s_o_l_u_t_i_o_n] + [----ssttaarrtt|--ss _s_t_a_r_t] [----eenndd|--ee _e_n_d] + +DDEESSCCRRIIPPTTIIOONN + The ffeettcchh function is normally used internally by the + graph function, to get data from RRRRDDs. ffeettcchh will analyze + the RRRRDD and will try to retrieve the data in the resolu- tion requested. The data fetched is printed to stdout. _*_U_N_K_N_O_W_N_* data is often represented by the string "NaN" depending on your OSs printf function. _f_i_l_e_n_a_m_e - the name of the RRRRRRRRDDDD you want to fetch the data + the name of the RRRRDD you want to fetch the data from. _C_F which consolidation function should have been applied to the data you want to fetch? (AVER- AGE,MIN,MAX,LAST) - --------rrrreeeessssoooolllluuuuttttiiiioooonnnn|----rrrr _r_e_s_o_l_u_t_i_o_n (default is the highest resolu- + ----rreessoolluuttiioonn|--rr _r_e_s_o_l_u_t_i_o_n (default is the highest resolu- tion) what interval should the values have (seconds per - value). rrrrrrrrddddffffeeeettttcccchhhh will try to match your request, + value). rrrrddffeettcchh will try to match your request, but it will return data even if no absolute match - is possible. NNNNBBBB.... See note below. + is possible. NNBB.. See note below. - --------ssssttttaaaarrrrtttt|----ssss _s_t_a_r_t (default end-1day) + ----ssttaarrtt|--ss _s_t_a_r_t (default end-1day) when should the data begin. A time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By @@ -41,16 +41,16 @@ detailed explanation on ways to specify start time. - --------eeeennnndddd|----eeee _e_n_d (default now) + ----eenndd|--ee _e_n_d (default now) when should the data end. Time in seconds since epoch. See also AT-STYLE TIME SPECIFICATION sec- tion for a detailed explanation of how to specify end time. - RRRREEEESSSSOOOOLLLLUUUUTTTTIIIIOOOONNNN IIIINNNNTTTTEEEERRRRVVVVAAAALLLL + RREESSOOLLUUTTIIOONN IINNTTEERRVVAALL In order to get rrdtool to fetch anything other than the - finest resolution RRA bbbbooootttthhhh the start and end time must be + finest resolution RRA bbootthh the start and end time must be specified on boundaries that are multiples of the wanted resolution. Consider the following example: @@ -72,7 +72,7 @@ rrdtool fetch subdata.rrd AVERAGE -r 900 -s -1h However, this will almost always result in a time series - that is NNNNOOOOTTTT in the 15 minute RRA. Therefore the highest + that is NNOOTT in the 15 minute RRA. Therefore the highest resolution RRA, i.e. 5 minute averages, will be chosen which, in this case, is not what you want. @@ -97,39 +97,38 @@ perl -e '$ctime = time; $rrdres = 900; system "rrdtool fetch subdata.rrd AVERAGE \ -r $rrdres -e @{[int($ctime/$rrdres)*$rrdres]} -s e-1h"' - - AAAATTTT----SSSSTTTTYYYYLLLLEEEE TTTTIIIIMMMMEEEE SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN + AATT--SSTTYYLLEE TTIIMMEE SSPPEECCIIFFIICCAATTIIOONN Apart from the traditional _S_e_c_o_n_d_s _s_i_n_c_e _e_p_o_c_h, rrdtool does also understand at-style time specification. The specification is called "at-style" after Unix command _a_t(1) that has moderately complex ways to specify time to run your job at. The at-style specification consists of - two parts: TTTTIIIIMMMMEEEE RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEE specification and TTTTIIIIMMMMEEEE OOOOFFFFFFFFSSSSEEEETTTT + two parts: TTIIMMEE RREEFFEERREENNCCEE specification and TTIIMMEE OOFFFFSSEETT specification. - TTTTIIIIMMMMEEEE RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEE SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN + TTIIMMEE RREEFFEERREENNCCEE SSPPEECCIIFFIICCAATTIIOONN Time reference specification is used, well,... to estab- lish a reference moment in time (for time offset to be applied to). When present, it should come first, when - omitted, it defaults to nnnnoooowwww. On its own part, time refer- + omitted, it defaults to nnooww. On its own part, time refer- ence consists of _t_i_m_e_-_o_f_-_d_a_y reference (which should come first, if present) and _d_a_y reference. - _T_i_m_e_-_o_f_-_d_a_y can be specified as HHHHHHHH::::MMMMMMMM, HHHHHHHH....MMMMMMMM, or just HHHHHHHH, - you can suffix it with aaaammmm or ppppmmmm or use 24-hours clock. The + _T_i_m_e_-_o_f_-_d_a_y can be specified as HHHH::MMMM, HHHH..MMMM, or just HHHH, + you can suffix it with aamm or ppmm or use 24-hours clock. The few special times of day are understood as well, these - include mmmmiiiiddddnnnniiiigggghhhhtttt (00:00), nnnnoooooooonnnn (12:00) and British tttteeeeaaaattttiiiimmmmeeee + include mmiiddnniigghhtt (00:00), nnoooonn (12:00) and British tteeaattiimmee (16:00). The _d_a_y can be specified as _m_o_n_t_h_-_n_a_m_e _d_a_y_-_o_f_-_t_h_e_-_m_o_n_t_h and optional 2- or 4-digit _y_e_a_r number (e.g. March 8 1999). Alternatively, you can use _d_a_y_-_o_f_-_w_e_e_k_-_n_a_m_e (e.g. - Monday), or one of the words: yyyyeeeesssstttteeeerrrrddddaaaayyyy, ttttooooddddaaaayyyy, ttttoooommmmoooorrrrrrrroooowwww. + Monday), or one of the words: yyeesstteerrddaayy, ttooddaayy, ttoommoorrrrooww. You can also specify _d_a_y as a full date in several numeri- - cal formats; these include: MMMMMMMM////DDDDDDDD////[[[[YYYYYYYY]]]]YYYYYYYY, DDDDDDDD....MMMMMMMM....[[[[YYYYYYYY]]]]YYYYYYYY, - YYYYYYYYYYYYYYYYMMMMMMMMDDDDDDDD. + cal formats; these include: MMMM//DDDD//[[YYYY]]YYYY, DDDD..MMMM..[[YYYY]]YYYY, + YYYYYYYYMMMMDDDD. _N_O_T_E_1: this is different from the original _a_t(1) behavior, which interprets a single-number date as MMDD[YY]YY. @@ -137,24 +136,24 @@ _N_O_T_E_2: if you specify _d_a_y this way, the _t_i_m_e_-_o_f_-_d_a_y is REQUIRED to be present. - Finally, you can use words nnnnoooowwww, ssssttttaaaarrrrtttt, or eeeennnndddd as your time - reference. NNNNoooowwww refers to the current moment (and is also a - default time reference). SSSSttttaaaarrrrtttt (eeeennnndddd) can be used to spec- + Finally, you can use words nnooww, ssttaarrtt, or eenndd as your time + reference. NNooww refers to the current moment (and is also a + default time reference). SSttaarrtt (eenndd) can be used to spec- ify time relative to the start (end) time for those tools that use these categories (rrdfetch, rrdgraph). Month and weekday names can be used in their naturally abbreviated form (e.g., Dec for December, Sun for Sunday, - etc.). The words nnnnoooowwww, ssssttttaaaarrrrtttt, eeeennnndddd can be abbreviated to nnnn, - ssss, eeee. + etc.). The words nnooww, ssttaarrtt, eenndd can be abbreviated to nn, + ss, ee. - TTTTIIIIMMMMEEEE OOOOFFFFFFFFSSSSEEEETTTT SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN + TTIIMMEE OOFFFFSSEETT SSPPEECCIIFFIICCAATTIIOONN Time offset specification is used to add (or subtract) certain time interval to (from) the time reference moment. - It consists of _s_i_g_n (++++ or ----) and _a_m_o_u_n_t. The following - time units can be used to specify the _a_m_o_u_n_t: yyyyeeeeaaaarrrrssss, - mmmmoooonnnntttthhhhssss, wwwweeeeeeeekkkkssss, ddddaaaayyyyssss, hhhhoooouuuurrrrssss, mmmmiiiinnnnuuuutttteeeessss, sssseeeeccccoooonnnnddddssss, these can be + It consists of _s_i_g_n (++ or --) and _a_m_o_u_n_t. The following + time units can be used to specify the _a_m_o_u_n_t: yyeeaarrss, + mmoonntthhss, wweeeekkss, ddaayyss, hhoouurrss, mmiinnuutteess, sseeccoonnddss, these can be used in singular or plural form, and abbreviated naturally or to a single letter (e.g. +3days, -1wk, -3y). Several time units can be combined together (e.g., -5mon1w2d), as @@ -190,21 +189,21 @@ '8:00 Mar 27 1999 +48 hours' = '9:00 Mar 29 1999', as expected) - _N_O_T_E_4: The single-letter abbreviation for both mmmmoooonnnntttthhhhssss and - mmmmiiiinnnnuuuutttteeeessss is mmmm. To disambiguate, the parser tries to read + _N_O_T_E_4: The single-letter abbreviation for both mmoonntthhss and + mmiinnuutteess is mm. To disambiguate, the parser tries to read your mind :) by applying the following two heuristics: - 1 If mmmm is used in context of (i.e. right after the) + 1 If mm is used in context of (i.e. right after the) years, months, weeks, or days it is assumed to mean - mmmmoooonnnntttthhhhssss, while in the context of hours, minutes, and - seconds it means minutes. (e.g., in -1y6m or +3w1m mmmm - means mmmmoooonnnntttthhhhssss, while in -3h20m or +5s2m mmmm means mmmmiiiinnnnuuuutttteeeessss) + mmoonntthhss, while in the context of hours, minutes, and + seconds it means minutes. (e.g., in -1y6m or +3w1m mm + means mmoonntthhss, while in -3h20m or +5s2m mm means mmiinnuutteess) - 2 Out of context (i.e. right after the ++++ or ---- sign) the - meaning of mmmm is guessed from the number it directly + 2 Out of context (i.e. right after the ++ or -- sign) the + meaning of mm is guessed from the number it directly follows. Currently, if the number absolute value is - below 25 it is assumed that mmmm means mmmmoooonnnntttthhhhssss, otherwise - it is treated as mmmmiiiinnnnuuuutttteeeessss. (e.g., -25m == -25 minutes, + below 25 it is assumed that mm means mmoonntthhss, otherwise + it is treated as mmiinnuutteess. (e.g., -25m == -25 minutes, while +24m == +24 months) _F_i_n_a_l _N_O_T_E_S: Time specification is case-insensitive. @@ -216,7 +215,7 @@ which also count as whitespace (e.g., midnight_Thu or mid- night,Thu) - TTTTIIIIMMMMEEEE SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS + TTIIMMEE SSPPEECCIIFFIICCAATTIIOONN EEXXAAMMPPLLEESS _O_c_t _1_2 -- October 12 this year @@ -245,9 +244,9 @@ _1_9_9_7_0_7_0_3 _1_2_:_4_5 -- 12:45 July 3th, 1997 (not quote stan- dard, but I love this ...) -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR Tobias Oetiker -2002-07-31 1.0.40 RRDFETCH(1) +1.0.41 2002-07-31 RRDFETCH(1) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrddump.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrddump.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrddump.html 2003-02-20 15:24:01.000000000 -0800 @@ -1,50 +1,57 @@ - - -rrddump - - + + + +rrddump + + - + - +

-

-

NAME

-

rrdtool dump - dump the contents of an RRD to XML format

-
PDF version.

-


-

SYNOPSIS

-

rrdtool dump filename.rrd > filename.xml

-

-


-

DESCRIPTION

-

The dump function prints the contents of an RRD in human +

+

+

NAME

+

rrdtool dump - dump the contents of an RRD to XML format

+
PDF version.

+

+
+

SYNOPSIS

+

rrdtool dump filename.rrd > filename.xml

+

+

+
+

DESCRIPTION

+

The dump function prints the contents of an RRD in human readable (?) XML format. This format can be read by rrdrestore. Together they allow you to transfer your files from one architecture -to another as well as manipulating the contents of an RRD file in a -somewhat more convenient manner.

-
-
filename.rrd
-
-The name of the RRD you want to dump. -

-

-


-

AUTHOR

-

Tobias Oetiker <oetiker at ee.ethz.ch>

+to another as well as manipulating the contents of an RRD file in a +somewhat more convenient manner.

+
+
filename.rrd
+
+
+The name of the RRD you want to dump. +
+

+

+

+
+

AUTHOR

+

Tobias Oetiker <oetiker at ee.ethz.ch>

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdinfo.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdinfo.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdinfo.txt 2003-02-20 15:24:02.000000000 -0800 @@ -2,24 +2,24 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE rrdtool info - extract header information from an rrd -SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS - rrrrrrrrddddttttoooooooollll iiiinnnnffffoooo _f_i_l_e_n_a_m_e_._r_r_d +SSYYNNOOPPSSIISS + rrrrddttooooll iinnffoo _f_i_l_e_n_a_m_e_._r_r_d -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN - The iiiinnnnffffoooo function prints the header information from an +DDEESSCCRRIIPPTTIIOONN + The iinnffoo function prints the header information from an rrd in a parsing friendly format. - Check the rrdcreate manpage if you are uncertain about the - meaning of the individual keys. + Check rrdcreate if you are uncertain about the meaning of + the individual keys. -EEEEXXXXAAAAMMMMPPPPLLLLEEEE - This is the output generated by running iiiinnnnffffoooo on a simple +EEXXAAMMPPLLEE + This is the output generated by running iinnffoo on a simple rrd which contains two datasources and one rra. Note that the number after the _l_a_s_t___u_p_d_a_t_e keyword is in seconds - since 1970. The string NNNNaaaaNNNN stands for _*_U_N_K_N_O_W_N_* data. In + since 1970. The string NNaaNN stands for _*_U_N_K_N_O_W_N_* data. In the example it means that this rrd has neither minimum not maximum values defined for either of its datasources. @@ -48,13 +48,12 @@ rra[0].cdp_prep[1].value = nan rra[0].cdp_prep[1].unknown_datapoints = 0 - _f_i_l_e_n_a_m_e_._r_r_d - The name of the RRRRRRRRDDDD you want to dump. + The name of the RRRRDD you want to dump. -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR Tobias Oetiker -2002-02-26 1.0.40 RRDINFO(1) +1.0.41 2002-02-26 RRDINFO(1) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/RRDp.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/RRDp.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/RRDp.txt 2003-02-20 15:24:02.000000000 -0800 @@ -2,50 +2,50 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE RRDp - Attach rrdtool from within a perl script via a set of pipes; -SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS - use RRRRRRRRDDDDpppp +SSYYNNOOPPSSIISS + use RRRRDDpp - RRRRRRRRDDDDpppp::::::::ssssttttaaaarrrrtttt _p_a_t_h _t_o _r_r_d_t_o_o_l _e_x_e_c_u_t_a_b_l_e + RRRRDDpp::::ssttaarrtt _p_a_t_h _t_o _r_r_d_t_o_o_l _e_x_e_c_u_t_a_b_l_e - RRRRRRRRDDDDpppp::::::::ccccmmmmdddd _r_r_d_t_o_o_l _c_o_m_m_a_n_d_l_i_n_e + RRRRDDpp::::ccmmdd _r_r_d_t_o_o_l _c_o_m_m_a_n_d_l_i_n_e - $answer = RRRRRRRRDDDD::::::::rrrreeeeaaaadddd + $answer = RRRRDD::::rreeaadd - $status = RRRRRRRRDDDD::::::::eeeennnndddd + $status = RRRRDD::::eenndd - $$$$RRRRRRRRDDDDpppp::::::::uuuusssseeeerrrr, $$$$RRRRRRRRDDDDpppp::::::::ssssyyyyssss, $$$$RRRRRRRRDDDDpppp::::::::rrrreeeeaaaallll + $$RRRRDDpp::::uusseerr, $$RRRRDDpp::::ssyyss, $$RRRRDDpp::::rreeaall -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN +DDEESSCCRRIIPPTTIIOONN With this module you can safely communicate with the rrd- tool. - After every RRRRRRRRDDDDpppp::::::::ccccmmmmdddd you have to issue an RRRRRRRRDDDDpppp::::::::rrrreeeeaaaadddd com- - mand to get rrrrrrrrddddttttoooooooolllls answer to your command. The answer is + After every RRRRDDpp::::ccmmdd you have to issue an RRRRDDpp::::rreeaadd com- + mand to get rrrrddttoooolls answer to your command. The answer is returned as a pointer, in order to speed things up. If the - last command did not return any data, RRRRRRRRDDDDpppp::::::::rrrreeeeaaaadddd will + last command did not return any data, RRRRDDpp::::rreeaadd will return an undefined variable. If you import the PERFORMANCE variables into your names- pace, you can access rrdtools internal performance mea- surements. - use RRRRRRRRDDDDpppp + use RRRRDDpp Load the RRDp::pipe module. - RRRRRRRRDDDDpppp::::::::ssssttttaaaarrrrtttt _p_a_t_h _t_o _r_r_d_t_o_o_l _e_x_e_c_u_t_a_b_l_e + RRRRDDpp::::ssttaarrtt _p_a_t_h _t_o _r_r_d_t_o_o_l _e_x_e_c_u_t_a_b_l_e start rrdtool. The argument must be the path to the rrdtool executable - RRRRRRRRDDDDpppp::::::::ccccmmmmdddd _r_r_d_t_o_o_l _c_o_m_m_a_n_d_l_i_n_e + RRRRDDpp::::ccmmdd _r_r_d_t_o_o_l _c_o_m_m_a_n_d_l_i_n_e pass commands on to rrdtool. check the rrdtool documentation for more info on the rrdtool com- mands. - $answer = RRRRRRRRDDDDpppp::::::::rrrreeeeaaaadddd + $answer = RRRRDDpp::::rreeaadd read rrdtools response to your command. Note that the $answer variable will only contain a pointer to the returned data. The reason for this is, that @@ -55,10 +55,10 @@ contents of $answer you have to use $$answer which dereferences the variable. - $status = RRRRRRRRDDDDpppp::::::::eeeennnndddd + $status = RRRRDDpp::::eenndd terminates rrdtool and returns rrdtools status ... - $$$$RRRRRRRRDDDDpppp::::::::uuuusssseeeerrrr, $$$$RRRRRRRRDDDDpppp::::::::ssssyyyyssss, $$$$RRRRRRRRDDDDpppp::::::::rrrreeeeaaaallll + $$RRRRDDpp::::uusseerr, $$RRRRDDpp::::ssyyss, $$RRRRDDpp::::rreeaall these variables will contain totals of the user time, system time and real time as seen by rrd- tool. User time is the time rrdtool is running, @@ -70,7 +70,7 @@ the time spent waiting for things like the hard disk and new input from the perl script. -EEEEXXXXAAAAMMMMPPPPLLLLEEEE +EEXXAAMMPPLLEE use RRDp; RRDp::start "/usr/local/bin/rrdtool"; RRDp::cmd qw(create demo.rrd --step 100 @@ -80,14 +80,13 @@ print $$answer; ($usertime,$systemtime,$realtime) = ($RRDp::user,$RRDp::sys,$RRDp::real); - -SSSSEEEEEEEE AAAALLLLSSSSOOOO +SSEEEE AALLSSOO For more information on how to use rrdtool, check the man- pages. -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR Tobias Oetiker -2002-10-11 1.0.40 RRDp(3) +1.0.41 2003-02-19 RRDp(3) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rpntutorial.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rpntutorial.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rpntutorial.html 2003-02-20 15:24:02.000000000 -0800 @@ -1,57 +1,62 @@ - - -rpntutorial - - + + + +rpntutorial + + - + - +

-

-

NAME

-

rpntutorial - Reading RRDTtool RPN Expressions by Steve Rader

-
PDF version.

-


-

DESCRIPTION

-

This tutorial should help you get to grips with rrdtool RPN expressions -as seen in CDEF arguments of rrdtool graph.

-

-


-

Reading Comparison Operators

-

The LT, LE, GT, GE and EQ RPN logic operators are not as tricky as +

+

+

NAME

+

rpntutorial - Reading RRDTtool RPN Expressions by Steve Rader

+
PDF version.

+

+
+

DESCRIPTION

+

This tutorial should help you get to grips with rrdtool RPN expressions +as seen in CDEF arguments of rrdtool graph.

+

+

+
+

Reading Comparison Operators

+

The LT, LE, GT, GE and EQ RPN logic operators are not as tricky as they appear. These operators act on the two values on the stack preceding them (to the left). Read these two values on the stack from left to right inserting the operator in the middle. If the resulting statement is true, the replace the three values from the stack with ``1''. If the statement if false, replace the three values -with ``0''.

-

For example think about ``2,1,GT''. This RPN expression could be +with ``0''.

+

For example think about ``2,1,GT''. This RPN expression could be read as ``is two greater than one?'' The answer to that question is ``true''. So the three values should be replaced with ``1''. Thus the -RPN expression 2,1,GT evaluates to 1.

-

Now also consider ``2,1,LE''. This RPN expression could be read as ``is +RPN expression 2,1,GT evaluates to 1.

+

Now also consider ``2,1,LE''. This RPN expression could be read as ``is two less than or equal to one?''. The natural response is ``no'' -and thus the RPN expression 2,1,LE evaluates to 0.

-

-


-

Reading the IF Operator

-

The IF RPN logic operator can be straightforward also. The key +and thus the RPN expression 2,1,LE evaluates to 0.

+

+

+
+

Reading the IF Operator

+

The IF RPN logic operator can be straightforward also. The key to reading IF operators is to understand that the condition part of the traditional ``if X than Y else Z'' notation has *already* been evaluated. So the IF operator acts on only one value on the @@ -59,137 +64,141 @@ value to the left of the IF corresponds to the true (``Y'') branch. And the first value to the left of the IF corresponds to the false (``Z'') branch. Read the RPN expression ``X,Y,Z,IF'' from left to -right like so: ``if X then Y else Z''.

-

For example, consider ``1,10,100,IF''. It looks bizzare to me. +right like so: ``if X then Y else Z''.

+

For example, consider ``1,10,100,IF''. It looks bizzare to me. But when I read ``if 1 then 10 else 100'' it's crystal clear: 1 is true so the answer is 10. Note that only zero is false; all other values are true. ``2,20,200,IF'' (``if 2 then 20 else 200'') evaluates to 20. -And ``0,1,2,IF'' (``if 0 then 1 else 2) evaluates to 2.

-

Notice that none of the above examples really simulate the whole +And ``0,1,2,IF'' (``if 0 then 1 else 2) evaluates to 2.

+

Notice that none of the above examples really simulate the whole ``if X then Y else Z'' statement. This is because computer programmers read this statement as ``if Some Condition then Y else Z''. So it's important to be able to read IF operators along with the LT, LE, -GT, GE and EQ operators.

-

-


-

Some Examples

-

While compound expressions can look overly complex, they can be +GT, GE and EQ operators.

+

+

+
+

Some Examples

+

While compound expressions can look overly complex, they can be considered elegantly simple. To quickly comprehend RPN expressions, you must know the the algorithm for evaluating RPN expressions: iterate searches from the left to the right looking for an operator, when it's found, apply that operator by popping the operator and some -number of values (and by definition, not operators) off the stack.

-

For example, the stack ``1,2,3,+,+'' gets ``2,3,+'' evaluated (as ``2+3'') +number of values (and by definition, not operators) off the stack.

+

For example, the stack ``1,2,3,+,+'' gets ``2,3,+'' evaluated (as ``2+3'') during the first iteration which is replaced by 5. This results in the stack ``1,5,+''. Finally, ``1,5,+'' is evaluated resulting in the answer 6. For convenience sake, it's useful to write this set of -operations as:

-
+operations as:

+
  1) 1,2,3,+,+    eval is 2,3,+ = 5    result is 1,5,+
  2) 1,5,+        eval is 1,5,+ = 6    result is 6
- 3) 6
-

Let's use that notation to conviently solve some complex RPN expressions -with multiple logic operators:

-
- 1) 20,10,GT,10,20,IF  eval is 20,10,GT = 1     result is 1,10,20,IF
-

read the eval as pop ``20 is greater than 10'' so push 1 -

-
-
- 2) 1,10,20,IF         eval is 1,10,20,IF = 10  result is 10
-

read pop ``if 1 then 10 else 20'' so push 10. Only 10 is left so -10 is the answer.

-

Let's read a complex RPN expression that also has the traditional -multiplication operator:

-
+ 3) 6
+

Let's use that notation to conviently solve some complex RPN expressions +with multiple logic operators:

+
+ 1) 20,10,GT,10,20,IF  eval is 20,10,GT = 1     result is 1,10,20,IF
+

read the eval as pop ``20 is greater than 10'' so push 1 +

+
+
+ 2) 1,10,20,IF         eval is 1,10,20,IF = 10  result is 10
+

read pop ``if 1 then 10 else 20'' so push 10. Only 10 is left so +10 is the answer.

+

Let's read a complex RPN expression that also has the traditional +multiplication operator:

+
  1) 128,8,*,7000,GT,7000,128,8,*,IF  eval 128,8,*       result is 1024
  2) 1024,7000,GT,7000,128,8,*,IF     eval 1024,7000,GT  result is 0
  3) 0,128,8,*,IF                     eval 128,8,*       result is 1024
- 4) 0,7000,1024,IF                                      result is 1024
-

Now let's go back to the first example of multiple logic operators -but replace the value 20 with the variable ``input'':

-
- 1) input,10,GT,10,input,IF  eval is input,10,GT  result is A
-

Read eval as ``if input > 10 then true'' and replace ``input,10,GT'' + 4) 0,7000,1024,IF result is 1024

+

Now let's go back to the first example of multiple logic operators +but replace the value 20 with the variable ``input'':

+
+ 1) input,10,GT,10,input,IF  eval is input,10,GT  result is A
+

Read eval as ``if input > 10 then true'' and replace ``input,10,GT'' with ``A: -

-
+

+
 
- 2) A,10,input,IF            eval is A,10,input,IF
-

read ``if A then 10 else input''. Now replace A it's verbose + 2) A,10,input,IF eval is A,10,input,IF

+

read ``if A then 10 else input''. Now replace A it's verbose description and--voila!--you have a easily readable description -of the expression:

-
- if input > 10 then 10 else input
-

Lastly, let's to back the first most complex example and replace -the value 128 with ``input'':

-
- 1) input,8,*,7000,GT,7000,input,8,*,IF  eval input,8,*     result is A
-

where A is ``input * 8''

-
- 2) A,7000,GT,7000,input,8,*,IF          eval is A,7000,GT  result is B
-

where B is ``if ((input * 8) > 7000) then true''

-
- 3) B,7000,input,8,*,IF                  eval is input,8,*  result is C
-

where C is ``input * 8''

-
- 4) B,7000,C,IF
-

At last we have a readable decoding of the complex RPN expression with -a variable:

-
- if ((input * 8) > 7000) then 7000 else (input * 8)
-

-


-

Exercises

-

Exercise 1:

-

Compute ``3,2,*,1,+ and ''3,2,1,+,*`` by hand. Rewrite them in -traditional notation. Explain why they have different answers.

-

Answer 1:

-
+of the expression:

+
+ if input > 10 then 10 else input
+

Lastly, let's to back the first most complex example and replace +the value 128 with ``input'':

+
+ 1) input,8,*,7000,GT,7000,input,8,*,IF  eval input,8,*     result is A
+

where A is ``input * 8''

+
+ 2) A,7000,GT,7000,input,8,*,IF          eval is A,7000,GT  result is B
+

where B is ``if ((input * 8) > 7000) then true''

+
+ 3) B,7000,input,8,*,IF                  eval is input,8,*  result is C
+

where C is ``input * 8''

+
+ 4) B,7000,C,IF
+

At last we have a readable decoding of the complex RPN expression with +a variable:

+
+ if ((input * 8) > 7000) then 7000 else (input * 8)
+

+

+
+

Exercises

+

Exercise 1:

+

Compute ``3,2,*,1,+ and ''3,2,1,+,*`` by hand. Rewrite them in +traditional notation. Explain why they have different answers.

+

Answer 1:

+
     3*2+1 = 7 and 3*(2+1) = 9.  These expressions have
     different answers because the altering of the plus and 
-    times operators alter the order of their evaluation.
-

Exercise 2:

-

One may be tempted to shorten the expression

-
- input,8,*,56000,GT,56000,input,*,8,IF
-

by removing the redundant use of ``input,8,*'' like so:

-
- input,56000,GT,56000,input,IF,8,*
-

Use tradition notation to show these expressions are not the same. + times operators alter the order of their evaluation.

+

Exercise 2:

+

One may be tempted to shorten the expression

+
+ input,8,*,56000,GT,56000,input,*,8,IF
+

by removing the redundant use of ``input,8,*'' like so:

+
+ input,56000,GT,56000,input,IF,8,*
+

Use tradition notation to show these expressions are not the same. Write an expression that's equivalent to the first expression but -uses the LE and DIV operators.

-

Answer 2:

-
+uses the LE and DIV operators.

+

Answer 2:

+
     if (input <= 56000/8 ) { input*8 } else { 56000 }
-    input,56000,8,DIV,LT,input,8,*,56000,IF
-

Exercise 3:

-

Briefly explain why traditional mathematic notation requires the + input,56000,8,DIV,LT,input,8,*,56000,IF

+

Exercise 3:

+

Briefly explain why traditional mathematic notation requires the use of parentheses. Explain why RPN notation does not require -the use of parentheses.

-

Answer 3:

-
+the use of parentheses.

+

Answer 3:

+
     Traditional mathematic expressions are evaluated by
     doing multiplication and division first, then addition and
     subtraction.  Perentences are used to force the evaluation of
     addition before multiplication (etc).  RPN does not require
     parentheses because the ordering of objects on the stack
-    can force the evaluation of addition before multiplication.
-

Exercise 4:

-

Explain why it is desirable for the RRDtool developers to implement -RPN notation instead of traditional mathematical notation.

-

Answer 4:

-
+    can force the evaluation of addition before multiplication.
+

Exercise 4:

+

Explain why it is desirable for the RRDtool developers to implement +RPN notation instead of traditional mathematical notation.

+

Answer 4:

+
     The algorithm that implements traditional mathematical
     notation is more complex then algorithm used for RPN.
     So implementing RPN allowed Tobias Oetiker to write less
     code!  (The code is also less complex and therefore less
-    likely to have bugs.)
-

-


-

AUTHOR

-

steve rader <rader at wiscnet.net>

+ likely to have bugs.)
+

+

+
+

AUTHOR

+

steve rader <rader at wiscnet.net> +

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdxport.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdxport.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdxport.html 2003-02-20 15:24:02.000000000 -0800 @@ -1,111 +1,130 @@ - - -rrdxport - - + + + +rrdxport + + - + - +

-

-

NAME

-

rrdtool xport - Export data in XML format based on data from one or several RRD

-
PDF version.

-


-

SYNOPSIS

-

rrdtool xport -[-s|--start seconds] -[-e|--end seconds] -[-m|--maxrows rows] -[--step value] -[DEF:vname=rrd:ds-name:CF] -[CDEF:vname=rpn-expression] -[XPORT:vname[:legend]]

-

-


-

DESCRIPTION

-

The xport functions main purpose is to write XML formatted -representation of the data stored in one or several RRDs. It -can also extract numerical reports.

-

If no XPORT statements are found, there will be no output.

-
-
-s|--start seconds (default end-1day)
-
+

+

+

NAME

+

rrdtool xport - Export data in XML format based on data from one or several RRD

+
PDF version.

+

+
+

SYNOPSIS

+

rrdtool xport +[-s|--start seconds] +[-e|--end seconds] +[-m|--maxrows rows] +[--step value] +[DEF:vname=rrd:ds-name:CF] +[CDEF:vname=rpn-expression] +[XPORT:vname[:legend]]

+

+

+
+

DESCRIPTION

+

The xport functions main purpose is to write XML formatted +representation of the data stored in one or several RRDs. It +can also extract numerical reports.

+

If no XPORT statements are found, there will be no output.

+
+
-s|--start seconds (default end-1day)
+
+
The time when the exported range should begin. Time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default one day worth of data will be printed. -See also AT-STYLE TIME SPECIFICATION section in the rrdfetch +See also AT-STYLE TIME SPECIFICATION section in the rrdfetch documentation for a detailed explanation on how to specify time. -

-
-e|--end seconds (default now)
-
+
+

+
-e|--end seconds (default now)
+
+
The time when the exported range should end. Time in seconds since epoch. -See also AT-STYLE TIME SPECIFICATION section in the rrdfetch +See also AT-STYLE TIME SPECIFICATION section in the rrdfetch documentation for a detailed explanation of ways to specify time. -

-
-m|--maxrows rows (default 400 rows)
-
-This works like the -w|--width parameter of rrdgraph. +
+

+
-m|--maxrows rows (default 400 rows)
+
+
+This works like the -w|--width parameter of rrdgraph. In fact it is exactly the same, but the parameter was renamed to -describe its purpose in this module. See rrdgraph documentation +describe its purpose in this module. See rrdgraph documentation for details. -

-
--step value (default automatic)
-
-See rrdgraph documentation. -

-
DEF:vname=rrd:ds-name:CF
-
-See rrdgraph documentation. -

-
CDEF:vname=rpn-expression
-
-See rrdgraph documentation. -

-
XPORT:vname::legend
-
-At least one XPORT statement should be present. The values -referenced by vname are printed. Optionally add a legend. -

-

-

Output format

-

The output is enclosed in a xport element and contains two -blocks. The first block is enclosed by a meta element and +

+

+
--step value (default automatic)
+
+
+See rrdgraph documentation. +
+

+
DEF:vname=rrd:ds-name:CF
+
+
+See rrdgraph documentation. +
+

+
CDEF:vname=rpn-expression
+
+
+See rrdgraph documentation. +
+

+
XPORT:vname::legend
+
+
+At least one XPORT statement should be present. The values +referenced by vname are printed. Optionally add a legend. +
+

+

+

+

Output format

+

The output is enclosed in a xport element and contains two +blocks. The first block is enclosed by a meta element and contains some meta data. The second block is enclosed by a -data element and contains the data rows.

-

Let's assume that the xport command looks like this:

-
+data element and contains the data rows.

+

Let's assume that the xport command looks like this:

+
   rrdtool xport \
           --start now-1h --end now \
           DEF:xx=host-inout.lo.rrd:output:AVERAGE \
           DEF:yy=host-inout.lo.rrd:input:AVERAGE \
           CDEF:aa=xx,yy,+,8,* \
           XPORT:xx:"out bytes" \
-          XPORT:aa:"in and out bits"
-

The resulting meta data section (the values will depend on the + XPORT:aa:"in and out bits"

+

The resulting meta data section (the values will depend on the RRD characteristics): -

-
+

+
 
   <meta>
     <start>1020611700</start>
@@ -117,11 +136,11 @@
       <entry>out bytes</entry>
       <entry>in and out bits</entry>
     </legend>
-  </meta>
-
+  </meta>
+
 
-The resulting data section:
-
+The resulting data section:
+
   <data>
     <row><t>1020611700</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
     <row><t>1020612000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
@@ -137,30 +156,35 @@
     <row><t>1020615000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
     <row><t>1020615300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
     <row><t>1020615600</t><v>NaN</v><v>NaN</v></row>
-  </data>
-

-


-

EXAMPLE 1

-
+  </data>
+

+

+
+

EXAMPLE 1

+
   rrdtool xport \
           DEF:out=if1-inouts.rrd:outoctets:AVERAGE \
-          XPORT:out:"out bytes"
-

-


-

EXAMPLE 2

-
+          XPORT:out:"out bytes"
+

+

+
+

EXAMPLE 2

+
   rrdtool xport \
           DEF:out1=if1-inouts.rrd:outoctets:AVERAGE \
           DEF:out2=if2-inouts.rrd:outoctets:AVERAGE \
           CDEF:sum=out1,out2,+ \
           XPORT:out1:"if1 out bytes" \
           XPORT:out2:"if2 out bytes" \
-          XPORT:sum:"output sum"
-

-


-

AUTHOR

-

Tobias Oetiker <oetiker at ee.ethz.ch>

+ XPORT:sum:"output sum"
+

+

+
+

AUTHOR

+

Tobias Oetiker <oetiker at ee.ethz.ch> - +

- + + + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdgraph.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdgraph.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdgraph.txt 2003-02-20 15:24:02.000000000 -0800 @@ -2,40 +2,42 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE rrdtool graph - Create a graph based on data from one or several RRD -SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS - rrrrrrrrddddttttoooooooollll ggggrrrraaaapppphhhh _f_i_l_e_n_a_m_e [----ssss|--------ssssttttaaaarrrrtttt _s_e_c_o_n_d_s] [----eeee|--------eeeennnndddd _s_e_c_- - _o_n_d_s] [----xxxx|--------xxxx----ggggrrrriiiidddd _x_-_a_x_i_s _g_r_i_d _a_n_d _l_a_b_e_l] [----yyyy|--------yyyy----ggggrrrriiiidddd _y_- - _a_x_i_s _g_r_i_d _a_n_d _l_a_b_e_l] [--------aaaalllltttt----yyyy----ggggrrrriiiidddd] [--------aaaalllltttt----yyyy----mmmmrrrrttttgggg] [--------aaaalllltttt---- - aaaauuuuttttoooossssccccaaaalllleeee] [--------aaaalllltttt----aaaauuuuttttoooossssccccaaaalllleeee----mmmmaaaaxxxx] [--------uuuunnnniiiittttssss----eeeexxxxppppoooonnnneeeennnntttt] - _v_a_l_u_e]> [----vvvv|--------vvvveeeerrrrttttiiiiccccaaaallll----llllaaaabbbbeeeellll _t_e_x_t] [----wwww|--------wwwwiiiiddddtttthhhh _p_i_x_e_l_s] - [----hhhh|--------hhhheeeeiiiigggghhhhtttt _p_i_x_e_l_s] [----iiii|--------iiiinnnntttteeeerrrrllllaaaacccceeeedddd] [----ffff|--------iiiimmmmggggiiiinnnnffffoooo _f_o_r_- - _m_a_t_s_t_r_i_n_g] [----aaaa|--------iiiimmmmggggffffoooorrrrmmmmaaaatttt GGGGIIIIFFFF|PPPPNNNNGGGG|GGGGDDDD] [----BBBB|--------bbbbaaaacccckkkk---- - ggggrrrroooouuuunnnndddd _v_a_l_u_e] [----OOOO|--------oooovvvveeeerrrrllllaaaayyyy _v_a_l_u_e] [----UUUU|--------uuuunnnniiiitttt _v_a_l_u_e] - [----zzzz|--------llllaaaazzzzyyyy] [----oooo|--------llllooooggggaaaarrrriiiitttthhhhmmmmiiiicccc] [----uuuu|--------uuuuppppppppeeeerrrr----lllliiiimmmmiiiitttt _v_a_l_u_e] - [----llll|--------lllloooowwwweeeerrrr----lllliiiimmmmiiiitttt _v_a_l_u_e] [----gggg|--------nnnnoooo----lllleeeeggggeeeennnndddd] [----rrrr|--------rrrriiiiggggiiiidddd] - [--------sssstttteeeepppp _v_a_l_u_e] [----bbbb|--------bbbbaaaasssseeee _v_a_l_u_e] [----cccc|--------ccccoooolllloooorrrr _C_O_L_- - _O_R_T_A_G####_r_r_g_g_b_b] [----tttt|--------ttttiiiittttlllleeee _t_i_t_l_e] [DDDDEEEEFFFF::::_v_n_a_m_e====_r_r_d::::_d_s_- - _n_a_m_e::::_C_F] [CCCCDDDDEEEEFFFF::::_v_n_a_m_e====_r_p_n_-_e_x_p_r_e_s_s_i_o_n] [PPPPRRRRIIIINNNNTTTT::::_v_n_a_m_e::::_C_F::::_f_o_r_- - _m_a_t] [GGGGPPPPRRRRIIIINNNNTTTT::::_v_n_a_m_e::::_C_F::::_f_o_r_m_a_t] [CCCCOOOOMMMMMMMMEEEENNNNTTTT::::_t_e_x_t] - [HHHHRRRRUUUULLLLEEEE::::_v_a_l_u_e####_r_r_g_g_b_b[::::_l_e_g_e_n_d]] [VVVVRRRRUUUULLLLEEEE::::_t_i_m_e####_r_r_g_g_b_b[::::_l_e_g_e_n_d]] - [LLLLIIIINNNNEEEE{1111|2222|3333}::::_v_n_a_m_e[####_r_r_g_g_b_b[::::_l_e_g_e_n_d]]] - [AAAARRRREEEEAAAA::::_v_n_a_m_e[####_r_r_g_g_b_b[::::_l_e_g_e_n_d]]] [SSSSTTTTAAAACCCCKKKK::::_v_n_a_m_e[####_r_r_g_g_b_b[::::_l_e_g_- +SSYYNNOOPPSSIISS + rrrrddttooooll ggrraapphh _f_i_l_e_n_a_m_e [--ss|----ssttaarrtt _s_e_c_o_n_d_s] [--ee|----eenndd _s_e_c_- + _o_n_d_s] [--xx|----xx--ggrriidd _x_-_a_x_i_s _g_r_i_d _a_n_d _l_a_b_e_l] + [--yy|----yy--ggrriidd _y_-_a_x_i_s _g_r_i_d _a_n_d _l_a_b_e_l] [--YY|----aalltt--yy--ggrriidd] + [--RR|----aalltt--yy--mmrrttgg] [--AA|----aalltt--aauuttoossccaallee] + [--MM|----aalltt--aauuttoossccaallee--mmaaxx] [--NN|----nnoo--mmiinnoorr] [--XX|----uunniittss--eexxppoo-- + nneenntt] _v_a_l_u_e]> [--vv|----vveerrttiiccaall--llaabbeell _t_e_x_t] [--ww|----wwiiddtthh _p_i_x_- + _e_l_s] [--hh|----hheeiigghhtt _p_i_x_e_l_s] [--ii|----iinntteerrllaacceedd] + [--ff|----iimmggiinnffoo _f_o_r_m_a_t_s_t_r_i_n_g] [--aa|----iimmggffoorrmmaatt GGIIFF|PPNNGG|GGDD] + [--BB|----bbaacckkggrroouunndd _v_a_l_u_e] [--OO|----oovveerrllaayy _v_a_l_u_e] + [--UU|----uunniitt _v_a_l_u_e] [--zz|----llaazzyy] [--oo|----llooggaarriitthhmmiicc] + [--uu|----uuppppeerr--lliimmiitt _v_a_l_u_e] [--ll|----lloowweerr--lliimmiitt _v_a_l_u_e] + [--gg|----nnoo--lleeggeenndd] [--rr|----rriiggiidd] [--SS|----sstteepp _v_a_l_u_e] + [--bb|----bbaassee _v_a_l_u_e] [--cc|----ccoolloorr _C_O_L_O_R_T_A_G##_r_r_g_g_b_b] + [--tt|----ttiittllee _t_i_t_l_e] [DDEEFF::_v_n_a_m_e==_r_r_d::_d_s_-_n_a_m_e::_C_F] + [CCDDEEFF::_v_n_a_m_e==_r_p_n_-_e_x_p_r_e_s_s_i_o_n] [PPRRIINNTT::_v_n_a_m_e::_C_F::_f_o_r_m_a_t] + [GGPPRRIINNTT::_v_n_a_m_e::_C_F::_f_o_r_m_a_t] [CCOOMMMMEENNTT::_t_e_x_t] + [HHRRUULLEE::_v_a_l_u_e##_r_r_g_g_b_b[::_l_e_g_e_n_d]] [VVRRUULLEE::_t_i_m_e##_r_r_g_g_b_b[::_l_e_g_e_n_d]] + [LLIINNEE{11|22|33}::_v_n_a_m_e[##_r_r_g_g_b_b[::_l_e_g_e_n_d]]] + [AARREEAA::_v_n_a_m_e[##_r_r_g_g_b_b[::_l_e_g_e_n_d]]] [SSTTAACCKK::_v_n_a_m_e[##_r_r_g_g_b_b[::_l_e_g_- _e_n_d]]] -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN - The ggggrrrraaaapppphhhh functions main purpose is to create graphical - representations of the data stored in one or several RRRRRRRRDDDDs. +DDEESSCCRRIIPPTTIIOONN + The ggrraapphh functions main purpose is to create graphical + representations of the data stored in one or several RRRRDDs. Apart from generating graphs, it can also extract numeri- cal reports. _f_i_l_e_n_a_m_e - The name of the graph to generate. Since rrrrrrrrddddttttoooooooollll out- + The name of the graph to generate. Since rrrrddttooooll out- puts GIFs and PNGs, it's recommended that the filename - end in either _._g_i_f or _._p_n_g. rrrrrrrrddddttttoooooooollll does not enforce + end in either _._g_i_f or _._p_n_g. rrrrddttooooll does not enforce this, however. If the _f_i_l_e_n_a_m_e is set to '-' the image file will be written to standard out. All other output will get suppressed. @@ -47,7 +49,7 @@ If no graph functions are called, the graph will not be created. - ----ssss|--------ssssttttaaaarrrrtttt _s_e_c_o_n_d_s (default end-1day) + --ss|----ssttaarrtt _s_e_c_o_n_d_s (default end-1day) The time when the graph should begin. Time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default one day @@ -55,27 +57,27 @@ SPECIFICATION section in the _r_r_d_f_e_t_c_h documentation for a detailed explanation on how to specify time. - ----eeee|--------eeeennnndddd _s_e_c_o_n_d_s (default now) + --ee|----eenndd _s_e_c_o_n_d_s (default now) The time when the graph should end. Time in seconds since epoch. See also AT-STYLE TIME SPECIFICATION section in the _r_r_d_f_e_t_c_h documentation for a detailed explanation of ways to specify time. - ----xxxx|--------xxxx----ggggrrrriiiidddd _x_-_a_x_i_s _g_r_i_d _a_n_d _l_a_b_e_l (default autoconfigure) + --xx|----xx--ggrriidd _x_-_a_x_i_s _g_r_i_d _a_n_d _l_a_b_e_l (default autoconfigure) The x-axis label is quite complex to configure. So if you don't have very special needs, you can rely on the autoconfiguration to get this right. If you want no x-grid at all, use the magic setting - nnnnoooonnnneeee. + nnoonnee. The x-axis label and grid can be configured, using the following format: - _G_T_M::::_G_S_T::::_M_T_M::::_M_S_T::::_L_T_M:_L_S_T::::_L_P_R::::_L_F_M + _G_T_M::_G_S_T::_M_T_M::_M_S_T::_L_T_M:_L_S_T::_L_P_R::_L_F_M - You have to configure three elements making up the x- - axis labels and grid. The base grid (_G_?_?), the major + You have to configure three elements making up the + x-axis labels and grid. The base grid (_G_?_?), the major grid (_M_?_?) and the labels (_L_?_?). The configuration is based on the idea that you first specify a well known amount of time (_?_T_M) and then say how many times it @@ -86,7 +88,7 @@ (_L_F_M). The _?_T_M elements must be one of the following key- - words: SSSSEEEECCCCOOOONNNNDDDD, MMMMIIIINNNNUUUUTTTTEEEE, HHHHOOOOUUUURRRR, DDDDAAAAYYYY, WWWWEEEEEEEEKKKK, MMMMOOOONNNNTTTTHHHH or YYYYEEEEAAAARRRR. + words: SSEECCOONNDD, MMIINNUUTTEE, HHOOUURR, DDAAYY, WWEEEEKK, MMOONNTTHH or YYEEAARR. If you wanted a graph with a base grid every 10 min- utes and a major one every hour, with labels every @@ -108,42 +110,45 @@ the locale you prefere prior to calling the graph function. - ----yyyy|--------yyyy----ggggrrrriiiidddd _g_r_i_d _s_t_e_p:_l_a_b_e_l _f_a_c_t_o_r (default autoconfigure) + --yy|----yy--ggrriidd _g_r_i_d _s_t_e_p:_l_a_b_e_l _f_a_c_t_o_r (default autoconfigure) Makes vertical grid lines appear at _g_r_i_d _s_t_e_p inter- val. Every _l_a_b_e_l _f_a_c_t_o_r gridstep, a major grid line is printed, along with label showing the value of the grid line. If you want no y-grid at all set specify the magic - word nnnnoooonnnneeee. + word nnoonnee. - --------aaaalllltttt----yyyy----ggggrrrriiiidddd + --YY|----aalltt--yy--ggrriidd Place Y grid dynamically based on graph Y range. Algo- rithm ensures that you always have grid, that there are enough but not too many grid lines and the grid is metric. That is grid lines are placed every 1, 2, 5 or 10 units. (contributed by Sasha Mikheev) - --------aaaalllltttt----yyyy----mmmmrrrrttttgggg - Y grid placed on graph Y range mimmics mrtg's (rateup- - generated) graphs. Currently axis is split into 4 - parts, just as rateup does. + ----nnoo--mmiinnoorr + Turn off the minor grid lines. This is partcularly + useful for small graphs which can be cluttered with + the minor grid lines. (contributed by Travis Brown) + + --RR|----aalltt--yy--mmrrttgg + Y grid placed on graph Y range mimmics mrtg's + (rateup-generated) graphs. Currently axis is split + into 4 parts, just as rateup does. - - - --------aaaalllltttt----aaaauuuuttttoooossssccccaaaalllleeee + --AA|----aalltt--aauuttoossccaallee Compute Y range based on function absolute minimum and maximum values. Default algorithm uses predefined set of ranges. This is good in many cases but it fails miserably when you need to graph something like - 260 + 0.001 * _s_i_n(x). Default algorithm will use Y + 260 + 0.001 * sin(x). Default algorithm will use Y range from 250 to 300 and on the graph you will see almost straight line. With --alt-autoscale Y range will be from slightly less the 260 - 0.001 to slightly more then 260 + 0.001 and periodic behavior will be seen. (contributed by Sasha Mikheev) - --------aaaalllltttt----aaaauuuuttttoooossssccccaaaalllleeee----mmmmaaaaxxxx + --MM|----aalltt--aauuttoossccaallee--mmaaxx Where --alt-autoscale will modify both the absolute maximum AND minimum values, this option will only affect the maximum value. The minimum value, if not @@ -152,7 +157,7 @@ WAN line uses compression, and thus the throughput may be higher than the WAN line speed. - --------uuuunnnniiiittttssss----eeeexxxxppppoooonnnneeeennnntttt _v_a_l_u_e (default autoconfigure) + --XX|----uunniittss--eexxppoonneenntt _v_a_l_u_e (default autoconfigure) This sets the 10**exponent scaling of the y-axis val- ues. Normally values will be scaled to the appropri- ate units (k, M, etc.). However you may wish to dis- @@ -166,19 +171,19 @@ lionths). Use a value of 0 to prevent any scaling of the y-axis values. - ----vvvv|--------vvvveeeerrrrttttiiiiccccaaaallll----llllaaaabbbbeeeellll _t_e_x_t + --vv|----vveerrttiiccaall--llaabbeell _t_e_x_t vertical label on the left side of the graph. This is normally used to specify the units used. - ----wwww|--------wwwwiiiiddddtttthhhh _p_i_x_e_l_s (default 400 pixel) + --ww|----wwiiddtthh _p_i_x_e_l_s (default 400 pixel) Width of the drawing area within the graph. This affects the size of the gif. - ----hhhh|--------hhhheeeeiiiigggghhhhtttt _p_i_x_e_l_s (default 100 pixel) + --hh|----hheeiigghhtt _p_i_x_e_l_s (default 100 pixel) Width of the drawing area within the graph. This affects the size of the gif. - ----iiii|--------iiiinnnntttteeeerrrrllllaaaacccceeeedddd (default: false) + --ii|----iinntteerrllaacceedd (default: false) If you set this option, then the resulting GIF will be interlaced. Most web browsers display these incremen- tally as they load. If you do not use this option, the @@ -187,110 +192,109 @@ GIF on disk. It makes no changes to the layout or con- tents of the graph. - ----ffff|--------iiiimmmmggggiiiinnnnffffoooo _f_o_r_m_a_t_s_t_r_i_n_g + --ff|----iimmggiinnffoo _f_o_r_m_a_t_s_t_r_i_n_g After the image has been created, the graph function uses printf together with this format string to create output similar to the PRINT function, only that the printf is supplied with the parameters _f_i_l_e_n_a_m_e, _x_s_i_z_e - and _y_s_i_z_e. In order to generate an IIIIMMMMGGGG tag suitable + and _y_s_i_z_e. In order to generate an IIMMGG tag suitable for including the graph into a web page, the command line would look like this: --imginfo 'Demo' - - ----aaaa|--------iiiimmmmggggffffoooorrrrmmmmaaaatttt GGGGIIIIFFFF|PPPPNNNNGGGG|GGGGDDDD (default: GIF) + --aa|----iimmggffoorrmmaatt GGIIFF|PPNNGG|GGDD (default: GIF) Allows you to produce PNG or GD output from rrdtool. - ----BBBB|--------bbbbaaaacccckkkkggggrrrroooouuuunnnndddd _v_a_l_u_e + --BB|----bbaacckkggrroouunndd _v_a_l_u_e You could use image in (currently only) GD format for background. It is used as background at the very beginning of graph creation. - ----OOOO|--------oooovvvveeeerrrrllllaaaayyyy _v_a_l_u_e + --OO|----oovveerrllaayy _v_a_l_u_e You could use image in (currently only) GD format as overlay. It is placed over created graph so that white pixel (color 255,255,255) is considered transparent, all other is replacing corresponding pixel in created graph. - ----UUUU|--------uuuunnnniiiitttt _v_a_l_u_e + --UU|----uunniitt _v_a_l_u_e You could use unit to be displayed on y axis. It is wise to use only short units on graph, however. - ----zzzz|--------llllaaaazzzzyyyy (default: false) + --zz|----llaazzyy (default: false) Only generate the graph, if the current gif is out of date or not existent. - ----uuuu|--------uuuuppppppppeeeerrrr----lllliiiimmmmiiiitttt _v_a_l_u_e (default autoconfigure) + --uu|----uuppppeerr--lliimmiitt _v_a_l_u_e (default autoconfigure) Defines the value normally located at the upper border of the graph. If the graph contains higher values, the upper border will move upwards to accomodate these values as well. If you want to define an upper-limit which will not - move in any event you have to set the --------rrrriiiiggggiiiidddd option + move in any event you have to set the ----rriiggiidd option as well. - ----llll|--------lllloooowwwweeeerrrr----lllliiiimmmmiiiitttt _v_a_l_u_e (default autoconfigure) + --ll|----lloowweerr--lliimmiitt _v_a_l_u_e (default autoconfigure) This is not the lower limit of a graph. But rather, this is the maximum lower bound of a graph. For exam- ple, the value -100 will result in a graph that has a lower limit of -100 or less. Use this keyword to expand graphs down. - ----rrrr|--------rrrriiiiggggiiiidddd + --rr|----rriiggiidd rigid boundaries mode. Normally rrdgraph will auto- matically expand the lower and upper limit if the graph contains a value outside the valid range. With the r option you can disable this behavior - ----bbbb|--------bbbbaaaasssseeee _v_a_l_u_e + --bb|----bbaassee _v_a_l_u_e if you are graphing memory (and NOT network traffic) this switch should be set to 1024 so that one Kb is 1024 byte. For traffic measurement, 1 kb/s is 1000 b/s. - ----oooo|--------llllooooggggaaaarrrriiiitttthhhhmmmmiiiicccc + --oo|----llooggaarriitthhmmiicc logarithmic y-axis scaling - ----cccc|--------ccccoooolllloooorrrr _C_O_L_O_R_T_A_G####_r_r_g_g_b_b (default colors) + --cc|----ccoolloorr _C_O_L_O_R_T_A_G##_r_r_g_g_b_b (default colors) override the colors for the standard elements of the graph. The _C_O_L_O_R_T_A_G must be one of the following sym- - bolic names: BBBBAAAACCCCKKKK ground, CCCCAAAANNNNVVVVAAAASSSS, SSSSHHHHAAAADDDDEEEEAAAA left/top bor- - der, SSSSHHHHAAAADDDDEEEEBBBB right/bottom border, GGGGRRRRIIIIDDDD, MMMMGGGGRRRRIIIIDDDD major - grid, FFFFOOOONNNNTTTT, FFFFRRRRAAAAMMMMEEEE and axis of the graph or AAAARRRRRRRROOOOWWWW. This + bolic names: BBAACCKK ground, CCAANNVVAASS, SSHHAADDEEAA left/top + border, SSHHAADDEEBB right/bottom border, GGRRIIDD, MMGGRRIIDD major + grid, FFOONNTT, FFRRAAMMEE and axis of the graph or AARRRROOWW. This option can be called multiple times to set several colors. - ----gggg|--------nnnnoooo----lllleeeeggggeeeennnndddd + --gg|----nnoo--lleeggeenndd Suppress generation of legend; only render the graph. - ----tttt|--------ttttiiiittttlllleeee _t_e_x_t (default no title) + --tt|----ttiittllee _t_e_x_t (default no title) Define a title to be written into the graph - --------sssstttteeeepppp _v_a_l_u_e (default automatic) - By default rrdgraph calculates the width of one pixle + --SS|----sstteepp _v_a_l_u_e (default automatic) + By default rrdgraph calculates the width of one pixel in the time domain and tries to get data at that reso- lution from the RRD. With this switch you can override this behaviour. If you want rrdgraph to get data at 1 hour resolution from the RRD, then you can set the step to 3600 seconds. Note, that a step smaller than 1 - pixle will be silently ignored. + pixel will be silently ignored. - DDDDEEEEFFFF::::_v_n_a_m_e====_r_r_d::::_d_s_-_n_a_m_e::::_C_F + DDEEFF::_v_n_a_m_e==_r_r_d::_d_s_-_n_a_m_e::_C_F Define virtual name for a data source. This name can then be used in the functions explained below. The DEF - call automatically chooses an RRRRRRRRAAAA which contains _C_F + call automatically chooses an RRRRAA which contains _C_F consolidated data in a resolution appropriate for the size of the graph to be drawn. Ideally this means - that one data point from the RRRRRRRRAAAA should be represented + that one data point from the RRRRAA should be represented by one pixel in the graph. If the resolution of the - RRRRRRRRAAAA is higher than the resolution of the graph, the + RRRRAA is higher than the resolution of the graph, the data in the RRA will be further consolidated according to the consolidation function (_C_F) chosen. - CCCCDDDDEEEEFFFF::::_v_n_a_m_e====_r_p_n_-_e_x_p_r_e_s_s_i_o_n + CCDDEEFF::_v_n_a_m_e==_r_p_n_-_e_x_p_r_e_s_s_i_o_n Create a new virtual data source by evaluating a math- ematical expression, specified in Reverse Polish Nota- tion (RPN). If you have ever used a traditional HP @@ -317,7 +321,7 @@ one value left on the stack: The result of the expres- sion. - The _r_p_n_-_e_x_p_r_e_s_s_i_o_n in the CCCCDDDDEEEEFFFF function takes both, + The _r_p_n_-_e_x_p_r_e_s_s_i_o_n in the CCDDEEFF function takes both, constant values as well as _v_n_a_m_e variables. The fol- lowing operators can be used on these values: @@ -327,8 +331,6 @@ the stack. The % operator stands for the modulo operation. - - SIN, COS, LOG, EXP, FLOOR, CEIL pops one value from the stack, applies the selected function and pushes the result back onto @@ -362,7 +364,6 @@ CDEF:a=alpha,0,100,LIMIT - DUP, EXC, POP These manipulate the stack directly. DUP will duplicate the top of the stack, pushing the result @@ -406,8 +407,8 @@ since 0:00:00 January 1, 1970. LTIME - This is like TIME ++++ ccccuuuurrrrrrrreeeennnntttt ttttiiiimmmmeeeezzzzoooonnnneeee ooooffffffffsssseeeetttt iiiinnnn - sssseeeeccccoooonnnnddddssss. The current offset takes daylight saving + This is like TIME ++ ccuurrrreenntt ttiimmeezzoonnee ooffffsseett iinn + sseeccoonnddss. The current offset takes daylight saving time into account, given your OS supports this. If you were looking at a sample, in Zurich, in sum- mer, the offset would be 2*3600 seconds, as Zurich @@ -419,17 +420,17 @@ calculation. Please note that you may only use _v_n_a_m_e variables that - you previously defined by either DDDDEEEEFFFF or CCCCDDDDEEEEFFFF. Further- + you previously defined by either DDEEFF or CCDDEEFF. Further- more, as of this writing (version 0.99.25), you must use at least one _v_n_a_m_e per expression, that is "CDEF:fourtytwo=2,40,+" will yield an error message but not a _v_n_a_m_e fourtytwo that's always equal to 42. - PPPPRRRRIIIINNNNTTTT::::_v_n_a_m_e::::_C_F::::_f_o_r_m_a_t + PPRRIINNTT::_v_n_a_m_e::_C_F::_f_o_r_m_a_t Calculate the chosen consolidation function _C_F over the data-source variable _v_n_a_m_e and "printf" the result to stdout using _f_o_r_m_a_t. In the _f_o_r_m_a_t string there - should be a '%lf' or '%le' marker in the place where + should be a '%lf'or '%le' marker in the place where the number should be printed. If an additional '%s' is found AFTER the marker, the @@ -453,51 +454,51 @@ If you want to put a '%' into your PRINT string, use '%%' instead. - GGGGPPPPRRRRIIIINNNNTTTT::::_v_n_a_m_e::::_C_F::::_f_o_r_m_a_t - Same as PPPPRRRRIIIINNNNTTTT but the result is printed into the graph + GGPPRRIINNTT::_v_n_a_m_e::_C_F::_f_o_r_m_a_t + Same as PPRRIINNTT but the result is printed into the graph below the legend. - CCCCaaaavvvveeeeaaaatttt:::: When using the PPPPRRRRIIIINNNNTTTT and GGGGRRRRPPPPRRRRIIIINNNNTTTT functions to cal- + CCaavveeaatt:: When using the PPRRIINNTT and GGRRPPRRIINNTT functions to cal- culate data summaries over time periods bounded by the current time, it is important to note that the last sample will almost always yield a value of UNKNOWN as it lies after the last update time. This can result in slight - data skewing, particularly with the AAAAVVVVEEEERRRRAAAAGGGGEEEE function. In + data skewing, particularly with the AAVVEERRAAGGEE function. In order to avoid this, make sure that your end time is at least one heartbeat prior to the current time. - CCCCOOOOMMMMMMMMEEEENNNNTTTT::::_t_e_x_t - Like GGGGPPPPRRRRIIIINNNNTTTT but the _t_e_x_t is simply printed into the + CCOOMMMMEENNTT::_t_e_x_t + Like GGPPRRIINNTT but the _t_e_x_t is simply printed into the graph. - HHHHRRRRUUUULLLLEEEE::::_v_a_l_u_e####_r_r_g_g_b_b[::::_l_e_g_e_n_d] + HHRRUULLEE::_v_a_l_u_e##_r_r_g_g_b_b[::_l_e_g_e_n_d] Draw a horizontal rule into the graph and optionally add a legend - VVVVRRRRUUUULLLLEEEE::::_t_i_m_e####_r_r_g_g_b_b[::::_l_e_g_e_n_d] + VVRRUULLEE::_t_i_m_e##_r_r_g_g_b_b[::_l_e_g_e_n_d] Draw a vertical rule into the graph and optionally add a legend - LLLLIIIINNNNEEEE{1111|2222|3333}::::_v_n_a_m_e[####_r_r_g_g_b_b[::::_l_e_g_e_n_d]] + LLIINNEE{11|22|33}::_v_n_a_m_e[##_r_r_g_g_b_b[::_l_e_g_e_n_d]] Plot for the requested data, using the color speci- fied. Write a legend into the graph. The 3 possible - keywords LLLLIIIINNNNEEEE1111, LLLLIIIINNNNEEEE2222, and LLLLIIIINNNNEEEE3333 generate increasingly + keywords LLIINNEE11, LLIINNEE22, and LLIINNEE33 generate increasingly wide lines. If no color is defined, the drawing is done 'blind' this is useful in connection with the - SSSSTTTTAAAACCCCKKKK function when you want to ADD the values of two + SSTTAACCKK function when you want to ADD the values of two data-sources without showing it in the graph. - AAAARRRREEEEAAAA:_v_n_a_m_e[####_r_r_g_g_b_b[::::_l_e_g_e_n_d]] - Does the same as LLLLIIIINNNNEEEE????, but the area between 0 and the + AARREEAA:_v_n_a_m_e[##_r_r_g_g_b_b[::_l_e_g_e_n_d]] + Does the same as LLIINNEE??, but the area between 0 and the graph will be filled with the color specified. - SSSSTTTTAAAACCCCKKKK:_v_n_a_m_e[####_r_r_g_g_b_b[::::_l_e_g_e_n_d]] - Does the same as LLLLIIIINNNNEEEE????, but the graph gets stacked on - top of the previous LLLLIIIINNNNEEEE????, AAAARRRREEEEAAAA or SSSSTTTTAAAACCCCKKKK graph. - Depending on the type of the previous graph, the SSSSTTTTAAAACCCCKKKK - will be either a LLLLIIIINNNNEEEE???? or an AAAARRRREEEEAAAA. This obviously - implies that the first SSSSTTTTAAAACCCCKKKK must be preceded by an - AAAARRRREEEEAAAA or LLLLIIIINNNNEEEE???? -- you need something to stack something + SSTTAACCKK:_v_n_a_m_e[##_r_r_g_g_b_b[::_l_e_g_e_n_d]] + Does the same as LLIINNEE??, but the graph gets stacked on + top of the previous LLIINNEE??, AARREEAA or SSTTAACCKK graph. + Depending on the type of the previous graph, the SSTTAACCKK + will be either a LLIINNEE?? or an AARREEAA. This obviously + implies that the first SSTTAACCKK must be preceded by an + AARREEAA or LLIINNEE?? -- you need something to stack something onto in the first place ;) Note, that when you STACK onto *UNKNOWN* data, rrdtool @@ -506,8 +507,8 @@ a CDEF argument with IF and UN functions to turn *UNKNOWN* into zero ... -NNNNOOOOTTTTEEEESSSS oooonnnn lllleeeeggggeeeennnndddd aaaarrrrgggguuuummmmeeeennnnttttssss - EEEEssssccccaaaappppiiiinnnngggg tttthhhheeee ccccoooolllloooonnnn +NNOOTTEESS oonn lleeggeenndd aarrgguummeennttss + EEssccaappiinngg tthhee ccoolloonn In a ':' in a _l_e_g_e_n_d argument will mark the end of the legend. To enter a ':' into a legend, the colon must be @@ -516,7 +517,7 @@ sary to write two backslashes so that one is passed onto rrd_graph. - SSSSttttrrrriiiinnnngggg FFFFoooorrrrmmmmaaaattttttttiiiinnnngggg + SSttrriinngg FFoorrmmaattttiinngg The text printed below the actual graph can be formated by appending special escaped characters at the end of a text. @@ -524,37 +525,43 @@ pushed onto the graph according to the character speci- fied. - Valid markers are: \\\\jjjj for justified, \\\\llll for left aligned, - \\\\rrrr for right aligned and \\\\cccc for centered. In the next - section there is an example showing how to use centered - formating. + Valid markers are: \\jj for justified, \\ll for left aligned, + \\rr for right aligned and \\cc for centered. In the next sec- + tion there is an example showing how to use centered for- + mating. Normally there are two space characters inserted between every two items printed into the graph. The space follow- - ing a string can be suppressed by putting a \\\\gggg at the end - of the string. The \\\\gggg also squshes any space inside the + ing a string can be suppressed by putting a \\gg at the end + of the string. The \\gg also squshes any space inside the string if it is at the very end of the string. This can be - used in connection with %%%%ssss to supress empty unit strings. + used in connection with %%ss to supress empty unit strings. GPRINT:a:MAX:%lf%s\g - A special case is COMMENT:\\\\ssss this inserts some additional + A special case is COMMENT:\\ss this inserts some additional vertical space before placing the next row of legends. -NNNNOOOOTTTTEEEE oooonnnn RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss + When text has to be formated without special instructions + from your side, rrdtool will automatically justify the + text as soon as one string goes over the right edge. If + you want to prevent the justification without forcing a + newline, you can use the special tag \\JJ at the end of the + string to disable the auto justification. + +NNOOTTEE oonn RReettuurrnn VVaalluueess Whenever rrd_graph gets called, it prints a line telling the size of the gif it has just created to STDOUT. This line looks like this: XSIZExYSIZE. -EEEEXXXXAAAAMMMMPPPPLLLLEEEE 1111 +EEXXAAMMPPLLEE 11 rrdtool graph demo.gif --title="Demo Graph" \ DEF:cel=demo.rrd:exhaust:AVERAGE \ "CDEF:far=cel,1.8,*,32,+"" \ LINE2:cel#00a000:"D. Celsius" \ LINE2:far#ff0000:"D. Fahrenheit\c" - -EEEEXXXXAAAAMMMMPPPPLLLLEEEE 2222 +EEXXAAMMPPLLEE 22 This example demonstrates the syntax for using IF and UN to set _*_U_N_K_N_O_W_N_* values to 0. This technique is useful if you are aggregating interface data where the start dates @@ -581,17 +588,13 @@ would have 0,0,7942099 and the real value would be the replacement. -EEEEXXXXAAAAMMMMPPPPLLLLEEEE 3333 +EEXXAAMMPPLLEE 33 This example shows two ways to use the INF function. First it makes the background change color during half of the hours. Then, it uses AREA and STACK to draw a picture. If one of the inputs was UNKNOWN, all inputs are overlaid with another AREA. - - - - rrdtool graph example.png --title="INF demo" \ DEF:val1=some.rrd:ds0:AVERAGE \ DEF:val2=some.rrd:ds1:AVERAGE \ @@ -628,12 +631,12 @@ have to add NEGINF in order to extend the coverage of the rea to whole graph. -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR Tobias Oetiker -RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS +RREEFFEERREENNCCEESS [1] http://www.dotpoint.com/xnumber/rpn_or_adl.htm -2002-06-20 1.0.40 RRDGRAPH(1) +1.0.41 2003-02-16 RRDGRAPH(1) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdtool.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdtool.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdtool.html 2003-02-20 15:24:02.000000000 -0800 @@ -1,223 +1,276 @@ - - -rrdtool - - + + + +rrdtool + + - + - +

-

-

NAME

-

rrdtool - round robin database tool

-
PDF version.

-


-

SYNOPSIS

-

rrdtool - | function

-

-


-

DESCRIPTION

-

-

OVERVIEW

-

It is pretty easy to gather status information from all sorts of +

+

+

NAME

+

rrdtool - round robin database tool

+
PDF version.

+

+
+

SYNOPSIS

+

rrdtool - | function

+

+

+
+

DESCRIPTION

+

+

+

OVERVIEW

+

It is pretty easy to gather status information from all sorts of things, ranging from the temperature in your office to the number of octets which have passed through the FDDI interface of your router. But it is not so trivial to store this data in a efficient and -systematic manner. This is where rrdtool kicks in. It lets you -log and analyze the data you gather from all kinds of data-sources -(DS). The data analysis part of rrdtool is based on the ability to +systematic manner. This is where rrdtool kicks in. It lets you +log and analyze the data you gather from all kinds of data-sources +(DS). The data analysis part of rrdtool is based on the ability to quickly generate graphical representations of the data values -collected over a definable time period.

-

In this man page you will find general information on the design and +collected over a definable time period.

+

In this man page you will find general information on the design and functionality of the Round Robin Database Tool (rrdtool). For a more detailed description of how to use the individual functions of the -rrdtool check the corresponding man page.

-

For an introduction to the usage of rrdtool make sure you check the rrdtutorial manpage.

-

-

FUNCTIONS

-

While the man pages talk of command line switches you have to set in -order to make rrdtool work it is important to note that the -rrdtool can be 'remote controlled' through a set of pipes. This +rrdtool check the corresponding man page.

+

For an introduction to the usage of rrdtool make sure you check the rrdtutorial manpage.

+

+

+

FUNCTIONS

+

While the man pages talk of command line switches you have to set in +order to make rrdtool work it is important to note that the +rrdtool can be 'remote controlled' through a set of pipes. This saves a considerable amount of startup time when you plan to make -rrdtool do a lot of things quickly. Check the section on Remote Control further down. There is also a number of language bindings +rrdtool do a lot of things quickly. Check the section on Remote Control further down. There is also a number of language bindings for rrdtool which allow you to use it directly from perl, python, tcl, -php, ...

-
-
create
-
-Set up a new Round Robin Database (RRD). Check the rrdcreate manpage. -

-
update
-
-Store new data values into an RRD. Check the rrdupdate manpage. -

-
graph
-
+php, ...

+
+
create
+
+
+Set up a new Round Robin Database (RRD). Check the rrdcreate manpage. +
+

+
update
+
+
+Store new data values into an RRD. Check the rrdupdate manpage. +
+

+
graph
+
+
Create a graph from data stored in one or several RRD. Apart from -generating graphs, data can also be extracted to stdout. Check the rrdgraph manpage. -

-
dump
-
+generating graphs, data can also be extracted to stdout. Check the rrdgraph manpage. +
+

+
dump
+
+
Dump the contents of an RRD in plain ASCII. In connection with restore you can use it to transport an rrd from one architecture to another. -Check the rrddump manpage. -

-
restore
-
-Restore an RRD in XML format to a binary rrd ... Check the rrdrestore manpage -

-
fetch
-
+Check the rrddump manpage. +
+

+
restore
+
+
+Restore an RRD in XML format to a binary rrd ... Check the rrdrestore manpage +
+

+
fetch
+
+
Get data for a certain time period from a RRD. The graph function -uses fetch to retrieve its data from an rrd. Check the rrdfetch manpage. -

-
tune
-
-Alter setup of an RRD. Check the rrdtune manpage. -

-
last
-
-Find last update time of an RRD. Check the rrdlast manpage. -

-
rrdresize
-
-Change the size of individual RRAs ... Dangerous! Check the rrdresize manpage. -

-
xport
-
-Export data retrieved from one or several RRD. Check the rrdxport manpage -

-
rrdcgi
-
+uses fetch to retrieve its data from an rrd. Check the rrdfetch manpage. +
+

+
tune
+
+
+Alter setup of an RRD. Check the rrdtune manpage. +
+

+
last
+
+
+Find last update time of an RRD. Check the rrdlast manpage. +
+

+
info
+
+
+Display information about an RRD ... Check the rrdinfo manpage +
+

+
rrdresize
+
+
+Change the size of individual RRAs ... Dangerous! Check the rrdresize manpage. +
+

+
xport
+
+
+Export data retrieved from one or several RRD. Check the rrdxport manpage +
+

+
rrdcgi
+
+
This is a standalone tool for producing rrd graphs on the fly. Check -the rrdcgi manpage. -

-

-

HOW DOES RRDTOOL WORK?

-
-
Data acquisition
-
+the rrdcgi manpage. +
+

+

+

+

HOW DOES RRDTOOL WORK?

+
+
Data acquisition
+
+
When monitoring the state of a system, it is convenient to have the data available at a constant interval. Unfortunately you may not always be able to fetch data at exactly the time you want -to. Therefore rrdtool lets you update the logfile at any time you +to. Therefore rrdtool lets you update the logfile at any time you want. It will automatically interpolate the value of the data-source -(DS) at the latest official time-slot and write this value to the +(DS) at the latest official time-slot and write this value to the log. The value you have supplied is stored as well and is also taken into account when interpolating the next log entry. -

-
Consolidation
-
+
+

+
Consolidation
+
+
You may log data at a 1 minute interval, but you are also be interested to know the development of the data over the last year. You could do this by simply storing the data in 1 minute interval, for one year. While this would take considerable disk space it would also take a lot of time to analyze the data when you wanted to create a graph -covering the whole year. rrdtool offers a solution to this +covering the whole year. rrdtool offers a solution to this problem through its data consolidation feature. When setting up -an Round Robin Database (RRD), you can define at which interval +an Round Robin Database (RRD), you can define at which interval this consolidation should occur, and what consolidation function -(CF) (average, minimum, maximum, last) should be used to +(CF) (average, minimum, maximum, last) should be used to build the consolidated values (see rrdcreate). You can define any -number of different consolidation setups within one RRD. They will -all be maintained on the fly when new data is loaded into the RRD. -

-
Round Robin Archives
-
+number of different consolidation setups within one RRD. They will +all be maintained on the fly when new data is loaded into the RRD. +
+

+
Round Robin Archives
+
+
Data values of the same consolidation setup are stored into Round -Robin Archives (RRA). This is a very efficient manner to store data +Robin Archives (RRA). This is a very efficient manner to store data for a certain amount of time, while using a known amount of storage space. -

It works like this: If you want to store 1000 values in 5 minute -interval, rrdtool will allocate space for 1000 data values and a +

+
+

It works like this: If you want to store 1000 values in 5 minute +interval, rrdtool will allocate space for 1000 data values and a header area. In the header it will store a pointer telling which one of the values in the storage area was last written to. New values are written to the Round Robin Archive in a ... you guess it ... round robin manner. This automatically limits the history to the last -1000 values. Because you can define several RRAs within a single RRD, +1000 values. Because you can define several RRAs within a single RRD, you can setup another one, storing 750 data values at a 2 hour interval and thus keeping a log for the last two months although at a lower -resolution.

-

The use of RRAs guarantees that the RRD does not grow over +resolution.

+
+
+

The use of RRAs guarantees that the RRD does not grow over time and that old data is automatically eliminated. By using the consolidation feature, you can still keep data for a very long time, while gradually reducing the resolution of the data along the time -axis. Using different consolidation functions (CF) allows you to +axis. Using different consolidation functions (CF) allows you to store exactly the type of information that actually interests you. (Maximum one minute traffic on the LAN, minimum temperature of -the wine cellar, total minutes down time ...)

-

-
Unknown Data
-
-As mentioned earlier, the RRD stores data at a constant +the wine cellar, total minutes down time ...)

+
+

+
Unknown Data
+
+
+As mentioned earlier, the RRD stores data at a constant interval. Now it may happen that no new data is available when a -value has to be written to the RRD. Data acquisition may not be -possible for one reason or an other. The rrdtool handles these -situations by storing an *UNKNOWN* value into the database. The -value '*UNKNOWN*' is supported through all the functions of the -database. When consolidating the amount of *UNKNOWN* data is +value has to be written to the RRD. Data acquisition may not be +possible for one reason or an other. The rrdtool handles these +situations by storing an *UNKNOWN* value into the database. The +value '*UNKNOWN*' is supported through all the functions of the +database. When consolidating the amount of *UNKNOWN* data is accumulated and when a new consolidated value is ready to be written -to its Round Robin Archive (RRA) a validity check is performed to +to its Round Robin Archive (RRA) a validity check is performed to make sure that the percentage of unknown data in the new value is -below a configurable level. If so, an *UNKNOWN* value will be -written to the RRA. -

-
Graphing
-
-The rrdtool also allows one to generate reports in numerical and +below a configurable level. If so, an *UNKNOWN* value will be +written to the RRA. +
+

+
Graphing
+
+
+The rrdtool also allows one to generate reports in numerical and graphical form based on the data stored in one or several -RRDs. The graphing feature is fully configurable. Size, color and -contents of the graph can be defined freely. Check the rrdgraph manpage +RRDs. The graphing feature is fully configurable. Size, color and +contents of the graph can be defined freely. Check the rrdgraph manpage for more information on this. -

-

-

REMOTE CONTROL

-

When you start rrdtool with the command line option '-', it waits +

+

+

+

+

REMOTE CONTROL

+

When you start rrdtool with the command line option '-', it waits for input via standard in. With this feature you can improve -performance by attaching rrdtool to another process (mrtg is one -example) through a set of pipes. Over the pipes rrdtool accepts the +performance by attaching rrdtool to another process (mrtg is one +example) through a set of pipes. Over the pipes rrdtool accepts the same arguments as on the command line. When a command is completed, -rrdtool will print the string 'OK', followed by timing information of -the form u:usertime s:systemtime both values are running +rrdtool will print the string 'OK', followed by timing information of +the form u:usertime s:systemtime both values are running totals of seconds since rrdtool was started. If an error occurs, a line -of the form 'ERROR: Description of error' will be printed. rrdtool -will not abort if possible, but follow the ERROR line with an OK line.

-

-


-

SEE ALSO

-

rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast, rrdxport

-

-


-

BUGS

-

Bugs ? Features !

-

-


-

AUTHOR

-

Tobias Oetiker <oetiker at ee.ethz.ch>

+of the form 'ERROR: Description of error' will be printed. rrdtool +will not abort if possible, but follow the ERROR line with an OK line.

+

+

+
+

SEE ALSO

+

rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast, rrdxport

+

+

+
+

BUGS

+

Bugs ? Features !

+

+

+
+

AUTHOR

+

Tobias Oetiker <oetiker at ee.ethz.ch>

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/RRDs.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/RRDs.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/RRDs.txt 2003-02-20 15:24:02.000000000 -0800 @@ -2,10 +2,10 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE RRDs - Access rrdtool as a shared module -SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS +SSYYNNOOPPSSIISS use RRDs; RRDs::error RRDs::last ... @@ -16,9 +16,8 @@ RRDs::fetch ... RRDs::tune ... - -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN - CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee +DDEESSCCRRIIPPTTIIOONN + CCaalllliinngg SSeeqquueennccee This module accesses rrdtool functionality directly from within perl. The arguments to the functions listed in the @@ -37,7 +36,7 @@ is also valid. - EEEErrrrrrrroooorrrr HHHHaaaannnnddddlllliiiinnnngggg + EErrrroorr HHaannddlliinngg The RRD functions will not abort your program even when they can not make sense out of the arguments you fed them. @@ -52,18 +51,17 @@ my $ERR=RRDs::error; die "ERROR while updating mydemo.rrd: $ERR\n" if $ERR; - - RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss + RReettuurrnn VVaalluueess The functions RRDs::last, RRDs::graph, RRDs::info and RRDs::fetch return their findings. - RRRRRRRRDDDDssss::::::::llllaaaasssstttt returns a single INTEGER representing the last + RRRRDDss::::llaasstt returns a single INTEGER representing the last update time. $lastupdate = RRDs::last ... - RRRRRRRRDDDDssss::::::::ggggrrrraaaapppphhhh returns an pointer to an ARRAY containing the + RRRRDDss::::ggrraapphh returns an pointer to an ARRAY containing the x-size and y-size of the created gif and results of the PRINT arguments. @@ -71,7 +69,7 @@ print "Gifsize: ${xsize}x${ysize}\n"; print "Averages: ", (join ", ", @$averages); - RRRRRRRRDDDDssss::::::::iiiinnnnffffoooo returns a pointer to a hash. The keys of the + RRRRDDss::::iinnffoo returns a pointer to a hash. The keys of the hash represent the property names of the rrd and the val- ues of the hash are the values of the properties. @@ -80,7 +78,7 @@ print "$key = $$hash{$key}\n"; } - RRRRRRRRDDDDssss::::::::ffffeeeettttcccchhhh is the most complex of the pack regarding + RRRRDDss::::ffeettcchh is the most complex of the pack regarding return values. There are 4 values. Two normal integers, a pointer to an array and a pointer to a array of pointers. @@ -102,7 +100,7 @@ See the examples directory for more ways to use this extension. -NNNNOOOOTTTTEEEE +NNOOTTEE If you are manipulating the TZ variable you should also call the posixs function tzset to initialize all internal state of the library for properly operating in the time- @@ -112,10 +110,9 @@ $ENV{TZ} = 'CET'; POSIX::tzset(); - -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR Tobias Oetiker -2002-10-11 1.0.40 RRDs(3) +1.0.41 2003-02-19 RRDs(3) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdcgi.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdcgi.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdcgi.txt 2003-02-20 15:24:02.000000000 -0800 @@ -2,29 +2,29 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE rrdcgi - create web pages containing RRD graphs based on templates -SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS - #!/path/to/rrrrrrrrddddccccggggiiii [--------ffffiiiilllltttteeeerrrr] +SSYYNNOOPPSSIISS + #!/path/to/rrrrddccggii [----ffiilltteerr] -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN - rrrrrrrrddddccccggggiiii is a sort of very limited script interpreter. Its +DDEESSCCRRIIPPTTIIOONN + rrrrddccggii is a sort of very limited script interpreter. Its purpose is to run as a cgi-program and parse a web page - template containing special tag referring to the graph. The --------llllaaaazzzzyyyy + tag referring to the graph. The ----llaazzyy option in RRD graph can be used to make sure that graphs are only regenerated when they are out of - date. The arguments to the RRRRRRRRDDDD::::::::GGGGRRRRAAAAPPPPHHHH tag work as - described in the rrrrrrrrddddggggrrrraaaapppphhhh manual page. + date. The arguments to the RRRRDD::::GGRRAAPPHH tag work as + described in the rrrrddggrraapphh manual page. - Use the --------llllaaaazzzzyyyy option in your RRD::GRAPH tags, to + Use the ----llaazzyy option in your RRD::GRAPH tags, to reduce the load on your server. This option makes sure that graphs are only regenerated when the old ones are out of date. - If you do not specify your own --------iiiimmmmggggiiiinnnnffffoooo format, + If you do not specify your own ----iimmggiinnffoo format, the following will be used: @@ -113,13 +113,13 @@ file argument will get dropped. RRD::PRINT _n_u_m_b_e_r - If the preceding RRRRRRRRDDDD::::::::GGGGRRRRAAAAPPPPHHHH tag contained and - PPPPRRRRIIIINNNNTTTT arguments, then you can access their output + If the preceding RRRRDD::::GGRRAAPPHH tag contained and + PPRRIINNTT arguments, then you can access their output with this tag. The _n_u_m_b_e_r argument refers to the - number of the PPPPRRRRIIIINNNNTTTT argument. This first PPPPRRRRIIIINNNNTTTT has + number of the PPRRIINNTT argument. This first PPRRIINNTT has _n_u_m_b_e_r 0. -EEEEXXXXAAAAMMMMPPPPLLLLEEEE 1111 +EEXXAAMMPPLLEE 11 The example below creates a web pages with a single RRD graph. @@ -144,8 +144,7 @@ - -EEEEXXXXAAAAMMMMPPPPLLLLEEEE 2222 +EEXXAAMMPPLLEE 22 This script is slightly more elaborate, it allows you to run it from a form which sets RRD_NAME. RRD_NAME is then used to select which RRD you want to use a source for your @@ -171,8 +170,7 @@ - -EEEEXXXXAAAAMMMMPPPPLLLLEEEE 3333 +EEXXAAMMPPLLEE 33 This example shows how to handle the case where the RRD, graphs and cgi-bins are seperate directories @@ -196,9 +194,8 @@ Note 2: The SRC=/.../gifs should be paths from the view of the webserver/browser -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR Tobias Oetiker -2002-04-09 1.0.40 RRDCGI(1) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/cdeftutorial.html ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/cdeftutorial.html (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/cdeftutorial.html 2003-02-20 15:24:02.000000000 -0800 @@ -1,77 +1,81 @@ - - -cdeftutorial - - + + + +cdeftutorial + + - + - +

-

-

NAME

-

cdeftutorial - Alex van den Bogaerdt's CDEF tutorial

-
PDF version.

-


-

DESCRIPTION

-

You provide a question and I will try to provide an answer in the next -release. No feedback equals no changes!

-

Additions to this document are also welcome.

-

Alex van den Bogaerdt <alex at ergens.op.het.net>

-

-

Why this tutorial ?

-

One of the powerful parts of RRDtool is its ability to do all sorts +

+

+

NAME

+

cdeftutorial - Alex van den Bogaerdt's CDEF tutorial

+
PDF version.

+

+
+

DESCRIPTION

+

You provide a question and I will try to provide an answer in the next +release. No feedback equals no changes!

+

Additions to this document are also welcome.

+

Alex van den Bogaerdt <alex at ergens.op.het.net>

+

+

+

Why this tutorial ?

+

One of the powerful parts of RRDtool is its ability to do all sorts of calculations on the data retrieved from it's databases. However RRDtool's many options and syntax make it difficult for the average user to understand. The manuals are good at explaining what these @@ -81,160 +85,165 @@ If you are happy with the official documentation, you may find this document too simple or even boring. If you do choose to read this tutorial, I also expect you to have read and fully understand my -other tutorial.

-

-

More reading

-

If you have difficulties with the way I try to explain it please read -Steve Rader's the rpntutorial manpage. It may help you understand how this all works.

-

-


-

What are CDEFs ?

-

When retrieving data from an RRD, you are using a ``DEF'' to work with +other tutorial.

+

+

+

More reading

+

If you have difficulties with the way I try to explain it please read +Steve Rader's the rpntutorial manpage. It may help you understand how this all works.

+

+

+
+

What are CDEFs ?

+

When retrieving data from an RRD, you are using a ``DEF'' to work with that data. Think of it as a variable that changes over time (where time is the x-axis). The value of this variable is what is found in the database at that particular time and you can't do any modifications on it. This is what CDEFs are for: they takes values -from DEFs and perform calculations on them.

-

-


-

Syntax

-
+from DEFs and perform calculations on them.

+

+

+
+

Syntax

+
    DEF:var_name_1=some.rrd:ds_name:CF
-   CDEF:var_name_2=RPN_expression
-

You first define ``var_name_1'' to be data collected from data source -``ds_name'' found in RRD ``some.rrd'' with consolidation function ``CF''.

-

Assume the ifInOctets SNMP counter is saved in mrtg.rrd as the DS ``in''. + CDEF:var_name_2=RPN_expression

+

You first define ``var_name_1'' to be data collected from data source +``ds_name'' found in RRD ``some.rrd'' with consolidation function ``CF''.

+

Assume the ifInOctets SNMP counter is saved in mrtg.rrd as the DS ``in''. Then the following DEF defines a variable for the average of that -data source:

-
-   DEF:inbytes=mrtg.rrd:in:AVERAGE
-

Say you want to display bits per second (instead of bytes per second +data source:

+
+   DEF:inbytes=mrtg.rrd:in:AVERAGE
+

Say you want to display bits per second (instead of bytes per second as stored in the database.) You have to define a calculation (hence ``CDEF'') on variable ``inbytes'' and use that variable (inbits) -instead of the original:

-
-   CDEF:inbits=inbytes,8,*
-

It tells to multiply inbytes by eight to get inbits. I'll explain later +instead of the original:

+
+   CDEF:inbits=inbytes,8,*
+

It tells to multiply inbytes by eight to get inbits. I'll explain later how this works. In the graphing or printing functions, you can now use -inbits where you would use inbytes otherwise.

-

Note that variable in the CDEF (inbits) must not be the same as the -variable (inbytes) in the DEF!

-

-


-

RPN-expressions

-

RPN is short-hand for Reverse Polish Notation. It works as follows. +inbits where you would use inbytes otherwise.

+

Note that variable in the CDEF (inbits) must not be the same as the +variable (inbytes) in the DEF!

+

+

+
+

RPN-expressions

+

RPN is short-hand for Reverse Polish Notation. It works as follows. You put the variables or numbers on a stack. You also put operations (things-to-do) on the stack and this stack is then processed. The result will be placed on the stack. At the end, there should be exactly one number left: the outcome of the series of operations. If there is not -exactly one number left, rrdtool will complain loudly.

-

Above multiplication by eight will look like:

-
    -
  1. +exactly one number left, rrdtool will complain loudly.

    +

    Above multiplication by eight will look like:

    +
      +
    1. Start with an empty stack -

      -
    2. +

      +
    3. Put the content of variable inbytes on the stack -

      -
    4. +

      +
    5. Put the number eight on the stack -

      -
    6. +

      +
    7. Put the operation multiply on the stack -

      -
    8. +

      +
    9. Process the stack -

      -
    10. +

      +
    11. Retrieve the value from the stack and put it in variable inbits -

    -

    We will now do an example with real numbers. Suppose the variable -inbytes would have value 10, the stack would be:

    -
      -
    1. +

    +

    We will now do an example with real numbers. Suppose the variable +inbytes would have value 10, the stack would be:

    +
      +
    1. || -

      -
    2. +

      +
    3. |10| -

      -
    4. +

      +
    5. |10|8| -

      -
    6. +

      +
    7. |10|8|*| -

      -
    8. +

      +
    9. |80| -

      -
    10. +

      +
    11. || -

    -

    Processing the stack (step 5) will retrieve one value from the stack +

+

Processing the stack (step 5) will retrieve one value from the stack (from the right at step 4). This is the operation multiply and this takes two values off the stack as input. The result is put back on the stack (the value 80 in this case). For multiplication the order doesn't matter but for other operations like subtraction and division it does. -Generally speaking you have the following order:

-
-   y = A - B  -->  y=minus(A,B)  -->  CDEF:y=A,B,-
-

This is not very intuitive (at least most people don't think so). For -the function f(A,B) you reverse the position of ``f'' but you do not -reverse the order of the variables.

-

-


-

Converting your wishes to RPN

-

First, get a clear picture of what you want to do. Break down the problem +Generally speaking you have the following order:

+
+   y = A - B  -->  y=minus(A,B)  -->  CDEF:y=A,B,-
+

This is not very intuitive (at least most people don't think so). For +the function f(A,B) you reverse the position of ``f'' but you do not +reverse the order of the variables.

+

+

+
+

Converting your wishes to RPN

+

First, get a clear picture of what you want to do. Break down the problem in smaller portions until they cannot be split anymore. Then it is rather -simple to convert your ideas into RPN.

-

Suppose you have several RRDs and would like to add up some counters in +simple to convert your ideas into RPN.

+

Suppose you have several RRDs and would like to add up some counters in them. These could be, for instance, the counters for every WAN link you -are monitoring.

-

You have:

-
+are monitoring.

+

You have:

+
    router1.rrd with link1in link2in
    router2.rrd with link1in link2in
-   router3.rrd with link1in link2in
-

Suppose you would like to add up all these counters, except for link2in -inside router2.rrd. You need to do:

-

(in this example, ``router1.rrd:link1in'' means the DS link1in inside the -RRD router1.rrd)

-
+   router3.rrd with link1in link2in
+

Suppose you would like to add up all these counters, except for link2in +inside router2.rrd. You need to do:

+

(in this example, ``router1.rrd:link1in'' means the DS link1in inside the +RRD router1.rrd)

+
    router1.rrd:link1in
    router1.rrd:link2in
    router2.rrd:link1in
    router3.rrd:link1in
    router3.rrd:link2in 
    --------------------   +
-   (outcome of the sum)
-

As a mathmatical function, this could be written:

-

add(router1.rrd:link1in , router1.rrd:link2in , router2.rrd:link1in , router3.rrd:link1in , router3.rrd:link2.in)

-

With RRDtool and RPN, first, define the inputs:

-
+   (outcome of the sum)
+

As a mathmatical function, this could be written:

+

add(router1.rrd:link1in , router1.rrd:link2in , router2.rrd:link1in , router3.rrd:link1in , router3.rrd:link2.in)

+

With RRDtool and RPN, first, define the inputs:

+
    DEF:a=router1.rrd:link1in:AVERAGE
    DEF:b=router1.rrd:link2in:AVERAGE
    DEF:c=router2.rrd:link1in:AVERAGE
    DEF:d=router3.rrd:link1in:AVERAGE
-   DEF:e=router3.rrd:link2in:AVERAGE
-

Now, the mathematical function becomes: add(a,b,c,d,e)

-

In RPN, there's no operator that sums more than two values so you need + DEF:e=router3.rrd:link2in:AVERAGE

+

Now, the mathematical function becomes: add(a,b,c,d,e)

+

In RPN, there's no operator that sums more than two values so you need to do several additions. You add a and b, add c to the result, add d -to the result and add e to the result.

-
+to the result and add e to the result.

+
    push a:         a     stack contains the value of a
    push b and add: b,+   stack contains the result of a+b
    push c and add: c,+   stack contains the result of a+b+c
    push d and add: d,+   stack contains the result of a+b+c+d
-   push e and add: e,+   stack contains the result of a+b+c+d+e
-

What was calculated here would be written down as:

-
-   ( ( ( (a+b) + c) + d) + e) >
-

This is in RPN: CDEF:result=a,b,+,c,+,d,+,e,+

-

This is correct but it can be made more clear to humans. It does + push e and add: e,+ stack contains the result of a+b+c+d+e

+

What was calculated here would be written down as:

+
+   ( ( ( (a+b) + c) + d) + e) >
+

This is in RPN: CDEF:result=a,b,+,c,+,d,+,e,+

+

This is correct but it can be made more clear to humans. It does not matter if you add a to b and then add c to the result or first add b to c and then add a to the result. This makes it possible to -rewrite the RPN into CDEF:result=a,b,c,d,e,+,+,+,+ which is -evaluatated differently:

-
+rewrite the RPN into CDEF:result=a,b,c,d,e,+,+,+,+ which is
+evaluatated differently:

+
    push value of variable a on the stack: a
    push value of variable b on the stack: a b
    push value of variable c on the stack: a b c
@@ -247,364 +256,374 @@
    push operator + on the stack:          a b Q +
    and process it:                        a R       (where R == b+Q)
    push operator + on the stack:          a R +
-   and process it:                        S         (where S == a+R)
-

As you can see the RPN expression a,b,c,d,e,+,+,+,+,+ will evaluate in -((((d+e)+c)+b)+a) and it has the same outcome as a,b,+,c,+,d,+,e,+ + and process it: S (where S == a+R)

+

As you can see the RPN expression a,b,c,d,e,+,+,+,+,+ will evaluate in +((((d+e)+c)+b)+a) and it has the same outcome as a,b,+,c,+,d,+,e,+ According to Steve Rader this is called the commutative law of addition but you may forget this right away, as long as you remember what it -represents.

-

Now look at an expression that contains a multiplication:

-

First in normal math: let result = a+b*c. In this case you can't +represents.

+

Now look at an expression that contains a multiplication:

+

First in normal math: let result = a+b*c. In this case you can't choose the order yourself, you have to start with the multiplication and then add a to it. You may alter the position of b and c, you may -not alter the position of a and b.

-

You have to take this in consideration when converting this expression +not alter the position of a and b.

+

You have to take this in consideration when converting this expression into RPN. Read it as: ``Add the outcome of b*c to a'' and then it is -easy to write the RPN expression: result=a,b,c,*,+ -Another expression that would return the same: result=b,c,*,a,+

-

In normal math, you may encounter something like ``a*(b+c)'' and this +easy to write the RPN expression: result=a,b,c,*,+ +Another expression that would return the same: result=b,c,*,a,+

+

In normal math, you may encounter something like ``a*(b+c)'' and this can also be converted into RPN. The parenthesis just tell you to first add b and c, and then multiply a with the result. Again, now it is -easy to write it in RPN: result=a,b,c,+,*. Note that this is very +easy to write it in RPN: result=a,b,c,+,*. Note that this is very similar to one of the expressions in the previous paragraph, only the -multiplication and the addition changed places.

-

When you have problems with RPN or when rrdtool is complaining, it's +multiplication and the addition changed places.

+

When you have problems with RPN or when rrdtool is complaining, it's usually a Good Thing to write down the stack on a piece of paper and see what happens. Have the manual ready and pretend to be rrdtool. Just do all the math by hand to see what happens, I'm sure this will -solve most, if not all, problems you encounter.

-

-


-

Some special numbers

-

-

The unknown value

-

Sometimes collecting your data will fail. This can be very common, +solve most, if not all, problems you encounter.

+

+

+
+

Some special numbers

+

+

+

The unknown value

+

Sometimes collecting your data will fail. This can be very common, especially when querying over busy links. RRDtool can be configured to allow for one (or even more) unknown value and calculate the missing update. You can, for instance, query your device every minute. This is creating one so called PDP or primary data point per minute. If you defined your RRD to contain an RRA that stores 5-minute values, you need five of those PDPs to create one CDP (consolidated data point). -These PDPs can become unknown in two cases:

-
    -
  1. +These PDPs can become unknown in two cases:

    +
      +
    1. The updates are too far apart. This is tuned using the ``heartbeat'' setting -

      -
    2. +

      +
    3. The update was set to unknown on purpose by inserting no value (using the template option) or by using ``U'' as the value to insert. -

    -

    When a CDP is calculated, another mechanism determines if this CDP is valid +

+

When a CDP is calculated, another mechanism determines if this CDP is valid or not. If there are too many PDPs unknown, the CDP is unknown as well. This is determined by the xff factor. Please note that one unknown counter update can result in two unknown PDPs! If you only allow for one unknown -PDP per CDP, this makes the CDP go unknown!

-

Suppose the counter increments with one per second and you retrieve it -every minute:

-
+PDP per CDP, this makes the CDP go unknown!

+

Suppose the counter increments with one per second and you retrieve it +every minute:

+
    counter value    resulting rate
    10000
    10060            1; (10060-10000)/60 == 1
    10120            1; (10120-10060)/60 == 1
    unknown          unknown; you don't know the last value
    10240            unknown; you don't know the previous value
-   10300            1; (10300-10240)/60 == 1
-

If the CDP was to be calculated from the last five updates, it would get + 10300 1; (10300-10240)/60 == 1

+

If the CDP was to be calculated from the last five updates, it would get two unknown PDPs and three known PDPs. If xff would have been set to 0.5 which by the way is a commonly used factor, the CDP would have a known value of 1. If xff would have been set to 0.2 then the resulting CDP -would be unknown.

-

You have to decide the proper values for heartbeat, number of PDPs per +would be unknown.

+

You have to decide the proper values for heartbeat, number of PDPs per CDP and the xff factor. As you can see from the previous text they define -the behavior of your RRA.

-

-

Working with unknown data in your database

-

As you have read in the previous chapter, entries in an RRA can be +the behavior of your RRA.

+

+

+

Working with unknown data in your database

+

As you have read in the previous chapter, entries in an RRA can be set to the unknown value. If you do calculations with this type of value, the result has to be unknown too. This means that an expression -such as result=a,b,+ will be unknown if either a or b is unknown. +such as result=a,b,+ will be unknown if either a or b is unknown. It would be wrong to just ignore the unknown value and return the value of the other parameter. By doing so, you would assume ``unknown'' means ``zero'' -and this is not true.

-

There has been a case where somebody was collecting data for over a year. +and this is not true.

+

There has been a case where somebody was collecting data for over a year. A new piece of equipment was installed, a new RRD was created and the scripts were changed to add a counter from the old database and a counter from the new database. The result was disappointing, a large part of the statistics seemed to have vanished mysteriously ... They of course didn't, values from the old database (known values) were added to values from the new database (unknown values) and the result was -unknown.

-

In this case, it is fairly reasonable to use a CDEF that alters unknown +unknown.

+

In this case, it is fairly reasonable to use a CDEF that alters unknown data into zero. The counters of the device were unknown (after all, it wasn't installed yet!) but you know that the data rate through the device -had to be zero (because of the same reason: it was not installed).

-

There are some examples further on that make this change.

-

-

Infinity

-

Infinite data is another form of a special number. It cannot be graphed +had to be zero (because of the same reason: it was not installed).

+

There are some examples further on that make this change.

+

+

+

Infinity

+

Infinite data is another form of a special number. It cannot be graphed because by definition you would never reach the infinite value. You could think of positive and negative infinity (I'm not sure if mathematicians -will agree) depending on the position relative to zero.

-

RRDtool is capable of representing (-not- graphing!) infinity by stopping +will agree) depending on the position relative to zero.

+

RRDtool is capable of representing (-not- graphing!) infinity by stopping at its current maximum (for positive infinity) or minimum (for negative -infinity) without knowing this maximum (minimum).

-

Infinity in rrdtool is mostly used to draw an AREA without knowing its +infinity) without knowing this maximum (minimum).

+

Infinity in rrdtool is mostly used to draw an AREA without knowing its vertical dimensions. You can think of it as drawing an AREA with an infinite height and displaying only the part that is visible in the current graph. This is probably a good way to approximate infinity -and it sure allows for some neat tricks. See below for examples.

-

-

Working with unknown data and infinity

-

Sometimes you would like to discard unknown data and pretend it is zero +and it sure allows for some neat tricks. See below for examples.

+

+

+

Working with unknown data and infinity

+

Sometimes you would like to discard unknown data and pretend it is zero (or any other value for that matter) and sometimes you would like to pretend that known data is unknown (to discard known-to-be-wrong data). This is why CDEFs have support for unknown data. There are also examples -available that show unknown data by using infinity.

-

-


-

Some examples

-

-

Example: using a recently created RRD

-

You are keeping statistics on your router for over a year now. Recently +available that show unknown data by using infinity.

+

+

+
+

Some examples

+

+

+

Example: using a recently created RRD

+

You are keeping statistics on your router for over a year now. Recently you installed an extra router and you would like to show the combined -throughput for these two devices.

-

If you just add up the counters from router.rrd and router2.rrd, you +throughput for these two devices.

+

If you just add up the counters from router.rrd and router2.rrd, you will add known data (from router.rrd) to unknown data (from router2.rrd) for -the bigger part of your stats. You could solve this in a few ways:

-
    -
  • +the bigger part of your stats. You could solve this in a few ways:

    +
      +
    • While creating the new database, fill it with zeros from the start to now. You have to make the database start at or before the least recent time in the other database. -

      -
    • +

      +
    • Alternately you could use CDEF and alter unknown data to zero. -

    -

    Both methods have their pros and cons. The first method is troublesome and +

+

Both methods have their pros and cons. The first method is troublesome and if you want to do that you have to figure it out yourself. It is not possible to create a database filled with zeros, you have to put them in -on purpose. Implementing the second method is described next:

-

What we want is: ``if the value is unknown, replace it with zero''. This +on purpose. Implementing the second method is described next:

+

What we want is: ``if the value is unknown, replace it with zero''. This could be writte in pseudo-code as: if (value is unknown) then (zero) else (value). When reading the rrdgraph manual you notice the ``UN'' function that returns zero or one. You also notice the ``IF'' function -that takes zero or one as input.

-

First look at the ``IF'' function. It takes three values from the stack, +that takes zero or one as input.

+

First look at the ``IF'' function. It takes three values from the stack, the first value is the decision point, the second value is returned to the stack if the evaluation is ``true'' and if not, the third value is returned to the stack. We want the ``UN'' function to decide what happens -so we combine those two functions in one CDEF.

-

Lets write down the two possible paths for the ``IF'' function:

-
+so we combine those two functions in one CDEF.

+

Lets write down the two possible paths for the ``IF'' function:

+
    if true  return a
-   if false return b
-

In RPN: result=x,a,b,IF where ``x'' is either true or false.

-

Now we have to fill in ``x'', this should be the ``(value is unknown)'' part -and this is in RPN: result=value,UN

-

We now combine them: result=value,UN,a,b,IF and when we fill in the -appropriate things for ``a'' and ``b'' we're finished:

-

CDEF:result=value,UN,0,value,IF

-

You may want to read Steve Raders RPN guide if you have difficulties -with the way I explained this last example.

-

If you want to check this RPN expression, just mimic rrdtools behavior:

-
+   if false return b
+

In RPN: result=x,a,b,IF where ``x'' is either true or false.

+

Now we have to fill in ``x'', this should be the ``(value is unknown)'' part +and this is in RPN: result=value,UN

+

We now combine them: result=value,UN,a,b,IF and when we fill in the +appropriate things for ``a'' and ``b'' we're finished:

+

CDEF:result=value,UN,0,value,IF

+

You may want to read Steve Raders RPN guide if you have difficulties +with the way I explained this last example.

+

If you want to check this RPN expression, just mimic rrdtools behavior:

+
    For any known value, the expression evaluates as follows:
    CDEF:result=value,UN,0,value,IF  (value,UN) is not true so it becomes 0
    CDEF:result=0,0,value,IF         "IF" will return the 3rd value
-   CDEF:result=value                The known value is returned
-
+   CDEF:result=value                The known value is returned
+
    For the unknown value, this happens:
    CDEF:result=value,UN,0,value,IF  (value,UN) is true so it becomes 1
    CDEF:result=1,0,value,IF         "IF" sees 1 and returns the 2nd value
-   CDEF:result=0                    Zero is returned
-

Of course, if you would like to see another value instead of zero, you -can use that other value.

-

Eventually, when all unknown data is removed from the RRD, you may want -to remove this rule so that unknown data is properly displayed.

-

-

Example: better handling of unknown data, by using time

-

Above example has one drawback. If you do log unknown data in + CDEF:result=0 Zero is returned

+

Of course, if you would like to see another value instead of zero, you +can use that other value.

+

Eventually, when all unknown data is removed from the RRD, you may want +to remove this rule so that unknown data is properly displayed.

+

+

+

Example: better handling of unknown data, by using time

+

Above example has one drawback. If you do log unknown data in your database after installing your new equipment, it will also be translated into zero and therefore you won't see that there was a -problem. This is not good and what you really want to do is:

-
    -
  • +problem. This is not good and what you really want to do is:

    +
      +
    • If there is unknown data, look at the time that this sample was taken -

      -
    • +

      +
    • If the unknown value is before time xxx, make it zero -

      -
    • +

      +
    • If it is after time xxx, leave it as unknown data -

    -

    This is doable: you can compare the time that the sample was taken +

+

This is doable: you can compare the time that the sample was taken to some known time. Assuming you started to monitor your device on Friday September 17, 00:35:57 MET DST. Translate this time in seconds since 1970-01-01 and it becomes 937521357. If you process unknown values that were received after this time, you want to leave them unknown and if they were ``received'' before this time, you want to translate them into zero (so you can effectively ignore them while adding them to your -other routers counters).

-

Translating Friday September 17, 00:35:57 MET DST into 937521357 can -be done by, for instance, using gnu date:

-
-   date -d "19990917 00:35:57" +%s
-

You could also dump the database and see where the data starts to be -known. There are several other ways of doing this, just pick one.

-

Now we have to create the magic that allows us to process unknown +other routers counters).

+

Translating Friday September 17, 00:35:57 MET DST into 937521357 can +be done by, for instance, using gnu date:

+
+   date -d "19990917 00:35:57" +%s
+

You could also dump the database and see where the data starts to be +known. There are several other ways of doing this, just pick one.

+

Now we have to create the magic that allows us to process unknown values different depending on the time that the sample was taken. -This is a three step process:

-
    -
  1. +This is a three step process:

    +
      +
    1. If the timestamp of the value is after 937521357, leave it as is -

      -
    2. +

      +
    3. If the value is a known value, leave it as is -

      -
    4. +

      +
    5. Change the unknown value into zero. -

    -

    Lets look at part one:

    -
    -    if (true) return the original value
    -

    We rewrite this:

    -
    +

+

Lets look at part one:

+
+    if (true) return the original value
+

We rewrite this:

+
     if (true) return "a"
-    if (false) return "b"
-

We need to calculate true or false from step 1. There is a function + if (false) return "b" +

We need to calculate true or false from step 1. There is a function available that returns the timestamp for the current sample. It is called, how surprisingly, ``TIME''. This time has to be compared to a constant number, we need ``GT''. The output of ``GT'' is true or false and this is good input to ``IF''. We want ``if (time > 937521357) then -(return a) else (return b)''.

-

This process was already described toroughly in the previous chapter -so lets do it quick:

-
+(return a) else (return b)''.

+

This process was already described toroughly in the previous chapter +so lets do it quick:

+
    if (x) then a else b
       where x represents "time>937521357"
       where a represents the original value
       where b represents the outcome of the previous example
-
-
-
-   time>937521357       --> TIME,937521357,GT
-
+      
+   time>937521357       --> TIME,937521357,GT
+
    if (x) then a else b --> x,a,b,IF
    substitute x         --> TIME,937521357,GT,a,b,IF
    substitute a         --> TIME,937521357,GT,value,b,IF
-   substitute b         --> TIME,937521357,GT,value,value,UN,0,value,IF,IF
-

We end up with: -CDEF:result=TIME,937521357,GT,value,value,UN,0,value,IF,IF

-

This looks very complex however as you can see it was not too hard to -come up with.

-

-

Example: Pretending weird data isn't there

-

Suppose you have a problem that shows up as huge spikes in your graph. + substitute b --> TIME,937521357,GT,value,value,UN,0,value,IF,IF

+

We end up with: +CDEF:result=TIME,937521357,GT,value,value,UN,0,value,IF,IF

+

This looks very complex however as you can see it was not too hard to +come up with.

+

+

+

Example: Pretending weird data isn't there

+

Suppose you have a problem that shows up as huge spikes in your graph. You know this happens and why so you decide to work around the problem. Perhaps you're using your network to do a backup at night and by doing so you get almost 10mb/s while the rest of your network activity does -not produce numbers higher than 100kb/s.

-

There are two options:

-
    -
  1. +not produce numbers higher than 100kb/s.

    +

    There are two options:

    +
      +
    1. If the number exceeds 100kb/s it is wrong and you want it masked out by changing it into unknown -

      -
    2. +

      +
    3. You don't want the graph to show more than 100kb/s -

    -

    Pseudo code: if (number > 100) then unknown else number +

+

Pseudo code: if (number > 100) then unknown else number or -Pseudo code: if (number > 100) then 100 else number.

-

The second ``problem'' may also be solved by using the rigid option of +Pseudo code: if (number > 100) then 100 else number.

+

The second ``problem'' may also be solved by using the rigid option of rrdtool graph, however this has not the same result. In this example you can end up with a graph that does autoscaling. Also, if you use -the numbers to display maxima they will be set to 100kb/s.

-

We use ``IF'' and ``GT'' again. ``if (x) then (y) else (z)'' is written +the numbers to display maxima they will be set to 100kb/s.

+

We use ``IF'' and ``GT'' again. ``if (x) then (y) else (z)'' is written down as ``CDEF:result=x,y,z,IF''; now fill in x, y and z. For x you fill in ``number greater than 100kb/s'' becoming ``number,100000,GT'' (kilo is 1000 and b/s is what we measure!). The ``z'' part is ``number'' in both cases and the ``y'' part is either -``UNKN'' for unknown or ``100000'' for 100kb/s.

-

The two CDEF expressions would be:

-
+``UNKN'' for unknown or ``100000'' for 100kb/s.

+

The two CDEF expressions would be:

+
     CDEF:result=number,100000,GT,UNKN,number,IF
-    CDEF:result=number,100000,GT,100000,number,IF
-

-

Example: working on a certain time span

-

If you want a graph that spans a few weeks, but would only want to + CDEF:result=number,100000,GT,100000,number,IF

+

+

+

Example: working on a certain time span

+

If you want a graph that spans a few weeks, but would only want to see some routers data for one week, you need to ``hide'' the rest of the time frame. Don't ask me when this would be useful, it's just -here for the example :)

-

We need to compare the time stamp to a begin date and an end date. -Comparing isn't difficult:

-
+here for the example :)

+

We need to compare the time stamp to a begin date and an end date. +Comparing isn't difficult:

+
         TIME,begintime,GE
-        TIME,endtime,LE
-

These two parts of the CDEF produce either 0 for false or 1 for true. + TIME,endtime,LE

+

These two parts of the CDEF produce either 0 for false or 1 for true. We can now check if they are both 0 (or 1) using a few IF statements but, as Wataru Satoh pointed out, we can use the ``*'' or ``+'' functions -as locical AND and locical OR.

-

For ``*'', the result will be zero (false) if either one of the two +as locical AND and locical OR.

+

For ``*'', the result will be zero (false) if either one of the two operators is zero. For ``+'', the result will only be false (0) when two false (0) operators will be added. Warning: *any* number not equal to 0 will be considered ``true''. This means that, for instance, ``-1,1,+'' (which should be ``true or true'') will become FALSE ... In other words, use ``+'' only if you know for sure that you have positive -numbers (or zero) only.

-

Let's compile the complete CDEF:

-
+numbers (or zero) only.

+

Let's compile the complete CDEF:

+
         DEF:ds0=router1.rrd:AVERAGE
-        CDEF:ds0modified=TIME,begintime,GE,TIME,endtime,LE,*,UNKN,ds0,IF
-

This will return the value of ds0 if both comparisons return true. You -could also do it the other way around:

-
+        CDEF:ds0modified=TIME,begintime,GE,TIME,endtime,LE,*,UNKN,ds0,IF
+

This will return the value of ds0 if both comparisons return true. You +could also do it the other way around:

+
         DEF:ds0=router1.rrd:AVERAGE
-        CDEF:ds0modified=TIME,begintime,LT,TIME,endtime,GT,+,UNKN,ds0,IF
-

This will return an UNKNOWN if either comparison returns true.

-

-

Example: You suspect to have problems and want to see unknown data.

-

Suppose you add up the number of active users on several terminal servers. + CDEF:ds0modified=TIME,begintime,LT,TIME,endtime,GT,+,UNKN,ds0,IF

+

This will return an UNKNOWN if either comparison returns true.

+

+

+

Example: You suspect to have problems and want to see unknown data.

+

Suppose you add up the number of active users on several terminal servers. If one of them doesn't give an answer (or an incorrect one) you get ``NaN'' -in the database (``Not a Number'') and NaN is evaluated as Unknown.

-

In this case, you would like to be alerted to it and the sum of the -remaining values is of no value to you.

-

It would be something like:

-
+in the database (``Not a Number'') and NaN is evaluated as Unknown.

+

In this case, you would like to be alerted to it and the sum of the +remaining values is of no value to you.

+

It would be something like:

+
     DEF:users1=location1.rrd:onlineTS1:LAST
     DEF:users2=location1.rrd:onlineTS2:LAST
     DEF:users3=location2.rrd:onlineTS1:LAST
     DEF:users4=location2.rrd:onlineTS2:LAST
-    CDEF:allusers=users1,users2,users3,users4,+,+,+
-

If you now plot allusers, unknown data in one of users1..users4 will + CDEF:allusers=users1,users2,users3,users4,+,+,+

+

If you now plot allusers, unknown data in one of users1..users4 will show up as a gap in your graph. You want to modify this to show a -bright red line, not a gap.

-

Define an extra CDEF that is unknown if all is okay and is infinite if -there is an unknown value:

-
-    CDEF:wrongdata=allusers,UN,INF,UNKN,IF
-

``allusers,UN'' will evaluate to either true or false, it is the (x) part +bright red line, not a gap.

+

Define an extra CDEF that is unknown if all is okay and is infinite if +there is an unknown value:

+
+    CDEF:wrongdata=allusers,UN,INF,UNKN,IF
+

``allusers,UN'' will evaluate to either true or false, it is the (x) part of the ``IF'' function and it checks if allusers is unknown. The (y) part of the ``IF'' function is set to ``INF'' (which means infinity) -and the (z) part of the function returns ``UNKN''.

-

The logic is: if (allusers == unknown) then return INF else return UNKN.

-

You can now use AREA to display this ``wrongdata'' in bright red. If it +and the (z) part of the function returns ``UNKN''.

+

The logic is: if (allusers == unknown) then return INF else return UNKN.

+

You can now use AREA to display this ``wrongdata'' in bright red. If it is unknown (because allusers is known) then the red AREA won't show up. If the value is INF (because allusers is unknown) then the red AREA will -be filled in on the graph at that particular time.

-
+be filled in on the graph at that particular time.

+
    AREA:allusers#0000FF:combined user count
-   AREA:wrongdata#FF0000:unknown data
-

-

Same example useful with STACKed data:

-

If you use stack in the previous example (as I would do) then you don't + AREA:wrongdata#FF0000:unknown data

+

+

+

Same example useful with STACKed data:

+

If you use stack in the previous example (as I would do) then you don't add up the values. Therefore, there is no relationship between the four values and you don't get a single value to test. Suppose users3 would be unknown at one point in time: users1 is plotted, users2 is stacked on top of users1, users3 is unknown and therefore nothing happens, users4 is stacked on top of users2. -Add the extra CDEFs anyway and use them to overlay the ``normal'' graph:

-
+Add the extra CDEFs anyway and use them to overlay the ``normal'' graph:

+
    DEF:users1=location1.rrd:onlineTS1:LAST
    DEF:users2=location1.rrd:onlineTS2:LAST
    DEF:users3=location2.rrd:onlineTS1:LAST
@@ -615,45 +634,47 @@
    STACK:users2#00FF00:users at ts2
    STACK:users3#00FFFF:users at ts3
    STACK:users4#FFFF00:users at ts4
-   AREA:wrongdata#FF0000:unknown data
-

If there is unknown data in one of users1..users4, the ``wrongdata'' AREA + AREA:wrongdata#FF0000:unknown data

+

If there is unknown data in one of users1..users4, the ``wrongdata'' AREA will be drawn and because it starts at the X-axis and has infinite height -it will effectively overwrite the STACKed parts.

-

You could combine the two CDEF lines into one (we don't use ``allusers'') -if you like. But there are good reasons for writting two CDEFS:

-
    -
  • +it will effectively overwrite the STACKed parts.

    +

    You could combine the two CDEF lines into one (we don't use ``allusers'') +if you like. But there are good reasons for writting two CDEFS:

    +
      +
    • It improves the readability of the script -

      -
    • +

      +
    • It can be used inside GPRINT to display the total number of users -

    -

    If you choose to combine them, you can substitute the ``allusers'' in the -second CDEF with the part after the equal sign from the first line:

    -
    -   CDEF:wrongdata=users1,users2,users3,users4,+,+,+,UN,INF,UNKN,IF
    -

    If you do so, you won't be able to use these next GPRINTs:

    -
    +

+

If you choose to combine them, you can substitute the ``allusers'' in the +second CDEF with the part after the equal sign from the first line:

+
+   CDEF:wrongdata=users1,users2,users3,users4,+,+,+,UN,INF,UNKN,IF
+

If you do so, you won't be able to use these next GPRINTs:

+
    COMMENT:"Total number of users seen"
    GPRINT:allusers:MAX:"Maximum: %6.0lf"
    GPRINT:allusers:MIN:"Minimum: %6.0lf"
    GPRINT:allusers:AVERAGE:"Average: %6.0lf"
-   GPRINT:allusers:LAST:"Current: %6.0lf\n"
-

-


-

The examples from the rrd graph manual page

-

-

Degrees Celcius vs. Degrees Fahrenheit

-
+   GPRINT:allusers:LAST:"Current: %6.0lf\n"
+

+

+
+

The examples from the rrd graph manual page

+

+

+

Degrees Celcius vs. Degrees Fahrenheit

+
    rrdtool graph demo.gif --title="Demo Graph" \
       DEF:cel=demo.rrd:exhaust:AVERAGE \
       CDEF:far=cel,32,-,0.55555,* \
       LINE2:cel#00a000:"D. Celsius" \
-      LINE2:far#ff0000:"D. Fahrenheit\c"
-

This example gets the DS called ``exhaust'' from database ``demo.rrd'' + LINE2:far#ff0000:"D. Fahrenheit\c" +

This example gets the DS called ``exhaust'' from database ``demo.rrd'' and puts the values in variable ``cel''. The CDEF used is evaluated -as follows:

-
+as follows:

+
    CDEF:far=cel,32,-,0.5555,*
    1. push variable "cel"
    2. push 32
@@ -661,13 +682,14 @@
       The stack now contains values that are 32 less than "cel"
    4. push 0.5555
    5. push function "multiply" and process it
-   6. the resulting value is now "(cel-32)*0.55555"
-

Note that if you take the celcius to fahrenheit function you should + 6. the resulting value is now "(cel-32)*0.55555"

+

Note that if you take the celcius to fahrenheit function you should be doing ``5/9*(cel-32)'' so 0.55555 is not exactly correct. It is close -enough for this purpose and it saves a calculation.

-

-

Changing unknown into zero

-
+enough for this purpose and it saves a calculation.

+

+

+

Changing unknown into zero

+
    rrdtool graph demo.gif --title="Demo Graph" \
       DEF:idat1=interface1.rrd:ds0:AVERAGE \
       DEF:idat2=interface2.rrd:ds0:AVERAGE \
@@ -676,8 +698,8 @@
       CDEF:agginput=idat1,UN,0,idat1,IF,idat2,UN,0,idat2,IF,+,8,* \
       CDEF:aggoutput=odat1,UN,0,odat1,IF,odat2,UN,0,odat2,IF,+,8,* \
       AREA:agginput#00cc00:Input Aggregate \
-      LINE1:aggoutput#0000FF:Output Aggregate
-

These two CDEFs are built from several functions. It helps to + LINE1:aggoutput#0000FF:Output Aggregate

+

These two CDEFs are built from several functions. It helps to split them when viewing what they do. Starting with the first CDEF we would get: idat1,UN --> a @@ -690,13 +712,14 @@ five items on the stack, it is done the same and will return answer ``h''. The resulting stack is therefore ``d,h''. The expression has been simplified to ``d,h,+,8,*'' and it will now be -easy to see that we add ``d'' and ``h'', and multiply the result with eight.

-

The end result is that we have added ``idat1'' and ``idat2'' and in the +easy to see that we add ``d'' and ``h'', and multiply the result with eight.

+

The end result is that we have added ``idat1'' and ``idat2'' and in the process we effectively ignored unknown values. The result is multiplied -by eight, most likely to convert bytes/s to bits/s.

-

-

Infinity demo

-
+by eight, most likely to convert bytes/s to bits/s.

+

+

+

Infinity demo

+
    rrdtool graph example.png --title="INF demo" \
       DEF:val1=some.rrd:ds0:AVERAGE \
       DEF:val2=some.rrd:ds1:AVERAGE \
@@ -709,30 +732,30 @@
       STACK:val2#00C000:Value2 \
       STACK:val3#FFFF00:Value3 \
       STACK:val4#FFC000:Value4 \
-      AREA:whipeout#FF0000:Unknown
-

This demo demonstrates two ways to use infinity. It is a bit tricky -to see what happens in the ``background'' CDEF.

-
-   "val4,POP,TIME,7200,%,3600,LE,INF,UNKN,IF"
-

This RPN takes the value of ``val4'' as input and then immediately + AREA:whipeout#FF0000:Unknown

+

This demo demonstrates two ways to use infinity. It is a bit tricky +to see what happens in the ``background'' CDEF.

+
+   "val4,POP,TIME,7200,%,3600,LE,INF,UNKN,IF"
+

This RPN takes the value of ``val4'' as input and then immediately removes it from the stack using ``POP''. The stack is now empty but as a side result we now know the time that this sample was taken. -This time is put on the stack by the ``TIME'' function.

-

``TIME,7200,%'' takes the modulo of time and 7200 (which is two hours). +This time is put on the stack by the ``TIME'' function.

+

``TIME,7200,%'' takes the modulo of time and 7200 (which is two hours). The resulting value on the stack will be a number in the range from -0 to 7199.

-

For people who don't know the modulo function: it is the remainder +0 to 7199.

+

For people who don't know the modulo function: it is the remainder after an integer division. If you divide 16 by 3, the answer would -be 5 and the remainder would be 1. So, ``16,3,%'' returns 1.

-

We have the result of ``TIME,7200,%'' on the stack, lets call this +be 5 and the remainder would be 1. So, ``16,3,%'' returns 1.

+

We have the result of ``TIME,7200,%'' on the stack, lets call this ``a''. The start of the RPN has become ``a,3600,LE'' and this checks if ``a'' is less or equal than ``3600''. It is true half of the time. We now have to process the rest of the RPN and this is only a simple ``IF'' function that returns either ``INF'' or ``UNKN'' depending on the -time. This is returned to variable ``background''.

-

The second CDEF has been discussed earlyer in this document so we -won't do that here.

-

Now you can draw the different layers. Start with the background +time. This is returned to variable ``background''.

+

The second CDEF has been discussed earlyer in this document so we +won't do that here.

+

Now you can draw the different layers. Start with the background that is either unknown (nothing to see) or infinite (the whole positive part of the graph gets filled). Next you draw the data on top of this background. It will overlay @@ -740,54 +763,58 @@ case you end up with only three bars stacked on top of each other. You don't want to see this because the data is only valid when all four variables are valid. This is why you use the second CDEF, it -will overlay the data with an AREA so the data cannot be seen anymore.

-

If your data can also have negative values you also need to overwrite +will overlay the data with an AREA so the data cannot be seen anymore.

+

If your data can also have negative values you also need to overwrite the other half of your graph. This can be done in a relatively simple way: what you need is the ``wipeout'' variable and place a negative sign before it: ``CDEF:wipeout2=wipeout,-1,*'' -

-
+

+
 
-=head2 Filtering data
-

You may do some complex data filtering:

-
-  MEDIAN FILTER: filters shot noise
-
+=head2 Filtering data
+

You may do some complex data filtering:

+
+  MEDIAN FILTER: filters shot noise
+
     DEF:var=database.rrd:traffic:AVERAGE
     CDEF:prev1=PREV(var)
     CDEF:prev2=PREV(prev1)
     CDEF:prev3=PREV(prev2)
     CDEF:median=prev1,prev2,prev3,+,+,3,/
     LINE3:median#000077:filtered
-    LINE1:prev2#007700:'raw data'
-
-  DERIVATE:
-
+    LINE1:prev2#007700:'raw data'
+
+  DERIVATE:
+
     DEF:var=database.rrd:traffic:AVERAGE
     CDEF:prev1=PREV(var)
     CDEF:time=TIME
     CDEF:prevtime=PREV(time)
     CDEF:derivate=var,prev1,-,time,prevtime,-,/
     LINE3:derivate#000077:derivate
-    LINE1:var#007700:'raw data'
-

-


-

Out of ideas for now

-

This document was created from questions asked by either myself or + LINE1:var#007700:'raw data'

+

+

+
+

Out of ideas for now

+

This document was created from questions asked by either myself or by other people on the list. Please let me know if you find errors in it or if you have trouble understanding it. If you think there -should be an addition, mail me: <alex at ergens.op.het.net>

-

Remember: No feedback equals no changes!

-

-


-

SEE ALSO

-

The RRDtool manpages

-

-


-

AUTHOR

-

Alex van den Bogaerdt -<alex at ergens.op.het.net>

+should be an addition, mail me: <alex at ergens.op.het.net>

+

Remember: No feedback equals no changes!

+

+

+
+

SEE ALSO

+

The RRDtool manpages

+

+

+
+

AUTHOR

+

Alex van den Bogaerdt +<alex at ergens.op.het.net> +

- + - + Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdlast.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdlast.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdlast.txt 2003-02-20 15:24:02.000000000 -0800 @@ -2,23 +2,23 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE rrdtool last - Return the date of the last data sample in - an RRRRRRRRDDDD + an RRRRDD -SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS - rrrrrrrrddddttttoooooooollll llllaaaasssstttt _f_i_l_e_n_a_m_e +SSYYNNOOPPSSIISS + rrrrddttooooll llaasstt _f_i_l_e_n_a_m_e -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN - The llllaaaasssstttt function returns the UNIX timestamp when the RRD +DDEESSCCRRIIPPTTIIOONN + The llaasstt function returns the UNIX timestamp when the RRD was last updated. _f_i_l_e_n_a_m_e - The name of the RRRRRRRRDDDD that contains the data. + The name of the RRRRDD that contains the data. -AAAAUUUUTTTTHHHHOOOORRRR +AAUUTTHHOORR Russ Wright -2002-02-26 1.0.40 RRDLAST(1) +1.0.41 2002-02-26 RRDLAST(1) Modified: trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.txt ============================================================================== --- trunk/orca/packages/rrdtool-1.0.40/doc/rrdtutorial.txt (original) +++ trunk/orca/packages/rrdtool-1.0.41/doc/rrdtutorial.txt 2003-02-20 15:24:03.000000000 -0800 @@ -2,10 +2,10 @@ -NNNNAAAAMMMMEEEE +NNAAMMEE rrdtutorial - Alex van den Bogaerdt's RRDtool tutorial -DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN +DDEESSCCRRIIPPTTIIOONN RRDtool is written by Tobias Oetiker with contributions from many people all around the world. This document is written by Alex van den Bogaerdt @@ -19,15 +19,15 @@ general things about statistics with a focus on network- ing. -TTTTUUUUTTTTOOOORRRRIIIIAAAALLLL - IIIImmmmppppoooorrrrttttaaaannnntttt +TTUUTTOORRIIAALL + IImmppoorrttaanntt Please don't skip ahead in this document! The first part of this document explains the basics and may be boring. But if you don't understand the basics, the examples will not be as meaningful to you. - WWWWhhhhaaaatttt iiiissss RRRRRRRRDDDDttttoooooooollll ???? + WWhhaatt iiss RRRRDDttooooll ?? RRDtool refers to Round Robin Database tool. Round robin is a technique that works with a fixed amount of data, and @@ -44,7 +44,7 @@ RRDtool works with with Round Robin Databases (RRDs). It stores and retrieves data from them. - WWWWhhhhaaaatttt ddddaaaattttaaaa ccccaaaannnn bbbbeeee ppppuuuutttt iiiinnnnttttoooo aaaannnn RRRRDDDDDDDD ???? + WWhhaatt ddaattaa ccaann bbee ppuutt iinnttoo aann RRDDDD ?? You name it, it will probably fit. You should be able to measure some value at several points in time and provide @@ -65,7 +65,7 @@ - WWWWhhhhaaaatttt ccccaaaannnn IIII ddddoooo wwwwiiiitttthhhh tttthhhhiiiissss ttttoooooooollll ???? + WWhhaatt ccaann II ddoo wwiitthh tthhiiss ttooooll ?? RRDtool originated from MRTG (Multi Router Traffic Gra- pher). MRTG started as a tiny little script for graphing @@ -88,8 +88,8 @@ You need a sensor to measure the data and be able to feed the numbers to RRDtool. - WWWWhhhhaaaatttt iiiiffff IIII ssssttttiiiillllllll hhhhaaaavvvveeee pppprrrroooobbbblllleeeemmmmssss aaaafffftttteeeerrrr rrrreeeeaaaaddddiiiinnnngggg tttthhhhiiiissss ddddooooccccuuuummmmeeeennnntttt - ???? + WWhhaatt iiff II ssttiillll hhaavvee pprroobblleemmss aafftteerr rreeaaddiinngg tthhiiss ddooccuummeenntt + ?? First of all: read it again! You may have missed some- thing. If you are unable to compile the sources and you @@ -111,12 +111,13 @@ usage of the list. I suggest you take a moment to subscribe to the mailing - list right now by sending an email to with a subject of "subscribe". If - you ever want to leave this list, you write an email to - the same address but now with a subject of "unsubscribe". + list right now by sending an email to + with a subject of + "subscribe". If you ever want to leave this list, you + write an email to the same address but now with a subject + of "unsubscribe". - HHHHoooowwww wwwwiiiillllllll yyyyoooouuuu hhhheeeellllpppp mmmmeeee ???? + HHooww wwiillll yyoouu hheellpp mmee ?? By giving you some detailed descriptions with detailed examples. It is assumed that following the instructions @@ -129,10 +130,10 @@ works. You will need to know something about hexadecimal numbers. - If you don't then start with reading the bin_dec_hex - manpage before you continue here. + If you don't then start with reading bin_dec_hex before + you continue here. - YYYYoooouuuurrrr ffffiiiirrrrsssstttt RRRRoooouuuunnnndddd RRRRoooobbbbiiiinnnn DDDDaaaattttaaaabbbbaaaasssseeee + YYoouurr ffiirrsstt RRoouunndd RRoobbiinn DDaattaabbaassee In my opinion the best way to learn something is to actu- ally do it. Why not start right now? We will create a @@ -239,7 +240,7 @@ (So enter: "rrdtool create test.rrd --start 920804400 DS ...") - WWWWhhhhaaaatttt hhhhaaaassss bbbbeeeeeeeennnn ccccrrrreeeeaaaatttteeeedddd ???? + WWhhaatt hhaass bbeeeenn ccrreeaatteedd ?? We created the round robin database called test (test.rrd) which starts at noon the day I started (7th of march, @@ -327,7 +328,6 @@ - 920804700: NaN 920805000: 0.04 920805300: 0.02 @@ -356,7 +356,7 @@ What this output represents will become clear in the rest of the tutorial. - IIIItttt iiiissss ttttiiiimmmmeeee ttttoooo ccccrrrreeeeaaaatttteeee ssssoooommmmeeee ggggrrrraaaapppphhhhiiiiccccssss + IItt iiss ttiimmee ttoo ccrreeaattee ssoommee ggrraapphhiiccss Try the following command: @@ -395,7 +395,7 @@ favorite image viewer. Web browsers will display the GIF via the URL "file://the/path/to/speed.gif" - GGGGrrrraaaapppphhhhiiiiccccssss wwwwiiiitttthhhh ssssoooommmmeeee mmmmaaaatttthhhh + GGrraapphhiiccss wwiitthh ssoommee mmaatthh When looking at the image, you notice that the horizontal axis is labeled 12:10, 12:20, 12:30, 12:40 and 12:50. The @@ -487,8 +487,7 @@ Check if kmh is greater than 100 ( kmh,100 ) GT If so, return kmh, else return 0 ((( kmh,100) GT ), kmh, 0) IF - - GGGGrrrraaaapppphhhhiiiiccccssss MMMMaaaaggggiiiicccc + GGrraapphhiiccss MMaaggiicc I like to believe there are virtually no limits to how RRDtool graph can manipulate data. I will not explain how @@ -527,7 +526,8 @@ Netscape in particular has a problem doing so and you'll need to click reload while pressing the shift key). - UUUUppppddddaaaatttteeeessss iiiinnnn RRRReeeeaaaalllliiiittttyyyy + + UUppddaatteess iinn RReeaalliittyy We've already used the "update" command: it took one or more parameters in the form of "