[Orca-checkins] rev 242 - in trunk/orca: . packages/rrdtool-1.0.42 packages/rrdtool-1.0.43 packages/rrdtool-1.0.43/contrib/add_ds packages/rrdtool-1.0.43/contrib/php4 packages/rrdtool-1.0.43/contrib/rrdfetchnames packages/rrdtool-1.0.43/contrib/rrdlastds packages/rrdtool-1.0.43/contrib/trytime packages/rrdtool-1.0.43/doc packages/rrdtool-1.0.43/perl-piped packages/rrdtool-1.0.43/perl-shared packages/rrdtool-1.0.43/src packages/rrdtool-1.0.43/tcl

Blair Zajac blair at orcaware.com
Thu Jul 3 16:27:26 PDT 2003


Author: blair
Date: Thu Jul  3 16:26:45 2003
New Revision: 242

Added:
   trunk/orca/packages/rrdtool-1.0.43/
      - copied from rev 241, trunk/orca/packages/rrdtool-1.0.42/
   trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.html
   trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.pod
   trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.txt
Removed:
   trunk/orca/packages/rrdtool-1.0.42/
Modified:
   trunk/orca/INSTALL
   trunk/orca/configure.in
   trunk/orca/packages/rrdtool-1.0.43/CHANGES
   trunk/orca/packages/rrdtool-1.0.43/Makefile.am
   trunk/orca/packages/rrdtool-1.0.43/Makefile.in
   trunk/orca/packages/rrdtool-1.0.43/configure
   trunk/orca/packages/rrdtool-1.0.43/configure.in
   trunk/orca/packages/rrdtool-1.0.43/contrib/add_ds/batch.pl
   trunk/orca/packages/rrdtool-1.0.43/contrib/php4/php_rrdtool.h
   trunk/orca/packages/rrdtool-1.0.43/contrib/php4/rrdtool.c
   trunk/orca/packages/rrdtool-1.0.43/contrib/rrdfetchnames/rrdfetchnames.pl
   trunk/orca/packages/rrdtool-1.0.43/contrib/rrdlastds/rrdlastds.pl
   trunk/orca/packages/rrdtool-1.0.43/contrib/trytime/Makefile.in
   trunk/orca/packages/rrdtool-1.0.43/doc/Makefile.am
   trunk/orca/packages/rrdtool-1.0.43/doc/Makefile.in
   trunk/orca/packages/rrdtool-1.0.43/doc/RRDp.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/RRDs.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/bin_dec_hex.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/cdeftutorial.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rpntutorial.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.html
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.pod
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdcreate.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrddump.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.html
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.pod
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdgraph.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdinfo.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdlast.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdresize.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdrestore.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdtool.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdtune.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdtutorial.es.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdtutorial.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdupdate.txt
   trunk/orca/packages/rrdtool-1.0.43/doc/rrdxport.txt
   trunk/orca/packages/rrdtool-1.0.43/perl-piped/RRDp.pm
   trunk/orca/packages/rrdtool-1.0.43/perl-shared/RRDs.pm
   trunk/orca/packages/rrdtool-1.0.43/rrdtool.spec
   trunk/orca/packages/rrdtool-1.0.43/src/Makefile.in
   trunk/orca/packages/rrdtool-1.0.43/src/gdpng.c
   trunk/orca/packages/rrdtool-1.0.43/src/gifsize.c
   trunk/orca/packages/rrdtool-1.0.43/src/pngsize.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd.h
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_cgi.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_create.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_diff.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_dump.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_error.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_fetch.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_format.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_format.h
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_graph.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_graph.h
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_info.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_last.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_open.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_resize.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_restore.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_tool.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_tool.h
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_tune.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_update.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_xport.c
   trunk/orca/packages/rrdtool-1.0.43/src/rrd_xport.h
   trunk/orca/packages/rrdtool-1.0.43/tcl/Makefile.am
   trunk/orca/packages/rrdtool-1.0.43/tcl/Makefile.in
Log:
Update rrdtool from 1.0.42 to 1.0.43.

* configure.in:
  Bump the required RRDs Perl VERSION number from 1.000421 to 1.000431
  and update the directory to find rrdtool in from rrdtool-1.0.42 to
  rrdtool-1.0.43.

* INSTALL (Determine which Perl modules need compiling and installing):
  Bump the required RRDs Perl VERSION number from 1.000421 to 1.000431
  and update the RRDs package version from 1.0.42 to 1.0.43.

* packages/rrdtool-1.0.43:
  Renamed from packages/rrdtool-1.0.42.  Directory contents updated
  from rrdtool-1.0.43.tar.gz.


Modified: trunk/orca/INSTALL
==============================================================================
--- trunk/orca/INSTALL	(original)
+++ trunk/orca/INSTALL	Thu Jul  3 16:26:45 2003
@@ -175,7 +175,7 @@
     Devel::DProf            Not required by Orca        19990108
     Digest::MD5             >= 2.24        >= 2.24      2.24
     Math::IntervalSearch    >= 1.05        >= 1.05      1.05
-    RRDs                    >= 1.000421    >= 1.0.42    1.0.42
+    RRDs                    >= 1.000431    >= 1.0.43    1.0.43
     Storable                >= 2.07        >= 2.07      2.07
     Time::HiRes             Not required by Orca        1.48
 

Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in	(original)
+++ trunk/orca/configure.in	Thu Jul  3 16:26:45 2003
@@ -37,8 +37,8 @@
 DIGEST_MD5_VER=2.24
 MATH_INTERVALSEARCH_DIR=Math-Interpolate-1.05
 MATH_INTERVALSEARCH_VER=1.05
-RRDTOOL_DIR=rrdtool-1.0.42
-RRDTOOL_VER=1.000421
+RRDTOOL_DIR=rrdtool-1.0.43
+RRDTOOL_VER=1.000431
 STORABLE_DIR=Storable-2.07
 STORABLE_VER=2.07
 TIME_HIRES_DIR=Time-HiRes-1.48

Modified: trunk/orca/packages/rrdtool-1.0.43/CHANGES
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/CHANGES	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/CHANGES	Thu Jul  3 16:26:45 2003
@@ -2,12 +2,34 @@
 ---------------------------
 - bugfix, + enhancement, * contrib, = RELEASE
 ---------------------------------------------
+= 1.0.43 2003/07/03 -- Tobi
+
+- 2003/06/30 - Kasparek Tomas <kasparek at fit.vutbr.cz>
+  fix for php4 bindings
+
+- 2003/06/27 - Pierre Suter <pierre.suter at pharma.ethz.ch>
+  fixed gifsize ... ZeroDataBlock name clash (Mac OS X)
+  fixed tcl compile
+  fixed perl install for mac os x  
+
++ 2003/05/20 - "Erskine, Thomas" <terskine at NRCan.gc.ca>
+  enhanced rrdcgi with <RRD::TIME::STRFTIME ...>
+
+- 2003/05/19 -  Kasparek Tomas <kasparek at fit.vutbr.cz>
+  fix for php4 bindings
+
+- 2003/05/11 - Daniel Karrenberg <daniel.karrenberg at ripe.net>
+  be more imaginative when you run out of colors in complex graphs  
+
+- 2003/04/23 - Tobi
+  added propper version update for rrdtool.spec 
+
 = 1.0.42 2003/04/12 -- Tobi
 
 - 2003/04/10 - Fabrice Bacchella <fabrice.bacchella at synaptique.com>
   make build realy location independent
 
-+ 2003/04/04 -  MichaÅ^B Suszko" <Michal at dry.pl>
++ 2003/04/04 -  Michal Suszko <Michal at dry.pl>
   added --enable-latin2 option to config
 
 - 2003/03/30 - Burton M. Strauss III <BStrauss at acm.org>

Modified: trunk/orca/packages/rrdtool-1.0.43/Makefile.am
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/Makefile.am	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/Makefile.am	Thu Jul  3 16:26:45 2003
@@ -17,12 +17,14 @@
 
 # lets schedule the perl stuff for installation
 # the special call to install-sh is because the -d switch is not portable
+# mac os X has its perl module in bundles so it seems
 install-data-local:
 	$(top_srcdir)/config/mkinstalldirs $(DESTDIR)$(prefix)/lib/perl/auto/RRDs
 	$(INSTALL) -m 644 perl-piped/RRDp.pm $(DESTDIR)$(prefix)/lib/perl
 	$(INSTALL) -m 644 perl-shared/RRDs.pm $(DESTDIR)$(prefix)/lib/perl
 	$(INSTALL) -m 644 perl-shared/blib/arch/auto/RRDs/RRDs.bs $(DESTDIR)$(prefix)/lib/perl/auto/RRDs
-	$(INSTALL) -m 755 perl-shared/blib/arch/auto/RRDs/RRDs. at SO_EXT@ $(DESTDIR)$(prefix)/lib/perl/auto/RRDs
+	[ -f perl-shared/blib/arch/auto/RRDs/RRDs. at SO_EXT@ ] && $(INSTALL) -m 755 perl-shared/blib/arch/auto/RRDs/RRDs. at SO_EXT@ $(DESTDIR)$(prefix)/lib/perl/auto/RRDs
+	[ -f perl-shared/blib/arch/auto/RRDs/RRDs.bundle ] && $(INSTALL) -m 755 perl-shared/blib/arch/auto/RRDs/RRDs.bundle $(DESTDIR)$(prefix)/lib/perl/auto/RRDs
 
 
 # use relaxed rules when building dists
@@ -73,8 +75,9 @@
 	(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 rrdtool.spec
+	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 's|RRDtool\s+\d+\.\d+\.\d+ |RRDtool $(VERSION) |' src/*.[ch]
+	perl -i -p -e 's|Version:.+|Version:\t$(VERSION)|' rrdtool.spec
 
 to-dist: to-docs dist
 	mv $(PACKAGE)-$(VERSION).tar.gz archive

Modified: trunk/orca/packages/rrdtool-1.0.43/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/Makefile.in	Thu Jul  3 16:26:45 2003
@@ -392,12 +392,14 @@
 
 # lets schedule the perl stuff for installation
 # the special call to install-sh is because the -d switch is not portable
+# mac os X has its perl module in bundles so it seems
 install-data-local:
 	$(top_srcdir)/config/mkinstalldirs $(DESTDIR)$(prefix)/lib/perl/auto/RRDs
 	$(INSTALL) -m 644 perl-piped/RRDp.pm $(DESTDIR)$(prefix)/lib/perl
 	$(INSTALL) -m 644 perl-shared/RRDs.pm $(DESTDIR)$(prefix)/lib/perl
 	$(INSTALL) -m 644 perl-shared/blib/arch/auto/RRDs/RRDs.bs $(DESTDIR)$(prefix)/lib/perl/auto/RRDs
-	$(INSTALL) -m 755 perl-shared/blib/arch/auto/RRDs/RRDs. at SO_EXT@ $(DESTDIR)$(prefix)/lib/perl/auto/RRDs
+	[ -f perl-shared/blib/arch/auto/RRDs/RRDs. at SO_EXT@ ] && $(INSTALL) -m 755 perl-shared/blib/arch/auto/RRDs/RRDs. at SO_EXT@ $(DESTDIR)$(prefix)/lib/perl/auto/RRDs
+	[ -f perl-shared/blib/arch/auto/RRDs/RRDs.bundle ] && $(INSTALL) -m 755 perl-shared/blib/arch/auto/RRDs/RRDs.bundle $(DESTDIR)$(prefix)/lib/perl/auto/RRDs
 
 perl_piped:: $(top_builddir)/perl-piped
 	test -d perl-piped \
@@ -427,8 +429,9 @@
 	(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 rrdtool.spec
+	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 's|RRDtool\s+\d+\.\d+\.\d+ |RRDtool $(VERSION) |' src/*.[ch]
+	perl -i -p -e 's|Version:.+|Version:\t$(VERSION)|' rrdtool.spec
 
 to-dist: to-docs dist
 	mv $(PACKAGE)-$(VERSION).tar.gz archive

Modified: trunk/orca/packages/rrdtool-1.0.43/configure
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/configure	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/configure	Thu Jul  3 16:26:45 2003
@@ -11,7 +11,7 @@
 ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
-ac_default_prefix=/usr/local/rrdtool-1.0.42 
+ac_default_prefix=/usr/local/rrdtool-1.0.43 
 ac_help="$ac_help
   --with-tcllib=DIR       location of the tclConfig.sh"
 ac_help="$ac_help
@@ -801,7 +801,7 @@
 
 PACKAGE=rrdtool
 
-VERSION=1.0.42
+VERSION=1.0.43
 
 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; }

Modified: trunk/orca/packages/rrdtool-1.0.43/configure.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/configure.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/configure.in	Thu Jul  3 16:26:45 2003
@@ -24,11 +24,11 @@
 AC_CANONICAL_SYSTEM
 
 dnl tell automake the this script is for rrdtool
-AM_INIT_AUTOMAKE(rrdtool, 1.0.42)
+AM_INIT_AUTOMAKE(rrdtool, 1.0.43)
 AC_SUBST(VERSION)
 
 dnl where we install our stuff ...
-AC_PREFIX_DEFAULT( /usr/local/rrdtool-1.0.42 )
+AC_PREFIX_DEFAULT( /usr/local/rrdtool-1.0.43 )
 
 dnl tell automake which file to use as config header
 AM_CONFIG_HEADER(config/config.h)

Modified: trunk/orca/packages/rrdtool-1.0.43/contrib/add_ds/batch.pl
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/contrib/add_ds/batch.pl	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/contrib/add_ds/batch.pl	Thu Jul  3 16:26:45 2003
@@ -43,7 +43,7 @@
 ########### USER CONFIGURABLE SECTION #######################
 
 my $newdir = "xml";
-my $rrdtool = "/usr/local/rrdtool-1.0.41/bin/rrdtool";
+my $rrdtool = "/usr/local/rrdtool-1.0.43/bin/rrdtool";
 my $add_ds = "./add_ds.pl";  # path to add_ds.pl script
 
 ########### END CONFIGURE SECTION ###########################

Modified: trunk/orca/packages/rrdtool-1.0.43/contrib/php4/php_rrdtool.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/contrib/php4/php_rrdtool.h	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/contrib/php4/php_rrdtool.h	Thu Jul  3 16:26:45 2003
@@ -12,7 +12,7 @@
 #ifndef _PHP4_RRDTOOL_H
 #define _PHP4_RRDTOOL_H
 
-#if COMPILE_DL
+#if COMPILE_DL_RRDTOOL
 #undef HAVE_RRDTOOL
 #define HAVE_RRDTOOL 1
 #endif

Modified: trunk/orca/packages/rrdtool-1.0.43/contrib/php4/rrdtool.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/contrib/php4/rrdtool.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/contrib/php4/rrdtool.c	Thu Jul  3 16:26:45 2003
@@ -20,6 +20,7 @@
 
 #include "php.h"
 #include "rrd.h"
+#include "php_config.h"
 #include "php_rrdtool.h"
 
 #if HAVE_RRDTOOL
@@ -370,7 +371,7 @@
 	pval *p_start, *p_end, *p_step, *p_ds_cnt;
 	HashTable *args_arr;
 	zval *p_ds_namv, *p_data;
-	int i, argc;
+	int i, j, argc;
 	time_t start, end;
 	unsigned long step, ds_cnt;
 	char **argv, **ds_namv; 
@@ -449,7 +450,8 @@
 				datap = data;
  
 				for (i = start; i <= end; i += step)
-					add_next_index_double(p_data, *(datap++));
+					for (j = 0; j < ds_cnt; j++)
+						add_next_index_double(p_data, *(datap++));
  
 				free(data);
 			}

Modified: trunk/orca/packages/rrdtool-1.0.43/contrib/rrdfetchnames/rrdfetchnames.pl
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/contrib/rrdfetchnames/rrdfetchnames.pl	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/contrib/rrdfetchnames/rrdfetchnames.pl	Thu Jul  3 16:26:45 2003
@@ -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.41/lib/perl ../lib/perl );
+use lib qw( /usr/local/rrdtool-1.0.43/lib/perl ../lib/perl );
 
 use vars qw(@ISA $loaded);
 

Modified: trunk/orca/packages/rrdtool-1.0.43/contrib/rrdlastds/rrdlastds.pl
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/contrib/rrdlastds/rrdlastds.pl	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/contrib/rrdlastds/rrdlastds.pl	Thu Jul  3 16:26:45 2003
@@ -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.41/lib/perl ../lib/perl );
+use lib qw( /usr/local/rrdtool-1.0.43/lib/perl ../lib/perl );
 
 use RRDs;
 

Modified: trunk/orca/packages/rrdtool-1.0.43/contrib/trytime/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/contrib/trytime/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/contrib/trytime/Makefile.in	Thu Jul  3 16:26:45 2003
@@ -267,9 +267,6 @@
 	    || cp -p $$d/$$file $(distdir)/$$file || :; \
 	  fi; \
 	done
-trytime.o: trytime.c ../../src/getopt.h ../../src/rrd_tool.h \
-	../../config/config.h ../../src/rrd.h ../../src/rrd_format.h \
-	../../gd1.3/gd.h
 
 info-am:
 info: info-am

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/Makefile.am
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/Makefile.am	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/Makefile.am	Thu Jul  3 16:26:45 2003
@@ -11,7 +11,7 @@
 POD = rrdtool.pod rrdlast.pod rrdcreate.pod rrdupdate.pod  rrdtutorial.es.pod \
 	cdeftutorial.pod rpntutorial.pod rrdgraph.pod  bin_dec_hex.pod \
 	rrdfetch.pod rrdrestore.pod rrddump.pod rrdtune.pod rrdresize.pod \
-	rrdcgi.pod rrdtutorial.pod rrdinfo.pod rrdxport.pod
+	rrdcgi.pod rrdtutorial.pod rrdinfo.pod rrdxport.pod rrd-beginners.pod
 
 PMP = RRDs.pm RRDp.pm
 

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/Makefile.in	Thu Jul  3 16:26:45 2003
@@ -95,7 +95,7 @@
 
 CLEANFILES = *.1 *.html *.txt *-dircache *.pm *.pdf *~ core *itemcache *.rej *.orig
 
-POD = rrdtool.pod rrdlast.pod rrdcreate.pod rrdupdate.pod  rrdtutorial.es.pod 	cdeftutorial.pod rpntutorial.pod rrdgraph.pod  bin_dec_hex.pod 	rrdfetch.pod rrdrestore.pod rrddump.pod rrdtune.pod rrdresize.pod 	rrdcgi.pod rrdtutorial.pod rrdinfo.pod rrdxport.pod
+POD = rrdtool.pod rrdlast.pod rrdcreate.pod rrdupdate.pod  rrdtutorial.es.pod 	cdeftutorial.pod rpntutorial.pod rrdgraph.pod  bin_dec_hex.pod 	rrdfetch.pod rrdrestore.pod rrddump.pod rrdtune.pod rrdresize.pod 	rrdcgi.pod rrdtutorial.pod rrdinfo.pod rrdxport.pod rrd-beginners.pod
 
 
 PMP = RRDs.pm RRDp.pm

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/RRDp.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/RRDp.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/RRDp.txt	Thu Jul  3 16:26:45 2003
@@ -89,4 +89,4 @@
 
 
 
-1.0.42                      2003-04-12                    RRDp(3)
+1.0.43                      2003-07-03                    RRDp(3)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/RRDs.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/RRDs.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/RRDs.txt	Thu Jul  3 16:26:45 2003
@@ -115,4 +115,4 @@
 
 
 
-1.0.42                      2003-04-12                    RRDs(3)
+1.0.43                      2003-07-03                    RRDs(3)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/bin_dec_hex.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/bin_dec_hex.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/bin_dec_hex.txt	Thu Jul  3 16:26:45 2003
@@ -411,4 +411,4 @@
 
 
 
-1.0.42                      2002-02-26             BIN_DEC_HEX(1)
+1.0.43                      2002-02-26             BIN_DEC_HEX(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/cdeftutorial.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/cdeftutorial.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/cdeftutorial.txt	Thu Jul  3 16:26:45 2003
@@ -881,4 +881,4 @@
 
 
 
-1.0.42                      2002-06-20            CDEFTUTORIAL(1)
+1.0.43                      2002-06-20            CDEFTUTORIAL(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rpntutorial.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rpntutorial.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rpntutorial.txt	Thu Jul  3 16:26:45 2003
@@ -202,4 +202,4 @@
 
 
 
-1.0.42                      2002-02-26             RPNTUTORIAL(1)
+1.0.43                      2002-02-26             RPNTUTORIAL(1)

Added: trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.html
==============================================================================
--- (empty file)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.html	Thu Jul  3 16:26:45 2003
@@ -0,0 +1,341 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>rrd-beginners</title>
+<link rev="made" href="mailto:dws at ee.ethz.ch" />
+</head>
+
+<body style="background-color: white">
+
+<p><a name="__index__"></a></p>
+<!-- INDEX BEGIN -->
+<!--
+
+<ul>
+
+	<li><a href="#name">NAME</a></li>
+	<li><a href="#synopsis">SYNOPSIS</a></li>
+	<li><a href="#description">DESCRIPTION</a></li>
+	<ul>
+
+		<li><a href="#what_makes_rrdtool_so_special">What makes RRDTool so special?</a></li>
+		<li><a href="#understanding_by_an_example">Understanding by an example</a></li>
+		<li><a href="#graphical_magic">Graphical Magic</a></li>
+		<li><a href="#wrapping_rrdtool_within_shell/perl_script">Wrapping RRDTool within Shell/Perl script</a></li>
+		<ul>
+
+			<li><a href="#shell_script_(collects_data,_updates_database)">Shell script (collects data, updates database)</a></li>
+			<li><a href="#perl_script_(retrieves_data_from_database_and_generates_graphs_and_statistics)">Perl script (retrieves data from database and generates graphs and statistics)</a></li>
+		</ul>
+
+	</ul>
+
+	<li><a href="#author">AUTHOR</a></li>
+</ul>
+-->
+<!-- INDEX END -->
+
+<p>
+</p>
+<h1><a name="name">NAME</a></h1>
+<p>rrd-beginners - Beginners guide</p>
+<p>
+</p>
+<hr />
+<h1><a name="synopsis">SYNOPSIS</a></h1>
+<p>Helping new RRDTool users to understand the basics of RRDTool</p>
+<p>
+</p>
+<hr />
+<h1><a name="description">DESCRIPTION</a></h1>
+<p>This manual is an attempt to assist beginners in understanding the concepts
+of RRDTool. It sheds a light on differences between RRDTool and other
+databases. With help of an example, it explains structure of RRDTool
+database. This is followed by an overview of the ``graph'' feature of RRDTool.
+At the end, it has sample scripts that illustrates the
+usage/wrapping of RRDTool within Shell/Perl.</p>
+<p>
+</p>
+<h2><a name="what_makes_rrdtool_so_special">What makes RRDTool so special?</a></h2>
+<p>RDtool is GNU licensed software developed by Tobies Oetiker, a system
+manager at the Swiss Federal Institute of Technology. Though it is a
+database, there are distinct differences between RRDtool database and other
+databases as listed below:</p>
+<ul>
+<li></li>
+RRDTool stores data; that makes it a back end tool. The RRDtool command set
+allows the creation of graphs; that makes it a front end tool as well. Other
+databases just stores data and can not create graphs.
+<p></p>
+<li></li>
+In case of linear databases, new data gets appended at the bottom of
+the database table. Thus its size keeps on increasing, whereas size of an RRDtool
+database is determined at creation time. Imagine an RRDtool database as the
+perimeter of a circle. Data is added along the perimeter. When new data
+reaches the starting point, it overwrites existing data. This way, the size of
+an RRDtool database always remains constant. The name ``Round Robin'' stems from this
+attribute.
+<p></p>
+<li></li>
+Other databases store the values as supplied. RRDtool can be configured to
+calculate the rate of change from the previous to the current value and
+store this information instead.
+<p></p>
+<li></li>
+Other databases get updated when values are supplied. The RRDTool database
+is structured in such a way that it needs data at predefined time
+intervals. If it does not get a new value during the interval, it stores an
+UNKNOWN value for that interval. So, when using the RRDTool database, it is
+imperative to use scripts that runs at regular intervals to ensure a constant
+data flow to update the RRDTool database.
+<p></p></ul>
+<p>RRDtool has a lot to do with time. With every data update, it also needs to
+know the time when that update occurred. Time is always expressed in
+seconds passed since epoch (01-01-1971). RRDTool can be installed on Unix as
+well as Windows. It has command set to carry out various
+operations on rrd database. This command set can be accessed from the command line,
+and from shell or perl scripts. The scripts
+act as wrappers for accessing data stored in RRDtool database.</p>
+<p>
+</p>
+<h2><a name="understanding_by_an_example">Understanding by an example</a></h2>
+<p>The structure of an RRD database is different than other linear databases.
+Other databases define tables with columns, and many other parameters. These
+definitions sometime are very complex, especially in large databases.
+RRDTool databases are primarily used for monitoring purposes and
+hence are very simple in structure. The parameters
+that need to be defined are variables that hold values and archives of those
+values. Being time sensitive, a couple of time related parameters are also
+defined. Because of its structure, the definition of an RRDTool database also
+includes a provision to specify specific actions to take in the absence of
+update values. Data structure (DS), heartbeat, data structure type, round
+robin archive (RRA), and consolidation function (CF) are some of the
+terminologies related to RRDTool databases.</p>
+<p>The structure of a database and the terminology associated with it can be
+best explained with an example.</p>
+<pre>
+ rrdtool create target.rrd
+         --start 1023654125
+         --step 300
+         DS:mem:GAUGE:600:0:671744
+         RRA:AVERAGE:0.5:12:24
+         RRA:AVERAGE:0.5:288:31</pre>
+<p>This example creates a database named <em>target.rrd</em>. Start time (1023654125) is
+specified in total number of seconds since epoch (time in seconds since
+01-01-1970). While updating the database, update time is also specified.
+This update time MUST occur after start time and MUST be in seconds since
+epoch.</p>
+<p>The step of 300 seconds indicates that database expects new values every
+300 seconds. The wrapper script should be scheduled to run every <strong>step</strong>
+seconds so that it updates the database every <strong>step</strong> seconds.</p>
+<p>DS (data structure) is the actual variable which relates to the parameter on
+the device that has to be monitored. Its syntax is</p>
+<pre>
+ DS:variable_name:DST:heartbeat:min:max</pre>
+<p><strong>DS</strong> is a key word. <code>variable_name</code> is a name under which the parameter is
+saved in database. There can be as many DSs in a database as needed. After
+every step interval, a new value of DS is supplied to update the database.
+This value is also called as Primary Data Point <strong>(PDP)</strong>. In our example
+mentioned above, a new PDP is generated every 300 seconds.</p>
+<p>Note, that if you do NOT supply new datapoints exaclty every 300 seconds,
+this is not problem, RRDTool will interpolate the data accordingly.</p>
+<p><strong>DST</strong> (data structure type) defines type of DS. It can be COUNTER, DERIVE,
+ABSOLUTE, GAUGE. A DS declared as COUNTER will save the rate of change of
+the value over a step period. This assumes that the value is always
+increasing (difference between last two values is more than 0). Traffic
+counters on a router is an ideal candidate for using COUNTER as DST. DERIVE
+is same as COUNTER but it allows negative values as well. If you want to see
+the rate of <em>change</em> in free diskspace on your server, then you might want to
+use the DERIVE data type. ABSOULTE also saves the rate of change but it assumes
+that previous value is set to 0. The difference between current and previous
+value is always equal to the current value. So, it stores the current value divided
+by step interval (300 seconds in our example). GAUGE does not save the rate of
+change. It saves the actual value itself. There are no
+divisions/calculations. Memory consumption in a server is an ideal
+example of gauge. Difference among different types DSTs can be explained
+better with following example:</p>
+<pre>
+ Values       = 300, 600, 900, 1200
+ Step         = 300 seconds
+ COUNTER DS   =    1,  1,   1,    1 
+ DERIVE DS    =    1,  1,   1,    1
+ ABSOLUTE DS  =    1,  2,   3,    4 
+ GAUGE DS     = 300, 600, 900, 1200</pre>
+<p>The next parameter is <strong>heartbeat</strong>. In our example, heartbeat is 600
+seconds. If database doesn not get a new PDP within 300
+seconds, it will wait for another 300 seconds (total 600 seconds).
+If it doesnt receive any PDP with in 600 seconds, it will save an UNKNOWN value
+into database. This UNKOWN value is a special feature of RRDTool - it is
+much better than to assume a missing value was 0 (zero).
+For example, the traffic flow counter on a router
+keeps on increasing. Lets say, a value is missed for an interval and 0 is stored
+instead of UNKNOWN. Now when next value becomes available, it will calculate
+difference between current value and previous value (0) which is not
+correct. So, inserting value UNKNOWN makes much more sense here.</p>
+<p>The next two parameters are the minimum and maximum value respectively. If variable
+to be stored has predictable maximum and minimum value, this should be
+specified here. Any update value falling out of this range will be saved as
+UNKNOWN.</p>
+<p>The next line declares a round robin archive (RRA). The syntax for declaring an RRA is</p>
+<pre>
+ RRA:CF:xff:step:rows</pre>
+<p>RRA is the keyword to declare RRAs. The consolidation function (CF) can be
+AVERAGE, MINIMUM, MAXIMUM, and LAST. The concept of the consolidated data point (CDP)
+comes into the picture here. A CDP is CFed (averaged, maximum/minimum value or
+last value) from <em>step</em> number of PDPs. This RRA will hold <em>rows</em> CDPs.</p>
+<p>Lets have a look at the example above. For the first RRA, 12 (steps) PDPs
+(DS variables) are AVERAGEed (CF) to form one CDP. 24 (rows) of theses CDPs
+are archived. Each PDP occurs at 300 seconds. 12 PDPs represent 12 times 300
+seconds which is 1 hour. It means 1 CDP (which is equal to 12 PDPs)
+represents data worth 1 hour. 24 such CDPs represent 1 day (1 hour times 24
+CDPs). It means, this RRA is an archive for one day. After 24 CDPs, CDP
+number 25 will replace the 1st CDP. Second RRA saves 31 CDPs; each CPD
+represents an AVERAGE value for a day (288 PDPs, each covering 300 seconds =
+24 hours). Therefore this RRA is an archive for one month. A single database
+can have many RRAs. If there are multiple DSs, each individual RRA will save
+data for all the DSes in the database. For example, if a database has 3 DSs;
+and daily, weekly, monthly, and yearly RRAs are declared, then each RRA will
+hold data from all 3 data sources.</p>
+<p>
+</p>
+<h2><a name="graphical_magic">Graphical Magic</a></h2>
+<p>Another important feature of RRDTool is its ability to create graphs. The
+``graph'' command uses ``fetch'' command internally to retrieve values from the
+database. With the retrieved values, it draws graphs as defined by the
+parameters supplied on the command line. A single graph can show different
+DS (variables) from within a database. It is also possible to show the
+values from more than one databases into a single graph. Often, it is
+necessary to perform some math on the values retrieved from database, before
+plotting them. For example, in SNMP replies, memory consumption values are
+usually specified in KBytes and traffic flow on interfaces is specified in
+Bytes. Graphs for these values will be more senseful if values are
+represented in MBytes and mbps. the RRDTool graph command allows to define
+such conversions. Apart from mathematical calculations, it is also possible
+to peform logical operations such as greater than, less than, and if then
+else. If a database contains more than one RRA archive, then a question may
+arise - how does RRDTool decide which RRA archive to use for retrieving the
+values? RRDtool takes looks at several things when making its choice. First
+it makes sure that the RRA covers as much of the graphing time frame as
+possible. Second it looks at the resolution of the RRA compared to the
+resolution of the graph. It tries to find one which has the same or better
+resolution. With the ``-r'' option you can force RRDtool to assume a different
+resolution than the one calculated from the pixel width of the graph.</p>
+<p>Values of different variables can be presented in 5 different shapes in a
+graph - AREA, LINE1, LINE2, LINE3, and STACK. AREA is represented by a solid
+colored area with values as the boundary of this area. LINE1/2/3 (increasing
+width) are just plain lines representing the values. STACK is also an area
+but it is ``stack''ed on AREA or LINE1/2/3. Another important thing to note,
+is that variables are plotted in the order they are defined in graph
+command. So, care must be taken to define STACK only after defining
+AREA/LINE. It is also possible to put formatted comments within the graph.
+Detailed instructions be found under graph manual.</p>
+<p>
+</p>
+<h2><a name="wrapping_rrdtool_within_shell/perl_script">Wrapping RRDTool within Shell/Perl script</a></h2>
+<p>After understanding RRDTool, it is now a time to actually use RRDTool in
+scripts. Tasks involved in network management are data collection, data
+storage, and data retrieval. In the following example,
+the previously created target.rrd database is used. Data collection and data
+storage is done using Shell scrip. Data retrieval
+and report generation is done using Perl script. These
+scripts are as shown below:</p>
+<p>
+</p>
+<h3><a name="shell_script_(collects_data,_updates_database)">Shell script (collects data, updates database)</a></h3>
+<pre>
+ #!/bin/sh
+ a=0
+ while [ &quot;$a&quot; == 0 ]; do
+ snmpwalk -c public 192.168.1.250 hrSWRunPerfMem &gt; snmp_reply
+     total_mem=`awk 'BEGIN {tot_mem=0}
+                           { if ($NF == &quot;KBytes&quot;)
+                             {tot_mem=tot_mem+$(NF-1)}
+                           }
+                     END {print tot_mem}' snmp_reply`
+     # I can use N as a replacement for the current time
+     rrdtool update target.rrd N:$total_mem
+     # sleep until the next 300 seconds are full
+     perl -e 'sleep 300 - time % 300'
+ done # end of while loop</pre>
+<p>
+</p>
+<h3><a name="perl_script_(retrieves_data_from_database_and_generates_graphs_and_statistics)">Perl script (retrieves data from database and generates graphs and statistics)</a></h3>
+<pre>
+ #!/usr/bin/perl -w
+ #This script fetch data from target.rrd, creates graph of memory consumption
+ on target (Dual P3 Processor 1 GHz, 656 MB RAM)</pre>
+<pre>
+ #calling RRD perl module
+ use lib qw( /usr/local/rrdtool-1.0.41/lib/perl ../lib/perl );
+ use RRDs;
+ my $cur_time = time();                # setting current time
+ my $end_time = $cur_time - 86400;     # setting end time to 24 hours behind current time
+ my $start_time = $end_time - 2592000; # setting start time to 30 days from end time</pre>
+<pre>
+ #fetching average values from rrd database between start and end time
+ my ($start,$step,$ds_names,$data) = 
+     RRDs::fetch(&quot;target.rrd&quot;, &quot;AVERAGE&quot;, 
+                 &quot;-r&quot;, &quot;600&quot;, &quot;-s&quot;, &quot;$start_time&quot;, &quot;-e&quot;, &quot;$end_time&quot;);
+ #saving fetched values in 2-dimensional array
+ my $rows = 0;
+ my $columns = 0;
+ my $time_variable = $start;
+ foreach $line (@$data) {
+   $vals[$rows][$columns] = $time_variable;
+   $time_variable = $time_variable + $step;
+   foreach $val (@$line) {
+           $vals[$rows][++$columns] = $val;}
+   $rows++;
+   $columns = 0;
+ }
+ my $tot_time = 0;
+ my $count = 0;
+ #saving values from 2-dimensional into 1-dimensional array
+ for $i ( 0 .. $#vals ) 
+     $tot_mem[$count] = $vals[$i][1];
+     $count++;
+ }
+ my $tot_mem_sum = 0;
+ #calculating total of all values
+ for $i ( 0 .. ($count-1) ) {
+     $tot_mem_sum = $tot_mem_sum + $tot_mem[$i];
+ }
+ #calculating average of array
+ my $tot_mem_ave = $tot_mem_sum/($count);
+ #creating graph
+ RRDs::graph (&quot;/images/mem_$count.gif&quot;,   \
+             &quot;--title= Memory Usage&quot;,    \
+             &quot;--vertical-label=Memory Consumption (MB)&quot;, \
+             &quot;--start=$start_time&quot;,      \
+             &quot;--end=$end_time&quot;,          \
+             &quot;--color=BACK#CCCCCC&quot;,      \
+             &quot;--color=CANVAS#CCFFFF&quot;,    \
+             &quot;--color=SHADEB#9999CC&quot;,    \
+             &quot;--height=125&quot;,             \
+             &quot;--upper-limit=656&quot;,        \
+             &quot;--lower-limit=0&quot;,          \
+             &quot;--rigid&quot;,                  \
+             &quot;--base=1024&quot;,              \
+             &quot;DEF:tot_mem=target.rrd:mem:AVERAGE&quot;, \
+             &quot;CDEF:correct_tot_mem=tot_mem,0,671744,LIMIT,UN,0,tot_mem,IF,1024,/&quot;,\
+             &quot;CDEF:machine_mem=tot_mem,656,+,tot_mem,-&quot;,\
+             &quot;COMMENT:Memory Consumption between $start_time&quot;,\
+             &quot;COMMENT:    and $end_time                     &quot;,\
+             &quot;HRULE:656#000000:Maximum Available Memory - 656 MB&quot;,\
+             &quot;AREA:machine_mem#CCFFFF:Memory Unused&quot;,   \
+             &quot;AREA:correct_tot_mem#6699CC:Total memory consumed in MB&quot;);
+ my $err=RRDs::error;
+ if ($err) {print &quot;problem generating the graph: $err\n&quot;;}
+ #printing the output
+ print &quot;Average memory consumption is &quot;;
+ printf &quot;%5.2f&quot;,$tot_mem_ave/1024;
+ print &quot; MB. Graphical representation can be found at /images/mem_$count.gif.&quot;;</pre>
+<p>
+</p>
+<hr />
+<h1><a name="author">AUTHOR</a></h1>
+<p>Ketan Patel &lt;<a href="mailto:k2pattu at yahoo.com">k2pattu at yahoo.com</a>&gt;</p>
+
+</body>
+
+</html>

Added: trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.pod
==============================================================================
--- (empty file)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.pod	Thu Jul  3 16:26:45 2003
@@ -0,0 +1,316 @@
+=head1 NAME 
+
+rrd-beginners - Beginners guide
+
+=head1 SYNOPSIS
+
+Helping new RRDTool users to understand the basics of RRDTool
+
+=head1 DESCRIPTION
+
+This manual is an attempt to assist beginners in understanding the concepts
+of RRDTool. It sheds a light on differences between RRDTool and other
+databases. With help of an example, it explains structure of RRDTool
+database. This is followed by an overview of the "graph" feature of RRDTool.
+At the end, it has sample scripts that illustrates the
+usage/wrapping of RRDTool within Shell/Perl.
+
+=head2 What makes RRDTool so special?
+
+RDtool is GNU licensed software developed by Tobies Oetiker, a system
+manager at the Swiss Federal Institute of Technology. Though it is a
+database, there are distinct differences between RRDtool database and other
+databases as listed below:
+
+=over
+
+=item *
+
+RRDTool stores data; that makes it a back end tool. The RRDtool command set
+allows the creation of graphs; that makes it a front end tool as well. Other
+databases just stores data and can not create graphs.
+
+=item *
+
+In case of linear databases, new data gets appended at the bottom of
+the database table. Thus its size keeps on increasing, whereas size of an RRDtool
+database is determined at creation time. Imagine an RRDtool database as the
+perimeter of a circle. Data is added along the perimeter. When new data
+reaches the starting point, it overwrites existing data. This way, the size of
+an RRDtool database always remains constant. The name "Round Robin" stems from this
+attribute.
+
+=item *
+
+Other databases store the values as supplied. RRDtool can be configured to
+calculate the rate of change from the previous to the current value and
+store this information instead.
+
+=item *
+
+Other databases get updated when values are supplied. The RRDTool database
+is structured in such a way that it needs data at predefined time
+intervals. If it does not get a new value during the interval, it stores an
+UNKNOWN value for that interval. So, when using the RRDTool database, it is
+imperative to use scripts that runs at regular intervals to ensure a constant
+data flow to update the RRDTool database.
+
+=back
+
+RRDtool has a lot to do with time. With every data update, it also needs to
+know the time when that update occurred. Time is always expressed in
+seconds passed since epoch (01-01-1971). RRDTool can be installed on Unix as
+well as Windows. It has command set to carry out various
+operations on rrd database. This command set can be accessed from the command line,
+and from shell or perl scripts. The scripts
+act as wrappers for accessing data stored in RRDtool database.
+
+=head2 Understanding by an example
+
+The structure of an RRD database is different than other linear databases.
+Other databases define tables with columns, and many other parameters. These
+definitions sometime are very complex, especially in large databases.
+RRDTool databases are primarily used for monitoring purposes and
+hence are very simple in structure. The parameters
+that need to be defined are variables that hold values and archives of those
+values. Being time sensitive, a couple of time related parameters are also
+defined. Because of its structure, the definition of an RRDTool database also
+includes a provision to specify specific actions to take in the absence of
+update values. Data structure (DS), heartbeat, data structure type, round
+robin archive (RRA), and consolidation function (CF) are some of the
+terminologies related to RRDTool databases.
+
+The structure of a database and the terminology associated with it can be
+best explained with an example.
+
+ rrdtool create target.rrd
+         --start 1023654125
+         --step 300
+         DS:mem:GAUGE:600:0:671744
+         RRA:AVERAGE:0.5:12:24
+         RRA:AVERAGE:0.5:288:31
+
+This example creates a database named F<target.rrd>. Start time (1023654125) is
+specified in total number of seconds since epoch (time in seconds since
+01-01-1970). While updating the database, update time is also specified.
+This update time MUST occur after start time and MUST be in seconds since
+epoch.
+
+The step of 300 seconds indicates that database expects new values every
+300 seconds. The wrapper script should be scheduled to run every B<step>
+seconds so that it updates the database every B<step> seconds.
+
+DS (data structure) is the actual variable which relates to the parameter on
+the device that has to be monitored. Its syntax is
+
+ DS:variable_name:DST:heartbeat:min:max
+
+B<DS> is a key word. C<variable_name> is a name under which the parameter is
+saved in database. There can be as many DSs in a database as needed. After
+every step interval, a new value of DS is supplied to update the database.
+This value is also called as Primary Data Point B<(PDP)>. In our example
+mentioned above, a new PDP is generated every 300 seconds.
+
+Note, that if you do NOT supply new datapoints exaclty every 300 seconds,
+this is not problem, RRDTool will interpolate the data accordingly.
+
+B<DST> (data structure type) defines type of DS. It can be COUNTER, DERIVE,
+ABSOLUTE, GAUGE. A DS declared as COUNTER will save the rate of change of
+the value over a step period. This assumes that the value is always
+increasing (difference between last two values is more than 0). Traffic
+counters on a router is an ideal candidate for using COUNTER as DST. DERIVE
+is same as COUNTER but it allows negative values as well. If you want to see
+the rate of I<change> in free diskspace on your server, then you might want to
+use the DERIVE data type. ABSOULTE also saves the rate of change but it assumes
+that previous value is set to 0. The difference between current and previous
+value is always equal to the current value. So, it stores the current value divided
+by step interval (300 seconds in our example). GAUGE does not save the rate of
+change. It saves the actual value itself. There are no
+divisions/calculations. Memory consumption in a server is an ideal
+example of gauge. Difference among different types DSTs can be explained
+better with following example:
+
+ Values       = 300, 600, 900, 1200
+ Step         = 300 seconds
+ COUNTER DS   =    1,  1,   1,    1 
+ DERIVE DS    =    1,  1,   1,    1
+ ABSOLUTE DS  =    1,  2,   3,    4 
+ GAUGE DS     = 300, 600, 900, 1200
+
+The next parameter is B<heartbeat>. In our example, heartbeat is 600
+seconds. If database doesn not get a new PDP within 300
+seconds, it will wait for another 300 seconds (total 600 seconds).
+If it doesnt receive any PDP with in 600 seconds, it will save an UNKNOWN value
+into database. This UNKOWN value is a special feature of RRDTool - it is
+much better than to assume a missing value was 0 (zero).
+For example, the traffic flow counter on a router
+keeps on increasing. Lets say, a value is missed for an interval and 0 is stored
+instead of UNKNOWN. Now when next value becomes available, it will calculate
+difference between current value and previous value (0) which is not
+correct. So, inserting value UNKNOWN makes much more sense here.
+
+The next two parameters are the minimum and maximum value respectively. If variable
+to be stored has predictable maximum and minimum value, this should be
+specified here. Any update value falling out of this range will be saved as
+UNKNOWN.
+
+The next line declares a round robin archive (RRA). The syntax for declaring an RRA is
+
+ RRA:CF:xff:step:rows
+
+RRA is the keyword to declare RRAs. The consolidation function (CF) can be
+AVERAGE, MINIMUM, MAXIMUM, and LAST. The concept of the consolidated data point (CDP)
+comes into the picture here. A CDP is CFed (averaged, maximum/minimum value or
+last value) from I<step> number of PDPs. This RRA will hold I<rows> CDPs.
+
+Lets have a look at the example above. For the first RRA, 12 (steps) PDPs
+(DS variables) are AVERAGEed (CF) to form one CDP. 24 (rows) of theses CDPs
+are archived. Each PDP occurs at 300 seconds. 12 PDPs represent 12 times 300
+seconds which is 1 hour. It means 1 CDP (which is equal to 12 PDPs)
+represents data worth 1 hour. 24 such CDPs represent 1 day (1 hour times 24
+CDPs). It means, this RRA is an archive for one day. After 24 CDPs, CDP
+number 25 will replace the 1st CDP. Second RRA saves 31 CDPs; each CPD
+represents an AVERAGE value for a day (288 PDPs, each covering 300 seconds =
+24 hours). Therefore this RRA is an archive for one month. A single database
+can have many RRAs. If there are multiple DSs, each individual RRA will save
+data for all the DSes in the database. For example, if a database has 3 DSs;
+and daily, weekly, monthly, and yearly RRAs are declared, then each RRA will
+hold data from all 3 data sources.
+
+=head2 Graphical Magic
+
+Another important feature of RRDTool is its ability to create graphs. The
+"graph" command uses "fetch" command internally to retrieve values from the
+database. With the retrieved values, it draws graphs as defined by the
+parameters supplied on the command line. A single graph can show different
+DS (variables) from within a database. It is also possible to show the
+values from more than one databases into a single graph. Often, it is
+necessary to perform some math on the values retrieved from database, before
+plotting them. For example, in SNMP replies, memory consumption values are
+usually specified in KBytes and traffic flow on interfaces is specified in
+Bytes. Graphs for these values will be more senseful if values are
+represented in MBytes and mbps. the RRDTool graph command allows to define
+such conversions. Apart from mathematical calculations, it is also possible
+to peform logical operations such as greater than, less than, and if then
+else. If a database contains more than one RRA archive, then a question may
+arise - how does RRDTool decide which RRA archive to use for retrieving the
+values? RRDtool takes looks at several things when making its choice. First
+it makes sure that the RRA covers as much of the graphing time frame as
+possible. Second it looks at the resolution of the RRA compared to the
+resolution of the graph. It tries to find one which has the same or better
+resolution. With the "-r" option you can force RRDtool to assume a different
+resolution than the one calculated from the pixel width of the graph.
+
+Values of different variables can be presented in 5 different shapes in a
+graph - AREA, LINE1, LINE2, LINE3, and STACK. AREA is represented by a solid
+colored area with values as the boundary of this area. LINE1/2/3 (increasing
+width) are just plain lines representing the values. STACK is also an area
+but it is "stack"ed on AREA or LINE1/2/3. Another important thing to note,
+is that variables are plotted in the order they are defined in graph
+command. So, care must be taken to define STACK only after defining
+AREA/LINE. It is also possible to put formatted comments within the graph.
+Detailed instructions be found under graph manual.
+
+=head2 Wrapping RRDTool within Shell/Perl script
+
+After understanding RRDTool, it is now a time to actually use RRDTool in
+scripts. Tasks involved in network management are data collection, data
+storage, and data retrieval. In the following example,
+the previously created target.rrd database is used. Data collection and data
+storage is done using Shell scrip. Data retrieval
+and report generation is done using Perl script. These
+scripts are as shown below:
+
+=head3 Shell script (collects data, updates database)
+
+ #!/bin/sh
+ a=0
+ while [ "$a" == 0 ]; do
+ snmpwalk -c public 192.168.1.250 hrSWRunPerfMem > snmp_reply
+     total_mem=`awk 'BEGIN {tot_mem=0}
+                           { if ($NF == "KBytes")
+                             {tot_mem=tot_mem+$(NF-1)}
+                           }
+                     END {print tot_mem}' snmp_reply`
+     # I can use N as a replacement for the current time
+     rrdtool update target.rrd N:$total_mem
+     # sleep until the next 300 seconds are full
+     perl -e 'sleep 300 - time % 300'
+ done # end of while loop
+
+=head3 Perl script (retrieves data from database and generates graphs and statistics)
+
+ #!/usr/bin/perl -w
+ #This script fetch data from target.rrd, creates graph of memory consumption
+ on target (Dual P3 Processor 1 GHz, 656 MB RAM)
+
+ #calling RRD perl module
+ use lib qw( /usr/local/rrdtool-1.0.41/lib/perl ../lib/perl );
+ use RRDs;
+ my $cur_time = time();                # setting current time
+ my $end_time = $cur_time - 86400;     # setting end time to 24 hours behind current time
+ my $start_time = $end_time - 2592000; # setting start time to 30 days from end time
+
+ #fetching average values from rrd database between start and end time
+ my ($start,$step,$ds_names,$data) = 
+     RRDs::fetch("target.rrd", "AVERAGE", 
+                 "-r", "600", "-s", "$start_time", "-e", "$end_time");
+ #saving fetched values in 2-dimensional array
+ my $rows = 0;
+ my $columns = 0;
+ my $time_variable = $start;
+ foreach $line (@$data) {
+   $vals[$rows][$columns] = $time_variable;
+   $time_variable = $time_variable + $step;
+   foreach $val (@$line) {
+           $vals[$rows][++$columns] = $val;}
+   $rows++;
+   $columns = 0;
+ }
+ my $tot_time = 0;
+ my $count = 0;
+ #saving values from 2-dimensional into 1-dimensional array
+ for $i ( 0 .. $#vals ) 
+     $tot_mem[$count] = $vals[$i][1];
+     $count++;
+ }
+ my $tot_mem_sum = 0;
+ #calculating total of all values
+ for $i ( 0 .. ($count-1) ) {
+     $tot_mem_sum = $tot_mem_sum + $tot_mem[$i];
+ }
+ #calculating average of array
+ my $tot_mem_ave = $tot_mem_sum/($count);
+ #creating graph
+ RRDs::graph ("/images/mem_$count.gif",   \
+             "--title= Memory Usage",    \
+             "--vertical-label=Memory Consumption (MB)", \
+             "--start=$start_time",      \
+             "--end=$end_time",          \
+             "--color=BACK#CCCCCC",      \
+             "--color=CANVAS#CCFFFF",    \
+             "--color=SHADEB#9999CC",    \
+             "--height=125",             \
+             "--upper-limit=656", 	 \
+             "--lower-limit=0",          \
+             "--rigid",                  \
+             "--base=1024",              \
+             "DEF:tot_mem=target.rrd:mem:AVERAGE", \
+             "CDEF:correct_tot_mem=tot_mem,0,671744,LIMIT,UN,0,tot_mem,IF,1024,/",\
+             "CDEF:machine_mem=tot_mem,656,+,tot_mem,-",\
+             "COMMENT:Memory Consumption between $start_time",\
+             "COMMENT:    and $end_time                     ",\
+             "HRULE:656#000000:Maximum Available Memory - 656 MB",\
+             "AREA:machine_mem#CCFFFF:Memory Unused",   \
+             "AREA:correct_tot_mem#6699CC:Total memory consumed in MB");
+ my $err=RRDs::error;
+ if ($err) {print "problem generating the graph: $err\n";}
+ #printing the output
+ print "Average memory consumption is ";
+ printf "%5.2f",$tot_mem_ave/1024;
+ print " MB. Graphical representation can be found at /images/mem_$count.gif.";
+
+=head1 AUTHOR
+
+Ketan Patel E<lt>k2pattu at yahoo.comE<gt>
+

Added: trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.txt
==============================================================================
--- (empty file)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.txt	Thu Jul  3 16:26:45 2003
@@ -0,0 +1,395 @@
+RRD-BEGINNERS(1)             rrdtool             RRD-BEGINNERS(1)
+
+
+
+NNAAMMEE
+       rrd-beginners - Beginners guide
+
+SSYYNNOOPPSSIISS
+       Helping new RRDTool users to understand the basics of RRD-
+       Tool
+
+DDEESSCCRRIIPPTTIIOONN
+       This manual is an attempt to assist beginners in under-
+       standing the concepts of RRDTool. It sheds a light on dif-
+       ferences between RRDTool and other databases. With help of
+       an example, it explains structure of RRDTool database.
+       This is followed by an overview of the "graph" feature of
+       RRDTool.  At the end, it has sample scripts that illus-
+       trates the usage/wrapping of RRDTool within Shell/Perl.
+
+       WWhhaatt mmaakkeess RRRRDDTTooooll ssoo ssppeecciiaall??
+
+       RDtool is GNU licensed software developed by Tobies
+       Oetiker, a system manager at the Swiss Federal Institute
+       of Technology. Though it is a database, there are distinct
+       differences between RRDtool database and other databases
+       as listed below:
+
+       +o   RRDTool stores data; that makes it a back end tool.
+           The RRDtool command set allows the creation of graphs;
+           that makes it a front end tool as well. Other
+           databases just stores data and can not create graphs.
+
+       +o   In case of linear databases, new data gets appended at
+           the bottom of the database table. Thus its size keeps
+           on increasing, whereas size of an RRDtool database is
+           determined at creation time. Imagine an RRDtool
+           database as the perimeter of a circle. Data is added
+           along the perimeter. When new data reaches the start-
+           ing point, it overwrites existing data. This way, the
+           size of an RRDtool database always remains constant.
+           The name "Round Robin" stems from this attribute.
+
+       +o   Other databases store the values as supplied. RRDtool
+           can be configured to calculate the rate of change from
+           the previous to the current value and store this
+           information instead.
+
+       +o   Other databases get updated when values are supplied.
+           The RRDTool database is structured in such a way that
+           it needs data at predefined time intervals. If it does
+           not get a new value during the interval, it stores an
+           UNKNOWN value for that interval. So, when using the
+           RRDTool database, it is imperative to use scripts that
+           runs at regular intervals to ensure a constant data
+           flow to update the RRDTool database.
+
+       RRDtool has a lot to do with time. With every data update,
+       it also needs to know the time when that update occurred.
+       Time is always expressed in seconds passed since epoch
+       (01-01-1971). RRDTool can be installed on Unix as well as
+       Windows. It has command set to carry out various opera-
+       tions on rrd database. This command set can be accessed
+       from the command line, and from shell or perl scripts. The
+       scripts act as wrappers for accessing data stored in RRD-
+       tool database.
+
+       UUnnddeerrssttaannddiinngg bbyy aann eexxaammppllee
+
+       The structure of an RRD database is different than other
+       linear databases.  Other databases define tables with
+       columns, and many other parameters. These definitions
+       sometime are very complex, especially in large databases.
+       RRDTool databases are primarily used for monitoring pur-
+       poses and hence are very simple in structure. The parame-
+       ters that need to be defined are variables that hold val-
+       ues and archives of those values. Being time sensitive, a
+       couple of time related parameters are also defined.
+       Because of its structure, the definition of an RRDTool
+       database also includes a provision to specify specific
+       actions to take in the absence of update values. Data
+       structure (DS), heartbeat, data structure type, round
+       robin archive (RRA), and consolidation function (CF) are
+       some of the terminologies related to RRDTool databases.
+
+       The structure of a database and the terminology associated
+       with it can be best explained with an example.
+
+        rrdtool create target.rrd
+                --start 1023654125
+                --step 300
+                DS:mem:GAUGE:600:0:671744
+                RRA:AVERAGE:0.5:12:24
+                RRA:AVERAGE:0.5:288:31
+
+       This example creates a database named _t_a_r_g_e_t_._r_r_d. Start
+       time (1023654125) is specified in total number of seconds
+       since epoch (time in seconds since 01-01-1970). While
+       updating the database, update time is also specified.
+       This update time MUST occur after start time and MUST be
+       in seconds since epoch.
+
+       The step of 300 seconds indicates that database expects
+       new values every 300 seconds. The wrapper script should be
+       scheduled to run every sstteepp seconds so that it updates the
+       database every sstteepp seconds.
+
+       DS (data structure) is the actual variable which relates
+       to the parameter on the device that has to be monitored.
+       Its syntax is
+
+        DS:variable_name:DST:heartbeat:min:max
+
+       DDSS is a key word. "variable_name" is a name under which
+       the parameter is saved in database. There can be as many
+       DSs in a database as needed. After every step interval, a
+       new value of DS is supplied to update the database.  This
+       value is also called as Primary Data Point ((PPDDPP)). In our
+       example mentioned above, a new PDP is generated every 300
+       seconds.
+
+       Note, that if you do NOT supply new datapoints exaclty
+       every 300 seconds, this is not problem, RRDTool will
+       interpolate the data accordingly.
+
+       DDSSTT (data structure type) defines type of DS. It can be
+       COUNTER, DERIVE, ABSOLUTE, GAUGE. A DS declared as COUNTER
+       will save the rate of change of the value over a step
+       period. This assumes that the value is always increasing
+       (difference between last two values is more than 0). Traf-
+       fic counters on a router is an ideal candidate for using
+       COUNTER as DST. DERIVE is same as COUNTER but it allows
+       negative values as well. If you want to see the rate of
+       _c_h_a_n_g_e in free diskspace on your server, then you might
+       want to use the DERIVE data type. ABSOULTE also saves the
+       rate of change but it assumes that previous value is set
+       to 0. The difference between current and previous value is
+       always equal to the current value. So, it stores the cur-
+       rent value divided by step interval (300 seconds in our
+       example). GAUGE does not save the rate of change. It saves
+       the actual value itself. There are no divisions/calcula-
+       tions. Memory consumption in a server is an ideal example
+       of gauge. Difference among different types DSTs can be
+       explained better with following example:
+
+        Values       = 300, 600, 900, 1200
+        Step         = 300 seconds
+        COUNTER DS   =    1,  1,   1,    1
+        DERIVE DS    =    1,  1,   1,    1
+        ABSOLUTE DS  =    1,  2,   3,    4
+        GAUGE DS     = 300, 600, 900, 1200
+
+       The next parameter is hheeaarrttbbeeaatt. In our example, heartbeat
+       is 600 seconds. If database doesn not get a new PDP within
+       300 seconds, it will wait for another 300 seconds (total
+       600 seconds).  If it doesnt receive any PDP with in 600
+       seconds, it will save an UNKNOWN value into database. This
+       UNKOWN value is a special feature of RRDTool - it is much
+       better than to assume a missing value was 0 (zero).  For
+       example, the traffic flow counter on a router keeps on
+       increasing. Lets say, a value is missed for an interval
+       and 0 is stored instead of UNKNOWN. Now when next value
+       becomes available, it will calculate difference between
+       current value and previous value (0) which is not correct.
+       So, inserting value UNKNOWN makes much more sense here.
+
+       The next two parameters are the minimum and maximum value
+       respectively. If variable to be stored has predictable
+       maximum and minimum value, this should be specified here.
+       Any update value falling out of this range will be saved
+       as UNKNOWN.
+
+       The next line declares a round robin archive (RRA). The
+       syntax for declaring an RRA is
+
+        RRA:CF:xff:step:rows
+
+       RRA is the keyword to declare RRAs. The consolidation
+       function (CF) can be AVERAGE, MINIMUM, MAXIMUM, and LAST.
+       The concept of the consolidated data point (CDP) comes
+       into the picture here. A CDP is CFed (averaged, maxi-
+       mum/minimum value or last value) from _s_t_e_p number of PDPs.
+       This RRA will hold _r_o_w_s CDPs.
+
+       Lets have a look at the example above. For the first RRA,
+       12 (steps) PDPs (DS variables) are AVERAGEed (CF) to form
+       one CDP. 24 (rows) of theses CDPs are archived. Each PDP
+       occurs at 300 seconds. 12 PDPs represent 12 times 300 sec-
+       onds which is 1 hour. It means 1 CDP (which is equal to 12
+       PDPs) represents data worth 1 hour. 24 such CDPs represent
+       1 day (1 hour times 24 CDPs). It means, this RRA is an
+       archive for one day. After 24 CDPs, CDP number 25 will
+       replace the 1st CDP. Second RRA saves 31 CDPs; each CPD
+       represents an AVERAGE value for a day (288 PDPs, each cov-
+       ering 300 seconds = 24 hours). Therefore this RRA is an
+       archive for one month. A single database can have many
+       RRAs. If there are multiple DSs, each individual RRA will
+       save data for all the DSes in the database. For example,
+       if a database has 3 DSs; and daily, weekly, monthly, and
+       yearly RRAs are declared, then each RRA will hold data
+       from all 3 data sources.
+
+       GGrraapphhiiccaall MMaaggiicc
+
+       Another important feature of RRDTool is its ability to
+       create graphs. The "graph" command uses "fetch" command
+       internally to retrieve values from the database. With the
+       retrieved values, it draws graphs as defined by the param-
+       eters supplied on the command line. A single graph can
+       show different DS (variables) from within a database. It
+       is also possible to show the values from more than one
+       databases into a single graph. Often, it is necessary to
+       perform some math on the values retrieved from database,
+       before plotting them. For example, in SNMP replies, memory
+       consumption values are usually specified in KBytes and
+       traffic flow on interfaces is specified in Bytes. Graphs
+       for these values will be more senseful if values are rep-
+       resented in MBytes and mbps. the RRDTool graph command
+       allows to define such conversions. Apart from mathematical
+       calculations, it is also possible to peform logical opera-
+       tions such as greater than, less than, and if then else.
+       If a database contains more than one RRA archive, then a
+       question may arise - how does RRDTool decide which RRA
+       archive to use for retrieving the values? RRDtool takes
+       looks at several things when making its choice. First it
+       makes sure that the RRA covers as much of the graphing
+       time frame as possible. Second it looks at the resolution
+       of the RRA compared to the resolution of the graph. It
+       tries to find one which has the same or better resolution.
+       With the "-r" option you can force RRDtool to assume a
+       different resolution than the one calculated from the
+       pixel width of the graph.
+
+       Values of different variables can be presented in 5 dif-
+       ferent shapes in a graph - AREA, LINE1, LINE2, LINE3, and
+       STACK. AREA is represented by a solid colored area with
+       values as the boundary of this area. LINE1/2/3 (increasing
+       width) are just plain lines representing the values. STACK
+       is also an area but it is "stack"ed on AREA or LINE1/2/3.
+       Another important thing to note, is that variables are
+       plotted in the order they are defined in graph command.
+       So, care must be taken to define STACK only after defining
+       AREA/LINE. It is also possible to put formatted comments
+       within the graph.  Detailed instructions be found under
+       graph manual.
+
+       WWrraappppiinngg RRRRDDTTooooll wwiitthhiinn SShheellll//PPeerrll ssccrriipptt
+
+       After understanding RRDTool, it is now a time to actually
+       use RRDTool in scripts. Tasks involved in network manage-
+       ment are data collection, data storage, and data
+       retrieval. In the following example, the previously cre-
+       ated target.rrd database is used. Data collection and data
+       storage is done using Shell scrip. Data retrieval and
+       report generation is done using Perl script. These scripts
+       are as shown below:
+
+       _S_h_e_l_l _s_c_r_i_p_t _(_c_o_l_l_e_c_t_s _d_a_t_a_, _u_p_d_a_t_e_s _d_a_t_a_b_a_s_e_)
+
+
+
+
+
+
+        #!/bin/sh
+        a=0
+        while [ "$a" == 0 ]; do
+        snmpwalk -c public 192.168.1.250 hrSWRunPerfMem > snmp_reply
+            total_mem=`awk 'BEGIN {tot_mem=0}
+                                  { if ($NF == "KBytes")
+                                    {tot_mem=tot_mem+$(NF-1)}
+                                  }
+                            END {print tot_mem}' snmp_reply`
+            # I can use N as a replacement for the current time
+            rrdtool update target.rrd N:$total_mem
+            # sleep until the next 300 seconds are full
+            perl -e 'sleep 300 - time % 300'
+        done # end of while loop
+
+       _P_e_r_l _s_c_r_i_p_t _(_r_e_t_r_i_e_v_e_s _d_a_t_a _f_r_o_m _d_a_t_a_b_a_s_e _a_n_d _g_e_n_e_r_a_t_e_s
+       _g_r_a_p_h_s _a_n_d _s_t_a_t_i_s_t_i_c_s_)
+
+        #!/usr/bin/perl -w
+        #This script fetch data from target.rrd, creates graph of memory consumption
+        on target (Dual P3 Processor 1 GHz, 656 MB RAM)
+
+        #calling RRD perl module
+        use lib qw( /usr/local/rrdtool-1.0.41/lib/perl ../lib/perl );
+        use RRDs;
+        my $cur_time = time();                # setting current time
+        my $end_time = $cur_time - 86400;     # setting end time to 24 hours behind current time
+        my $start_time = $end_time - 2592000; # setting start time to 30 days from end time
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        #fetching average values from rrd database between start and end time
+        my ($start,$step,$ds_names,$data) =
+            RRDs::fetch("target.rrd", "AVERAGE",
+                        "-r", "600", "-s", "$start_time", "-e", "$end_time");
+        #saving fetched values in 2-dimensional array
+        my $rows = 0;
+        my $columns = 0;
+        my $time_variable = $start;
+        foreach $line (@$data) {
+          $vals[$rows][$columns] = $time_variable;
+          $time_variable = $time_variable + $step;
+          foreach $val (@$line) {
+                  $vals[$rows][++$columns] = $val;}
+          $rows++;
+          $columns = 0;
+        }
+        my $tot_time = 0;
+        my $count = 0;
+        #saving values from 2-dimensional into 1-dimensional array
+        for $i ( 0 .. $#vals )
+            $tot_mem[$count] = $vals[$i][1];
+            $count++;
+        }
+        my $tot_mem_sum = 0;
+        #calculating total of all values
+        for $i ( 0 .. ($count-1) ) {
+            $tot_mem_sum = $tot_mem_sum + $tot_mem[$i];
+        }
+        #calculating average of array
+        my $tot_mem_ave = $tot_mem_sum/($count);
+        #creating graph
+        RRDs::graph ("/images/mem_$count.gif",   \
+                    "--title= Memory Usage",    \
+                    "--vertical-label=Memory Consumption (MB)", \
+                    "--start=$start_time",      \
+                    "--end=$end_time",          \
+                    "--color=BACK#CCCCCC",      \
+                    "--color=CANVAS#CCFFFF",    \
+                    "--color=SHADEB#9999CC",    \
+                    "--height=125",             \
+                    "--upper-limit=656",        \
+                    "--lower-limit=0",          \
+                    "--rigid",                  \
+                    "--base=1024",              \
+                    "DEF:tot_mem=target.rrd:mem:AVERAGE", \
+                    "CDEF:correct_tot_mem=tot_mem,0,671744,LIMIT,UN,0,tot_mem,IF,1024,/",\
+                    "CDEF:machine_mem=tot_mem,656,+,tot_mem,-",\
+                    "COMMENT:Memory Consumption between $start_time",\
+                    "COMMENT:    and $end_time                     ",\
+                    "HRULE:656#000000:Maximum Available Memory - 656 MB",\
+                    "AREA:machine_mem#CCFFFF:Memory Unused",   \
+                    "AREA:correct_tot_mem#6699CC:Total memory consumed in MB");
+        my $err=RRDs::error;
+        if ($err) {print "problem generating the graph: $err\n";}
+        #printing the output
+        print "Average memory consumption is ";
+        printf "%5.2f",$tot_mem_ave/1024;
+        print " MB. Graphical representation can be found at /images/mem_$count.gif.";
+
+AAUUTTHHOORR
+       Ketan Patel <k2pattu at yahoo.com>
+
+
+
+1.0.43                      2003-06-25           RRD-BEGINNERS(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.html
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdcgi.html	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.html	Thu Jul  3 16:26:45 2003
@@ -49,7 +49,7 @@
 is to run as a cgi-program and parse a web page template containing special
 &lt;RRD:: tags. <strong>rrdcgi</strong> will interpret and act according to these tags.
 In the end it will printout a web page including the necessary CGI headers.</p>
-<p><strong>rrdcgi</strong> parses the contents of the template in 2 steps. In each step it looks
+<p><strong>rrdcgi</strong> parses the contents of the template in 3 steps. In each step it looks
 only for a subset of tags. This allows to nest tags.</p>
 <p>The argument parser uses the same semantics as you are used from your c shell.</p>
 <p>
@@ -139,6 +139,17 @@
 This gets replaced by the current time of day. The
 time is <em>strftime</em>-formated with the string specified in the argument.
 </dd>
+<p></p>
+<dt><strong><a name="item_rrd%3a%3atime%3a%3astrftime_start%7cend_start%2dsp">RRD::TIME::STRFTIME <em>START|END</em> <em>start-spec</em> <em>end-spec</em> <em>strftime-format</em></a></strong><br />
+</dt>
+<dd>
+This gets replaced by a strftime-formatted time using the format
+<em>strftime-format</em> on either <em>start-spec</em> or <em>end-spec</em> depending on
+whether <em>START</em> or <em>END</em> is specified.  Both <em>start-spec</em> and <em>end-spec</em>
+must be supplied as either could be relative to the other.  This is intended
+to allow pretty titles on graphs with times that are easier for non rrdtool
+folks to figure out than ``-2weeks''.
+</dd>
 <p></p></dl>
 <p>
 </p>

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.pod
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdcgi.pod	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.pod	Thu Jul  3 16:26:45 2003
@@ -16,7 +16,7 @@
 E<lt>RRD:: tags. B<rrdcgi> will interpret and act according to these tags.
 In the end it will printout a web page including the necessary CGI headers.
 
-B<rrdcgi> parses the contents of the template in 2 steps. In each step it looks
+B<rrdcgi> parses the contents of the template in 3 steps. In each step it looks
 only for a subset of tags. This allows to nest tags. 
 
 The argument parser uses the same semantics as you are used from your c shell.
@@ -93,6 +93,15 @@
 This gets replaced by the current time of day. The
 time is I<strftime>-formated with the string specified in the argument.
 
+=item RRD::TIME::STRFTIME I<START|END> I<start-spec> I<end-spec> I<strftime-format>
+
+This gets replaced by a strftime-formatted time using the format
+I<strftime-format> on either I<start-spec> or I<end-spec> depending on
+whether I<START> or I<END> is specified.  Both I<start-spec> and I<end-spec>
+must be supplied as either could be relative to the other.  This is intended
+to allow pretty titles on graphs with times that are easier for non rrdtool
+folks to figure out than "-2weeks".
+
 =back
 
 =head2 Pass 3

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdcgi.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.txt	Thu Jul  3 16:26:45 2003
@@ -17,7 +17,7 @@
        will printout a web page including the necessary CGI head-
        ers.
 
-       rrrrddccggii parses the contents of the template in 2 steps. In
+       rrrrddccggii parses the contents of the template in 3 steps. In
        each step it looks only for a subset of tags. This allows
        to nest tags.
 
@@ -86,6 +86,17 @@
                time is _s_t_r_f_t_i_m_e-formated with the string speci-
                fied in the argument.
 
+       RRD::TIME::STRFTIME _S_T_A_R_T_|_E_N_D _s_t_a_r_t_-_s_p_e_c _e_n_d_-_s_p_e_c _s_t_r_f_-
+       _t_i_m_e_-_f_o_r_m_a_t
+               This gets replaced by a strftime-formatted time
+               using the format _s_t_r_f_t_i_m_e_-_f_o_r_m_a_t on either _s_t_a_r_t_-
+               _s_p_e_c or _e_n_d_-_s_p_e_c depending on whether _S_T_A_R_T or _E_N_D
+               is specified.  Both _s_t_a_r_t_-_s_p_e_c and _e_n_d_-_s_p_e_c must
+               be supplied as either could be relative to the
+               other.  This is intended to allow pretty titles on
+               graphs with times that are easier for non rrdtool
+               folks to figure out than "-2weeks".
+
        PPaassss 33
 
 
@@ -123,13 +134,6 @@
        The example below creates a web pages with a single RRD
        graph.
 
-
-
-
-
-
-
-
         #!/usr/local/bin/rrdcgi
         <HTML>
         <HEAD><TITLE>RRDCGI Demo</TITLE></HEAD>
@@ -199,3 +203,4 @@
 
 
 
+1.0.43                      2003-05-20                  RRDCGI(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdcreate.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdcreate.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdcreate.txt	Thu Jul  3 16:26:45 2003
@@ -248,4 +248,4 @@
 
 
 
-1.0.42                      2002-12-20               RRDCREATE(1)
+1.0.43                      2002-12-20               RRDCREATE(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrddump.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrddump.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrddump.txt	Thu Jul  3 16:26:45 2003
@@ -24,4 +24,4 @@
 
 
 
-1.0.42                      2002-02-26                 RRDDUMP(1)
+1.0.43                      2002-02-26                 RRDDUMP(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.html
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdfetch.html	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.html	Thu Jul  3 16:26:45 2003
@@ -251,7 +251,7 @@
 <p><em>931225537</em> -- 18:45  July 5th, 1999
 (yes, seconds since 1970 are valid as well)</p>
 <p><em>19970703 12:45</em> -- 12:45  July 3th, 1997
-(not quote standard, but I love this ...)</p>
+(my favorite, and its even got an ISO number (8601))</p>
 <p>
 </p>
 <hr />

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.pod
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdfetch.pod	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.pod	Thu Jul  3 16:26:45 2003
@@ -248,8 +248,7 @@
 (yes, seconds since 1970 are valid as well)
 
 I<19970703 12:45> -- 12:45  July 3th, 1997
-(not quote standard, but I love this ...)
-
+(my favorite, and its even got an ISO number (8601))
 
 =head1 AUTHOR
 

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdfetch.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.txt	Thu Jul  3 16:26:45 2003
@@ -241,12 +241,12 @@
        _9_3_1_2_2_5_5_3_7 -- 18:45  July 5th, 1999 (yes, seconds since
        1970 are valid as well)
 
-       _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 ...)
+       _1_9_9_7_0_7_0_3 _1_2_:_4_5 -- 12:45  July 3th, 1997 (my favorite, and
+       its even got an ISO number (8601))
 
 AAUUTTHHOORR
        Tobias Oetiker <oetiker at ee.ethz.ch>
 
 
 
-1.0.42                      2002-07-31                RRDFETCH(1)
+1.0.43                      2003-04-16                RRDFETCH(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdgraph.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdgraph.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdgraph.txt	Thu Jul  3 16:26:45 2003
@@ -639,4 +639,4 @@
 
 
 
-1.0.42                      2003-02-19                RRDGRAPH(1)
+1.0.43                      2003-02-19                RRDGRAPH(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdinfo.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdinfo.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdinfo.txt	Thu Jul  3 16:26:45 2003
@@ -56,4 +56,4 @@
 
 
 
-1.0.42                      2002-02-26                 RRDINFO(1)
+1.0.43                      2002-02-26                 RRDINFO(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdlast.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdlast.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdlast.txt	Thu Jul  3 16:26:45 2003
@@ -21,4 +21,4 @@
 
 
 
-1.0.42                      2002-02-26                 RRDLAST(1)
+1.0.43                      2002-02-26                 RRDLAST(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdresize.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdresize.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdresize.txt	Thu Jul  3 16:26:45 2003
@@ -44,4 +44,4 @@
 
 
 
-1.0.42                      2002-07-05               RRDRESIZE(1)
+1.0.43                      2002-07-05               RRDRESIZE(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdrestore.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdrestore.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdrestore.txt	Thu Jul  3 16:26:45 2003
@@ -29,4 +29,4 @@
 
 
 
-1.0.42                      2002-02-26              RRDRESTORE(1)
+1.0.43                      2002-02-26              RRDRESTORE(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdtool.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdtool.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdtool.txt	Thu Jul  3 16:26:45 2003
@@ -202,4 +202,4 @@
 
 
 
-1.0.42                      2002-11-29                 RRDTOOL(1)
+1.0.43                      2002-11-29                 RRDTOOL(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdtune.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdtune.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdtune.txt	Thu Jul  3 16:26:45 2003
@@ -64,4 +64,4 @@
 
 
 
-1.0.42                      2002-02-26                 RRDTUNE(1)
+1.0.43                      2002-02-26                 RRDTUNE(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdtutorial.es.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdtutorial.es.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdtutorial.es.txt	Thu Jul  3 16:26:45 2003
@@ -1262,4 +1262,4 @@
 
 
 
-1.0.42                      2003-01-20          RRDTUTORIAL.ES(1)
+1.0.43                      2003-01-20          RRDTUTORIAL.ES(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdtutorial.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdtutorial.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdtutorial.txt	Thu Jul  3 16:26:45 2003
@@ -1241,4 +1241,4 @@
 
 
 
-1.0.42                      2003-02-27             RRDTUTORIAL(1)
+1.0.43                      2003-02-27             RRDTUTORIAL(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdupdate.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdupdate.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdupdate.txt	Thu Jul  3 16:26:45 2003
@@ -72,4 +72,4 @@
 
 
 
-1.0.42                      2002-02-26               RRDUPDATE(1)
+1.0.43                      2002-02-26               RRDUPDATE(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdxport.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdxport.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdxport.txt	Thu Jul  3 16:26:45 2003
@@ -125,4 +125,4 @@
 
 
 
-1.0.42                      2002-05-29                RRDXPORT(1)
+1.0.43                      2002-05-29                RRDXPORT(1)

Modified: trunk/orca/packages/rrdtool-1.0.43/perl-piped/RRDp.pm
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/perl-piped/RRDp.pm	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/perl-piped/RRDp.pm	Thu Jul  3 16:26:45 2003
@@ -110,7 +110,7 @@
 sub end ();
 sub read ();
 
-$VERSION = 1.000421 ;
+$VERSION = 1.000431 ;
 
 sub start ($){
   croak "rrdtool is already running"

Modified: trunk/orca/packages/rrdtool-1.0.43/perl-shared/RRDs.pm
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/perl-shared/RRDs.pm	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/perl-shared/RRDs.pm	Thu Jul  3 16:26:45 2003
@@ -7,7 +7,7 @@
 
 require DynaLoader;
 
-$VERSION = 1.000421;
+$VERSION = 1.000431;
 
 bootstrap RRDs $VERSION;
 

Modified: trunk/orca/packages/rrdtool-1.0.43/rrdtool.spec
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/rrdtool.spec	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/rrdtool.spec	Thu Jul  3 16:26:45 2003
@@ -5,7 +5,7 @@
 
 Summary: 	RRDtool - round robin database
 Name: 		rrdtool
-Version: 	1.0.41
+Version:	1.0.43
 Release:	1.%{DISTRO_REL}
 Copyright: 	GPL
 Group: 		Applications/Databases

Modified: trunk/orca/packages/rrdtool-1.0.43/src/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/Makefile.in	Thu Jul  3 16:26:45 2003
@@ -384,6 +384,7 @@
 	    || cp -p $$d/$$file $(distdir)/$$file || :; \
 	  fi; \
 	done
+diff_test.o: diff_test.c
 gdpng.lo gdpng.o : gdpng.c ../libpng-1.0.9/png.h ../zlib-1.1.4/zlib.h \
 	../zlib-1.1.4/zconf.h ../libpng-1.0.9/pngconf.h ../gd1.3/gd.h
 getopt.lo getopt.o : getopt.c ../config/config.h getopt.h
@@ -398,8 +399,7 @@
 	rrd_format.h ../gd1.3/gd.h ../cgilib-0.4/cgi.h
 rrd_create.lo rrd_create.o : rrd_create.c rrd_tool.h ../config/config.h \
 	rrd.h getopt.h rrd_format.h ../gd1.3/gd.h
-rrd_diff.lo rrd_diff.o : rrd_diff.c rrd_tool.h ../config/config.h rrd.h \
-	getopt.h rrd_format.h ../gd1.3/gd.h
+rrd_diff.lo rrd_diff.o : rrd_diff.c
 rrd_dump.lo rrd_dump.o : rrd_dump.c rrd_tool.h ../config/config.h rrd.h \
 	getopt.h rrd_format.h ../gd1.3/gd.h
 rrd_error.lo rrd_error.o : rrd_error.c rrd_tool.h ../config/config.h \

Modified: trunk/orca/packages/rrdtool-1.0.43/src/gdpng.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/gdpng.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/gdpng.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * gdpng.c  add PNG output routine to gd library
  *****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.43/src/gifsize.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/gifsize.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/gifsize.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  ****************************************************************************
  * gifsize.c  provides the function gifsize which determines the size of a gif
  ****************************************************************************/
@@ -52,7 +52,7 @@
 static int DoExtension (FILE *fd, int label, int *Transparent);
 static int GetDataBlock (FILE *fd, unsigned char *buf);
 
-int ZeroDataBlock;
+int gifsize_ZeroDataBlock;
 
 int
 GifSize(FILE *fd, long *width, long *height)
@@ -68,7 +68,7 @@
        unsigned char   ColorMap[3][MAXCOLORMAPSIZE];
        int             imageCount = 0;
        char            version[4];
-       ZeroDataBlock = FALSE;
+       gifsize_ZeroDataBlock = FALSE;
 
        imageNumber = 1;
        if (! ReadOK(fd,buf,6)) {
@@ -185,7 +185,7 @@
                return -1;
        }
 
-       ZeroDataBlock = count == 0;
+       gifsize_ZeroDataBlock = count == 0;
 
        if ((count != 0) && (! ReadOK(fd, buf, count))) {
                return -1;

Modified: trunk/orca/packages/rrdtool-1.0.43/src/pngsize.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/pngsize.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/pngsize.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * pngsize.c  determine the size of a PNG image
  *****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd.h	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd.h	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997,1998, 1999
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997,1998, 1999
  *****************************************************************************
  * rrdlib.h   Public header file for librrd
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_cgi.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_cgi.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_cgi.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_cgi.c  RRD Web Page Generator
  *****************************************************************************/
@@ -56,6 +56,9 @@
 /* for how long is the output of the cgi valid ? */
 char* rrdgoodfor(long, char **);
 
+/* format at-time specified times using strftime */
+char* printstrftime(long, char**);
+
 /** http protocol needs special format, and GMT time **/
 char *http_time(time_t *);
 
@@ -160,6 +163,7 @@
       i += parse(&buffer,i,"<RRD::INCLUDE",includefile);
       i += parse(&buffer,i,"<RRD::TIME::LAST",printtimelast);
       i += parse(&buffer,i,"<RRD::TIME::NOW",printtimenow);
+      i += parse(&buffer,i,"<RRD::TIME::STRFTIME",printstrftime);
   }
 
   /* pass 3 */
@@ -231,6 +235,62 @@
   return stralloc("");
 }
 
+/* Format start or end times using strftime.  We always need both the
+ * start and end times, because, either might be relative to the other.
+ * */
+#define MAX_STRFTIME_SIZE 256
+char* printstrftime(long argc, char **args){
+	struct	time_value start_tv, end_tv;
+	char    *parsetime_error = NULL;
+	char	formatted[MAX_STRFTIME_SIZE];
+	struct tm *the_tm;
+	time_t	start_tmp, end_tmp;
+
+	/* Make sure that we were given the right number of args */
+	if( argc != 4) {
+		rrd_set_error( "wrong number of args %d", argc);
+		return (char *) -1;
+	}
+
+	/* Init start and end time */
+	parsetime("end-24h", &start_tv);
+	parsetime("now", &end_tv);
+
+	/* Parse the start and end times we were given */
+	if( (parsetime_error = parsetime( args[1], &start_tv))) {
+		rrd_set_error( "start time: %s", parsetime_error);
+		return (char *) -1;
+	}
+	if( (parsetime_error = parsetime( args[2], &end_tv))) {
+		rrd_set_error( "end time: %s", parsetime_error);
+		return (char *) -1;
+	}
+	if( proc_start_end( &start_tv, &end_tv, &start_tmp, &end_tmp) == -1) {
+		return (char *) -1;
+	}
+
+	/* Do we do the start or end */
+	if( strcasecmp( args[0], "START") == 0) {
+		the_tm = localtime( &start_tmp);
+	}
+	else if( strcasecmp( args[0], "END") == 0) {
+		the_tm = localtime( &end_tmp);
+	}
+	else {
+		rrd_set_error( "start/end not found in '%s'", args[0]);
+		return (char *) -1;
+	}
+
+	/* now format it */
+	if( strftime( formatted, MAX_STRFTIME_SIZE, args[3], the_tm)) {
+		return( stralloc( formatted));
+	}
+	else {
+		rrd_set_error( "strftime failed");
+		return (char *) -1;
+	}
+}
+
 char* includefile(long argc, char **args){
   char *buffer;
   if (argc >= 1) {

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_create.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_create.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_create.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_create.c  creates new rrds
  *****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_diff.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_diff.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_diff.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1999
+ * RRDtool 1.0.43  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
@@ -24,8 +24,13 @@
  *
  *****************************************************************************/
 
-#include "rrd_tool.h"
-
+/* #include "rrd_tool.h" */
+#define LAST_DS_LEN 100
+#define DNAN  0.0/0;
+#define max(a,b) ((a) > (b) ? (a) : (b))
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
 double
 rrd_diff(char *a, char *b)
 {
@@ -66,13 +71,11 @@
     r1[1] = 0;  /* Null terminate result */
     c = 0;
     for (x=0; x<m; x++) {
-        if (a1 >= a && b1 >= b) {
-            *r1 = ((*a1 - c) - *b1) + '0';
-        } else if (a1 >= a) {
-            *r1 = (*a1 - c);
-        } else {
-            *r1 = ('0' - *b1 - c) + '0';
-        }
+        /* we want to avoid reading off the edge of the string */
+        char save_a,save_b;
+        save_a = ( a1 >= a) ? *a1 : '0';
+        save_b = ( b1 >= b) ? *b1 : '0';
+        *r1 = save_a - save_b - c + '0';
         if (*r1 < '0') {
             *r1 += 10;
             c=1;

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_dump.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_dump.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_dump.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_dump  Display a RRD
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_error.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_error.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_error.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_error.c   Common Header File
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_fetch.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_fetch.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_fetch.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_fetch.c  read date from an rrd to use for further processing
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_format.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_format.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_format.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1999
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1999
  *****************************************************************************
  * rrd_format.c  RRD Database Format helper functions
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_format.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_format.h	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_format.h	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997, 1998, 1999
  *****************************************************************************
  * rrd_format.h  RRD Database Format header
  *****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_graph.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_graph.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_graph.c	Thu Jul  3 16:26:45 2003
@@ -1,6 +1,6 @@
 
 /****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  ****************************************************************************
  * rrd__graph.c  make creates ne rrds
  ****************************************************************************/
@@ -175,9 +175,19 @@
     } 
 }
 
-   
-    
+/* allocate colors with re-use */
+
+int color_allocate(gdImagePtr im, int r, int g, int b) { 
+
+	int color;
 
+	if ((color = gdImageColorExact(im, r, g, b)) != -1) {
+		return(color);
+	}
+
+	return(gdImageColorAllocate(im, r, g, b));
+}
+    
 
 /* conversion function for symbolic entry names */
 
@@ -2352,9 +2362,9 @@
   }
 
   gdImageColorTransparent(brush, 
-			  gdImageColorAllocate(brush, 0, 0, 0));
+			  color_allocate(brush, 0, 0, 0));
 
-  pen = gdImageColorAllocate(brush, 
+  pen = color_allocate(brush, 
 			     im->gdes[cosel].col.red,
 			     im->gdes[cosel].col.green,
 			     im->gdes[cosel].col.blue);
@@ -2395,7 +2405,7 @@
      {c2 = gdImageGetPixel(img,i1,i2);	/* get pixel */
       if (copy_white || img->red[c2] != 255 || img->green[c2] != 255 || img->blue[c2] != 255)
        {if ((c1 = gdImageColorExact(gif,img->red[c2],img->green[c2],img->blue[c2])) < 0)
-         if ((c1 = gdImageColorAllocate(gif,img->red[c2],img->green[c2],img->blue[c2])) < 0)
+         if ((c1 = color_allocate(gif,img->red[c2],img->green[c2],img->blue[c2])) < 0)
           c1 = gdImageColorClosest(gif,img->red[c2],img->green[c2],img->blue[c2]);
         gdImageSetPixel(gif,i1,i2,c1);
        }
@@ -2517,13 +2527,13 @@
 	/* check for user override values */
 	if(im->graph_col[i].red != -1)
 	    graph_col[i].i = 
-		gdImageColorAllocate( gif,
+		color_allocate( gif,
 				      im->graph_col[i].red, 
 				      im->graph_col[i].green, 
 				      im->graph_col[i].blue);
 	else
 	    graph_col[i].i = 
-		gdImageColorAllocate( gif,
+		color_allocate( gif,
 				      graph_col[i].red, 
 				      graph_col[i].green, 
 				      graph_col[i].blue);
@@ -2534,7 +2544,7 @@
 	/* only for elements which have a color defined */
 	if (im->gdes[i].col.red != -1)
 	    im->gdes[i].col.i = 
-		gdImageColorAllocate(gif,
+		color_allocate(gif,
 				     im->gdes[i].col.red,
 				     im->gdes[i].col.green,
 				     im->gdes[i].col.blue);

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_graph.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_graph.h	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_graph.h	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  ****************************************************************************
  * rrd__graph.h  
  ****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_info.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_info.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_info.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_info  Get Information about the configuration of an RRD
  *****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_last.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_last.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_last.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_last.c
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_open.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_open.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_open.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_open.c  Open an RRD File
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_resize.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_resize.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_resize.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_resize.c Alters size of an RRA
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_restore.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_restore.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_restore.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_restore.c  creates new rrd from data dumped by rrd_dump.c
  *****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_tool.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_tool.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_tool.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2001
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2001
  *****************************************************************************
  * rrd_tool.c  Startup wrapper
  *****************************************************************************/
@@ -20,7 +20,7 @@
 {
 
     char help_main[] =
-	   "RRDtool 1.0.42  Copyright 1997-2001 by Tobias Oetiker <tobi at oetiker.ch>\n\n"
+	   "RRDtool 1.0.43  Copyright 1997-2001 by Tobias Oetiker <tobi at oetiker.ch>\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.42  Copyright (C) 1997-2001 by Tobias Oetiker <tobi at oetiker.ch>\n");
+        printf("RRDtool 1.0.43  Copyright (C) 1997-2001 by Tobias Oetiker <tobi at oetiker.ch>\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.43/src/rrd_tool.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_tool.h	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_tool.h	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_tool.h   Common Header File
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_tune.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_tune.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_tune.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * change header parameters of an rrd
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_update.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_update.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_update.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  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.42  Copyright 1997-2000 by Tobias Oetiker <tobi at oetiker.ch>\n\n"
+                printf("RRDtool 1.0.43  Copyright 1997-2000 by Tobias Oetiker <tobi at oetiker.ch>\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.43/src/rrd_xport.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_xport.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_xport.c	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  ****************************************************************************
  * rrd_xport.c  export RRD data 
  ****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_xport.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_xport.h	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_xport.h	Thu Jul  3 16:26:45 2003
@@ -1,5 +1,5 @@
 /****************************************************************************
- * RRDtool 1.0.42  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43  Copyright Tobias Oetiker, 1997 - 2000
  ****************************************************************************
  * rrd_xport.h  contains XML related constants
  ****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.43/tcl/Makefile.am
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/tcl/Makefile.am	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/tcl/Makefile.am	Thu Jul  3 16:26:45 2003
@@ -10,6 +10,7 @@
 TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
 TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
 TCL_PACKAGE_PATH = $(DESTDIR)@TCL_PACKAGE_PATH@
+TCL_LIB_FILE = tclrrd.$(VERSION)$(TCL_SHLIB_SUFFIX)
 TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
 GD_LIB_DIR       = $(top_srcdir)/@GD_LIB_DIR@
 
@@ -20,20 +21,20 @@
 
 if COMP_TCL
 
-tclrrd$(TCL_SHLIB_SUFFIX): tclrrd.o
-	$(TCL_SHLIB_LD) $(LIBDIRS) $< -o $@ -lrrd_private -lm
+$(TCL_LIB_FILE): tclrrd.o
+	$(TCL_SHLIB_LD) $(LIBDIRS) $< -o $@ -lrrd_private -lm -ltcl
 
 tclrrd.o: tclrrd.c
 	$(CC) $(CFLAGS) $(TCL_SHLIB_CFLAGS) $(INCLUDES) -c $< -DVERSION=\"$(VERSION)\"
 
-all-local: tclrrd$(TCL_SHLIB_SUFFIX)
+all-local: $(TCL_LIB_FILE)
 
-tcl-install: tclrrd$(TCL_SHLIB_SUFFIX)
-	cp tclrrd$(TCL_SHLIB_SUFFIX) $(TCL_PACKAGE_PATH)/tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)
-	if [ ! -d $(TCL_PACKAGE_PATH)/tclrrd$(VERSION) ] ; then \
-		mkdir $(TCL_PACKAGE_PATH)/tclrrd$(VERSION) ; \
+tcl-install: $(TCL_LIB_FILE)
+	cp $(TCL_LIB_FILE) $(TCL_PACKAGE_PATH)/$(TCL_LIB_FILE)
+	if [ ! -d $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION) ] ; then \
+		mkdir $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION) ; \
 	fi
-	echo "package ifneeded Rrd $(VERSION) [list load [file join \$$dir .. tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)]]" > $(TCL_PACKAGE_PATH)/tclrrd$(VERSION)/pkgIndex.tcl
+	echo "package ifneeded Rrd $(VERSION) [list load [file join \$$dir .. $(TCL_LIB_FILE)]]" > $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION)/pkgIndex.tcl
 
 else
 

Modified: trunk/orca/packages/rrdtool-1.0.43/tcl/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/tcl/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.43/tcl/Makefile.in	Thu Jul  3 16:26:45 2003
@@ -90,6 +90,7 @@
 TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
 TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
 TCL_PACKAGE_PATH = $(DESTDIR)@TCL_PACKAGE_PATH@
+TCL_LIB_FILE = tclrrd.$(VERSION)$(TCL_SHLIB_SUFFIX)
 TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
 GD_LIB_DIR = $(top_srcdir)/@GD_LIB_DIR@
 
@@ -200,20 +201,20 @@
 mostlyclean distclean maintainer-clean
 
 
- at COMP_TCL_TRUE@tclrrd$(TCL_SHLIB_SUFFIX): tclrrd.o
- at COMP_TCL_TRUE@	$(TCL_SHLIB_LD) $(LIBDIRS) $< -o $@ -lrrd_private -lm
+ at COMP_TCL_TRUE@$(TCL_LIB_FILE): tclrrd.o
+ at COMP_TCL_TRUE@	$(TCL_SHLIB_LD) $(LIBDIRS) $< -o $@ -lrrd_private -lm -ltcl
 
 @COMP_TCL_TRUE at tclrrd.o: tclrrd.c
 @COMP_TCL_TRUE@	$(CC) $(CFLAGS) $(TCL_SHLIB_CFLAGS) $(INCLUDES) -c $< -DVERSION=\"$(VERSION)\"
 
- at COMP_TCL_TRUE@all-local: tclrrd$(TCL_SHLIB_SUFFIX)
+ at COMP_TCL_TRUE@all-local: $(TCL_LIB_FILE)
 
- at COMP_TCL_TRUE@tcl-install: tclrrd$(TCL_SHLIB_SUFFIX)
- at COMP_TCL_TRUE@	cp tclrrd$(TCL_SHLIB_SUFFIX) $(TCL_PACKAGE_PATH)/tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)
- at COMP_TCL_TRUE@	if [ ! -d $(TCL_PACKAGE_PATH)/tclrrd$(VERSION) ] ; then \
- at COMP_TCL_TRUE@		mkdir $(TCL_PACKAGE_PATH)/tclrrd$(VERSION) ; \
+ at COMP_TCL_TRUE@tcl-install: $(TCL_LIB_FILE)
+ at COMP_TCL_TRUE@	cp $(TCL_LIB_FILE) $(TCL_PACKAGE_PATH)/$(TCL_LIB_FILE)
+ at COMP_TCL_TRUE@	if [ ! -d $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION) ] ; then \
+ at COMP_TCL_TRUE@		mkdir $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION) ; \
 @COMP_TCL_TRUE@	fi
- at COMP_TCL_TRUE@	echo "package ifneeded Rrd $(VERSION) [list load [file join \$$dir .. tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)]]" > $(TCL_PACKAGE_PATH)/tclrrd$(VERSION)/pkgIndex.tcl
+ at COMP_TCL_TRUE@	echo "package ifneeded Rrd $(VERSION) [list load [file join \$$dir .. $(TCL_LIB_FILE)]]" > $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION)/pkgIndex.tcl
 
 @COMP_TCL_FALSE at all-local:
 



More information about the Orca-checkins mailing list