[Orca-checkins] rev 126 - in trunk/orca: . src docs contrib contrib/rotate_orca_graphs contrib/orcaservices orcallator config lib lib/Orca packages packages/Digest-MD5-2.13 packages/Digest-MD5-2.13/t packages/Time-HiRes-01.20 packages/Time-HiRes-01.20/t packages/rrdtool-1.0.33 packages/rrdtool-1.0.33/tcl packages/rrdtool-1.0.33/src packages/rrdtool-1.0.33/cgilib-0.4 packages/rrdtool-1.0.33/zlib-1.1.3 packages/rrdtool-1.0.33/contrib packages/rrdtool-1.0.33/contrib/rrdview packages/rrdtool-1.0.33/contrib/rrdfetchnames packages/rrdtool-1.0.33/contrib/killspike packages/rrdtool-1.0.33/contrib/rrd-file-icon packages/rrdtool-1.0.33/contrib/snmpstats packages/rrdtool-1.0.33/contrib/trytime packages/rrdtool-1.0.33/contrib/rrdlastds packages/rrdtool-1.0.33/contrib/rrdexplorer packages/rrdtool-1.0.33/contrib/php3 packages/rrdtool-1.0.33/contrib/php3/examples packages/rrdtool-1.0.33/contrib/log2rrd packages/rrdtool-1.0.33/contrib/rrdproc packages/rrdtool-1.0.33/contrib/php4 packages/rrdtool-1.0.33/contrib/php4/build packages/rrdtool-1.0.33/contrib/php4/examples packages/rrdtool-1.0.33/contrib/add_ds packages/rrdtool-1.0.33/contrib/add_ds/add_ds packages/rrdtool-1.0.33/perl-piped packages/rrdtool-1.0.33/config packages/rrdtool-1.0.33/doc packages/rrdtool-1.0.33/perl-shared packages/rrdtool-1.0.33/perl-shared/t packages/rrdtool-1.0.33/gd1.3 packages/rrdtool-1.0.33/examples packages/rrdtool-1.0.33/libpng-1.0.9 packages/Storable-1.0.11 packages/Storable-1.0.11/t packages/TimeDate-1.10 packages/TimeDate-1.10/t packages/TimeDate-1.10/lib packages/TimeDate-1.10/lib/Date packages/TimeDate-1.10/lib/Date/Language packages/TimeDate-1.10/lib/Time

blair at orcaware.com blair at orcaware.com
Sat Jul 13 21:28:04 PDT 2002


Author: blair
Date: Fri, 28 Jun 2002 22:11:56 -0700
New Revision: 126

Added:
   trunk/orca/contrib/
   trunk/orca/contrib/Makefile.in
   trunk/orca/contrib/orcaservices/
   trunk/orca/contrib/orcaservices/Makefile.in
   trunk/orca/contrib/orcaservices/README
   trunk/orca/contrib/orcaservices/S99orcaservices.sh.in
   trunk/orca/contrib/orcaservices/orcaservices.cfg.in
   trunk/orca/contrib/orcaservices/orcaservices.pl.in
   trunk/orca/contrib/orcaservices/orcaservices_running.pl.in
   trunk/orca/contrib/orcaservices/restart_orcaservices.sh.in
   trunk/orca/contrib/orcaservices/start_orcaservices.sh.in
   trunk/orca/contrib/orcaservices/stop_orcaservices.sh.in
   trunk/orca/contrib/rotate_orca_graphs/
   trunk/orca/contrib/rotate_orca_graphs/Makefile.in
   trunk/orca/contrib/rotate_orca_graphs/rotate_orca_graphs.sh.in
   trunk/orca/packages/Storable-1.0.11/t/blessed.t
   trunk/orca/packages/Storable-1.0.11/t/compat-0.6.t
   trunk/orca/packages/Storable-1.0.11/t/lock.t
   trunk/orca/packages/Storable-1.0.11/t/overload.t
   trunk/orca/packages/Storable-1.0.11/t/recurse.t
   trunk/orca/packages/Storable-1.0.11/t/tied_hook.t
   trunk/orca/packages/Storable-1.0.11/t/tied_items.t
   trunk/orca/packages/Storable-1.0.11/t/utf8.t
   trunk/orca/packages/Time-HiRes-01.20/
   trunk/orca/packages/Time-HiRes-01.20/Changes
   trunk/orca/packages/Time-HiRes-01.20/HiRes.pm
   trunk/orca/packages/Time-HiRes-01.20/HiRes.xs
   trunk/orca/packages/Time-HiRes-01.20/MANIFEST
   trunk/orca/packages/Time-HiRes-01.20/Makefile.PL
   trunk/orca/packages/Time-HiRes-01.20/README
   trunk/orca/packages/Time-HiRes-01.20/TODO
   trunk/orca/packages/Time-HiRes-01.20/t/
   trunk/orca/packages/Time-HiRes-01.20/t/01test.t
   trunk/orca/packages/Time-HiRes-01.20/t/02export.t
   trunk/orca/packages/TimeDate-1.10/
   trunk/orca/packages/TimeDate-1.10/ChangeLog
   trunk/orca/packages/TimeDate-1.10/MANIFEST
   trunk/orca/packages/TimeDate-1.10/Makefile.PL
   trunk/orca/packages/TimeDate-1.10/README
   trunk/orca/packages/TimeDate-1.10/TimeDate.ppd
   trunk/orca/packages/TimeDate-1.10/lib/
   trunk/orca/packages/TimeDate-1.10/lib/Date/
   trunk/orca/packages/TimeDate-1.10/lib/Date/Format.pm
   trunk/orca/packages/TimeDate-1.10/lib/Date/Language.pm
   trunk/orca/packages/TimeDate-1.10/lib/Date/Language/
   trunk/orca/packages/TimeDate-1.10/lib/Date/Language/Austrian.pm
   trunk/orca/packages/TimeDate-1.10/lib/Date/Language/Czech.pm
   trunk/orca/packages/TimeDate-1.10/lib/Date/Language/Dutch.pm
   trunk/orca/packages/TimeDate-1.10/lib/Date/Language/English.pm
   trunk/orca/packages/TimeDate-1.10/lib/Date/Language/French.pm
   trunk/orca/packages/TimeDate-1.10/lib/Date/Language/German.pm
   trunk/orca/packages/TimeDate-1.10/lib/Date/Language/Italian.pm
   trunk/orca/packages/TimeDate-1.10/lib/Date/Language/Norwegian.pm
   trunk/orca/packages/TimeDate-1.10/lib/Date/Parse.pm
   trunk/orca/packages/TimeDate-1.10/lib/Time/
   trunk/orca/packages/TimeDate-1.10/lib/Time/Zone.pm
   trunk/orca/packages/TimeDate-1.10/t/
   trunk/orca/packages/TimeDate-1.10/t/date.t
   trunk/orca/packages/TimeDate-1.10/t/format.t
   trunk/orca/packages/TimeDate-1.10/t/getdate.t
   trunk/orca/packages/TimeDate-1.10/t/lang.t
   trunk/orca/packages/rrdtool-1.0.33/contrib/add_ds/add_ds.pl
   trunk/orca/packages/rrdtool-1.0.33/contrib/add_ds/add_ds/
   trunk/orca/packages/rrdtool-1.0.33/contrib/add_ds/add_ds/add_ds.pl
   trunk/orca/packages/rrdtool-1.0.33/contrib/add_ds/add_ds/batch.pl
   trunk/orca/packages/rrdtool-1.0.33/contrib/add_ds/batch.pl
   trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/killspike.pl
   trunk/orca/packages/rrdtool-1.0.33/contrib/log2rrd/log2rrd.pl
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/INSTALL
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/Makefile
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/README
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/USAGE
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/VERSION
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_create.php
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_fetch.php
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_graph.php
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_last.php
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_update.php
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/php3_rrdtool.c
   trunk/orca/packages/rrdtool-1.0.33/contrib/php3/php3_rrdtool.h
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/.cvsignore
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/.deps
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/INSTALL
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/README
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/USAGE
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/acinclude.m4
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/aclocal.m4
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/build/
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/build/dynlib.mk
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/build/fastgen.sh
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/build/library.mk
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/build/ltlib.mk
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/build/program.mk
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/build/rules.mk
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/build/shtool
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/config.guess
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/config.m4
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/config.sub
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/configure
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/configure.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/dynlib.m4
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/examples/
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/examples/rrd_create.php
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/examples/rrd_fetch.php
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/examples/rrd_graph.php
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/examples/rrd_last.php
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/examples/rrd_update.php
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/install-sh
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/ltconfig
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/ltmain.sh
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/missing
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/mkinstalldirs
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/php_config.h.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/php_rrdtool.h
   trunk/orca/packages/rrdtool-1.0.33/contrib/php4/rrdtool.c
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/README.txt
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/map.cgi
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/png.cgi
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdfetchnames/rrdfetchnames.pl
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl.in.orig
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl.in.rej
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdproc/.deps/
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdview/
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdview/README
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdview/rrdview.cgi
   trunk/orca/packages/rrdtool-1.0.33/contrib/snmpstats/
   trunk/orca/packages/rrdtool-1.0.33/contrib/snmpstats/README
   trunk/orca/packages/rrdtool-1.0.33/contrib/snmpstats/SNMPstats.pl
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdinfo.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdinfo.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdinfo.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtutorial.es.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtutorial.es.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtutorial.es.txt
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/configure
   trunk/orca/packages/rrdtool-1.0.33/rrdtool.spec
   trunk/orca/packages/rrdtool-1.0.33/src/rrd.h
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_info.c
   trunk/orca/packages/rrdtool-1.0.33/tcl/
   trunk/orca/packages/rrdtool-1.0.33/tcl/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/tcl/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/tcl/README
   trunk/orca/packages/rrdtool-1.0.33/tcl/ifOctets.tcl
   trunk/orca/packages/rrdtool-1.0.33/tcl/tclrrd.c
Removed:
   trunk/orca/packages/Digest-MD5-2.13/MD2/
   trunk/orca/packages/Digest-MD5-2.13/SHA1/
   trunk/orca/packages/Digest-MD5-2.13/examples/
   trunk/orca/packages/Digest-MD5-2.13/lib/
   trunk/orca/packages/Digest-MD5-2.13/rfc2104.txt
   trunk/orca/packages/Digest-MD5-2.13/t/digest.t
   trunk/orca/packages/Digest-MD5-2.13/t/md5.t
   trunk/orca/packages/Digest-MD5-2.13/t/rfc2202.t
   trunk/orca/packages/Storable-1.0.11/patchlevel.h
   trunk/orca/packages/rrdtool-1.0.33/config/acinclude.m4
   trunk/orca/packages/rrdtool-1.0.33/contrib/add_ds/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/contrib/add_ds/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/log2rrd/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/contrib/log2rrd/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrd-file-icon/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrd-file-icon/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdfetchnames/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdfetchnames/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdproc/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/contrib/rrdproc/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/ansi2knr.1
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/ansi2knr.c
Modified:
   trunk/orca/CHANGES
   trunk/orca/FAQ
   trunk/orca/INSTALL
   trunk/orca/Makefile.in
   trunk/orca/NEWS
   trunk/orca/README
   trunk/orca/TODO
   trunk/orca/config/PerlHead1.in
   trunk/orca/config/PerlHead2.in
   trunk/orca/configure
   trunk/orca/configure.in
   trunk/orca/docs/Makefile.in
   trunk/orca/docs/REQUIREMENTS
   trunk/orca/docs/manual.html
   trunk/orca/lib/Makefile.in
   trunk/orca/lib/Orca/Config.pm
   trunk/orca/lib/Orca/Constants.pm
   trunk/orca/lib/Orca/DataFile.pm
   trunk/orca/lib/Orca/HTMLFile.pm
   trunk/orca/lib/Orca/ImageFile.pm
   trunk/orca/lib/Orca/NewState.pm
   trunk/orca/lib/Orca/OldState.pm
   trunk/orca/lib/Orca/OpenFileHash.pm
   trunk/orca/lib/Orca/RRDFile.pm
   trunk/orca/lib/Orca/SourceFile.pm
   trunk/orca/lib/Orca/SourceFileIDs.pm
   trunk/orca/lib/Orca/Utils.pm
   trunk/orca/lib/download.cfg
   trunk/orca/lib/homesteaders.cfg
   trunk/orca/lib/time_gets.cfg
   trunk/orca/orcallator/Makefile.in
   trunk/orca/orcallator/orcallator.cfg.in
   trunk/orca/orcallator/orcallator.se
   trunk/orca/orcallator/orcallator_column.pl
   trunk/orca/orcallator/orcallator_running.pl.in
   trunk/orca/orcallator/start_orcallator.sh.in
   trunk/orca/packages/Digest-MD5-2.13/Changes
   trunk/orca/packages/Digest-MD5-2.13/MANIFEST
   trunk/orca/packages/Digest-MD5-2.13/MD5.pm
   trunk/orca/packages/Digest-MD5-2.13/MD5.xs
   trunk/orca/packages/Digest-MD5-2.13/README
   trunk/orca/packages/Digest-MD5-2.13/t/files.t
   trunk/orca/packages/Makefile.in
   trunk/orca/packages/Storable-1.0.11/ChangeLog
   trunk/orca/packages/Storable-1.0.11/MANIFEST
   trunk/orca/packages/Storable-1.0.11/Makefile.PL
   trunk/orca/packages/Storable-1.0.11/README
   trunk/orca/packages/Storable-1.0.11/Storable.pm
   trunk/orca/packages/Storable-1.0.11/Storable.xs
   trunk/orca/packages/Storable-1.0.11/t/canonical.t
   trunk/orca/packages/Storable-1.0.11/t/dclone.t
   trunk/orca/packages/Storable-1.0.11/t/dump.pl
   trunk/orca/packages/Storable-1.0.11/t/forgive.t
   trunk/orca/packages/Storable-1.0.11/t/freeze.t
   trunk/orca/packages/Storable-1.0.11/t/retrieve.t
   trunk/orca/packages/Storable-1.0.11/t/store.t
   trunk/orca/packages/Storable-1.0.11/t/tied.t
   trunk/orca/packages/rrdtool-1.0.33/CHANGES
   trunk/orca/packages/rrdtool-1.0.33/CONTRIBUTORS
   trunk/orca/packages/rrdtool-1.0.33/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/README
   trunk/orca/packages/rrdtool-1.0.33/TODO
   trunk/orca/packages/rrdtool-1.0.33/cgilib-0.4/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/cgilib-0.4/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/config/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/config/acconfig.h
   trunk/orca/packages/rrdtool-1.0.33/config/aclocal.m4
   trunk/orca/packages/rrdtool-1.0.33/config/config.h.in
   trunk/orca/packages/rrdtool-1.0.33/config/ltconfig
   trunk/orca/packages/rrdtool-1.0.33/configure
   trunk/orca/packages/rrdtool-1.0.33/configure.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/contrib/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/killspike.pl.in
   trunk/orca/packages/rrdtool-1.0.33/contrib/trytime/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/doc/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/doc/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/doc/RRDp.html
   trunk/orca/packages/rrdtool-1.0.33/doc/RRDp.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/RRDs.html
   trunk/orca/packages/rrdtool-1.0.33/doc/RRDs.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/bin_dec_hex.html
   trunk/orca/packages/rrdtool-1.0.33/doc/bin_dec_hex.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/bin_dec_hex.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/cdeftutorial.html
   trunk/orca/packages/rrdtool-1.0.33/doc/cdeftutorial.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/cdeftutorial.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rpntutorial.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rpntutorial.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rpntutorial.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdcgi.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdcgi.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdcgi.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdcreate.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdcreate.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdcreate.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrddump.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrddump.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrddump.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdfetch.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdfetch.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdfetch.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdgraph.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdgraph.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdgraph.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdlast.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdlast.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdlast.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdresize.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdresize.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdresize.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdrestore.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdrestore.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdrestore.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtool.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtool.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtool.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtune.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtune.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtune.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtutorial.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtutorial.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdtutorial.txt
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdupdate.html
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdupdate.pod
   trunk/orca/packages/rrdtool-1.0.33/doc/rrdupdate.txt
   trunk/orca/packages/rrdtool-1.0.33/examples/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/examples/piped-demo.pl.in
   trunk/orca/packages/rrdtool-1.0.33/examples/shared-demo.pl.in
   trunk/orca/packages/rrdtool-1.0.33/gd1.3/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/gd1.3/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/gd1.3/gd.c
   trunk/orca/packages/rrdtool-1.0.33/gd1.3/gd.h
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/ANNOUNCE
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/CHANGES
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/INSTALL
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/KNOWNBUG
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/README
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/README.rrdtool
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/TODO
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/Y2KINFO
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/example.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/libpng.3
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/libpng.txt
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/libpngpf.3
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/png.5
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/png.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/png.h
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngconf.h
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngerror.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngget.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngmem.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngpread.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngread.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngrio.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngrtran.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngrutil.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngset.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngtrans.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngwio.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngwrite.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngwtran.c
   trunk/orca/packages/rrdtool-1.0.33/libpng-1.0.9/pngwutil.c
   trunk/orca/packages/rrdtool-1.0.33/perl-piped/RRDp.pm
   trunk/orca/packages/rrdtool-1.0.33/perl-shared/Makefile.PL
   trunk/orca/packages/rrdtool-1.0.33/perl-shared/RRDs.pm
   trunk/orca/packages/rrdtool-1.0.33/perl-shared/RRDs.xs
   trunk/orca/packages/rrdtool-1.0.33/perl-shared/t/base.t
   trunk/orca/packages/rrdtool-1.0.33/src/Makefile.am
   trunk/orca/packages/rrdtool-1.0.33/src/Makefile.in
   trunk/orca/packages/rrdtool-1.0.33/src/gdpng.c
   trunk/orca/packages/rrdtool-1.0.33/src/gifsize.c
   trunk/orca/packages/rrdtool-1.0.33/src/parsetime.c
   trunk/orca/packages/rrdtool-1.0.33/src/parsetime.h
   trunk/orca/packages/rrdtool-1.0.33/src/pngsize.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_cgi.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_create.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_diff.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_dump.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_error.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_fetch.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_format.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_format.h
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_graph.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_last.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_open.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_resize.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_restore.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_tool.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_tool.h
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_tune.c
   trunk/orca/packages/rrdtool-1.0.33/src/rrd_update.c
   trunk/orca/packages/rrdtool-1.0.33/zlib-1.1.3/Makefile.in
   trunk/orca/src/Makefile.in
   trunk/orca/src/orca.pl.in
Log:
Load orca-0.27b1 into trunk/orca.


Modified: trunk/orca/configure
==============================================================================
--- trunk/orca/configure	(original)
+++ trunk/orca/configure	Sat Jul 13 21:25:40 2002
@@ -643,19 +643,46 @@
 
 
 # Remember the command line arguments to configure for use when
-# configure is run again.
-CONFIGURE_COMMAND_LINE=${1+"$@"}
+# configure is run again.  Also create the command line options for
+# RRD configure.
+ORCA_CONFIGURE_COMMAND_LINE=${1+"$@"}
+RRD_CONFIGURE_COMMAND_LINE="$ORCA_CONFIGURE_COMMAND_LINE --cache-file=../../config.cache"
 
 
+
+# Set this to yes to have configure always build all of the required
+# Perl Orca modules.  This is used to test the build more than
+# anything else.
+ALWAYS_BUILD_PERL_MODULES=yes
+ALWAYS_BUILD_PERL_MODULES=
+
 # Define the directories containing packages that Orca makes use of here.
 # The directory name packages where these packages are distributed with
 # Orca gets added where necessary.
 COMPRESS_ZLIB_DIR=Compress-Zlib-1.05
+COMPRESS_ZLIB_VER=1.05
 DATA_DUMPER_DIR=Data-Dumper-2.101
-DIGEST_MD5_DIR=Digest-MD5-2.09
+DATA_DUMPER_VER=2.101
+DATE_PARSE_DIR=TimeDate-1.10
+DATE_PARSE_VER=2.20
+DIGEST_MD5_DIR=Digest-MD5-2.13
+DIGEST_MD5_VER=2.13
 MATH_INTERPOLATE_DIR=Math-Interpolate-1.05
-RRDTOOL_DIR=rrdtool-1.0.13
-STORABLE_DIR=Storable-0.6.9
+MATH_INTERPOLATE_VER=1.05
+RRDTOOL_DIR=rrdtool-1.0.33
+RRDTOOL_VER=1.000331
+STORABLE_DIR=Storable-1.0.11
+STORABLE_VER=1.011
+TIME_HIRES_DIR=Time-HiRes-01.20
+TIME_HIRES_VER=1.20
+
+
+
+
+
+
+
+
 
 
 
@@ -663,6 +690,16 @@
 
 
 
+
+
+
+# Get the current working directory and the config directory.
+cwd=`pwd`
+config_dir="$cwd/config"
+if test ! -d $config_dir; then
+  { echo "configure: error: *** Cannot find config directory." 1>&2; exit 1; }
+fi
+
 # Minimum Autoconf version required.
 
 
@@ -807,7 +844,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:811: checking for $ac_word" >&5
+echo "configure:848: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -837,7 +874,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:841: checking for $ac_word" >&5
+echo "configure:878: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -888,7 +925,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:892: checking for $ac_word" >&5
+echo "configure:929: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -920,7 +957,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:924: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:961: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -931,12 +968,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 935 "configure"
+#line 972 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -962,12 +999,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:966: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1003: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:971: checking whether we are using GNU C" >&5
+echo "configure:1008: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -976,7 +1013,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -995,7 +1032,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:999: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1036: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1028,7 +1065,7 @@
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1032: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1069: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1076,7 +1113,7 @@
 # Extract the first word of "bzip2", so it can be a program name with args.
 set dummy bzip2; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1080: checking for $ac_word" >&5
+echo "configure:1117: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_BZIP2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1111,7 +1148,7 @@
 # Extract the first word of "bunzip2", so it can be a program name with args.
 set dummy bunzip2; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1115: checking for $ac_word" >&5
+echo "configure:1152: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_BUNZIP2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1146,7 +1183,7 @@
 # Extract the first word of "compress", so it can be a program name with args.
 set dummy compress; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1150: checking for $ac_word" >&5
+echo "configure:1187: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_COMPRESS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1181,7 +1218,7 @@
 # Extract the first word of "cut", so it can be a program name with args.
 set dummy cut; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1185: checking for $ac_word" >&5
+echo "configure:1222: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CUT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1217,7 +1254,7 @@
 # Extract the first word of "expr", so it can be a program name with args.
 set dummy expr; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1221: checking for $ac_word" >&5
+echo "configure:1258: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_EXPR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1250,10 +1287,50 @@
   echo "$ac_t""no" 1>&6
 fi
 
+for ac_prog in gtar gnutar tar
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1296: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$TAR" in
+  /*)
+  ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
+  ;;
+  ?:/*)			 
+  ac_cv_path_TAR="$TAR" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_TAR="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+TAR="$ac_cv_path_TAR"
+if test -n "$TAR"; then
+  echo "$ac_t""$TAR" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$TAR" && break
+done
+
 # Extract the first word of "gzip", so it can be a program name with args.
 set dummy gzip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1257: checking for $ac_word" >&5
+echo "configure:1334: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1288,7 +1365,7 @@
 # Extract the first word of "gunzip", so it can be a program name with args.
 set dummy gunzip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1292: checking for $ac_word" >&5
+echo "configure:1369: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GUNZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1325,7 +1402,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1329: checking for $ac_word" >&5
+echo "configure:1406: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1365,7 +1442,7 @@
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1369: checking for $ac_word" >&5
+echo "configure:1446: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1403,7 +1480,7 @@
 else
   
   echo $ac_n "checking if '$PERL' will run Perl scripts""... $ac_c" 1>&6
-echo "configure:1407: checking if '$PERL' will run Perl scripts" >&5
+echo "configure:1484: checking if '$PERL' will run Perl scripts" >&5
   rm -f conftest.BZ
   cat > conftest.BZ <<EOF
 #!$PERL
@@ -1421,7 +1498,7 @@
   rm -f conftest.BZ
 
 fi
-PERL_HEAD="../config/$PERL_HEAD"
+PERL_HEAD="$cwd/config/$PERL_HEAD"
 
 
 # Determine the correct ps command to use to find out about process
@@ -1429,7 +1506,7 @@
 # Extract the first word of "ps", so it can be a program name with args.
 set dummy ps; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1433: checking for $ac_word" >&5
+echo "configure:1510: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1466,7 +1543,7 @@
     PS_SELF="$PS -p PID -o \'rss vsz pmem time user pid comm\'"
     ;;
   *-linux-*)
-    PS_SELF="$PS auxp PID"
+    PS_SELF="$PS up PID"
     ;;
   *)
     PS_SELF="$PS aux | grep PID"
@@ -1475,19 +1552,19 @@
     echo "configure: warning: *** to get process information for your host," 1>&2
     echo "configure: warning: *** please email the command the the output from" 1>&2
     echo "configure: warning: *** ./config/config.guess to" 1>&2
-    echo "configure: warning: *** orca-developers at onelist.com" 1>&2
+    echo "configure: warning: *** orca-developers at yahoogroups.com" 1>&2
     ;;
 esac
 if test "$PS_SELF"; then
   echo $ac_n "checking for ps command""... $ac_c" 1>&6
-echo "configure:1484: checking for ps command" >&5
+echo "configure:1561: checking for ps command" >&5
   echo "$ac_t""$PS_SELF" 1>&6
   
 fi
 # Extract the first word of "se", so it can be a program name with args.
 set dummy se; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1491: checking for $ac_word" >&5
+echo "configure:1568: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1522,7 +1599,7 @@
 # Extract the first word of "uname", so it can be a program name with args.
 set dummy uname; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1526: checking for $ac_word" >&5
+echo "configure:1603: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UNAME'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1558,7 +1635,7 @@
 # Extract the first word of "uncompress", so it can be a program name with args.
 set dummy uncompress; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1562: checking for $ac_word" >&5
+echo "configure:1639: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UNCOMPRESS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1631,7 +1708,7 @@
 
 # This command can be used to add --enable-shared to the configure
 # options for RRDtool if it is not already declared.
-# expr "$CONFIGURE_COMMAND_LINE" : "--enable-shared" >/dev/null 2>&1 || CONFIGURE_COMMAND_LINE="$CONFIGURE_COMMAND_LINE --enable-shared"
+# expr "$ORCA_CONFIGURE_COMMAND_LINE" : "--enable-shared" >/dev/null 2>&1 || ORCA_CONFIGURE_COMMAND_LINE="$ORCA_CONFIGURE_COMMAND_LINE --enable-shared"
 
 
 
@@ -1640,9 +1717,9 @@
 
 
 
-  echo $ac_n "checking if Perl module Data::Dumper version 2.101 is installed""... $ac_c" 1>&6
-echo "configure:1645: checking if Perl module Data::Dumper version 2.101 is installed" >&5
-  if $PERL ./config/check_for_perl_mod Data::Dumper 2.101; then
+  echo $ac_n "checking if Perl module Data::Dumper version $DATA_DUMPER_VER is installed""... $ac_c" 1>&6
+echo "configure:1722: checking if Perl module Data::Dumper version $DATA_DUMPER_VER is installed" >&5
+  if $PERL ./config/check_for_perl_mod Data::Dumper $DATA_DUMPER_VER; then
     borp_cv_perl_data_dumper=yes
     
   else
@@ -1651,6 +1728,7 @@
   fi
   echo "$ac_t""$borp_cv_perl_data_dumper" 1>&6
 
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_data_dumper=no
 if test "$borp_cv_perl_data_dumper" = no; then
   MAKE_DATA_DUMPER=make_data_dumper
   TEST_DATA_DUMPER=test_data_dumper
@@ -1665,9 +1743,35 @@
 
 
 
-  echo $ac_n "checking if Perl module Digest::MD5 version 2.09 is installed""... $ac_c" 1>&6
-echo "configure:1670: checking if Perl module Digest::MD5 version 2.09 is installed" >&5
-  if $PERL ./config/check_for_perl_mod Digest::MD5 2.09; then
+  echo $ac_n "checking if Perl module Date::Parse version $DATE_PARSE_VER is installed""... $ac_c" 1>&6
+echo "configure:1748: checking if Perl module Date::Parse version $DATE_PARSE_VER is installed" >&5
+  if $PERL ./config/check_for_perl_mod Date::Parse $DATE_PARSE_VER; then
+    borp_cv_perl_date_parse=yes
+    
+  else
+    borp_cv_perl_date_parse=no
+    
+  fi
+  echo "$ac_t""$borp_cv_perl_date_parse" 1>&6
+
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_date_parse=no
+if test "$borp_cv_perl_date_parse" = no; then
+  MAKE_DATE_PARSE=make_date_parse
+  TEST_DATE_PARSE=test_date_parse
+  INSTALL_PERL_DATE_PARSE=install_perl_date_parse
+  CLEAN_DATE_PARSE=clean_date_parse
+  DISTCLEAN_DATE_PARSE=distclean_date_parse
+fi
+
+
+
+
+
+
+
+  echo $ac_n "checking if Perl module Digest::MD5 version $DIGEST_MD5_VER is installed""... $ac_c" 1>&6
+echo "configure:1774: checking if Perl module Digest::MD5 version $DIGEST_MD5_VER is installed" >&5
+  if $PERL ./config/check_for_perl_mod Digest::MD5 $DIGEST_MD5_VER; then
     borp_cv_perl_digest_md5=yes
     
   else
@@ -1676,6 +1780,7 @@
   fi
   echo "$ac_t""$borp_cv_perl_digest_md5" 1>&6
 
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_digest_md5=no
 if test "$borp_cv_perl_digest_md5" = no; then
   MAKE_DIGEST_MD5=make_digest_md5
   TEST_DIGEST_MD5=test_digest_md5
@@ -1690,9 +1795,9 @@
 
 
 
-  echo $ac_n "checking if Perl module Math::Interpolate version 1.05 is installed""... $ac_c" 1>&6
-echo "configure:1695: checking if Perl module Math::Interpolate version 1.05 is installed" >&5
-  if $PERL ./config/check_for_perl_mod Math::Interpolate 1.05; then
+  echo $ac_n "checking if Perl module Math::Interpolate version $MATH_INTERPOLATE_VER is installed""... $ac_c" 1>&6
+echo "configure:1800: checking if Perl module Math::Interpolate version $MATH_INTERPOLATE_VER is installed" >&5
+  if $PERL ./config/check_for_perl_mod Math::Interpolate $MATH_INTERPOLATE_VER; then
     borp_cv_perl_math_interpolate=yes
     
   else
@@ -1701,6 +1806,7 @@
   fi
   echo "$ac_t""$borp_cv_perl_math_interpolate" 1>&6
 
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_math_interpolate=no
 if test "$borp_cv_perl_math_interpolate" = no; then
   MAKE_MATH_INTERPOLATE=make_math_interpolate
   TEST_MATH_INTERPOLATE=test_math_interpolate
@@ -1715,18 +1821,19 @@
 
 
 
-  echo $ac_n "checking if Perl module RRDs version 1.000131 is installed""... $ac_c" 1>&6
-echo "configure:1720: checking if Perl module RRDs version 1.000131 is installed" >&5
-  if $PERL ./config/check_for_perl_mod RRDs 1.000131; then
-    borp_cv_perl_rdds=yes
+  echo $ac_n "checking if Perl module RRDs version $RRDTOOL_VER is installed""... $ac_c" 1>&6
+echo "configure:1826: checking if Perl module RRDs version $RRDTOOL_VER is installed" >&5
+  if $PERL ./config/check_for_perl_mod RRDs $RRDTOOL_VER; then
+    borp_cv_perl_rrds=yes
     
   else
-    borp_cv_perl_rdds=no
+    borp_cv_perl_rrds=no
     
   fi
-  echo "$ac_t""$borp_cv_perl_rdds" 1>&6
+  echo "$ac_t""$borp_cv_perl_rrds" 1>&6
 
-if test "$borp_cv_perl_rdds" = no; then
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_rrds=no
+if test "$borp_cv_perl_rrds" = no; then
   MAKE_RRDTOOL=make_rrdtool
   TEST_RRDTOOL=test_rrdtool
   INSTALL_PERL_RRDTOOL=install_perl_rrdtool
@@ -1740,9 +1847,9 @@
 
 
 
-  echo $ac_n "checking if Perl module Storable version 0.609 is installed""... $ac_c" 1>&6
-echo "configure:1745: checking if Perl module Storable version 0.609 is installed" >&5
-  if $PERL ./config/check_for_perl_mod Storable 0.609; then
+  echo $ac_n "checking if Perl module Storable version $STORABLE_VER is installed""... $ac_c" 1>&6
+echo "configure:1852: checking if Perl module Storable version $STORABLE_VER is installed" >&5
+  if $PERL ./config/check_for_perl_mod Storable $STORABLE_VER; then
     borp_cv_perl_storable=yes
     
   else
@@ -1751,6 +1858,7 @@
   fi
   echo "$ac_t""$borp_cv_perl_storable" 1>&6
 
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_storable=no
 if test "$borp_cv_perl_storable" = no; then
   MAKE_STORABLE=make_storable
   TEST_STORABLE=test_storable
@@ -1764,10 +1872,40 @@
 
 
 
+
+  echo $ac_n "checking if Perl module Time::HiRes version $TIME_HIRES_VER is installed""... $ac_c" 1>&6
+echo "configure:1878: checking if Perl module Time::HiRes version $TIME_HIRES_VER is installed" >&5
+  if $PERL ./config/check_for_perl_mod Time::HiRes $TIME_HIRES_VER; then
+    borp_cv_perl_time_hires=yes
+    
+  else
+    borp_cv_perl_time_hires=no
+    
+  fi
+  echo "$ac_t""$borp_cv_perl_time_hires" 1>&6
+
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_time_hires=no
+if test "$borp_cv_perl_time_hires" = no; then
+  MAKE_TIME_HIRES=make_time_hires
+  TEST_TIME_HIRES=test_time_hires
+  INSTALL_PERL_TIME_HIRES=install_perl_time_hires
+  CLEAN_TIME_HIRES=clean_time_hires
+  DISTCLEAN_TIME_HIRES=distclean_time_hires
+  PERL_USE_TIME_HIRES=
+else
+  PERL_USE_TIME_HIRES="use Time::HiRes qw(time);"
+fi
+
+
+
+
+
+
+
 # Define the INSTALL and MKDIR variables to point to the scripts in
 # the config directory.
-INSTALL="../config/install-sh -c"
-MKDIR="../config/mkinstalldirs"
+INSTALL="$config_dir/install-sh -c"
+MKDIR="$config_dir/mkinstalldirs"
 
 
 
@@ -1897,15 +2035,26 @@
 
 ac_given_srcdir=$srcdir
 
-trap 'rm -fr `echo "config/PerlHead1
+trap 'rm -fr `echo "Makefile
+	  config/PerlHead1
 	  config/PerlHead2
 	  lib/Makefile
 	  packages/Makefile
-	  src/orca.pl
 	  src/Makefile
+	  src/orca.pl
 	  $ORCALLATOR_OUTPUT
 	  docs/Makefile
-	  Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+	  contrib/Makefile
+	  contrib/rotate_orca_graphs/Makefile
+	  contrib/rotate_orca_graphs/rotate_orca_graphs.sh
+	  contrib/orcaservices/Makefile
+	  contrib/orcaservices/orcaservices.cfg
+	  contrib/orcaservices/orcaservices.pl
+	  contrib/orcaservices/orcaservices_running.pl
+	  contrib/orcaservices/restart_orcaservices.sh
+	  contrib/orcaservices/start_orcaservices.sh
+	  contrib/orcaservices/stop_orcaservices.sh
+	  contrib/orcaservices/S99orcaservices.sh" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -1952,13 +2101,24 @@
 s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
-s%@CONFIGURE_COMMAND_LINE@%$CONFIGURE_COMMAND_LINE%g
+s%@ORCA_CONFIGURE_COMMAND_LINE@%$ORCA_CONFIGURE_COMMAND_LINE%g
+s%@RRD_CONFIGURE_COMMAND_LINE@%$RRD_CONFIGURE_COMMAND_LINE%g
 s%@COMPRESS_ZLIB_DIR@%$COMPRESS_ZLIB_DIR%g
 s%@DATA_DUMPER_DIR@%$DATA_DUMPER_DIR%g
+s%@DATE_PARSE_DIR@%$DATE_PARSE_DIR%g
 s%@DIGEST_MD5_DIR@%$DIGEST_MD5_DIR%g
 s%@MATH_INTERPOLATE_DIR@%$MATH_INTERPOLATE_DIR%g
 s%@RRDTOOL_DIR@%$RRDTOOL_DIR%g
 s%@STORABLE_DIR@%$STORABLE_DIR%g
+s%@TIME_HIRES_DIR@%$TIME_HIRES_DIR%g
+s%@COMPRESS_ZLIB_VER@%$COMPRESS_ZLIB_VER%g
+s%@DATA_DUMPER_VER@%$DATA_DUMPER_VER%g
+s%@DATE_PARSE_VER@%$DATE_PARSE_VER%g
+s%@DIGEST_MD5_VER@%$DIGEST_MD5_VER%g
+s%@MATH_INTERPOLATE_VER@%$MATH_INTERPOLATE_VER%g
+s%@RRDTOOL_VER@%$RRDTOOL_VER%g
+s%@STORABLE_VER@%$STORABLE_VER%g
+s%@TIME_HIRES_VER@%$TIME_HIRES_VER%g
 s%@RRD_DIR@%$RRD_DIR%g
 s%@HTML_DIR@%$HTML_DIR%g
 s%@ORCALLATOR_DIR@%$ORCALLATOR_DIR%g
@@ -1971,6 +2131,7 @@
 s%@COMPRESS@%$COMPRESS%g
 s%@CUT@%$CUT%g
 s%@EXPR@%$EXPR%g
+s%@TAR@%$TAR%g
 s%@GZIP@%$GZIP%g
 s%@GUNZIP@%$GUNZIP%g
 s%@AWK@%$AWK%g
@@ -1995,6 +2156,11 @@
 s%@INSTALL_PERL_DATA_DUMPER@%$INSTALL_PERL_DATA_DUMPER%g
 s%@CLEAN_DATA_DUMPER@%$CLEAN_DATA_DUMPER%g
 s%@DISTCLEAN_DATA_DUMPER@%$DISTCLEAN_DATA_DUMPER%g
+s%@MAKE_DATE_PARSE@%$MAKE_DATE_PARSE%g
+s%@TEST_DATE_PARSE@%$TEST_DATE_PARSE%g
+s%@INSTALL_PERL_DATE_PARSE@%$INSTALL_PERL_DATE_PARSE%g
+s%@CLEAN_DATE_PARSE@%$CLEAN_DATE_PARSE%g
+s%@DISTCLEAN_DATE_PARSE@%$DISTCLEAN_DATE_PARSE%g
 s%@MAKE_DIGEST_MD5@%$MAKE_DIGEST_MD5%g
 s%@TEST_DIGEST_MD5@%$TEST_DIGEST_MD5%g
 s%@INSTALL_PERL_DIGEST_MD5@%$INSTALL_PERL_DIGEST_MD5%g
@@ -2015,6 +2181,12 @@
 s%@INSTALL_PERL_STORABLE@%$INSTALL_PERL_STORABLE%g
 s%@CLEAN_STORABLE@%$CLEAN_STORABLE%g
 s%@DISTCLEAN_STORABLE@%$DISTCLEAN_STORABLE%g
+s%@MAKE_TIME_HIRES@%$MAKE_TIME_HIRES%g
+s%@TEST_TIME_HIRES@%$TEST_TIME_HIRES%g
+s%@INSTALL_PERL_TIME_HIRES@%$INSTALL_PERL_TIME_HIRES%g
+s%@CLEAN_TIME_HIRES@%$CLEAN_TIME_HIRES%g
+s%@DISTCLEAN_TIME_HIRES@%$DISTCLEAN_TIME_HIRES%g
+s%@PERL_USE_TIME_HIRES@%$PERL_USE_TIME_HIRES%g
 s%@INSTALL@%$INSTALL%g
 s%@MKDIR@%$MKDIR%g
 
@@ -2058,15 +2230,26 @@
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"config/PerlHead1
+CONFIG_FILES=\${CONFIG_FILES-"Makefile
+	  config/PerlHead1
 	  config/PerlHead2
 	  lib/Makefile
 	  packages/Makefile
-	  src/orca.pl
 	  src/Makefile
+	  src/orca.pl
 	  $ORCALLATOR_OUTPUT
 	  docs/Makefile
-	  Makefile"}
+	  contrib/Makefile
+	  contrib/rotate_orca_graphs/Makefile
+	  contrib/rotate_orca_graphs/rotate_orca_graphs.sh
+	  contrib/orcaservices/Makefile
+	  contrib/orcaservices/orcaservices.cfg
+	  contrib/orcaservices/orcaservices.pl
+	  contrib/orcaservices/orcaservices_running.pl
+	  contrib/orcaservices/restart_orcaservices.sh
+	  contrib/orcaservices/start_orcaservices.sh
+	  contrib/orcaservices/stop_orcaservices.sh
+	  contrib/orcaservices/S99orcaservices.sh"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -2135,13 +2318,14 @@
 
 # Build the RRDtool library if it is needed.
 if test "$borp_cv_perl_rdds" = no; then
-  command="(cd packages/$RRDTOOL_DIR; ./configure $CONFIGURE_COMMAND_LINE --cache-file=../../config.cache)"
+  command="(cd packages/$RRDTOOL_DIR; ./configure $RRD_CONFIGURE_COMMAND_LINE)"
   echo ""
   echo "Running configure in packages/$RRDTOOL_DIR to create RRDtool and RRDs.pm."
   echo ""
   echo $command
   echo ""
   eval $command
+  sleep 1
 fi
 
 if test -z "$WEB_LOG"; then

Modified: trunk/orca/Makefile.in
==============================================================================
--- trunk/orca/Makefile.in	(original)
+++ trunk/orca/Makefile.in	Sat Jul 13 21:25:41 2002
@@ -1,7 +1,8 @@
 @SET_MAKE@
 
-SUBDIRS 	= packages lib src @ORCALLATOR_SUBDIR@ docs
-PREFIX		= @prefix@
+SUBDIRS 	= packages lib src @ORCALLATOR_SUBDIR@ docs contrib
+prefix		= @prefix@
+MKDIR		= @MKDIR@
 MAKE_RRDTOOL	= @MAKE_RRDTOOL@
 ORCALLATOR_DIR	= @ORCALLATOR_DIR@
 RRD_DIR		= @RRD_DIR@
@@ -19,13 +20,16 @@
 	cd src && $(MAKE) upgrade_installation
 
 install: $(INSTALL_RRDTOOL)
-	./config/mkinstalldirs $(ORCALLATOR_DIR)
-	./config/mkinstalldirs $(RRD_DIR)/orcallator
+	$(MKDIR) $(ORCALLATOR_DIR)
+	$(MKDIR) $(RRD_DIR)/orcallator
 	@for dir in $(SUBDIRS); do			\
 		echo "cd $$dir && $(MAKE) install";	\
 		(cd $$dir && $(MAKE) install);		\
 	done
 
+install_contrib:
+	cd contrib && $(MAKE) install_contrib
+
 orcallator_run_at_boot:
 	cd orcallator && $(MAKE) orcallator_run_at_boot
 

Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in	(original)
+++ trunk/orca/configure.in	Sat Jul 13 21:25:41 2002
@@ -6,25 +6,62 @@
 AC_CANONICAL_SYSTEM
 
 # Remember the command line arguments to configure for use when
-# configure is run again.
-CONFIGURE_COMMAND_LINE=${1+"$@"}
-AC_SUBST(CONFIGURE_COMMAND_LINE)
+# configure is run again.  Also create the command line options for
+# RRD configure.
+ORCA_CONFIGURE_COMMAND_LINE=${1+"$@"}
+RRD_CONFIGURE_COMMAND_LINE="$ORCA_CONFIGURE_COMMAND_LINE --cache-file=../../config.cache"
+AC_SUBST(ORCA_CONFIGURE_COMMAND_LINE)
+AC_SUBST(RRD_CONFIGURE_COMMAND_LINE)
+
+# Set this to yes to have configure always build all of the required
+# Perl Orca modules.  This is used to test the build more than
+# anything else.
+ALWAYS_BUILD_PERL_MODULES=yes
+ALWAYS_BUILD_PERL_MODULES=
 
 # Define the directories containing packages that Orca makes use of here.
 # The directory name packages where these packages are distributed with
 # Orca gets added where necessary.
 COMPRESS_ZLIB_DIR=Compress-Zlib-1.05
+COMPRESS_ZLIB_VER=1.05
 DATA_DUMPER_DIR=Data-Dumper-2.101
-DIGEST_MD5_DIR=Digest-MD5-2.09
+DATA_DUMPER_VER=2.101
+DATE_PARSE_DIR=TimeDate-1.10
+DATE_PARSE_VER=2.20
+DIGEST_MD5_DIR=Digest-MD5-2.13
+DIGEST_MD5_VER=2.13
 MATH_INTERPOLATE_DIR=Math-Interpolate-1.05
-RRDTOOL_DIR=rrdtool-1.0.13
-STORABLE_DIR=Storable-0.6.9
+MATH_INTERPOLATE_VER=1.05
+RRDTOOL_DIR=rrdtool-1.0.33
+RRDTOOL_VER=1.000331
+STORABLE_DIR=Storable-1.0.11
+STORABLE_VER=1.011
+TIME_HIRES_DIR=Time-HiRes-01.20
+TIME_HIRES_VER=1.20
+
 AC_SUBST(COMPRESS_ZLIB_DIR)
 AC_SUBST(DATA_DUMPER_DIR)
+AC_SUBST(DATE_PARSE_DIR)
 AC_SUBST(DIGEST_MD5_DIR)
 AC_SUBST(MATH_INTERPOLATE_DIR)
 AC_SUBST(RRDTOOL_DIR)
 AC_SUBST(STORABLE_DIR)
+AC_SUBST(TIME_HIRES_DIR)
+AC_SUBST(COMPRESS_ZLIB_VER)
+AC_SUBST(DATA_DUMPER_VER)
+AC_SUBST(DATE_PARSE_VER)
+AC_SUBST(DIGEST_MD5_VER)
+AC_SUBST(MATH_INTERPOLATE_VER)
+AC_SUBST(RRDTOOL_VER)
+AC_SUBST(STORABLE_VER)
+AC_SUBST(TIME_HIRES_VER)
+
+# Get the current working directory and the config directory.
+cwd=`pwd`
+config_dir="$cwd/config"
+if test ! -d $config_dir; then
+  AC_MSG_ERROR([*** Cannot find config directory.])
+fi
 
 # Minimum Autoconf version required.
 AC_PREREQ(2.13)
@@ -155,6 +192,7 @@
 AC_PATH_PROG(COMPRESS, compress)
 AC_PATH_PROG(CUT, cut, cut)
 AC_PATH_PROG(EXPR, expr, expr)
+AC_PATH_PROGS(TAR,gtar gnutar tar)
 AC_PATH_PROG(GZIP, gzip)
 AC_PATH_PROG(GUNZIP, gunzip)
 AC_PATH_PROGS(AWK, mawk gawk nawk awk)
@@ -166,7 +204,7 @@
 else
   BORP_PERL_RUN($PERL, PERL_HEAD=PerlHead1, PERL_HEAD=PerlHead2)
 fi
-PERL_HEAD="../config/$PERL_HEAD"
+PERL_HEAD="$cwd/config/$PERL_HEAD"
 AC_SUBST(PERL_HEAD)
 
 # Determine the correct ps command to use to find out about process
@@ -177,7 +215,7 @@
     PS_SELF="$PS -p PID -o \'rss vsz pmem time user pid comm\'"
     ;;
   *-linux-*)
-    PS_SELF="$PS auxp PID"
+    PS_SELF="$PS up PID"
     ;;
   *)
     PS_SELF="$PS aux | grep PID"
@@ -186,7 +224,7 @@
     AC_MSG_WARN([*** to get process information for your host,])
     AC_MSG_WARN([*** please email the command the the output from])
     AC_MSG_WARN([*** ./config/config.guess to])
-    AC_MSG_WARN([*** orca-developers at onelist.com])
+    AC_MSG_WARN([*** orca-developers at yahoogroups.com])
     ;;
 esac
 if test "$PS_SELF"; then
@@ -238,9 +276,10 @@
 
 # This command can be used to add --enable-shared to the configure
 # options for RRDtool if it is not already declared.
-# expr "$CONFIGURE_COMMAND_LINE" : "--enable-shared" >/dev/null 2>&1 || CONFIGURE_COMMAND_LINE="$CONFIGURE_COMMAND_LINE --enable-shared"
+# expr "$ORCA_CONFIGURE_COMMAND_LINE" : "--enable-shared" >/dev/null 2>&1 || ORCA_CONFIGURE_COMMAND_LINE="$ORCA_CONFIGURE_COMMAND_LINE --enable-shared"
 
-dnl BORP_PERL_MODULE(borp_cv_perl_compress_zlib, $PERL, Compress::Zlib, 1.05)
+dnl BORP_PERL_MODULE(borp_cv_perl_compress_zlib, $PERL, Compress::Zlib, $COMPRESS_ZLIB_VER)
+dnl test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_compress_zlib=no
 dnl if test "$borp_cv_perl_compress_zlib" = no; then
 dnl   MAKE_COMPRESS_ZLIB=make_compress_zlib
 dnl   TEST_COMPRESS_ZLIB=test_compress_zlib
@@ -254,7 +293,8 @@
 AC_SUBST(CLEAN_COMPRESS_ZLIB)
 AC_SUBST(DISTCLEAN_COMPRESS_ZLIB)
 
-BORP_PERL_MODULE(borp_cv_perl_data_dumper, $PERL, Data::Dumper, 2.101)
+BORP_PERL_MODULE(borp_cv_perl_data_dumper, $PERL, Data::Dumper, $DATA_DUMPER_VER)
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_data_dumper=no
 if test "$borp_cv_perl_data_dumper" = no; then
   MAKE_DATA_DUMPER=make_data_dumper
   TEST_DATA_DUMPER=test_data_dumper
@@ -268,7 +308,23 @@
 AC_SUBST(CLEAN_DATA_DUMPER)
 AC_SUBST(DISTCLEAN_DATA_DUMPER)
 
-BORP_PERL_MODULE(borp_cv_perl_digest_md5, $PERL, Digest::MD5, 2.09)
+BORP_PERL_MODULE(borp_cv_perl_date_parse, $PERL, Date::Parse, $DATE_PARSE_VER)
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_date_parse=no
+if test "$borp_cv_perl_date_parse" = no; then
+  MAKE_DATE_PARSE=make_date_parse
+  TEST_DATE_PARSE=test_date_parse
+  INSTALL_PERL_DATE_PARSE=install_perl_date_parse
+  CLEAN_DATE_PARSE=clean_date_parse
+  DISTCLEAN_DATE_PARSE=distclean_date_parse
+fi
+AC_SUBST(MAKE_DATE_PARSE)
+AC_SUBST(TEST_DATE_PARSE)
+AC_SUBST(INSTALL_PERL_DATE_PARSE)
+AC_SUBST(CLEAN_DATE_PARSE)
+AC_SUBST(DISTCLEAN_DATE_PARSE)
+
+BORP_PERL_MODULE(borp_cv_perl_digest_md5, $PERL, Digest::MD5, $DIGEST_MD5_VER)
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_digest_md5=no
 if test "$borp_cv_perl_digest_md5" = no; then
   MAKE_DIGEST_MD5=make_digest_md5
   TEST_DIGEST_MD5=test_digest_md5
@@ -282,7 +338,8 @@
 AC_SUBST(CLEAN_DIGEST_MD5)
 AC_SUBST(DISTCLEAN_DIGEST_MD5)
 
-BORP_PERL_MODULE(borp_cv_perl_math_interpolate, $PERL, Math::Interpolate, 1.05)
+BORP_PERL_MODULE(borp_cv_perl_math_interpolate, $PERL, Math::Interpolate, $MATH_INTERPOLATE_VER)
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_math_interpolate=no
 if test "$borp_cv_perl_math_interpolate" = no; then
   MAKE_MATH_INTERPOLATE=make_math_interpolate
   TEST_MATH_INTERPOLATE=test_math_interpolate
@@ -296,8 +353,9 @@
 AC_SUBST(CLEAN_MATH_INTERPOLATE)
 AC_SUBST(DISTCLEAN_MATH_INTERPOLATE)
 
-BORP_PERL_MODULE(borp_cv_perl_rdds, $PERL, RRDs, 1.000131)
-if test "$borp_cv_perl_rdds" = no; then
+BORP_PERL_MODULE(borp_cv_perl_rrds, $PERL, RRDs, $RRDTOOL_VER)
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_rrds=no
+if test "$borp_cv_perl_rrds" = no; then
   MAKE_RRDTOOL=make_rrdtool
   TEST_RRDTOOL=test_rrdtool
   INSTALL_PERL_RRDTOOL=install_perl_rrdtool
@@ -310,7 +368,8 @@
 AC_SUBST(CLEAN_RRDTOOL)
 AC_SUBST(DISTCLEAN_RRDTOOL)
 
-BORP_PERL_MODULE(borp_cv_perl_storable, $PERL, Storable, 0.609)
+BORP_PERL_MODULE(borp_cv_perl_storable, $PERL, Storable, $STORABLE_VER)
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_storable=no
 if test "$borp_cv_perl_storable" = no; then
   MAKE_STORABLE=make_storable
   TEST_STORABLE=test_storable
@@ -324,10 +383,29 @@
 AC_SUBST(CLEAN_STORABLE)
 AC_SUBST(DISTCLEAN_STORABLE)
 
+BORP_PERL_MODULE(borp_cv_perl_time_hires, $PERL, Time::HiRes, $TIME_HIRES_VER)
+test "$ALWAYS_BUILD_PERL_MODULES" && borp_cv_perl_time_hires=no
+if test "$borp_cv_perl_time_hires" = no; then
+  MAKE_TIME_HIRES=make_time_hires
+  TEST_TIME_HIRES=test_time_hires
+  INSTALL_PERL_TIME_HIRES=install_perl_time_hires
+  CLEAN_TIME_HIRES=clean_time_hires
+  DISTCLEAN_TIME_HIRES=distclean_time_hires
+  PERL_USE_TIME_HIRES=
+else
+  PERL_USE_TIME_HIRES="use Time::HiRes qw(time);"
+fi
+AC_SUBST(MAKE_TIME_HIRES)
+AC_SUBST(TEST_TIME_HIRES)
+AC_SUBST(INSTALL_PERL_TIME_HIRES)
+AC_SUBST(CLEAN_TIME_HIRES)
+AC_SUBST(DISTCLEAN_TIME_HIRES)
+AC_SUBST(PERL_USE_TIME_HIRES)
+
 # Define the INSTALL and MKDIR variables to point to the scripts in
 # the config directory.
-INSTALL="../config/install-sh -c"
-MKDIR="../config/mkinstalldirs"
+INSTALL="$config_dir/install-sh -c"
+MKDIR="$config_dir/mkinstalldirs"
 AC_SUBST(INSTALL)
 AC_SUBST(MKDIR)
 
@@ -345,25 +423,37 @@
                      orcallator/Makefile"
 fi
 
-AC_OUTPUT(config/PerlHead1
+AC_OUTPUT(Makefile
+	  config/PerlHead1
 	  config/PerlHead2
 	  lib/Makefile
 	  packages/Makefile
-	  src/orca.pl
 	  src/Makefile
+	  src/orca.pl
 	  $ORCALLATOR_OUTPUT
 	  docs/Makefile
-	  Makefile)
+	  contrib/Makefile
+	  contrib/rotate_orca_graphs/Makefile
+	  contrib/rotate_orca_graphs/rotate_orca_graphs.sh
+	  contrib/orcaservices/Makefile
+	  contrib/orcaservices/orcaservices.cfg
+	  contrib/orcaservices/orcaservices.pl
+	  contrib/orcaservices/orcaservices_running.pl
+	  contrib/orcaservices/restart_orcaservices.sh
+	  contrib/orcaservices/start_orcaservices.sh
+	  contrib/orcaservices/stop_orcaservices.sh
+	  contrib/orcaservices/S99orcaservices.sh)
 
 # Build the RRDtool library if it is needed.
 if test "$borp_cv_perl_rdds" = no; then
-  command="(cd packages/$RRDTOOL_DIR; ./configure $CONFIGURE_COMMAND_LINE --cache-file=../../config.cache)"
+  command="(cd packages/$RRDTOOL_DIR; ./configure $RRD_CONFIGURE_COMMAND_LINE)"
   echo ""
   echo "Running configure in packages/$RRDTOOL_DIR to create RRDtool and RRDs.pm."
   echo ""
   echo $command
   echo ""
   eval $command
+  sleep 1
 fi
 
 if test -z "$WEB_LOG"; then

Modified: trunk/orca/src/Makefile.in
==============================================================================
--- trunk/orca/src/Makefile.in	(original)
+++ trunk/orca/src/Makefile.in	Sat Jul 13 21:25:41 2002
@@ -3,8 +3,8 @@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 bindir		= @bindir@
-MKDIR		= @MKDIR@
 INSTALL		= @INSTALL@
+MKDIR		= @MKDIR@
 PERL_HEAD	= @PERL_HEAD@
 ORCALLATOR_DIR	= @ORCALLATOR_DIR@
 RRD_DIR		= @RRD_DIR@
@@ -42,7 +42,6 @@
 
 Makefile:	Makefile.in
 		cd .. && CONFIG_FILES=src/Makefile ./config.status
-		$(MAKE)
 
 orca.pl:	orca.pl.in
 		cd .. && CONFIG_FILES=src/orca.pl ./config.status

Modified: trunk/orca/src/orca.pl.in
==============================================================================
--- trunk/orca/src/orca.pl.in	(original)
+++ trunk/orca/src/orca.pl.in	Sat Jul 13 21:25:41 2002
@@ -1,6 +1,6 @@
 # Orca: display arbitrary data from files onto web pages using RRDtool.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 use strict;
 require 5.004_01;
@@ -16,15 +16,17 @@
 }
 
 use Carp;
+use Getopt::Long;
+use Cwd;
 
 # Load any modules that have required version numbers here in
 # addition to the loading of the modules in the other Orca
 # modules to keep all the requiste numbers here.
-use Data::Dumper         2.101;
-use Digest::MD5          2.09 qw(md5_base64);
-use Math::IntervalSearch 1.05 qw(interval_search);
-use Storable             0.609;
-use RRDs                 1.000131;
+use Data::Dumper         @DATA_DUMPER_VER@;
+use Digest::MD5          @DIGEST_MD5_VER@;
+use Math::IntervalSearch @MATH_INTERPOLATE_VER@ qw(interval_search);
+use Storable             @STORABLE_VER@;
+use RRDs                 @RRDTOOL_VER@;
 
 # Set behavior of the Data::Dumper module.
 $Data::Dumper::Indent   = 1;
@@ -33,20 +35,28 @@
 
 # Load the required Orca modules.
 use Orca::Constants     qw($ORCA_VERSION
-                           @IMAGE_PLOT_TYPES
+                           IS_WIN32
+                           die_when_called
+                           $INCORRECT_NUMBER_OF_ARGS
+                           $opt_daemon
                            $opt_generate_gifs
+                           $opt_log_filename
+                           $opt_no_html
+                           $opt_no_images
                            $opt_once_only
-                           $opt_rrd_update_only
                            $opt_verbose
-                           $IMAGE_SUFFIX);
+                           @IMAGE_PLOT_TYPES
+                           $IMAGE_SUFFIX
+                           $MAX_PLOT_TYPE_LENGTH);
 use Orca::Config        qw(load_config
-                           %config_options
-                           %config_groups
+                           %config_global
+                           @config_groups
+                           @config_groups_names
                            @config_plots);
-use Orca::OldState      qw($orca_old_state 
-                           load_old_state 
+use Orca::OldState      qw($orca_old_state
+                           load_old_state
                            save_old_state);
-use Orca::Utils         qw(perl_glob unique);
+use Orca::Utils         qw(name_to_fsname perl_glob unique);
 use Orca::SourceFile;
 use Orca::SourceFileIDs qw(@sfile_fids);
 use Orca::HTMLFile;
@@ -54,6 +64,10 @@
 # Note the starting time of the script.
 my $start_time = time;
 
+# Remember the original working directory because it will be needed to
+# remove the locking directory.
+my $start_cwd = cwd;
+
 # Set up a signal handler to force looking for new files.
 my $force_find_files = 0;
 sub handle_hup {
@@ -62,112 +76,193 @@
 $SIG{HUP} = \&handle_hup;
 
 sub Usage {
-  die "usage: $0 [-o] [-r] [-v] config_file\n";
+  print STDERR "$0: @_\n" if @_;
+die << "END";
+usage: $0 [options] configuration_file
+Options:
+  -daemon           Run Orca in daemon mode
+  -gifs             Output GIFs instead of PNGs
+  -logfile filename Output all messages
+  -no-html          Update RRD files and images but not HTML files
+  -no-images        Update RRD files but not image and HTML files
+  -once             Run only once and do not continue to monitor input files
+  -verbose          Verbose; list multiple times for increased verbosity
+Orca understands the first unique command line option, i.e. -d for -daemon.
+END
 }
 
-while (@ARGV and $ARGV[0] =~ /^-\w/) {
-  my $arg = shift;
-  if ($arg eq '-gifs') {
-    $opt_generate_gifs = 1;
-    $IMAGE_SUFFIX      = 'gif';
-  } elsif ($arg eq '-o') {
-    $opt_once_only = 1;
-  } elsif ($arg eq '-r') {
-    $opt_rrd_update_only = 1;
-  } elsif ($arg eq '-v') {
-    ++$opt_verbose;
-  } else {
-    Usage;
-  }
+GetOptions('daemon'     => \$opt_daemon,
+           'gifs'       => \$opt_generate_gifs,
+           'logfile=s'  => \$opt_log_filename,
+           'no-html'    => \$opt_no_html,
+           'no-images'  => \$opt_no_images,
+           'once'       => \$opt_once_only,
+           'verbose+'   => \$opt_verbose) or
+  Usage;
+
+# Currently, Orca can only daemonize itself on Unix platforms.
+if ($opt_daemon and IS_WIN32) {
+  die "$0: cannot daemonize on a Windows platform.\n";
 }
 
-Usage unless @ARGV;
+if ($opt_generate_gifs) {
+  $IMAGE_SUFFIX = 'gif';
+}
 
-# Install signal handlers to clean up.
+# Load the configuration file.
+Usage("no configuration file specified") unless @ARGV == 1;
+my $config_filename = shift;
+unless (-r $config_filename) {
+  die "$0: no configuration file `$config_filename' to read.\n";
+}
+load_config($config_filename);
+
+# Set two variables that are used by the code that ensures that only
+# one Orca process is using a particular configuration file at a
+# particular time.  This is done by using the fact that mkdir() is
+# atomic.  The first variable is the name of the directory to create
+# and the second is a flag used by the Orca clean up code to see if
+# the locking directory should be removed.
+my $locking_directory       = "$config_filename.lock";
+my $rmdir_locking_directory = '';
+
+# Install signal handlers to clean Orca up, including the locking
+# directory.
 $SIG{INT}     = \&catch_signal;
+$SIG{PIPE}    = \&catch_signal;
 $SIG{TERM}    = \&catch_signal;
-$SIG{__DIE__} = \&catch_signal;
+$SIG{__DIE__} = \&catch_die;
+
+# Now try to create the locking directory.
+unless (mkdir($locking_directory, 0755)) {
+  die "$0: cannot create locking directory `$locking_directory': $!\n";
+}
+$rmdir_locking_directory = 1;
+
+# If a log file was specified or if Orca should daemonize itself, then
+# redirect STDOUT to the appropriate file.  If Orca should daemonize
+# itself and no log file was specified, then write to /dev/null.
+# STDERR is dup'ed from STDOUT after any daemonizing since it does a
+# chdir() and the log filename may be relative to the current
+# directory.  This will still keep any failures to the real STDERR
+# until the last possible time.
+if ($opt_daemon and !$opt_log_filename) {
+  $opt_log_filename = '/dev/null';
+}
+if ($opt_log_filename) {
+  open(STDOUT, ">>$opt_log_filename") or
+    die "$0: cannot open `$opt_log_filename' for writing: $!\n";
+}
+
+# If Orca should daemonize itself, then do so now.  Find POSIX::setsid
+# but do not always use it unless it is needed since some systems do
+# not supply POSIX::setsid and Orca should not quit on those systems.
+if ($opt_daemon) {
+  my $expr = 'use POSIX qw(setsid)';
+  local $SIG{__DIE__}  = 'DEFAULT';
+  local $SIG{__WARN__} = \&die_when_called;
+  eval $expr;
+  if ($@) {
+    die "$0: cannot get setsid since eval '$expr' failed: $@\n";
+  }
+  chdir('/')               or die "$0: cannot chdir `/': $!\n";
+  open(STDIN, '/dev/null') or die "$0: cannot read `/dev/null': $!\n";
+  defined(my $pid = fork)  or die "$0: cannot fork: $!\n";
+  exit if $pid;
+  POSIX::setsid()          or die "$0: cannot start a new session: $!\n";
+}
+
+if ($opt_log_filename) {
+  open(STDERR, '>&STDOUT') or
+    die "$0: cannot dup stdout: $!\n";
+}
 
 if ($opt_verbose) {
-  print "Orca version $ORCA_VERSION using RRDs version $RRDs::VERSION.\n";
+  print "Orca version $ORCA_VERSION using RRDs version $RRDs::VERSION at ",
+        scalar localtime, ".\n";
 }
 
-&main(@ARGV);
+# Load the file state information from disk.
+load_old_state($config_global{state_file});
 
-exit 0;
+# Create orca.gif, rrdtool.gif and any other static images for the
+# HTML pages.
+&create_static_images;
 
-# This is the locking directory.
-my $locking_directory;
+# Load in any new data and update necessary plots.
+&watch_data_sources($config_filename);
 
-# This is set to 1 if the locking directory should be removed.
-my $rmdir_locking_directory;
+&clean_up_and_quit(1, "Orca has completed.\n");
 
-sub clean_up_and_quit {
-  # Print some statistics about running.
-  &running_stats;
+exit 0;
 
-  if ($rmdir_locking_directory and
-      $locking_directory and
-      -d $locking_directory) {
-    rmdir($locking_directory) or
-      warn "$0: cannot rmdir `$locking_directory': $!\n";
-  }
-  exit 0;
-}
+# This cleans up any leftover temporary files.  In certain
+# circumstances, such as when Orca receives a SIGPIPE, then assume
+# that STDOUT and STDERR are closed and do not print any messages so
+# that Orca can properly clean up.  If Orca prints when STDOUT and/or
+# STDERR or closed, then it will hang.
+sub clean_up_and_quit {
+  my $can_print = shift;
+  my $message   = shift;
 
-sub catch_signal {
-  my $signal = shift;
-  chomp($signal);
-  $signal =~ s/\.+$//;
-  if ($signal =~ /$0/o) {
-    print STDERR "$signal.\n";
-  } else {
-    print STDERR "$0: caught signal $signal.\n";
-  }
-  clean_up_and_quit;
-}
+  $can_print = 1 unless defined $can_print;
 
-sub main {
-  my $config_filename = shift;
+  if ($rmdir_locking_directory and $locking_directory) {
+    my $ok = 1;
+    if ($opt_daemon) {
+      unless (chdir($start_cwd)) {
+        $ok = 0;
+        if ($can_print) {
+          warn "$0: cannot chdir `$start_cwd': $!\n";
+        }
+      }
+    }
 
-  unless (-r $config_filename) {
-    die "$0: no configuration file `$config_filename' to read.\n";
+    if ($ok and -d $locking_directory) {
+      unless (rmdir($locking_directory)) {
+        if ($can_print) {
+          warn "$0: cannot rmdir `$locking_directory': $!\n";
+        }
+      }
+    }
   }
 
-  # Create a locking directory using the configuration filename.
-  $locking_directory = "$config_filename.lock";
-  unless (mkdir($locking_directory, 0755)) {
-    die "$0: cannot create locking directory `$locking_directory': $!\n";
+  # Print the given message and any running statistics.
+  if ($can_print) {
+    &running_stats;
+    print $message if $message;
   }
-  $rmdir_locking_directory = 1;
-
-  # Load the configuration file.
-  load_config($config_filename) or
-    die "$0: cannot load configuration file.\n";
-
-  # Load the file state information from disk.
-  load_old_state($config_options{state_file});
 
-  # Create orca.gif, rrdtool.gif and any other static images for
-  # the HTML pages.
-  &create_static_images;
+  exit 0;
+}
 
-  # Load in any new data and update necessary plots.
-  &watch_data_sources($config_filename);
+# Catch any die messages.
+sub catch_die {
+  my $message = shift;
+  clean_up_and_quit(1, $message);
+}
 
-  &clean_up_and_quit;
+# Catch any signals.  Treat SIGPIPE specially to instruct Orca to not
+# print any more messages to STDOUT or STDERR, since these file
+# descriptors may have closed if they were attached to a process that
+# exited, unless a log filename is specified, in which case it is ok
+# to print since STDOUT and STDERR were opened to a file.
+sub catch_signal {
+  my $signal    = shift;
+  my $can_print = $signal !~ /PIPE/ || $opt_log_filename;
+  my $message   = "$0: caught signal $signal.\n";
+  clean_up_and_quit($can_print, $message);
 }
 
+# Create the necessary static images files in the HTML directory using
+# the data stored in Orca's DATA section.  The generated files should
+# include orca.gif and rrdtool.gif.  Convert the hexadecimal forms
+# stored in the DATA section to the raw image form on disk.
 sub create_static_images {
-  # Create the necessary images files in the HTML directory unless
-  # Orca was passed the -r flag, which instructs it to only update
-  # the RRD files.  The generated files should include orca.gif and
-  # rrdtool.gif.  Convert the hexadecimal forms stored in the DATA
-  # section to the raw image form on disk.
-  return if $opt_rrd_update_only;
   my $image_filename = '';
   while (<main::DATA>) {
     chomp;
+    next unless $_;
     if ($image_filename) {
       if (/CLOSE/) {
         close(ORCA_WRITE) or
@@ -178,7 +273,7 @@
         print ORCA_WRITE pack('h*', $_);
       }
     } elsif (/OPEN (.*)/) {
-      $image_filename = "$config_options{html_dir}/$1";
+      $image_filename = "$config_global{html_dir}/$1";
       print "Creating $1.\n" if $opt_verbose;
       unless (open(ORCA_WRITE, ">$image_filename")) {
         warn "$0: cannot open `$image_filename' for writing: $!\n";
@@ -203,7 +298,7 @@
 
 sub watch_data_sources {
   unless (@_ == 1) {
-    confess "$0: watch_data_sources: passed wrong number of arguments.\n";
+    confess "$0: watch_data_sources $INCORRECT_NUMBER_OF_ARGS";
   }
   my $config_filename = shift;
 
@@ -217,11 +312,11 @@
   # time interval that the current time is in, where the intervals are
   # defined as the times to have Orca find new source data files.
   my $find_new_files = 1;
-  my $time_interval  = get_time_interval($config_options{find_times});
+  my $time_interval  = get_time_interval($config_global{find_times});
 
   # This hash holds the next time to load the data from all the files
   # in a particular subgroup.
-  my %subgroup_load_time;
+  my @subgroup_load_time;
 
   for (;;) {
     # If Orca is being forced to find new files, then set up the
@@ -229,7 +324,7 @@
     if ($force_find_files) {
       $force_find_files = 0;
       $find_new_files   = 1;
-      $time_interval    = get_time_interval($config_options{find_times});
+      $time_interval    = get_time_interval($config_global{find_times});
     }
 
     my $found_new_files = 0;
@@ -253,15 +348,19 @@
       # Go through all of the subgroups and for each subgroup and all
       # of the files in the subgroup find the next load time in the
       # future.
-      undef %subgroup_load_time;
-      foreach my $group_name (keys %$subgroup_fids_ref) {
-        foreach my $subgroup_name (keys %{$subgroup_fids_ref->{$group_name}}) {
+      undef @subgroup_load_time;
+      for (my $group_index=0;
+           $group_index<@$subgroup_fids_ref;
+           ++$group_index) {
+        my $indexed_subgroup_fids_ref = $subgroup_fids_ref->[$group_index] or
+          next;
+        foreach my $subgroup_name (keys %$indexed_subgroup_fids_ref) {
           my $subgroup_load_time = 1e20;
-          foreach my $fid (@{$subgroup_fids_ref->{$group_name}{$subgroup_name}}) {
+          foreach my $fid (@{$indexed_subgroup_fids_ref->{$subgroup_name}}) {
             my $load_time       = $new_found_files_ref->{$fid}->next_load_time;
             $subgroup_load_time = $load_time if $load_time < $subgroup_load_time;
           }
-          $subgroup_load_time{$group_name}{$subgroup_name} = $subgroup_load_time;
+          $subgroup_load_time[$group_index]{$subgroup_name} = $subgroup_load_time;
         }
       }
     }
@@ -278,11 +377,13 @@
     # is in the future.
     my $sleep_till_time;
     my $need_to_save_state = $found_new_files;
-    foreach my $group_name (sort keys %subgroup_load_time) {
-      foreach my $subgroup_name (sort keys %{$subgroup_load_time{$group_name}}) {
+    for (my $group_index=0; $group_index<@subgroup_load_time; ++$group_index) {
+      my $subgroup_load_time_ref = $subgroup_load_time[$group_index] or
+        next;
+      foreach my $subgroup_name (sort keys %{$subgroup_load_time_ref}) {
         # Skip this subgroup if the load time has not been reached and
         # if no new files were found.
-        my $subgroup_load_time = $subgroup_load_time{$group_name}{$subgroup_name};
+        my $subgroup_load_time = $subgroup_load_time_ref->{$subgroup_name};
         if ($subgroup_load_time > time) {
           $sleep_till_time = $subgroup_load_time unless $sleep_till_time;
           if ($subgroup_load_time < $sleep_till_time) {
@@ -291,9 +392,10 @@
           next unless $found_new_files;
         }
 
+        my $group_name = $config_groups_names[$group_index];
         if ($opt_verbose) {
-          print "Loading new data",
-                $subgroup_name ? " from $subgroup_name" : "", ".\n";
+          print "Loading new data from group $group_name",
+                $subgroup_name ? " for $subgroup_name.\n" : ".\n";
         }
 
         my %this_subgroup_rrds;
@@ -301,21 +403,21 @@
         my $number_new_data_points_since_flush = 0;
         $subgroup_load_time                    = 1e20;
         my $previous_fid;
-        foreach my $fid (@{$subgroup_fids_ref->{$group_name}{$subgroup_name}}) {
+        foreach my $fid (@{$subgroup_fids_ref->[$group_index]{$subgroup_name}}) {
           # Determine if the currently loaded data should be flushed.
           if (defined $previous_fid) {
             local $Orca::Config::a = $fid;
             local $Orca::Config::b = $previous_fid;
-            if (&{$config_groups{$group_name}{filename_compare}} > 1 and
+            if (&{$config_groups[$group_index]{filename_compare}} > 1 and
                 $number_new_data_points_since_flush) {
               if ($opt_verbose) {
-                print "Flushing new data",
-                       $subgroup_name ? " from $subgroup_name" : "", ".\n";
+                print "Flushing new data from group $group_name",
+                       $subgroup_name ? " for $subgroup_name" : "", ".\n";
               }
               foreach my $rrd (sort values %this_subgroup_rrds) {
                 $rrd->flush_data;
               }
-              save_old_state($config_options{state_file},
+              save_old_state($config_global{state_file},
                              $new_found_files_ref);
               $number_new_data_points_since_flush = 0;
               $need_to_save_state                 = 0;
@@ -340,7 +442,7 @@
         }
 
         # Update the load time for this subgroup.
-        $subgroup_load_time{$group_name}{$subgroup_name} = $subgroup_load_time;
+        $subgroup_load_time_ref->{$subgroup_name} = $subgroup_load_time;
 
         # Now that the source data files have been read, recalculate
         # the time to sleep to if the load time for this subgroup is
@@ -364,40 +466,40 @@
           print "Flushing new data and updating ", uc($IMAGE_SUFFIX),
                 $subgroup_name ? "s from $subgroup_name" : "s", ".\n";
         }
-        foreach my $rrd (sort {$a->name cmp $b->name}
+        foreach my $rrd (sort {$a->data_expression cmp $b->data_expression}
                               values %this_subgroup_rrds) {
           $rrd->flush_data;
-          next if $opt_rrd_update_only;
+          next if $opt_no_images;
           foreach my $image ($rrd->created_images) {
             next if $image->rrds > 1;
             $image->plot;
           }
         }
-        save_old_state($config_options{state_file}, $new_found_files_ref);
+        save_old_state($config_global{state_file}, $new_found_files_ref);
         $need_to_save_state = 0;
       }
     }
 
     # Save the state if any new data was loaded or new files were found.
     if ($need_to_save_state) {
-      save_old_state($config_options{state_file}, $new_found_files_ref);
+      save_old_state($config_global{state_file}, $new_found_files_ref);
     }
 
-    # Create the HTML and image files now.
-    unless ($opt_rrd_update_only) {
+    # Create the image files now.
+    unless ($opt_no_images) {
       # Plot the data in each image.
       print "Updating ", uc($IMAGE_SUFFIX), "s.\n" if $opt_verbose;
       foreach my $image (@{$image_files_ref->{list}}) {
         $image->plot;
       }
+    }
 
-      # Make the HTML files.
-      if ($found_new_files) {
-        &create_html_files($new_found_files_ref,
-                           $subgroup_fids_ref,
-                           $image_files_ref);
-        $found_new_files = 0;
-      }
+    # Create the HTML files now.
+    if ($found_new_files and !$opt_no_html) {
+      &create_html_files($new_found_files_ref,
+                         $subgroup_fids_ref,
+                         $image_files_ref);
+      $found_new_files = 0;
     }
 
     # Return now if this loop is being run only once.
@@ -407,7 +509,7 @@
     # does change, then find new files only if the new time interval
     # is not -1, which signifies that the time is before the first
     # find_times.
-    my $new_time_interval = get_time_interval($config_options{find_times});
+    my $new_time_interval = get_time_interval($config_global{find_times});
     if ($time_interval != $new_time_interval) {
       $find_new_files = 1 if $new_time_interval != -1;
       $time_interval  = $new_time_interval;
@@ -434,7 +536,7 @@
 
 # Take a string and capatialize only the first character of the
 # string.
-sub Capatialize {
+sub capatialize {
   my $string = shift;
   substr($string, 0, 1) = uc(substr($string, 0, 1));
   $string;
@@ -474,16 +576,35 @@
       $subgroup_fids_ref,
       $image_files_ref) = @_;
 
-  my $html_dir         = $config_options{html_dir};
+  my $html_dir         = $config_global{html_dir};
   my $index_filename   = "$html_dir/index.html";
 
+  # This variable sets the number of groups to place into a single row.
+  my $table_number_columns = 9;
+  my @table_columns;
+
+  # Depending on the number of different timespan plots to make,
+  # create a set of HTML pages labeled 'All' that contains all of the
+  # different timespan plots.  Only make the 'All' pages if there is
+  # more than one timespan plot, otherwise there is no point in making
+  # it.  This array holds the names of the different HTML pages to
+  # create containing different plots.
+  my @html_page_plot_types = @IMAGE_PLOT_TYPES;
+  my $make_html_all_page;
+  if (@html_page_plot_types > 1) {
+    $make_html_all_page = 1;
+    push(@html_page_plot_types, 'all');
+  } else {
+    $make_html_all_page = 0;
+  }
+
   print "Creating HTML files in `$html_dir/'.\n" if $opt_verbose;
 
   # Create the main HTML index.html file.
   my $index_html = Orca::HTMLFile->new($index_filename,
-                                       $config_options{html_top_title},
-                                       $config_options{html_page_header},
-                                       $config_options{html_page_footer});
+                                       $config_global{html_top_title},
+                                       $config_global{html_page_header},
+                                       $config_global{html_page_footer});
   unless ($index_html) {
     warn "$0: warning: cannot create Orca::HTMLFile object: $@.\n";
     return;
@@ -498,51 +619,64 @@
   # images for that subgroup.  Also create an HTML file for different time
   # span images (i.e., daily, monthly, etc).
 
-  # This variable sets the number of groups to place into a single row.
-  my $table_number_columns = 9;
-  my @table_columns;
-
-  # Go through each subgroup.  If there is only one subgroup and that
-  # subgroup does not have a name, then give the subgroup the name Everything.
-  # However, only refer to the name Everything in naming HTML files
-  # and in HTML content.  Use the original subgroup name as a hash key.
-  my $number_subgroups = 0;
-  foreach my $group_name (keys %$subgroup_fids_ref) {
-    $number_subgroups += keys %{$subgroup_fids_ref->{$group_name}};
-  }
-  $index_html->print("<h2>Available Targets</h2>\n\n<table>\n");
-  foreach my $group_name (sort keys %$subgroup_fids_ref) {
-    foreach my $subgroup_name (sort sort_subgroup_names keys
-                               %{$subgroup_fids_ref->{$group_name}}) {
-      my $html_subgroup_name = ($number_subgroups == 1 and !$subgroup_name) ? 'Everything' : $subgroup_name;
+  $index_html->print("<h2>Available Targets</h2>\n\n");
+  for (my $group_index=0; $group_index<@$subgroup_fids_ref; ++$group_index) {
+    my $subgroups_ref = $subgroup_fids_ref->[$group_index] or
+      next;
+    my $group_name = $config_groups_names[$group_index];
+    my @subgroups  = sort sort_subgroup_names keys %$subgroups_ref;
+    next unless @subgroups;
+    if (@config_groups > 1) {
+      $index_html->print("<h3>Group $group_name</h3>\n");
+    }
+    $index_html->print("<table>\n");
+
+    foreach my $subgroup_name (@subgroups) {
+      my $html_subgroup_name;
+      my $html_title_name = @config_groups > 1 ? "Group $group_name" : '';
+      if (@subgroups != 1 or $subgroup_name) {
+        $html_subgroup_name  = $subgroup_name;
+        $html_title_name    .= " $subgroup_name";
+      } else {
+        $html_subgroup_name  = '';
+      }
 
       # Create the HTML code for the main index.html file.
-      my $subgroup_basename = escape_name($html_subgroup_name);
-      my $element = "<table border=2><tr><td><b>$html_subgroup_name</b></td></tr>\n<tr><td>\n";
+      my $subgroup_basename = name_to_fsname("${group_name}_$html_subgroup_name",
+                                             $MAX_PLOT_TYPE_LENGTH+6);
+      my $element = "<table border=2>";
+      if ($html_subgroup_name) {
+        $element .= "<tr><td><b>$html_subgroup_name</b></td></tr>\n";
+      }
+      $element .= "<tr><td>\n";
       foreach my $plot_type (@IMAGE_PLOT_TYPES) {
         $element      .= "<a href=\"$subgroup_basename-$plot_type.html\">";
-        my $Plot_Type  = Capatialize($plot_type);
+        my $Plot_Type  = capatialize($plot_type);
         $element      .= "$Plot_Type</a><br>\n";
       }
-      $element .= "<a href=\"$subgroup_basename-all.html\">All</a></td></tr>\n";
+      if ($make_html_all_page) {
+        $element .= "<a href=\"$subgroup_basename-all.html\">All</a></td></tr>\n";
+      }
       $element .= "</table>\n\n";
 
       push(@table_columns, "<td>$element</td>");
       if (@table_columns == $table_number_columns) {
-        $index_html->print("<tr valign=top>" . join('', @table_columns) . "</tr>\n");
+        $index_html->print("<tr valign=top>" .
+                           join('', @table_columns) .
+                           "</tr>\n");
         @table_columns = ();
       }
 
       # Create the various time span HTML files for this subgroup.
       my @html_files;
-      foreach my $plot_type (@IMAGE_PLOT_TYPES, 'all') {
+      foreach my $plot_type (@html_page_plot_types) {
         my $href      = "$subgroup_basename-$plot_type.html";
         my $filename  = "$html_dir/$href";
-        my $Plot_Type = Capatialize($plot_type);
+        my $Plot_Type = capatialize($plot_type);
         my $fd = Orca::HTMLFile->new($filename,
-                                     "$Plot_Type $html_subgroup_name",
-                                     $config_options{html_page_header},
-                                     $config_options{html_page_footer});
+                                     "$Plot_Type $html_title_name",
+                                     $config_global{html_page_header},
+                                     $config_global{html_page_footer});
         unless ($fd) {
           warn "$0: warning: cannot create Orca::HTMLFile object: $@.\n";
           next;
@@ -568,13 +702,14 @@
       # the HTML files that are being created.  Make sure the images
       # appear in the files in the order listed in the configuration
       # file.
-      my @images = sort {$a->plot_ref->{_index} <=> $b->plot_ref->{_index}}
+      my @images = sort {$a->plot_ref->{index} <=> $b->plot_ref->{index}}
                    grep {$subgroup_name eq $_->subgroup_name} @{$image_files_ref->{list}};
       if (@images > 1) {
         my $href_html = "<hr>";
         for (my $i=0; $i<@images; ++$i) {
           $href_html .= "<a href=\"#$i\">[" .
-                        replace_subgroup_name($images[$i]->plot_ref->{title},'') .
+                        replace_subgroup_name($images[$i]->plot_ref->{title},
+                                              '') .
                         "]</a><spacer size=10>\n";
         }
         foreach my $html_file (@html_files) {
@@ -588,8 +723,7 @@
         my $name       = $image->name;
         my $title      = replace_subgroup_name($image->plot_ref->{title},
                                                $image->subgroup_name);
-        my $href       = "href=\"" . escape_name($name) . ".html\"";
-        my $sub_dir    = $config_groups{$image->group_name}{sub_dir};
+        my $href       = "href=\"" . name_to_fsname($name, 5) . ".html\"";
         my $image_size = $image->image_src_size;
 
         foreach my $html_file (@html_files) {
@@ -599,29 +733,37 @@
 
         # Put the proper images into each HTML file.  The all HTML file is
         # listed last and requires special handling.
-        for (my $j=0; $j<@html_files-1; ++$j) {
-          my $image_filename = "$name-$html_files[$j]{plot_type}.$IMAGE_SUFFIX";
-          $image_filename    = "$subgroup_name/$image_filename" if $sub_dir;
+        for (my $j=0; $j<@html_files-$make_html_all_page; ++$j) {
+          my $image_filename = length($subgroup_name) ?
+                               "$subgroup_name/" :
+                               "";
+          $image_filename .= "$name-$html_files[$j]{plot_type}.$IMAGE_SUFFIX";
           my $html = "<a $href><img src=\"$image_filename\" $image_size " .
                      "alt=\"$html_files[$j]{Plot_Type} $title\"></a>\n";
           $html_files[$j]{fd}->print($html);
-          $html_files[-1]{fd}->print($html);
+          if ($make_html_all_page) {
+            $html_files[-1]{fd}->print($html);
           }
         }
+      }
 
-        foreach my $html_file (@html_files) {
-          $html_file->{fd}->print("<hr>\n");
-        }
+      foreach my $html_file (@html_files) {
+        $html_file->{fd}->print("<hr>\n");
+      }
     }
-  }
 
-  # If there are any remaining subgroups to display, do it now.
-  if (@table_columns) {
-    $index_html->print("<tr valign=top>" .
-                       join('', @table_columns) .
-                       "</tr>\n");
+    # If there are any remaining subgroups to display, do it now.
+    if (@table_columns) {
+      $index_html->print("<tr valign=top>" .
+                         join('', @table_columns) .
+                         "</tr>\n");
+      @table_columns = ();
+    }
+
+    $index_html->print("</table>\n\n");
   }
-  $index_html->print("</table>\n\n\n<br>\n<hr>\n" .
+
+  $index_html->print("<br>\n<hr>\n" .
                      "<h2>Available Data Sets</h2>\n\n");
 
   # Here the different available plots are listed and the HTML files
@@ -640,9 +782,14 @@
   @table_columns        = ();
 
   # Go through all of the configured plots.
-  for (my $i=0; $i<@config_plots; ++$i) {
+  foreach my $config_plot (@config_plots) {
+    my $plot_creates = $config_plot->{creates};
+    next unless @$plot_creates;
+
+    my $group_index = $config_plot->{source_index};
+    my $group_name  = $config_groups_names[$group_index];
 
-    next unless @{$config_plots[$i]{creates}};
+    my $html_title_name = @config_groups > 1 ? " Group $group_name" : '';
 
     # Create an ordered list of images sorted on the legend name for
     # each image.  Remember, each image represented here actually
@@ -654,9 +801,10 @@
     # have the same legend name.
     my %image_legend_no_subgroup;
     my %same_legends_image_list;
-    foreach my $image (@{$config_plots[$i]{creates}}) {
-      my $legend_no_subgroup = replace_subgroup_name($image->plot_ref->{title}, '');
-      $image_legend_no_subgroup{$image} = $legend_no_subgroup; 
+    foreach my $image (@$plot_creates) {
+      my $legend_no_subgroup = replace_subgroup_name($image->plot_ref->{title},
+                                                     '');
+      $image_legend_no_subgroup{$image} = $legend_no_subgroup;
       unless (defined $same_legends_image_list{$legend_no_subgroup}) {
         $same_legends_image_list{$legend_no_subgroup} = [];
       }
@@ -681,7 +829,8 @@
     # through and create the correct HTML files.
     foreach my $image (@images) {
 
-      my $no_subgroup_name   = escape_name($image->no_subgroup_name);
+      my $no_subgroup_name   = name_to_fsname($image->no_subgroup_name,
+                                              $MAX_PLOT_TYPE_LENGTH+6);
       my $legend_no_subgroup = $image_legend_no_subgroup{$image};
 
       # If this is the first time that this legend has been seen in
@@ -692,14 +841,14 @@
         # Now create the HTML files for the time span plots.  Use the
         # legend name to create this list.
         $legend_html_files{$legend_no_subgroup} = [];
-        foreach my $plot_type (@IMAGE_PLOT_TYPES, 'all') {
+        foreach my $plot_type (@html_page_plot_types) {
           my $href      = "$no_subgroup_name-$plot_type.html";
           my $filename  = "$html_dir/$href";
-          my $Plot_Type = Capatialize($plot_type);
+          my $Plot_Type = capatialize($plot_type);
           my $fd = Orca::HTMLFile->new($filename,
-                                       "$Plot_Type $legend_no_subgroup",
-                                       $config_options{html_page_header},
-                                       "<hr>\n$config_options{html_page_footer}");
+                                       "${Plot_Type}${html_title_name} $legend_no_subgroup",
+                                       $config_global{html_page_header},
+                                       "<hr>\n$config_global{html_page_footer}");
           unless ($fd) {
             warn "$0: warning: cannot create Orca::HTMLFile object: $@.\n";
             next;
@@ -740,13 +889,13 @@
         # to these other HTML files.  If the configuration file contains
         # an href for information on this plot, then include the href here.
         my $element = "<td><b>$legend_no_subgroup";
-        if (my $legend_href = $config_plots[$i]{href}) {
+        if (my $legend_href = $config_plot->{href}) {
           $element .= " [<a href=\"$legend_href\">Info</a>]";
         }
         $element .= "</b></td>\n";
-        foreach my $plot_type (@IMAGE_PLOT_TYPES, 'all') {
+        foreach my $plot_type (@html_page_plot_types) {
           $element .= "<td><a href=\"$no_subgroup_name-$plot_type.html\">";
-          $element .= Capatialize($plot_type) . "</a></td>\n";
+          $element .= capatialize($plot_type) . "</a></td>\n";
         }
         push(@table_columns, $element);
         if (@table_columns == $table_number_columns) {
@@ -758,24 +907,26 @@
       # At this point the HTML files for this set of of images have been
       # opened.  Now create the summary HTML file that contains only the
       # images for a particular plot for a particular subgroup.
-      my $with_subgroup_name   = escape_name($image->name);
+      my $with_subgroup_name   = name_to_fsname($image->name, 5);
       my $legend_with_subgroup = replace_subgroup_name($image->plot_ref->{title},
                                                        $image->subgroup_name);
       my $summarize_name       = "$html_dir/$with_subgroup_name.html";
       my $summarize_html       = Orca::HTMLFile->new($summarize_name,
-                                                     $legend_with_subgroup,
-                                                     $config_options{html_page_header},
-                                                     $config_options{html_page_footer});
+                                                     "$html_title_name ZZZ $legend_with_subgroup",
+                                                     $config_global{html_page_header},
+                                                     $config_global{html_page_footer});
       unless ($summarize_html) {
         warn "$0: warning: cannot create Orca::HTMLFile object: $@.\n";
         next;
       }
-      my $sub_dir        = $config_groups{$image->group_name}{sub_dir};
-      my $image_filename = $with_subgroup_name;
-      $image_filename    = $image->subgroup_name . "/$image_filename" if $sub_dir;
-      my $image_size     = $image->image_src_size;
+      my $image_subgroup_name = $image->subgroup_name;
+      my $image_filename      = length($image_subgroup_name) ?
+                                "$image_subgroup_name/" :
+                                "";
+      $image_filename        .= $with_subgroup_name;
+      my $image_size          = $image->image_src_size;
       foreach my $plot_type (@IMAGE_PLOT_TYPES) {
-        my $Plot_Type    = Capatialize($plot_type);
+        my $Plot_Type    = capatialize($plot_type);
         $summarize_html->print("<hr>\n<h2>$Plot_Type $legend_with_subgroup</h2>\n",
                                "<img src=\"$image_filename-$plot_type.$IMAGE_SUFFIX\"",
                                $image_size,
@@ -783,21 +934,25 @@
       }
 
       # Now add the images into each HTML file.
-      my $name     = $image->name;
-      my $subgroup = $image->subgroup_name;
-      my $href     = "href=\"$with_subgroup_name.html\"";
+      my $name          = $image->name;
+      my $subgroup_name = $image->subgroup_name;
+      my $href          = "href=\"$with_subgroup_name.html\"";
 
       my @legend_html_files = @{$legend_html_files{$legend_no_subgroup}};
-      $legend_html_files[-1]{fd}->print("<hr>\n<h2><a ${href} name=\"$subgroup\">$subgroup $legend_no_subgroup</a></h2>\n");
-      for (my $i=0; $i<@legend_html_files-1; ++$i) {
+      if ($make_html_all_page) {
+        $legend_html_files[-1]{fd}->print("<hr>\n<h2><a ${href} name=\"$subgroup_name\">$subgroup_name $legend_no_subgroup</a></h2>\n");
+      }
+      for (my $i=0; $i<@legend_html_files-$make_html_all_page; ++$i) {
         my $Plot_Type      = $legend_html_files[$i]{Plot_Type};
-        my $image_filename = "$name-$legend_html_files[$i]{plot_type}.$IMAGE_SUFFIX";
-        $image_filename    = "$subgroup/$image_filename" if $sub_dir;
+        my $image_filename = length($subgroup_name) ? "$subgroup_name/" : "";
+        $image_filename   .= "$name-$legend_html_files[$i]{plot_type}.$IMAGE_SUFFIX";
         my $html = "<a $href><img src=\"$image_filename\" $image_size " .
-                   "alt=\"$Plot_Type $subgroup $legend_no_subgroup\"></a>\n";
-        $legend_html_files[$i]{fd}->print("<hr>\n<h2><a ${href} name=\"$subgroup\">$Plot_Type $subgroup $legend_no_subgroup</a></h2>\n");
+                   "alt=\"$Plot_Type $subgroup_name $legend_no_subgroup\"></a>\n";
+        $legend_html_files[$i]{fd}->print("<hr>\n<h2><a ${href} name=\"$subgroup_name\">$Plot_Type $subgroup_name $legend_no_subgroup</a></h2>\n");
         $legend_html_files[$i]{fd}->print($html);
-        $legend_html_files[-1]{fd}->print($html);
+        if ($make_html_all_page) {
+          $legend_html_files[-1]{fd}->print($html);
+        }
       }
     }
   }
@@ -808,26 +963,6 @@
   $index_html->print("\n</table>\n\n</font>\n<hr>\n");
 }
 
-# Email the list of people a message.
-sub email_message {
-  my ($people, $subject) = @_;
-
-  return unless $people;
-
-  if (open(SENDMAIL, "|/usr/lib/sendmail -oi -t")) {
-    print SENDMAIL <<"EOF";
-To: $people
-Subject: Orca: $subject
-
-Orca: $subject
-EOF
-  close(SENDMAIL) or
-    warn "$0: warning: sendmail did not close: $!\n";
-  } else {
-    warn "$0: warning: cannot fork for sendmail: $!\n";
-  }
-}
-
 # Replace any %g with the subgroup and any %G's with a capitalized
 # version of the subgroup in the title string with the subgroup name.
 sub replace_subgroup_name {
@@ -843,72 +978,9 @@
   $title;
 }
 
-# Replace special characters from key names, remove redundant characters,
-# and shorten the names so the maximum path name is not exceeded.  If
-# the name is still too long such that the maximum filename path length
-# may be exceeded by appending -daily.html or other names to the name,
-# which is choosen to be 235 characters, then compute a MD5 hash of the
-# name, trim the name the name to 210 characters, which leaves enough space
-# for a 22 byte base64 MD5 digest, plus a separating '-' and plus the prefix,
-# and append the MD5 name.
-sub escape_name {
-  my $name = shift;
-
-  $name =~ s/:/_/g;
-  $name =~ s:/:_per_:g;
-  $name =~ s:\s+:_:g;
-  $name =~ s:%:_pct_:g;
-  $name =~ s:#:_num_:g;
-  $name =~ s:\*:_X_:g;
-
-  # Trim anything containing orcallator, orca.
-  $name =~ s:orcallator:o:g;
-  $name =~ s:orca:o:g;
-
-  # Remove trailing _'s.
-  $name =~ s:_+$::;
-  $name =~ s:_+,:,:g;
-
-  # Replace multiple _'s with one _, except when they follow a , which
-  # happens when the same group and subgroup appear for a new data
-  # source.
-  $name =~ s:,_{2,}:\200:g;
-  $name =~ s:_{2,}:_:g;
-  $name =~ s:\200:,__:g;
-
-  if (length($name) > 235) {
-    my $md5 = md5_base64($name);
-    $name   = substr($name, 0, 210) . "-$md5";
-
-    # Be careful to convert any / characters _, since / is a valid base64
-    # character and should not be used.
-    $name =~ s:/:_:g;
-  }
-
-  $name;
-}
-
-# Replace special characters from key names, remove redundant characters,
-# and shorten the names so the maximum path name is not exceeded.
-sub old_escape_name {
-  my $name = shift;
-  $name =~ s/:/_/g;
-  $name =~ s:/:_per_:g;
-  $name =~ s:\s+:_:g;
-  $name =~ s:%:_percent_:g;
-  $name =~ s:#:_number_:g;
-  $name =~ s:\*:_X_:g;
-  $name =~ s:([_,]){2,}:$1:g;
-
-  # Remove trailing _'s.
-  $name =~ s:_+$::;
-  $name =~ s:_+,:,:g;
-  $name;
-}
-
 sub find_files {
   unless (@_ == 4) {
-    confess "$0: find_files passed wrong number of arguments.\n";
+    confess "$0: find_files $INCORRECT_NUMBER_OF_ARGS";
   }
 
   my ($config_filename,
@@ -917,17 +989,21 @@
       $image_files_ref) = @_;
 
   my %new_found_files;
-  my %subgroup_fids;
+  my @subgroup_fids;
   my $found_new_files = 0;
 
-  foreach my $group_name (sort keys %config_groups) {
+  for (my $group_index=0; $group_index<@config_groups; ++$group_index) {
+    my $group_ref  = $config_groups[$group_index];
+    my $group_name = $config_groups_names[$group_index];
+
     # Find all the readable files matching the regular expression.
     my @fids;
-    foreach my $regexp (@{$config_groups{$group_name}{find_files}}) {
+    foreach my $regexp (@{$group_ref->{find_files}}) {
       push(@fids, perl_glob($regexp));
     }
     unless (@fids) {
-      warn "$0: warning: no files found for `find_files' for `group $group_name' in `$config_filename'.\n";
+      warn "$0: warning: no files found for `find_files' for `group ",
+           "$group_name' in `$config_filename'.\n";
       next;
     }
 
@@ -940,7 +1016,7 @@
       # Find the subgroup that the files belong in.
       my $filename = $sfile_fids[$fid];
       my $subgroup = undef;
-      foreach my $regexp (@{$config_groups{$group_name}{find_files}}) {
+      foreach my $regexp (@{$group_ref->{find_files}}) {
         my @result = ($filename =~ $regexp);
         if (@result) {
           # There there are no ()'s in the regexp, then change (1) to
@@ -965,17 +1041,26 @@
 
     # Create a new list of filenames sorted by subgroup name and
     # inside each subgroup sorted using the filename_compare
-    # configuration option function or by the Perl cmp function.  This
-    # will cause the created plots to appear in subgroup order.  The
-    # compare subroutine expects the input in the $a and $b package
-    # variables.  Since the subroutine was eval'ed in the Orca::Config
-    # package, the sort subroutine needs be in that package.
+    # configuration file function or by the default compare function
+    # that uses cmp to compare filenames.  This will cause the created
+    # plots to appear in subgroup order.  Note that the FIDs are not
+    # being sorted, but the filename the FID references.
+    #
+    # The compare subroutine expects the input in the $a and $b
+    # package variables and since the compare subroutine was eval'ed
+    # in the Orca::Config package it will look for these variables in
+    # Orca::Config.  Also, since sort cannot be passed a reference to
+    # a sorting subroutine stored in a hash (i.e. sort $a{b} @c), use
+    # a temporary variable.  Some versions of Perl will complain that
+    # fc is used only once, so declare the variable and set it in two
+    # separate statements.
     @fids = ();
     {
-      local *Orca::Config::fc = $config_groups{$group_name}{filename_compare};
+      package Orca::Config;
+      local *fc;
+      *fc = $group_ref->{filename_compare};
       foreach my $subgroup (sort keys %tmp_fids_by_subgroup) {
-        push(@fids,
-             sort Orca::Config::fc @{$tmp_fids_by_subgroup{$subgroup}});
+        push(@fids, sort fc @{$tmp_fids_by_subgroup{$subgroup}});
       }
     }
 
@@ -983,8 +1068,8 @@
     # manages that file and the images that are generated from the
     # file.  Delete from the list of filenames those files that have
     # not successfully created Orca::SourceDataFile objects.
-    for (my $i=0; $i<@fids;) {
-      my $fid = $fids[$i];
+    for (my $j=0; $j<@fids;) {
+      my $fid = $fids[$j];
       # Create the object that contains this file.  Take care if the
       # same file is being used in another group.
       unless (defined $new_found_files{$fid}) {
@@ -992,73 +1077,67 @@
           $new_found_files{$fid} = $old_found_files_ref->{$fid};
         } else {
           print "  $sfile_fids[$fid]\n" if $opt_verbose > 2;
-          my $data_file =
-            Orca::SourceFile->new($fid,
-                                  $config_groups{$group_name}{interval},
-                                  $config_options{late_interval},
-                                  $config_groups{$group_name}{reopen},
-                                  $config_groups{$group_name}{column_description},
-                                  $config_groups{$group_name}{date_source},
-                                  $config_groups{$group_name}{date_format},
-                                  $config_options{warn_email});
+          my $data_file = Orca::SourceFile->new($group_index, $fid);
           unless ($data_file) {
             warn "$0: warning: cannot process `$sfile_fids[$fid]'.\n";
-            splice(@fids, $i, 1);
+            splice(@fids, $j, 1);
             next;
           }
           $new_found_files{$fid} = $data_file;
           $found_new_files = 1;
         }
       }
-      ++$i;
+      ++$j;
     }
 
     # Register with each source data file the groups that use it.
     foreach my $fid (@fids) {
-      $new_found_files{$fid}->add_groups($group_name);
+      $new_found_files{$fid}->add_groups($group_index);
     }
 
     # Go through each source data file and register the new plots to
     # create.
     foreach my $fid (@fids) {
       my $subgroup_name = $tmp_subgroup_by_fid{$fid};
-      $new_found_files{$fid}->add_plots($group_name,
+      $new_found_files{$fid}->add_plots($group_index,
                                         $subgroup_name,
                                         $rrd_data_files_ref,
                                         $image_files_ref);
-      unless (defined $subgroup_fids{$group_name}{$subgroup_name}) {
-        $subgroup_fids{$group_name}{$subgroup_name} = [];
+      unless (defined $subgroup_fids[$group_index]{$subgroup_name}) {
+        $subgroup_fids[$group_index]{$subgroup_name} = [];
       }
-      push(@{$subgroup_fids{$group_name}{$subgroup_name}}, $fid);
+      push(@{$subgroup_fids[$group_index]{$subgroup_name}}, $fid);
     }
   }
   my @found_files = keys %new_found_files;
 
-  die "$0: no data source files found.\n" unless @found_files;
+  unless (@found_files) {
+    die "$0: no data files found.  Make sure `find_files' parameter is set ",
+        "properly.\n";
+  }
 
   # Now that all the source data files have been loaded, empty the state
   # object loaded from disk.
   undef %$orca_old_state;
 
-  return ($found_new_files,
-          \%new_found_files,
-          \%subgroup_fids);
+  return ($found_new_files, \%new_found_files, \@subgroup_fids);
 }
 
 # Print a message on the statistics of this running process.
 sub running_stats {
+  return unless $opt_verbose;
+
   my $ps_self = '@PS_SELF@';
   if ($ps_self) {
     $ps_self =~ s/PID/$$/g;
     system($ps_self);
   }
-  if ($opt_verbose) {
-    my $time_span = time - $start_time;
-    my $minutes   = int($time_span/60);
-    my $seconds   = $time_span - 60*$minutes;
 
-    printf "Current running time is %d:%02d minutes.\n", $minutes, $seconds;
-  }
+  my $time_span = time - $start_time;
+  my $minutes   = int($time_span/60);
+  my $seconds   = $time_span - 60*$minutes;
+
+  printf "Current running time is %d:%02d minutes.\n", $minutes, $seconds;
 }
 
 __END__
@@ -1071,7 +1150,7 @@
 
 =head1 SYNOPSIS
 
-  orca [-gifs] [-o] [-r] [-v [-v [-v]]] configuration_file
+  orca [-gifs] [-no-html] [-o] [-r] [-v [-v [-v]]] configuration_file
 
 =head1 DESCRIPTION
 
@@ -1082,8 +1161,8 @@
   * Reads white space separated data files.
   * Watches data files for updates and sleeps between reads.
   * Finds new files at specified times.
-  * Remembers the last modification times for files so they do not have to
-    be reread continuously.
+  * Remembers the last modification times for files so they do not
+    have to be reread continuously.
   * Can plot the same type of data from different files into different
     or the same PNGs.
   * Different plots can be created based on the filename.
@@ -1091,16 +1170,16 @@
   * Create arbitrary plots of data from different columns.
   * Ignore columns or use the same column in many plots.
   * Add or remove columns from plots without having to deleting RRDs.
-  * Plot the results of arbitrary Perl expressions, including mathematical
-    ones, using one or more columns.
-  * Group multiple columns into a single plot using regular expressions on
-    the column titles.
+  * Plot the results of arbitrary Perl expressions, including
+    mathematical ones, using one or more columns.
+  * Group multiple columns into a single plot using regular
+    expressions on the column titles.
   * Creates an HTML tree of HTML files and PNG plots.
   * Creates an index of URL links listing all available targets.
   * Creates an index of URL links listing all different plot types.
   * No separate CGI set up required.
-  * Can be run under cron or it can sleep itself waiting for file updates
-    based on when the file was last updated.
+  * Can be run under cron or it can sleep itself waiting for file
+    updates based on when the file was last updated.
 
 Orca is similar to but substantially different from other tools that
 record and display hourly, daily, monthly, and yearly data, such as
@@ -1112,6 +1191,34 @@
 
   http://www.munitions.com/~jra/cricket/
 
+=head1 INDEX
+
+This is an index of this manual:
+
+  Name
+  Synopsis
+  Description
+  Index
+  Examples
+  Command Line Options
+  Mailing Lists
+  Plot Prefixes
+  Author, Comments and Bugs
+  Recognized Signals
+  Architecture Issues
+  Installation and Configuration
+    Required Global Parameters
+    Optional Global Parameters
+    Group Parameters
+      Required Group Parameters
+      Optional Group Parameters
+    Plot Parameters
+      Required Plot Parameters
+      Data Source Optional Plot Parameters
+    Plotting Parameters
+    Multiple Plot Plotting Parameters
+  Implementation Notes
+
 =head1 EXAMPLES
 
 A static example of Orca is at
@@ -1123,11 +1230,16 @@
 
 =head1 COMMAND LINE OPTIONS
 
-Orca has only four command line options.  They are:
+Orca has only five command line options.  They are:
 
 B<-gifs>: Generate GIFs instead of PNGs.  Tell Orca to generate GIFs
 instead of PNGs.  You may not want to generate GIFs since PNGs are 1/3
-the size of GIFs and take less time to generate.
+the size of GIFs and take less time to generate.  The only reason to
+do this is if you are using a browser that does not support PNGs and
+only supports GIFs.
+
+B<-no-html>: Do not generate any HTML files and only update the
+images.
 
 B<-o>: Once.  This tells Orca to go through the steps of finding
 files, updating the RRDs, updating the PNGs, and creating the HTML
@@ -1149,6 +1261,89 @@
 configuration files can be found in the sample_configs directory with
 the distribution of this tool.
 
+=head1 MAILING LISTS
+
+Four mailing lists exist for Orca.  To subscribe to any of the mailing
+lists, please visit the URL below.  You have the parameter of choosing
+a digest form of the mailing list if you wish it when you subscribe to
+the mailing list or anytime thereafter.  To send email to any of these
+lists you must subscribe to the list.
+
+B<orca-announce at yahoogroups.com>
+
+  Home         http://groups.yahoo.com/group/orca-announce/
+  Subscribe    http://groups.yahoo.com/group/orca-announce/join
+  Archive      http://groups.yahoo.com/group/orca-announce/archive
+
+The orca-announce at yahoogroups.com mailing list is a LOW volume
+moderated mailing list for announcing stable releases of Orca.
+
+B<orca-users at yahoogroups.com>
+
+  Home         http://groups.yahoo.com/group/orca-users/
+  Subscribe    http://groups.yahoo.com/group/orca-users/join
+  Archive      http://groups.yahoo.com/group/orca-users/archive
+
+The orca-users at yahoogroups.com is a first stop mailing list for
+getting help in setting up and getting Orca running.  Problems
+relating to downloading, configuring, compiling the necessary Perl
+modules, and installing Orca belong here.  People interested anything
+more than this, such as developing data gathering modules or active
+Perl development, should be on one or both of the
+orca-discuss at yahoogroups.com or orca-developers at yahoogroups.com
+mailing lists.  Once you get Orca running to your satisfaction, you
+may want to remove yourself from this list.
+
+B<orca-discuss at yahoogroups.com>
+
+  Home         http://groups.yahoo.com/group/orca-discuss/
+  Subscribe    http://groups.yahoo.com/group/orca-discuss/join
+  Archive      http://groups.yahoo.com/group/orca-discuss/archive
+
+The orca-discuss at yahoogroups.com mailing list is for active users of
+Orca who are doing new interesting things with Orca and want to
+discuss Orca but are not interested in actively developing Orca source
+code.  These people are also not interested in helping people get Orca
+running on their systems.
+
+B<orca-developers at yahoogroups.com>
+
+  Home         http://groups.yahoo.com/group/orca-developers/
+  Subscribe    http://groups.yahoo.com/group/orca-developers/join
+  Archive      http://groups.yahoo.com/group/orca-developers/archive
+
+The orca-developers at yahoogroups.com mailing list is for hackers of
+Orca who actually hack and improve Orca.
+
+=head1 PLOT PREFIXES
+
+RRDtool generates the actual GIF or PNG plots and sometimes will need
+to scale the Y axis of the plot to have normal looking like numbers,
+such as 1 M instead of 1,000,000.  If you see a letter following the
+numbers in the bottom of the plot, then use that letter to scale the Y
+axis appropriately:
+
+  a  10e-18 Ato
+  f  10e-15 Femto
+  p  10e-12 Pico
+  n  10e-9  Nano
+  u  10e-6  Micro
+  m  10e-3  Milli
+  k  10e3   Kilo
+  M  10e6   Mega
+  G  10e9   Giga
+  T  10e12  Terra
+  P  10e15  Peta
+  E  10e18  Exa
+
+=head1 AUTHOR, COMMENTS, AND BUGS
+
+Please direct all Orca comments and bugs to one of the above mailing
+lists.
+
+If you wish to contact the author of Orca, Blair Zajac, directly,
+please email me at blair at gps.caltech.edu.
+
 =head1 RECOGNIZED SIGNALS
 
 Orca, when it received the HUP signal, will look for new source data
@@ -1164,8 +1359,8 @@
 good amount of IO.  The machine running Orca should always have the
 B<rrd_dir> directory locally mounted.  It is more important this
 B<rrd_dir> be locally stored than B<html_dir> for performance
-concerns.  The two options B<html_dir> and B<rrd_dir> are described in
-more detail below.
+concerns.  The two parameters B<html_dir> and B<rrd_dir> are described
+in more detail below.
 
 =head1 INSTALLATION AND CONFIGURATION
 
@@ -1175,16 +1370,16 @@
 a line.  Lines that begin with whitespace are concatenated onto the
 last key's value.
 
-There are three main groups of options in a Orca confg: general
-options, file specific options, and plot specific options.  General
-options may be used by the file and plot specific options.  If an
-option is required, then it is only placed one time into the
-configuration file.
+There are three main groups of parameters in a Orca configuration
+file: global parameters, file specific parameters, and plot specific
+parameters.  Global parameters may be used by the group and plot
+specific parameters.  If an parameter is required, then it is only
+placed one time into the configuration file.
 
-General options break down into two main groups, required and options.
-These are the required options:
+Global parameters break down into two main groups, required and
+optional.  These are the required parameters:
 
-=head2 Required General Options
+=head2 Required Global Parameters
 
 =over 4
 
@@ -1194,8 +1389,8 @@
 all input data files and the Unix epoch time when they were last read
 by Orca into a state file.  The value for B<state_file> must be a
 valid, writable filename.  If I<filename> does not begin with a / and
-the B<base_dir> option was set, then the B<base_dir> directory will be
-prepended to the I<filename>.
+the B<base_dir> parameter was set, then the B<base_dir> directory will
+be prepended to the I<filename>.
 
 Each entry for a data input file is roughly 100 bytes, so for small
 sites, this file will not be large.
@@ -1208,8 +1403,9 @@
 directory should be on a disk locally attached to the host running
 Orca, but is not necessary.
 
-If I<directory> does not begin with a / and the B<base_dir> option was
-set, then the B<base_dir> directory will be prepended to I<directory>.
+If I<directory> does not begin with a / and the B<base_dir> parameter
+was set, then the B<base_dir> directory will be prepended to
+I<directory>.
 
 =item B<rrd_dir> I<directory>
 
@@ -1220,8 +1416,9 @@
 slowed down.  It is more important this B<rrd_dir> be locally stored
 than B<html_dir> for performance concerns.
 
-If I<directory> does not begin with a / and the B<base_dir> option was
-set, then the B<base_dir> directory will be prepended to I<directory>.
+If I<directory> does not begin with a / and the B<base_dir> parameter
+was set, then the B<base_dir> directory will be prepended to
+I<directory>.
 
 If B<rrd_dir> is not defined, then B<base_dir> will be used as
 B<rrd_dir>.  Orca will quit with an error if both B<rrd_dir> and
@@ -1231,15 +1428,26 @@
 
 If B<base_dir> is set, then it is used to prepend to any file or
 directory based names that do not begin with /.  These are currently
-B<state_file>, B<html_dir>, B<rrd_dir>, and the B<find_files> option
-in the B<group> options.
+B<state_file>, B<html_dir>, B<rrd_dir>, and the B<find_files>
+parameter in the B<group> section.
 
 =back
 
-=head2 Optional General Options
+=head2 Optional Global Parameters
 
 =over 4
 
+=item B<require> I<package name> I<version number>
+
+B<require> allows the configuration file to specify the minimum
+required version of a package to run as in the same way that B<use>
+and B<require> are used in Perl programs.  Here, both I<package name>
+and I<version number> are required and I<version number> must be a
+number, not a general Perl expression.
+
+Currently, only the version of Orca can be specified and I<package
+name> must be set to Orca.
+
 =item B<late_interval> I<Perl expression>
 
 B<late_interval> is used to calculate the time interval between a
@@ -1271,7 +1479,14 @@
   1) When a file did exist and now is gone.
   2) When a file was being updated regularly and then no longer is updated.
 
-By default, nobody is emailed.
+The only way to disable these email messages is by commenting out
+warn_email or by not giving it an argument:
+
+  #warn_email  root at localhost
+
+or
+
+  warn_email
 
 =item B<expire_images> 1
 
@@ -1280,7 +1495,7 @@
 being used, then the following modifications must added to srm.conf or
 httpd.conf.
 
-  < 
+  <
   < #MetaDir .web
   ---
   >
@@ -1295,20 +1510,28 @@
 
 =item B<find_times> I<hours:minutes> [I<hours:minutes> ...]
 
-The B<find_times> option is used to tell Orca when to go and find new
-files.  This particularly useful when new input data files are created
-at midnight.  In this case, something like
-
-  find_times 0:10
-
-would work.
+The B<find_times> parameter is used to tell Orca when to go and find
+new files.  This particularly useful when new input data files are
+created at midnight.  In this case, something like this may work:
+
+  # Find files at the following times:
+  #    0:10 to pick up new orcallator files for the new day.
+  #    1:00 to pick up late comer orcallator files for the new day.
+  #    6:00 to pick up new files before the working day.
+  #   12:00 to pick up new files during the working day.
+  #   19:00 to pick up new files after the working day.
+  find_times 0:10 1:00 6:00 12:00 19:00
+
+If you add too many different times to find_times, then Orca may spend
+a large amount of time finding files, so it's best just to have it
+find files when you know that they will appear.
 
 By default, files are only searched for when Orca starts up.
 
 =item B<html_top_title> I<text> ...
 
 The I<text> is placed at the top of the main index.html that Orca
-creates.  By default, no addition text is placed at the top of the
+creates.  By default, no additional text is placed at the top of the
 main index.html.
 
 =item B<html_page_header> I<text> ...
@@ -1322,24 +1545,67 @@
 creates.  By default, no additional text is placed at the bottom of
 each HTML file.
 
-=item B<sub_dir> I<directory>
+=item B<generate_hourly_plot> I<value>
+
+This tells Orca if it should or should not create a hourly plot of the
+data.  By default, the daily plot is always created, unless I<value>
+is set to 0.  This may be useful if it does not make any sense
+plotting the data on this timescale.
+
+=item B<generate_daily_plot> I<value>
+
+This tells Orca if it should or should not create a daily plot of the
+data.  By default, the daily plot is always created, unless I<value>
+is set to 0.  This may be useful if it does not make any sense
+plotting the data on this timescale.
+
+=item B<generate_weekly_plot> I<value>
+
+This tells Orca if it should or should not create a weekly plot of the
+data.  By default, the weekly plot is always created, unless I<value>
+is set to 0.  This may be useful if it does not make any sense
+plotting the data on this timescale.
+
+=item B<generate_monthly_plot> I<value>
+
+This tells Orca if it should or should not create a monthly plot of
+the data.  By default, the monthly plot is always created, unless
+I<value> is set to 0.  This may be useful if it does not make any
+sense plotting the data on this timescale.
 
-In certain cases Orca will not create sub directories for the
-different groups of files that it processes.  If you wish to force
-Orca to create sub directories, then do this
+=item B<generate_quarterly_plot> I<value>
 
-  sub_dir 1
+This tells Orca if it should or should not create a quarterly plot of
+the data.  By default, the quarterly plot is always created, unless
+I<value> is set to 0.  This may be useful if it does not make any
+sense plotting the data on this timescale.
+
+=item B<generate_yearly_plot> I<value>
+
+This tells Orca if it should or should not create a yearly plot of the
+data.  By default, the yearly plot is always created, unless I<value>
+is set to 0.  This may be useful if it does not make any sense
+plotting the data on this timescale.
+
+=item B<max_filename_length> I<value>
+
+When creating plots and HTML files Orca can create filenames that have
+an individual path element up to 250 bytes long.  Some web servers
+and/or web browsers cannot handle filenames this long and this
+configuration file parameter allows the user to reduce the length of
+the filenames that Orca creates.  The default I<value> is 250 and
+I<value> must be greater than 63.
 
 =back
 
-=head2 Group Options
+=head2 Group Parameters
 
 The next step in configuring Orca is telling where to find the files
 to use as input, a description of the columns of data comprising the
 file, the interval at which the file is updated, and where the
 measurement time is stored in the file.  This is stored into a group.
 
-A generic example of a group and its options are:
+A generic example of a group and its parameters are:
 
   group GROUP_NAME1 {
   find_files		filename1 filename2 ...
@@ -1358,18 +1624,18 @@
 
 The key for a group, in this example GROUP_NAME1 and GROUP_NAME2, is a
 descriptive name that is unique for all files and is used later when
-the plots to create are defined.  Files that share the same general
-format of column data may be grouped together.  The options for a
+the plots to create are defined.  Files that share the same global
+format of column data may be grouped together.  The parameters for a
 particular group must be enclosed in the curly brackets {}'s.  An
 unlimited number of groups may be listed.
 
-=head2 Required Group Options
+=head2 Required Group Parameters
 
 =over 4
 
 =item B<find_files> I<path|regexp> [I<path|regexp> ...]
 
-The B<find_files> option tells Orca what data files to use as its
+The B<find_files> parameter tells Orca what data files to use as its
 input.  The arguments to B<find_files> may be a simple filename, a
 complete path to a filename, or a regular expression to find files.
 The regular expression match is not the normal shell globing that the
@@ -1378,8 +1644,8 @@
 
   find_files /data/source1 /data/source2
 
-will have Orca use /data/source1 and /data/source2 as the inputs to Orca.
-This could have also been written as
+will have Orca use /data/source1 and /data/source2 as the inputs to
+Orca.  This could have also been written as
 
   find_files /data/source\d
 
@@ -1422,13 +1688,13 @@
 hence all the (?:...) for matching anything else.
 
 If any of the paths or regular expressions given to B<find_files> do
-not begin with a / and the B<base_dir> option was set, then the
+not begin with a / and the B<base_dir> parameter was set, then the
 B<base_dir> directory will be prepended to the path or regular
 expression.
 
 =item B<interval> I<seconds>
 
-The B<interval> options takes the number of seconds between updates
+The B<interval> parameters takes the number of seconds between updates
 for the input data files listed in this group.
 
 =item B<column_description> I<column_name> [I<column_name> ...]
@@ -1459,35 +1725,45 @@
 
 =item B<date_source> file_mtime
 
-The B<date_source> option tells Orca where time and date of the
-measurement is located.  The first form of the B<date_source> options
-lists the column name as given to B<column_description> that contains
-the Unix epoch time.  The second form with the file_mtime argument
-tells Orca that the date and time for any new data in the file is the
-last modification time of the file.
-
-=item B<date_format> I<string>
-
-The B<date_format> option is only required if the column_name argument
-to B<date_source> is used.  Current, this argument is not used by
-Orca.
+The B<date_source> parameter tells Orca where time and date of the
+measurement is located.  The first form of the B<date_source>
+parameters lists the column name as given to B<column_description>
+that contains the Unix epoch time.  The second form with the
+file_mtime argument tells Orca that the date and time for any new data
+in the file is the last modification time of the file.
+
+=item B<date_parse> I<Perl subroutine>
+
+To support converting arbitrary strings in the input source data files
+that somehow represent time into an Unix epoch time usable by Orca,
+the B<date_source> parameter can be used.  The value for B<date_parse>
+is a Perl subroutine that accepts two arguments, the first being the
+name of the file where the data is loaded and the second the string
+from the `date_source' column that contains some time information.
+The subroutine should return the Unix epoch time.  If this parameter
+is not specified, then Orca assumes that the string holds the Unix
+epoch time.
+
+This Perl subroutine is only used if the file's date source is not
+specified to be the file's last modified time as indicated to Orca by
+use of the B<date_source> file_mtime configuration file parameter.
 
 =back
 
-=head2 Optional Group Options
+=head2 Optional Group Parameters
 
 =over 4
 
 =item B<filename_compare> I<Perl subroutine>
 
-The B<filename_compare> option is used to sort the found filenames in
-a particular group.  This function must be written as though it were
-being passed to the Perl sort() function, which takes the two items to
-compare in the package global $a and $b variables instead of the @_
-array.
+The B<filename_compare> parameter is used to sort the found filenames
+in a particular group.  This function must be written as though it
+were being passed to the Perl sort() function, which takes the two
+items to compare in the package global $a and $b variables instead of
+the @_ array.
 
-Use of this option has an additional effect on letting Orca know when
-it can flush data to the RRD files.  It determines this when it
+Use of this parameter has an additional effect on letting Orca know
+when it can flush data to the RRD files.  It determines this when it
 compares the previously loaded filename to the filename about to be
 loaded using the B<filename_compare> function.  If the result of the
 comparison is greater than 1, then the data is flushed.  If the
@@ -1517,20 +1793,26 @@
 not cause a flush but when orcallator-2000-02-16 is about to be
 loaded, previously loaded data will be flushed.
 
-If the B<filename_compare> option is not used, then the filenames are
-sorted using the Perl <=> operator and data is not flushed until all
-of it is loaded.
+If the B<filename_compare> parameter is not used, then the filenames
+are sorted using the Perl <=> operator and data is not flushed until
+all of it is loaded.
+
+=item B<late_interval> I<Perl expression>
+
+Each group can have its own B<late_interval> that overrides the
+late_interval global parameter.  If the group's late_interval is not
+specified, then the global one is used.
 
 =item B<reopen> 1
 
-Using the B<reopen> option for a group instructs Orca to close and
+Using the B<reopen> parameter for a group instructs Orca to close and
 reopen any input data files when there is new data to be read.  This
 is of most use when an input data file is erased and rewritten by some
 other process.
 
 =back
 
-=head2 Plot Options
+=head2 Plot Parameters
 
 The final step is to tell Orca what plots to create and how to create
 them.  The general format for creating a plot is:
@@ -1552,19 +1834,19 @@
 Unlike the group, there is no key for generating a plot.  An unlimited
 number of plots can be created.
 
-Some of the plot options if they have the two characters %g or %G will
-perform a substitution of this substring with the group name from the
-find_files ()'s matching.  %g gets replaced with the exact match from
-() and %G gets replaced with the first character capitalized.  For
-example, if
+Some of the plot parameters if they have the two characters %g or %G
+will perform a substitution of this substring with the group name from
+the find_files ()'s matching.  %g gets replaced with the exact match
+from () and %G gets replaced with the first character capitalized.
+For example, if
 
   find_files /(olympia)/data
 
 was used to locate a file, then %g will be replaced with olympia and
 %G replaced with Olympia.  This substitution is performed on the
-B<title> and B<legend> plot options.
+B<title> and B<legend> plot parameters.
 
-=head2 Required Plot Options
+=head2 Required Plot Parameters
 
 =over 4
 
@@ -1578,19 +1860,19 @@
 
 =item B<data> I<regular expression>
 
-The B<data> plot option tells Orca the data sources to use to place in
-a single PNG plot.  At least one B<data> option is required for a
-particular plot and as many as needed may be placed into a single
+The B<data> plot parameter tells Orca the data sources to use to place
+in a single PNG plot.  At least one B<data> parameter is required for
+a particular plot and as many as needed may be placed into a single
 plot.
 
 Two forms of arguments to B<data> are allowed.  The first form allows
 arbitrary Perl expressions, including mathematical expressions, that
 result in a number as a data source to plot.  The expression may
 contain the names of the columns as found in the group given to the
-B<source> option.  The column names must be separated with white space
-from any other characters in the expression.  For example, if you have
-number of bytes per second input and output and you want to plot the
-total number of bits per second, you could do this:
+B<source> parameter.  The column names must be separated with white
+space from any other characters in the expression.  For example, if
+you have number of bytes per second input and output and you want to
+plot the total number of bits per second, you could do this:
 
   plot {
   source	bytes_per_second
@@ -1616,7 +1898,7 @@
                      hme0IErr/s hme0OErr/s
                      hme1IErr/s hme1OErr/s
   .
-  .  
+  .
   }
 
   plot {
@@ -1670,7 +1952,7 @@
   hme1 Input & Output Errors per Second
 
 If you wanted to have the links listed in order of hme0 and hme1, then
-you would add the B<flush_regexps> option to tell Orca to find all
+you would add the B<flush_regexps> parameter to tell Orca to find all
 regular expression matches for a particular plot set and all plot sets
 before the plot set containing B<flush_regexps> before continuing on
 to the next plot set.  For example, if
@@ -1700,23 +1982,25 @@
 
 =back
 
-=head2 Data Source Optional Plot Options
+=head2 Data Source Optional Plot Parameters
 
-The following options are plot optional.  Like the B<data> option,
-multiple copies of these may be specified.  The first option of a
-particular type sets the option for the first B<data> option, the
-second option refers to the second B<data> option, etc.
+The following parameters are optional.  Like the B<data> parameter,
+multiple copies of these may be specified.  The first parameter of a
+particular type sets the parameter for the first B<data> parameter,
+the second parameter refers to the second B<data> parameter, etc.
 
 =over 4
 
 =item B<data_type> I<type>
 
 When defining data types, Orca uses the same data types as provided by
-RRD.  These are (a direct quote from the RRDcreate manual page):
+RRD.
+
+These are (a direct quote from the RRDcreate manual page):
 
 =over 4
 
-=item B<GAUGE> 
+=item B<GAUGE>
 
 is for things like temperatures or number of people in a room or value
 of a RedHat share.
@@ -1740,7 +2024,7 @@
 overflow checks. So if your counter does not reset at 32 or 64 bit you
 might want to use DERIVE and combine it with a MIN value of 0.
 
-=item B<ABSOLUTE> 
+=item B<ABSOLUTE>
 
 is for counters which get reset upon reading. This is used for fast
 counters which tend to overflow. So instead of reading them normally
@@ -1749,17 +2033,50 @@
 
 =back
 
-If the B<data_type> is not specified for a B<data> option, it defaults
-to GAUGE.
+If there are no B<data_type>'s specified for a plot, then all of the
+data_types for the data's default to GAUGE.  If at least one data_type
+is specified and there are more data's than data_types's, then the
+last specified data_type will be used for all of the data's were not
+given a data_type.  In the following example, there are three data's
+and only two data_types's.  The data_type of COUNTER will be applied
+to column3 and column4.
+
+  plot {
+  data		column1
+  data		column2
+  data		column3
+  data		column4
+  data_type	DERIVE
+  data_type	COUNTER
+  }
+
+
+The B<data_type> is only used once when the RRD files are created as a
+parameter to rrdcreate.  If you want to change B<data_type> after the
+RRD files have been created and you want to change these values, then
+you have to modify Orca's configuration file, remove the RRD files and
+let Orca rebuild them.
+
+If there are multiple plots that refer to the same RRD and if the
+different plots have different data_types, then the first plot that
+creates the RRD file will set the data_type.
 
 =item B<data_min> I<number>
 
 =item B<data_max> I<number>
 
 B<data_min> and B<data_max> are optional entries defining the expected
-range of the supplied data.  If B<data_min> and/or B<data_max> are
-defined, any value outside the defined range will be regarded as
-I<*UNKNOWN*>.
+range of the supplied data and used by RRDtool and not by Orca to
+limit the range of data stored in the RRD files.  If the input value
+that Orca passes to RRDtool is less than B<data_min> or greater than
+B<data_max> then RRD will store I<*UNKNOWN*> in its place instead.
+
+These values are only used once when the RRD files are created as a
+parameter to rrdcreate.  If you want to change either B<data_min> or
+B<data_max> after the RRD files have been created and you want to
+change these values, then you have to modify Orca's configuration file
+and either remove the RRD files and let Orca rebuild them or find a
+separate RRD program that will modify the minimum and maximum values.
 
 If you want to specify the second data sources minimum and maximum but
 do not want to limit the first data source, then set the I<number>'s
@@ -1768,25 +2085,40 @@
   plot {
   data		column1
   data		column2
+  data		column3
   data_min	U
   data_max	U
   data_min	0
   data_max	100
   }
 
+If there are no minimum or maximum values specified for a particular
+plot, then there will no limit applied to any input data given to the
+RRD file since the value 'U' is passed to rrdcreate.  If at least one
+data_min or data_max is specified and there are more data's than
+data_*'s, then the last specified data_* will be used for all of the
+data's were not given a data_*'.  In the example above, there are
+three data's and only two data_*'s.  The minimum of 0 and maximum of
+100 will be applied to column3.
+
+If there are multiple plots that refer to the same RRD and if the
+different plots have different data_min's and data_max's, then the
+first plot that creates the RRD file will set the data_min's and
+data_max's.
+
 =item B<color> I<rrggbb>
 
-The optional B<color> option specifies the color to use for a
+The optional B<color> parameter specifies the color to use for a
 particular plot.  The color should be of the form I<rrggbb> in
 hexadecimal.
 
 =item B<flush_regexps> 1
 
-Using the B<flush_regexps> option tells Orca to make sure that the
-plot set including this option and all previous plot sets have matched
-all of the columns with their regular expressions.  See the above
-description of using regular expressions in the B<data> option for an
-example.
+Using the B<flush_regexps> parameter tells Orca to make sure that the
+plot set including this parameter and all previous plot sets have
+matched all of the columns with their regular expressions.  See the
+above description of using regular expressions in the B<data>
+parameter for an example.
 
 =item B<required> 1
 
@@ -1799,12 +2131,12 @@
 
   required 1
 
-in the options for a particular plot.  In this case, Orca will record
-a I<*UNKNOWN*> value for all invalid data.
+in the parameters for a particular plot.  In this case, Orca will
+record a I<*UNKNOWN*> value for all invalid data.
 
 =back
 
-=head2 Plotting Options
+=head2 Plotting Parameters
 
 =over 4
 
@@ -1816,44 +2148,44 @@
 
 =item B<plot_width> I<number>
 
-Using the B<plot_width> option specifies how many pixels wide the
+Using the B<plot_width> parameter specifies how many pixels wide the
 drawing area inside the PNG is.
 
 =item B<plot_height> I<number>
 
-Using the B<plot_height> option specifies how many pixels high the
+Using the B<plot_height> parameter specifies how many pixels high the
 drawing area inside the PNG is.
 
 =item B<plot_min> I<number>
 
-By setting the B<plot_min> option, the minimum value to be graphed is
-set.  By default this will be auto-configured from the data you select
-with the graphing functions.
+By setting the B<plot_min> parameter, the minimum value to be graphed
+is set.  By default this will be auto-configured from the data you
+select with the graphing functions.
 
 =item B<plot_max> I<number>
 
-By setting the B<plot_max> option, the minimum value to be graphed is
-set.  By default this will be auto-configured from the data you select
-with the graphing functions.
+By setting the B<plot_max> parameter, the minimum value to be graphed
+is set.  By default this will be auto-configured from the data you
+select with the graphing functions.
 
 =item B<rigid_min_max>
 
 Normally Orca will automatically expand the lower and upper limit if
 the graph contains a value outside the valid range.  By setting the
-B<rigid_min_max> option, this is disabled.
+B<rigid_min_max> parameter, this is disabled.
 
 =item B<logarithmic>
 
 Normally Orca will use a linear scale for the Y axis.  If a plot
-contains this option, then a logarithmic scale will be used.
+contains this parameter, then a logarithmic scale will be used.
 
 =item B<title> <text>
 
-Setting the B<title> option sets the title of the plot.  If you place
-%g or %G in the title, it is replaced with the text matched by any
-()'s in the group B<find_files> option.  %g gets replaced with the
-exact text matched by the ()'s and %G is replaced with the same text,
-except the first character is capitalized.
+Setting the B<title> parameter sets the title of the plot.  If you
+place %g or %G in the title, it is replaced with the text matched by
+any ()'s in the group B<find_files> parameter.  %g gets replaced with
+the exact text matched by the ()'s and %G is replaced with the same
+text, except the first character is capitalized.
 
 =item B<y_legend> <text>
 
@@ -1862,17 +2194,17 @@
 
 =back
 
-=head2 Multiple Plot Plotting Options
+=head2 Multiple Plot Plotting Parameters
 
 =over 4
 
-The following options should be specified multiple times for each data
-source in the plot.
+The following parameters should be specified multiple times for each
+data source in the plot.
 
 =item B<line_type> I<type>
 
-The B<line_type> option specifies the type of line to plot a
-particular data set with.  The available options are: LINE1, LINE2,
+The B<line_type> parameter specifies the type of line to plot a
+particular data set with.  The available parameters are: LINE1, LINE2,
 and LINE3 which generate increasingly wide lines, AREA, which does the
 same as LINE? but fills the area between 0 and the graph with the
 specified color, and STACK, which does the same as LINE?, but the
@@ -1882,9 +2214,56 @@
 
 =item B<legend> I<text>
 
-The B<legend> option specifies for a single data source the comment
+The B<legend> parameter specifies for a single data source the comment
 that is placed below the PNG plot.
 
+=item B<summary_format> I<format>
+
+The B<summary_format> option specifies the format for the summary
+values, as passed to the RRDtool GPRINT function.  In the format
+string there should be a '%lf' or '%le' marker in the place where the
+number should be printed.
+
+If an additional '%s' is found AFTER the marker, the value will be
+scaled and an appropriate SI magnitude unit will be printed in place
+of the '%s' marker.  The scaling will take the base of the plot into
+consideration.
+
+If a '%S' is used instead of a '%s', then instead of calculating the
+appropriate SI magnitude unit for this value, the previously
+calculated SI magnitude unit will be used.  This is useful if you want
+all the values in a PRINT statement to have the same SI magnitude
+unit.  If there was no previous SI magnitude calculation made, then
+'%S' behaves like a '%s', unless the value is 0, in which case it does
+not remember a SI magnitude unit and a SI magnitude unit will only be
+calculated when the next '%s' is seen or the next '%S' for a non-zero
+value.
+
+The same format is used for each number within a single summary line,
+but you can specify multiple summary_format options if there are
+multiple plots on the graph:
+
+  plot {
+  source		things
+  data			some
+  data			other
+  data			things
+  data			something_else
+  summary_format	%.0lf
+  summary_format	%4.1f %s
+  color			0000ff
+  color			ff0000
+  }
+
+If there are no summary format specifiers, then the default format of
+'%9.3lf %S' will be used for all of the data summary lines.  If at
+least one summary_format is specified and there are more data's than
+summary_format's, then the last specified summary_format will be used
+for all of the data summary lines that were not given a
+summary_format.  In the example above, there are four data's and only
+two summary_format's.  The format '%4.1f %s' will be used for the
+`things' and `something_else' data summary lines.
+
 =back
 
 =head1 IMPLEMENTATION NOTES
@@ -1901,64 +2280,6 @@
 the value being the anonymous subroutine array.  This saves in memory
 and in processing time.
 
-=head1 MAILING LISTS
-
-Four mailing lists exist for Orca.  To subscribe to any of the mailing
-lists, please visit the URL below.  You have the option of choosing a
-digest form of the mailing list if you wish it when you subscribe to
-the mailing list or anytime thereafter.  To send email to any of these
-lists you must subscribe to the list.
-
-B<orca-announce>
-
-  Subscribe http://www.onelist.com/subscribe/orca-announce
-  Archive   http://www.onelist.com/archive/orca-announce
-
-The orca-announce at onelist.com mailing list is a LOW volume moderated
-mailing list for announcing stable releases of Orca.
-
-B<orca-users at onelist.com>
-
-  Subscribe http://www.onelist.com/subscribe/orca-users
-  Archive   http://www.onelist.com/archive/orca-users
-
-The orca-users at onelist.com is a first stop mailing list for getting
-help in setting up and getting Orca running.  Problems relating to
-downloading, configuring, compiling the necessary Perl modules, and
-installing Orca belong here.  People interested anything more than
-this, such as developing data gathering modules or active Perl
-development, should be on one or both of the orca-discuss at onelist.com
-or orca-developers at onelist.com mailing lists.  Once you get Orca
-running to your satisfaction, you may want to remove yourself from
-this list.
-
-B<orca-discuss at onelist.com>
-
-  Subscribe http://www.onelist.com/subscribe/orca-discuss
-  Archive   http://www.onelist.com/archive/orca-discuss
-
-The orca-discuss at onelist.com mailing list is for active users of Orca
-who are doing new interesting things with Orca and want to discuss
-Orca but are not interested in actively developing Orca source code.
-These people are also not interested in helping people get Orca
-running on their systems.
-
-B<orca-developers at onelist.com>
-
-  Subscribe http://www.onelist.com/subscribe/orca-developers
-  Archive   http://www.onelist.com/archive/orca-developers
-
-The orca-developers at onelist.com mailing list is for hackers of Orca
-who actually hack and improve Orca.
-
-=head1 AUTHOR, COMMENTS, AND BUGS
-
-Please direct all Orca comments and bugs to one of the above mailing
-lists.
-
-If you wish to contact the author or Orca, Blair Zajac, directly,
-please email me to blair at akamai.com.
-
 =cut
 
 These are hexadecimal forms of GIFs used by Orca.

Modified: trunk/orca/docs/manual.html
==============================================================================
--- trunk/orca/docs/manual.html	(original)
+++ trunk/orca/docs/manual.html	Sat Jul 13 21:25:42 2002
@@ -77,9 +77,9 @@
 
 
 "Company, Paul" wrote:
-> 
+>
 > Observations on Solaris 2.x:
-> 
+>
 >         + Average # Processes in Run Queue
 >           and
 >           System Load
@@ -87,12 +87,12 @@
 >         + Bits Per Second does not work, although the Packets Per Second
 > does.
 >         + No definitions for Data Sets
-> 
+>
 > File this stuff away or not.
 > Just though you might want this data.
 > I'll send you the fixes if I find them.
-> 
+>
 > --pjc
-> 
+>
 >
 

Modified: trunk/orca/docs/Makefile.in
==============================================================================
--- trunk/orca/docs/Makefile.in	(original)
+++ trunk/orca/docs/Makefile.in	Sat Jul 13 21:25:42 2002
@@ -1,7 +1,9 @@
+ at SET_MAKE@
+
 prefix	= @prefix@
 mandir	= @mandir@/man1
-MKDIR	= @MKDIR@
 INSTALL	= @INSTALL@
+MKDIR	= @MKDIR@
 ORCA	= ../src/orca.pl
 
 TARGETS	= orca.man orca.html orca.txt
@@ -23,7 +25,6 @@
 
 Makefile: Makefile.in
 	cd .. && CONFIG_FILES=docs/Makefile ./config.status
-	$(MAKE)
 
 clean:
 	$(RM) $(TARGETS) pod2html-*

Modified: trunk/orca/docs/REQUIREMENTS
==============================================================================
--- trunk/orca/docs/REQUIREMENTS	(original)
+++ trunk/orca/docs/REQUIREMENTS	Sat Jul 13 21:25:42 2002
@@ -7,7 +7,7 @@
 		Can have brand new data fields at any point in time
 
 	Internal Storage
-		
+
 	Methods
 
 Orca::RRDFile

Modified: trunk/orca/README
==============================================================================
--- trunk/orca/README	(original)
+++ trunk/orca/README	Sat Jul 13 21:25:42 2002
@@ -40,7 +40,7 @@
 explain how the data files Orca uses are created, maintained, and used
 to create the images that Orca creates.  Read about RRDtool at
 
-    http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/
+    http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
 
 DATA COLLECTION TOOLS
 =====================
@@ -87,16 +87,18 @@
 the mailing list or anytime thereafter.  To send email to any of these
 lists you must subscribe to the list.
 
-orca-announce at onelist.com
-    Subscribe    http://www.onelist.com/subscribe/orca-announce
-    Archive      http://www.onelist.com/archive/orca-announce
+orca-announce at yahoogroups.com
+    Home         http://groups.yahoo.com/group/orca-announce/
+    Subscribe    http://groups.yahoo.com/group/orca-announce/join
+    Archive      http://groups.yahoo.com/group/orca-announce/archive
 
     This is a LOW volume moderated mailing list for announcing stable
     releases of Orca.
 
-orca-users at onelist.com
-    Subscribe    http://www.onelist.com/subscribe/orca-users
-    Archive      http://www.onelist.com/archive/orca-users
+orca-users at yahoogroups.com
+    Home         http://groups.yahoo.com/group/orca-users/
+    Subscribe    http://groups.yahoo.com/group/orca-users/join
+    Archive      http://groups.yahoo.com/group/orca-users/archive
 
     This mailing list is a first stop mailing list for getting help
     in setting up and getting Orca running.  Problems relating to
@@ -107,9 +109,10 @@
     Once you get Orca running to your satisfaction, you may want to
     remove yourself from this list.
 
-orca-discuss at onelist.com
-    Subscribe    http://www.onelist.com/subscribe/orca-discuss
-    Archive      http://www.onelist.com/archive/orca-discuss
+orca-discuss at yahoogroups.com
+    Home         http://groups.yahoo.com/group/orca-discuss/
+    Subscribe    http://groups.yahoo.com/group/orca-discuss/join
+    Archive      http://groups.yahoo.com/group/orca-discuss/archive
 
     This mailing list is for active users of Orca who are doing new
     interesting things with Orca and want to discuss Orca but are not
@@ -117,9 +120,10 @@
     are also not interested in helping people get Orca running on their
     systems.
 
-orca-developers at onelist.com
-    Subscribe    http://www.onelist.com/subscribe/orca-developers
-    Archive      http://www.onelist.com/archive/orca-developers
+orca-developers at yahoogroups.com
+    Home         http://groups.yahoo.com/group/orca-developers/
+    Subscribe    http://groups.yahoo.com/group/orca-developers/join
+    Archive      http://groups.yahoo.com/group/orca-developers/archive
 
     This mailing list is for people who are interested in actively
     developing, fixing and improving Orca's source code and related data
@@ -133,17 +137,19 @@
 AUTHOR
 ======
 
-These two tools were written by Blair Zajac.  I welcome any patches for
-bugs or improvements, comments and suggestions.  Please send any Orca
-correspondence to orca-users at onelist.com or orca-developers at onelist.com,
-which I read and participate on.
+These two tools were written by Blair Zajac.  I welcome any patches
+for bugs or improvements, comments and suggestions.  Please send any
+Orca correspondence to orca-users at yahoogroups.com or
+orca-developers at yahoogroups.com, which I read and participate on.
 
-If you wish to contact me directly, my email address is bzajac at akamai.com.
+If you wish to contact me directly, my email address is
+blair at gps.caltech.edu.
 
 NAMING OF ORCA
 ==============
 
-I originally named Orca FMRTG, but after asking my wife
-http://www.rothschildimage.com for some suggestions, she came up with
-Orca.  It turns out that there are only one or two small programs on
-the Internet named Orca, so we both were happy to hear this.
+I originally named Orca FMRTG, but after asking my wife Ashley
+Rothschild (http://www.rothschildimage.com) for some suggestions, she
+came up with Orca.  It turns out that there are only one or two small
+programs on the Internet named Orca, so we both were happy to hear
+this.

Added: trunk/orca/contrib/Makefile.in
==============================================================================
--- trunk/orca/contrib/Makefile.in	(original)
+++ trunk/orca/contrib/Makefile.in	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,34 @@
+ at SET_MAKE@
+
+SUBDIRS = orcaservices rotate_orca_graphs
+
+all:	Makefile $(TARGETS)
+	@for dir in $(SUBDIRS); do					\
+		echo "cd $$dir && $(MAKE) CFLAGS=$(CFLAGS)";		\
+		(cd $$dir && $(MAKE) CFLAGS="$(CFLAGS)");		\
+	done
+
+# Users will need to install the contributed programs by hand.
+install:
+
+install_contrib:
+	@for dir in $(SUBDIRS); do					\
+		echo "cd $$dir && $(MAKE) CFLAGS=$(CFLAGS) install";	\
+		(cd $$dir && $(MAKE) CFLAGS="$(CFLAGS)" install);	\
+	done
+
+clean:
+	@for dir in $(SUBDIRS); do					\
+		echo "cd $$dir && $(MAKE) CFLAGS=$(CFLAGS) clean";	\
+		(cd $$dir && $(MAKE) CFLAGS="$(CFLAGS)" clean);		\
+	done
+
+distclean: clean
+	@for dir in $(SUBDIRS); do					\
+		echo "cd $$dir && $(MAKE) CFLAGS=$(CFLAGS) distclean";	\
+		(cd $$dir && $(MAKE) CFLAGS="$(CFLAGS)" distclean);	\
+	done
+	$(RM) Makefile
+
+Makefile: Makefile.in
+	cd ../.. && CONFIG_FILES=contrib/Makefile ./config.status

Added: trunk/orca/contrib/rotate_orca_graphs/Makefile.in
==============================================================================
--- trunk/orca/contrib/rotate_orca_graphs/Makefile.in	(original)
+++ trunk/orca/contrib/rotate_orca_graphs/Makefile.in	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,34 @@
+ at SET_MAKE@
+
+bindir	= @bindir@
+INSTALL	= @INSTALL
+MKDIR	= @MKDIR@
+
+TARGETS	= rotate_orca_graphs
+
+all:	Makefile $(TARGETS)
+
+Makefile: Makefile.in
+	cd ../.. && CONFIG_FILES=contrib/rotate_orca_graphs/Makefile ./config.status
+
+rotate_orca_graphs.sh: rotate_orca_graphs.sh.in
+	cd ../.. && CONFIG_FILES=contrib/rotate_orca_graphs/rotate_orca_graphs.sh ./config.status
+
+.SUFFIXES:	.sh
+
+.sh:
+	cp $< $@
+	chmod 0755 $@
+
+install:
+	$(MKDIR) $(bindir)
+	@for file in $(TARGETS); do			\
+		echo $(INSTALL) $$file $(bindir);	\
+		$(INSTALL) $$file $(bindir);		\
+	done
+
+clean:
+	$(RM) $(TARGETS)
+
+distclean: clean
+	$(RM) *.sh Makefile

Added: trunk/orca/contrib/rotate_orca_graphs/rotate_orca_graphs.sh.in
==============================================================================
--- trunk/orca/contrib/rotate_orca_graphs/rotate_orca_graphs.sh.in	(original)
+++ trunk/orca/contrib/rotate_orca_graphs/rotate_orca_graphs.sh.in	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# This script can be used to generate daily copies of the Orca HTML
+# directory so that daily plots of your systems can be stored and
+# viewed later.
+#
+# To use this script:
+# 1) Set the ARCHIVE_DIR to the location of the archive directory.
+# 2) Set up a cron job that runs this script:
+#    59 23 * * * create_orca_daily_graphs.sh
+
+# Set this directory to archive the daily plots in.
+ARCHIVE_DIR=
+
+DATE=`date +%Y-%m-%d`
+HTML_DIR=@HTML_DIR@
+TAR=@TAR@
+
+if test -z "$ARCHIVE_DIR"; then
+  echo "$0: please edit $0 to set ARCHIVE_DIR" 1>&2
+  exit 1
+fi
+
+# Make sure that the Orca and archive HTML directories are not the
+# same.
+cd $ARCHIVE_DIR
+dir2=`pwd`
+cd $HTML_DIR
+dir1=`pwd`
+if test "$dir1" = "$dir2"; then
+  echo "$0: HTML_DIR $dir1 and ARCHIVE_DIR $dir2 are the same directory" 1>&2
+  exit 1
+fi
+
+if test ! -e $ARCHIVE_DIR/$DATE; then
+  mkdir $ARCHIVE_DIR/$DATE || exit 1
+fi
+
+$TAR cfl - . | (cd $ARCHIVE_DIR/$DATE; $TAR xf -)

Added: trunk/orca/contrib/orcaservices/Makefile.in
==============================================================================
--- trunk/orca/contrib/orcaservices/Makefile.in	(original)
+++ trunk/orca/contrib/orcaservices/Makefile.in	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,85 @@
+ at SET_MAKE@
+
+prefix		= @prefix@
+exec_prefix	= @exec_prefix@
+bindir		= @bindir@
+libdir		= @libdir@
+INSTALL		= @INSTALL@
+MKDIR		= @MKDIR@
+PERL_HEAD	= @PERL_HEAD@
+ORCALLATOR_DIR	= @ORCALLATOR_DIR@/../orcaservices
+ORCASERVICES_DIR	= @ORCALLATOR_DIR@/../orcaservices
+RRD_DIR		= @RRD_DIR@
+RRDTOOL_DIR	= @RRDTOOL_DIR@
+PERL_SCRIPTS	= orcaservices_running orcaservices.pl
+SHELL_SCRIPTS	= restart_orcaservices stop_orcaservices start_orcaservices \
+		  S99orcaservices
+TARGETS		= $(PERL_SCRIPTS) $(SHELL_SCRIPTS)
+
+all:		Makefile $(TARGETS) orcaservices.cfg
+
+install: all
+		$(MKDIR) $(bindir)
+		$(MKDIR) $(libdir)
+		$(MKDIR) $(RRD_DIR)/orcaservices
+		@for file in $(TARGETS); do			\
+			echo $(INSTALL) $$file $(bindir);	\
+			$(INSTALL) $$file $(bindir);		\
+		done
+		if test -r $(libdir)/orcaservices.cfg; then	\
+			cp -p $(libdir)/orcaservices.cfg $(libdir)/orcaservices.cfg.`date +%Y-%m-%d-%H:%M:%S`; \
+		fi
+		$(INSTALL) -m 0644 orcaservices.cfg $(libdir)
+		$(INSTALL) -m 0755 orcaservices.pl $(libdir)
+
+orcaservices_run_at_boot: all
+		-$(RM) /etc/init.d/orcaservices /etc/rc0.d/K01orcaservices
+		-$(RM) /etc/rc1.d/K01orcaservices /etc/rc3.d/S99orcaservices
+		$(INSTALL) -m 0744 S99orcaservices /etc/init.d/orcaservices
+		ln /etc/init.d/orcaservices /etc/rc0.d/K01orcaservices
+		ln /etc/init.d/orcaservices /etc/rc1.d/K01orcaservices
+		ln /etc/init.d/orcaservices /etc/rc3.d/S99orcaservices
+
+clean:
+		$(RM) $(TARGETS)
+
+distclean:	clean
+		$(RM) *.sh orcaservices.cfg orcaservices_running.pl Makefile
+
+.SUFFIXES:	.pl .sh
+
+.pl:		$(PERL_HEAD)
+		cat $(PERL_HEAD) $< > $@
+		chmod 0755 $@
+
+.sh:
+		cp $< $@
+		chmod 0755 $@
+
+Makefile:	Makefile.in
+		cd ../.. && CONFIG_FILES=contrib/orcaservices/Makefile ./config.status
+		$(MAKE)
+
+orcaservices.cfg:			orcaservices.cfg.in
+		cd ../.. && CONFIG_FILES=contrib/orcaservices/orcaservices.cfg ./config.status
+
+orcaservices.pl:		orcaservices.pl.in	$(PERL_HEAD)
+		cd ../.. && CONFIG_FILES=contrib/orcaservices/orcaservices.pl ./config.status
+		cat $(PERL_HEAD) orcaservices.pl > orcaservices.perl
+		mv orcaservices.perl orcaservices.pl
+		chmod 0755 orcaservices.pl
+
+orcaservices_running.pl:		orcaservices_running.pl.in
+		cd ../.. && CONFIG_FILES=contrib/contrib/orcaservices/orcaservices_running.pl ./config.status
+
+restart_orcaservices.sh:		restart_orcaservices.sh.in
+		cd ../.. && CONFIG_FILES=contrib/contrib/orcaservices/restart_orcaservices.sh ./config.status
+
+start_orcaservices.sh:		start_orcaservices.sh.in
+		cd ../.. && CONFIG_FILES=contrib/contrib/orcaservices/start_orcaservices.sh ./config.status
+
+stop_orcaservices.sh:		stop_orcaservices.sh.in
+		cd ../.. && CONFIG_FILES=contrib/contrib/orcaservices/stop_orcaservices.sh ./config.status
+
+S99orcaservices.sh:		S99orcaservices.sh.in
+		cd ../.. && CONFIG_FILES=contrib/contrib/orcaservices/S99orcaservices.sh ./config.status

Added: trunk/orca/contrib/orcaservices/start_orcaservices.sh.in
==============================================================================
--- trunk/orca/contrib/orcaservices/start_orcaservices.sh.in	(original)
+++ trunk/orca/contrib/orcaservices/start_orcaservices.sh.in	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# This script runs orcaservices.pl with the proper options for your site.
+
+# Define program locations that will be needed.
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+AWK=@AWK@
+CUT=@CUT@
+UNAME=@UNAME@
+ORCASERVICES_DIR=@ORCALLATOR_DIR@/../orcaservices
+
+# Get the hostname without the fully qualified part; that is, trim off
+# anything past the first `.'.
+uname=`$UNAME -n | $CUT -d. -f1`
+
+# The directory these files go into is $ORCASERVICES_DIR/HOSTNAME
+OUTDIR=$ORCASERVICES_DIR/$uname
+
+# Export the environmental variables.
+export OUTDIR
+
+# Check if orcaservices is already running.
+pids=`/usr/ucb/ps auxww | $AWK '/orcaservices.pl/ && !/awk/ {print $2}'`
+if test "$pids" != ""; then
+  echo "Orcaservices already running.  Exiting."
+  exit 1
+fi
+
+echo "Writing data into $OUTDIR/"
+
+# Cd to / so that any automounted filesystems can be unmounted.
+cd /
+
+# Create the output directory if it doesn't exist yet.
+if test ! -d $OUTDIR; then
+  echo "Creating $OUTDIR/"
+  mkdir -p $OUTDIR
+fi
+
+if test ! -d $OUTDIR; then
+  echo "Unable to create $OUTDIR/" 1>&2
+  exit 2
+fi
+
+# Now start the logging.
+echo "Starting logging"
+HOSTNAME=`hostname`
+if test -f "$libdir/orcaservices.$HOSTNAME"; then
+    $libdir/orcaservices.pl `cat $libdir/orcaservices.$HOSTNAME`
+else
+    $libdir/orcaservices.pl
+fi
+
+### # Write the PID of orcaservices to a file to make killing easier.
+### pid=$!
+### echo $pid > $OUTDIR/orcaservices.pid
+
+# Sleep for a couple of seconds to allow any orcaservices warnings to appear.
+sleep 5

Added: trunk/orca/contrib/orcaservices/orcaservices.pl.in
==============================================================================
--- trunk/orca/contrib/orcaservices/orcaservices.pl.in	(original)
+++ trunk/orca/contrib/orcaservices/orcaservices.pl.in	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,2022 @@
+##
+##
+## OrcaServices.pl, a log generating services usage monitor
+##
+##
+
+##
+## This program logs many different services usage to a log file
+## for later processing.
+##
+
+##
+## Author: Carlos Canau <Carlos.Canau at KPNQwest.com>
+## With: Jose Carlos Pereira <Jose.Pereira at KPNQwest.com>
+##
+
+##
+## Portions adapted from Orcallator.se written by Blair Zajac
+## Portions ported to perl from Orcallator.se written by Blair Zajac
+## other portions adapted from several other open source scripts
+##
+##
+
+##
+## Version 1.5.5.dist: 06 Nov 2000	First distribution version
+##
+## Version 1.5.5: 31 Oct 2000	Bug with increasing "others" in named
+##
+## Version 1.5.4: 31 Oct 2000	DB radiator more secure method of getting DB user/pass
+##
+## Version 1.5.3: 31 Oct 2000	DB radiator accounting
+##
+## Version 1.5.2: 30 Oct 2000	Bugs---, bugs---, ...
+##
+## Version 1.5.1: 27 Oct 2000	Bugs--, bugs--, ...
+##
+## Version 1.5.0: 27 Oct 2000	Radiator/SQL accounting
+##
+## Version 1.4.1: 26 Oct 2000	on/off on services
+##
+## Version 1.4.0.3: 25 Oct 2000	some bugs crashed
+##
+## Version 1.4.0: 24 Oct 2000	DNS / named added
+##
+## Version 1.3.10: 17 Oct 2000	1 query/5min mechanism
+##
+## Version 1.3.9: 12 Oct 2000	New value: mailq
+##
+## Version 1.2.0: 11 Aug 2000	CAC.Washington.EDU ipop3d logfile added
+##
+## Version 1.1.0: 09 Aug 2000   Merit Radius logfile added
+##
+## Version 1.0.3: 09 Aug 2000   Re-open bug fixed (?)
+##
+## Version 1.0.2: 27 Jul 2000   Changes in SMTP regex
+##
+## Version 1.0.1: 25 Jul 2000   Lots of bugs smashed.
+##
+## Version 1.0.0: 23 Jul 2000	First release. Just SMTP.
+##
+##
+
+##
+## BUGS:
+##      several ?...
+##
+
+##
+## TODO:
+##      more services and diferent logfile reading synchronization
+##      code optimization and cleaning
+##      debugging
+##      can this code be GPLed ??
+##
+
+##
+## LICENSE:
+##         GPL.
+##         (c) 2000 Carlos Canau & Jose Carlos Pereira
+##
+
+##
+## DISCLAIMER:
+##            you use this program at your own and complete risk
+##            if you don't agree with that then delete it
+##
+
+$version = "1.5.5.dist";
+
+#
+# ATTENTION: you might need to edit this variables
+#
+$CAT="/usr/local/bin/cat";
+$ECHO="/usr/local/bin/echo";
+$TOUCH="/usr/local/bin/touch";
+
+$UNAME = "/usr/bin/uname";
+$nodename = `$UNAME -n`;
+chop($nodename);
+
+require 5.004;
+use Fcntl;
+use Getopt::Long;			# option handler
+use POSIX;				# useful functions
+use IO::Handle;
+use IO::File;
+use Sys::Syslog;
+ at PERL_USE_TIME_HIRES@			# import time from Time::HiRes
+					# for nanosecond precision
+
+$log_facility = "user";
+$log_priority = "info";
+
+($progname = $0) =~ s(.*/)();
+
+$SaveDay = 0;
+
+# put this in an option
+#
+# ATTENTION: you might need to edit this
+#
+$MAILQCMD = "/usr/bin/mailq | /usr/bin/tail -1";
+
+##
+## options
+##
+local %options;
+# my $def_poll = 5;
+# my $def_lines = 10;
+# my $def_count = (-1);
+my $def_interval = 300;                     # 5 minutes
+my $def_dns_logfile = "/var/log/named";
+my $def_smtp_logfile = "/var/log/syslog";
+my $def_merit_radius_logfile = "/usr/local/etc/raddb/logfile";
+my $def_pop_logfile = "/var/log/ipop3d.log";
+my $def_outputdir = "/var/orca/orcaservices";
+my $def_pid  = "$def_outputdir/${progname}.pid";
+my $def_compress = "/usr/local/bin/gzip -9";
+
+my $def_radius_auth = "/usr/local/lib/orcaservices.DB.$nodename";
+
+my $def_mailq = "on";
+
+GetOptions("pidfile=s"         => \$options{pidfile},
+           "debug:s"           => \$options{debug},
+           "interval=i"        => \$options{interval},
+           "dns_logfile=s"     => \$options{dns_logfile},
+           "smtp_logfile=s"    => \$options{smtp_logfile},
+           "merit_radius_logfile=s"  => \$options{merit_radius_logfile},
+           "radius_db=s"       => \$options{radius_db},
+           "pop_logfile=s"     => \$options{pop_logfile},
+           "outputdir=s"       => \$options{outputdir},
+	   "compress=s"        => \$options{compress},
+	   "mailq=s"           => \$options{mailq},
+           "help"              => \$options{help},
+           "version"           => \$options{help}
+           ) || usage();
+usage() if $options{help};
+
+if ($options{debug}) {
+    if ($options{debug} ne "on") {
+	$debug = 0;
+	exit if fork;
+    } else {
+	$debug = 1;
+    }
+} else {
+    $debug = 0;
+    exit if fork;
+}
+
+if ($options{interval}) {
+    $interval = $options{interval};
+} else {
+    $interval = $def_interval;
+}
+
+if ($options{compress}) {
+    $Compress = $options{compress};
+} else {
+    $Compress = $def_compress;
+}
+
+if ($options{outputdir}) {
+    $OutputDir = $options{outputdir};
+} else {
+    $OutputDir = $def_outputdir;
+}
+system ("mkdir $OutputDir 2>/dev/null");             # ignore return value
+system ("chmod 0755 $OutputDir 2>/dev/null");        # if you can change these
+                                                     # two systems bye the perl
+                                                     # syscall ... :-)
+system ("mkdir $OutputDir/$nodename 2>/dev/null");   # ignore return value
+system ("chmod 0755 $OutputDir/$nodename 2>/dev/null");
+if ($options{pidfile}) {
+    $PidFile = $options{pidfile};
+} else {
+    $PidFile = "$OutputDir/$nodename/${progname}.pid";;
+}
+
+if ($options{dns_logfile}) {
+    $DNSFile = $options{dns_logfile};
+} else {
+    $DNSFile = $def_dns_logfile;
+}
+
+if ($options{smtp_logfile}) {
+    $SMTPFile = $options{smtp_logfile};
+} else {
+    $SMTPFile = $def_smtp_logfile;
+}
+
+if ($options{mailq}) {
+    $MAILQ = $options{mailq};
+} else {
+    $MAILQ = $def_mailq;
+}
+
+if ($options{merit_radius_logfile}) {
+    $Merit_RADIUSFile = $options{merit_radius_logfile};
+} else {
+    $Merit_RADIUSFile = $def_merit_radius_logfile;
+}
+
+if ($options{pop_logfile}) {
+    $POPFile = $options{pop_logfile};
+} else {
+    $POPFile = $def_pop_logfile;
+}
+
+if ($options{radius_db}) {
+    $RADIUS_DB = $options{radius_db};
+###    print "\n\nWARNING: radius_db option not being used via cmd line. Using default\n\n";
+###    $RADIUS_DB = $def_radius_auth;
+} else {
+    $RADIUS_DB = $def_radius_auth;
+}
+
+##
+## options
+##
+
+
+
+
+&logit ("ready (pid $$)");
+if (open(P, "> $PidFile")) {
+    print P "$$\n";
+    close P;
+} else {
+    &logit("can't save pid (can't write to \`$PidFile')");
+    warn "$progname: can't save pid (can't write to \`$PidFile')\n";
+}
+
+
+
+##
+## init logfiles
+##
+my ($dns_ino, $dns_size, $dns_ok) = (0,0,0);
+if ($DNSFile !~ /^off$/i) {
+    $dns_ok = &init_dns ($DNSFile);                           # inits DNSFD
+}
+
+my ($smtp_ino, $smtp_size, $smtp_ok) = (0,0,0);
+if ($SMTPFile !~ /^off$/i) {
+    $smtp_ok = &init_smtp ($SMTPFile);                        # inits SMTPFD
+}
+
+my ($merit_radius_ino, $merit_radius_size, $merit_radius_ok) = (0,0,0);
+if ($Merit_RADIUSFile !~ /^off$/i) {
+    $merit_radius_ok = &init_merit_radius ($Merit_RADIUSFile);                  # inits RADIUSFD
+}
+
+my ($pop_ino, $pop_size, $pop_ok) = (0,0,0);
+if ($POPFile !~ /^off$/i) {
+    $pop_ok = &init_pop ($POPFile);                           # inits POPFD
+}
+
+if ($RADIUS_DB !~ /^off$/i) {
+
+    #check if database user/passwd is given!
+    if( ! -f $RADIUS_DB){
+        print "Database init error: No such file: $RADIUS_DB\n";
+        print "Aborting\n";
+        exit;
+    }
+
+    my($proto,$drv,$database,$user,$pass)= split(/:/,`$CAT $RADIUS_DB`);
+
+    if(!$proto || !$drv || !$database || !$user || !$pass){
+        print "Database init error: unable to parse $RADIUS_DB\n";
+        print "Syntax must be: protocol:driver:database:user:passwd ex: DBI:oracle:ORCA:user:pass\n";
+        print "Aborting\n";
+        exit;
+    }
+    chomp($pass);
+
+    if ( ($radius_ok = &init_radius("$proto:$drv:$database",$user,$pass)) ) {                      # inits $RADdbh
+        print "ERROR: Radius init failed! Aborting $radius_ok\n";
+        exit;
+    }
+}
+
+$print_header = 0;
+$current_column = 0;
+
+##
+## init outpufile
+##
+my $OutputFilename = "";
+#$outputfile_ok = &check_output ("$OutputDir/$nodename");  # inits OUTFD
+#                                                          # & $OutputFilename
+
+
+# incremental
+if (defined($DNSFD)) {
+    &init_dns_vars ();
+}
+
+while () {
+    my $outputfile_ok = 0;
+    my ($now, $sleep_till);
+
+    $now        = time;
+    $sleep_till = ($now/$interval) * $interval;
+    while ($sleep_till < $now + $interval*0.5) {
+	$sleep_till += $interval;
+    }
+
+    &measure_head ($now);
+
+    if (defined($SMTPFD)) {
+	&init_smtp_vars ();
+    }
+    if ($MAILQ eq "on") {
+	&init_mailq_vars ();
+    }
+    if (defined($Merit_RADIUSFD)) {
+	&init_merit_radius_vars ();
+    }
+    if (defined($POPFD)) {
+	&init_pop_vars ();
+    }
+
+    ### call the measure routines...
+    &measure ($sleep_till);
+
+    if (defined($RADdbh)) {
+	&put_radius ();
+    }
+
+    if (defined($DNSFD)) {
+	&put_dns ();
+    }
+    if (defined($SMTPFD)) {
+	&put_smtp ();
+    }
+    if ($MAILQ eq "on") {
+	&put_mailq ();
+    }
+    if (defined($Merit_RADIUSFD)) {
+	&put_merit_radius ();
+    }
+    if (defined($POPFD)) {
+	&put_pop ();
+    }
+
+    $outputfile_ok = &check_output ("$OutputDir/$nodename");
+
+    &flush_output ();
+
+}
+
+exit 0;
+
+
+
+# ----------------------------------------------------------------------------
+
+sub usage {
+    die "Usage: $progname [options]
+    ($progname uses the GNU extended POSIX option format)
+
+    --pidfile=FILE        write my PID here           (default: $def_pid)
+    --debug[=on|off]      show copious debugging info (default: off)
+    --interval=i          pooling interval in sec.    (default: $def_interval)
+    --dns_logfile=FILE    syslog from named           (default: $def_dns_logfile)
+    --smtp_logfile=FILE   syslog from sendmail        (default: $def_smtp_logfile)
+    --merit_radius_logfile=FILE syslog from merit_radius          (default: $def_merit_radius_logfile)
+    --radius_db=FILE      file for user/passwd for DB access (default: $def_radius_auth)
+    --pop_logfile=FILE    syslog from pop             (default: $def_pop_logfile)
+    --outputdir=DIR       write here output files     (default: $def_outputdir)
+    --compress=COMMAND    use this to compress files  (default: $def_compress)
+    --mailq=[on|off]      get mailq total requests    (default: $def_mailq)
+    --help, --version this option summary
+
+    Note: use filename 'off' to turn off the specific service
+
+    This is $progname version $version
+
+";
+}
+
+
+# -------------------------------------------------------------------
+#
+# logit -- send MSG(s) to the syslog.
+#
+# usage: &logit($msg_to_log);
+#
+
+sub logit {
+    local($Msg) = @_;
+
+    &Sys::Syslog::openlog("$progname", 'cons,pid', "$log_facility");
+    &Sys::Syslog::syslog("$log_priority", $Msg);
+    &Sys::Syslog::closelog();
+}
+
+
+# -------------------------------------------------------------------
+#
+# measure_head -- put first values
+#
+# usage: &measure_head($time)
+#
+
+sub measure_head() {
+    my ($time) = @_;
+
+    $now_string = strftime "%T", localtime;
+    put_output(" timestamp", sprintf("%10d", $time));
+    put_output("locltime", $now_string);
+}
+
+
+# ----------------------------------------------------------------------
+#
+# init_radius - set RADIATOR_RADIUS vars, connect to DB, calculate correct time stamp
+#
+# usage: &init_radius($db,$user,$pass);
+#
+
+sub init_radius {
+  my ($db,$user,$pass) = @_;
+
+    use DBI;
+
+    $RADdbh   = DBI->connect($db,$user,$pass);
+    if(!$RADdbh) {
+        print "Connect error $DBI::errstr\n";
+        return 1;
+    }
+
+    #get the lower time limit that our queries will start from
+    #get a "history" of 5minutes
+
+    $radius_base_ts= time - 5*60;
+
+    #get accumulated values for what we want to measure:
+
+#jcp correct this please!
+##    my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, undef) = localtime($radius_base_ts);
+##    $year += 1900;
+##    $mon++;
+
+
+##    $BASE_ACCUM_radius_DB="/var/orca/orcaservices/$nodename";
+##    $ACCUM_radius_DB= "$BASE_ACCUM_radius_DB/radiatorRadiusAccum.$year$mon.txt";
+##    `$TOUCH $ACCUM_radius_DB`;
+
+##    $radius_inc_time       ||= 0;
+##    $radius_inc_sessions   ||= 0;
+
+#END jcp correct this please!
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# init_dns - set DNS vars, open the logfile and seek into the end.
+#
+# usage: &init_dns($dns_logfile);
+#
+
+sub init_dns {
+    my ($filename) = @_;
+
+    if ($filename) {
+	$DNSFD = new IO::File "$filename", "r";
+	if (defined($DNSFD)) {
+	    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+		$atime,$mtime,$ctime,$blksize,$blocks) = stat($DNSFD);
+	    if (!$dev) {
+		&logit ("can't stat $filename");
+		warn "$progname: can't stat $filename\n";
+		return 1;
+	    }
+	    $dns_ino = $ino;
+	    $dns_size = $size;
+	    $seek_ok = seek($DNSFD, 0, SEEK_END);
+	    if (!$seek_ok) {
+		&logit ("can't seek into EOF on $filename");
+		warn "$progname: can't seek into EOF on $filename\n";
+		return 2;
+	    }
+	} else {
+	    &logit ("can't open $filename");
+	    warn "$progname: can't open $filename\n";
+	    return 3;
+	}
+    }
+    &init_dns_vars ();
+    return 0;
+}
+
+# -------------------------------------------------------------------
+#
+# init_smtp - set SMTP vars, open the logfile and seek into the end.
+#
+# usage: &init_smtp($smtp_logfile);
+#
+
+sub init_smtp {
+    my ($filename) = @_;
+
+    if ($filename) {
+	$SMTPFD = new IO::File "$filename", "r";
+	if (defined($SMTPFD)) {
+	    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+		$atime,$mtime,$ctime,$blksize,$blocks) = stat($SMTPFD);
+	    if (!$dev) {
+		&logit ("can't stat $filename");
+		warn "$progname: can't stat $filename\n";
+		return 1;
+	    }
+	    $smtp_ino = $ino;
+	    $smtp_size = $size;
+	    $seek_ok = seek($SMTPFD, 0, SEEK_END);
+	    if (!$seek_ok) {
+		&logit ("can't seek into EOF on $filename");
+		warn "$progname: can't seek into EOF on $filename\n";
+		return 2;
+	    }
+	} else {
+	    &logit ("can't open $filename");
+	    warn "$progname: can't open $filename\n";
+	    return 3;
+	}
+    }
+    &init_smtp_vars ();
+    return 0;
+}
+
+
+# ----------------------------------------------------------------------
+#
+# init_merit_radius - set Merit_RADIUS vars, open the logfile and seek into the end.
+#
+# usage: &init_merit_radius($radius_logfile);
+#
+
+sub init_merit_radius {
+    my ($filename) = @_;
+
+    if ($filename) {
+	$Merit_RADIUSFD = new IO::File "$filename", "r";
+	if (defined($Merit_RADIUSFD)) {
+	    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+		$atime,$mtime,$ctime,$blksize,$blocks) = stat($Merit_RADIUSFD);
+	    if (!$dev) {
+		&logit ("can't stat $filename");
+		warn "$progname: can't stat $filename\n";
+		return 1;
+	    }
+	    $merit_radius_ino = $ino;
+	    $merit_radius_size = $size;
+	    $seek_ok = seek($Merit_RADIUSFD, 0, SEEK_END);
+	    if (!$seek_ok) {
+		&logit ("can't seek into EOF on $filename");
+		warn "$progname: can't seek into EOF on $filename\n";
+		return 2;
+	    }
+	} else {
+	    &logit ("can't open $filename");
+	    warn "$progname: can't open $filename\n";
+	    return 3;
+	}
+    }
+    &init_merit_radius_vars ();
+    return 0;
+}
+
+
+# ----------------------------------------------------------------------
+#
+# init_pop - set POP vars, open the logfile and seek into the end.
+#
+# usage: &init_pop($pop_logfile);
+#
+
+sub init_pop {
+    my ($filename) = @_;
+
+    if ($filename) {
+	$POPFD = new IO::File "$filename", "r";
+	if (defined($POPFD)) {
+	    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+		$atime,$mtime,$ctime,$blksize,$blocks) = stat($POPFD);
+	    if (!$dev) {
+		&logit ("can't stat $filename");
+		warn "$progname: can't stat $filename\n";
+		return 1;
+	    }
+	    $pop_ino = $ino;
+	    $pop_size = $size;
+	    $seek_ok = seek($POPFD, 0, SEEK_END);
+	    if (!$seek_ok) {
+		&logit ("can't seek into EOF on $filename");
+		warn "$progname: can't seek into EOF on $filename\n";
+		return 2;
+	    }
+	} else {
+	    &logit ("can't open $filename");
+	    warn "$progname: can't open $filename\n";
+	    return 3;
+	}
+    }
+    &init_pop_vars ();
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# check_output - set outputfile vars, open the outputfile.
+#
+# usage: &check_output($outputdir);
+#
+
+sub check_output {
+    my ($outputdir) = @_;
+    $sec1=$min1=$hour1=$mday1=$mon1=$year1=$wday1=$yday1=$isdst1 = 0;
+
+    ($sec1,$min1,$hour1,$mday1,$mon1,$year1,$wday1,$yday1,$isdst1) = localtime();
+
+    if ($mday1 != $SaveDay) {
+	# First time or day has changed, start new logfile.
+	if (OUTFD->opened) {
+	    close(OUTFD);                            # ignore error
+	}
+	if (($Compress) && ($SaveDay)) {             # just on day change
+	    if ($OutputFilename) {
+		&logit ("compressing $OutputFilename");
+		system ("$Compress $OutputFilename");  # ignore error ??
+	    }
+	}
+
+	$now_string = strftime "%Y-%m-%d", localtime;
+
+	$OutputFilename = "$outputdir/percol-$now_string";
+
+        if (!open (OUTFD, ">>$OutputFilename")) {
+	    &logit ("can't open outputfile $OutputFilename");
+	    die "$progname: can't open outputfile $OutputFilename\n";
+	}
+
+	$SaveDay = $mday1;
+
+	$print_header = 1;
+    }
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# flush_output - dumps line into outputfile
+#
+# usage: &flush_output();
+#
+
+sub flush_output() {
+
+    if ($print_header) {
+	&print_columns(\@col_comment);
+	$print_header = 0;
+    }
+    &print_columns(\@col_data);
+    $current_column = 0;
+}
+
+# -------------------------------------------------------------------
+#
+# Send the stored columns of information to the output.
+#
+# usage: &print_columns( \@array );
+#
+
+sub print_columns() {
+    my ($ref) = @_;
+
+    @col = @$ref;
+
+    for ($i=0; $i < $current_column; $i++) {
+	printf OUTFD "%s", $col[$i];
+	if ($i != $current_column - 1) {
+	    printf OUTFD " ";
+	}
+    }
+    printf OUTFD "\n";
+
+    OUTFD->flush;
+}
+
+# -------------------------------------------------------------------
+#
+# Add one column of comments and data to the buffers.
+#
+# usage: &put_output( $comment, $data );
+#
+
+sub put_output() {
+    my ($comment, $data) = @_;
+
+    printf "OUT: --%s-- %s\n", $comment, $data if $debug;
+    $col_comment[$current_column] = $comment;
+    $col_data[$current_column]    = $data;
+    $current_column++;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Cycle several measurables
+#
+# usage: &measure( $sleep_till );
+#
+
+sub measure () {
+    my ($sleep_till) = @_;
+
+
+    $now = time;
+    while ($now < $sleep_till) {
+
+        printf "SMTP: sleeping for 5\n" if $debug;
+        sleep(5);
+        $now = time;
+
+	# measure...
+	if (defined($SMTPFD)) {
+	    &measure_smtp();
+	}
+	if (defined($Merit_RADIUSFD)) {
+	    &measure_merit_radius();
+	}
+	if (defined($POPFD)) {
+	    &measure_pop();
+	}
+	#
+	# stats only once an hour... but better not have logfile reading picks
+	#
+	if (defined($DNSFD)) {
+	    &measure_dns();
+	}
+
+	# measure...
+
+	$now = time;
+
+    } ## while ($now < $sleep_till)
+    # put in the end... calls external prog.
+    if ($MAILQ eq "on") {
+	&measure_mailq();
+    }
+
+    if (defined($RADdbh)) {
+        &measure_radius();
+    }
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Get values for smtp columns
+#
+# usage: &measure_smtp( );
+#
+
+sub measure_smtp () {
+
+
+    #################################### insert bail out for too much
+    #################################### time spent ??
+    $buf = <$SMTPFD>;
+    while ($buf) {
+	## process line read and check for eof
+	if ($buf) {
+	    &process_smtp_line ($buf);
+	}
+	if ($SMTPFD->eof) {
+	    printf "SMTP: eof on $SMTPFile\n" if $debug;
+	    last; # get out of while($buf)
+	}
+	$buf = <$SMTPFD>;
+    } ## while ($buf)
+
+
+    # test for file change via different inode or filesize decrease
+    $dev = $ino = $mode = $nlink = $uid = $gid = $rdev =
+	$size = $atime = $mtime = $ctime = $blksize = $blocks = '';
+    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+     $atime,$mtime,$ctime,$blksize,$blocks) = stat($SMTPFile);
+    if (!$dev) {
+	&logit ("can't stat $SMTPFile");
+	warn "$progname: can't stat $SMTPFile\n";
+	return 1;
+    }
+    printf "SMTPFD: smtp_ino=%s vs. ino=%s\tsmtp_size=%s vs. size=%s\n", $smtp_ino, $ino, $smtp_size, $size if $debug;
+    if (($smtp_ino != $ino) || ($smtp_size > $size)) {
+	undef $SMTPFD;
+	printf "SMTP: file change on $SMTPFile\n" if $debug;
+	$SMTPFD = new IO::File "$SMTPFile", "r";
+	if (!defined ($SMTPFD)) {
+	    &logit ("can't re-open $SMTPFile");
+	    warn "$progname: can't re-open $SMTPFile\n";
+	    $smtp_ino = $smtp_size = 0;
+	    return 2;
+	}
+	$smtp_ino = $ino;
+	$smtp_size = $size;
+    }
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# init smtp vars
+#
+# usage: &init_smtp_vars();
+#
+
+sub init_smtp_vars() {
+    $smtp_froms      = 0;
+    $smtp_MaxSize    = 0;
+    $smtp_sizes      = 0;
+
+    $smtp_MaxSeconds = 0;
+    $smtp_seconds    = 0;
+    $smtp_sent       = 0;
+
+    $smtp_fail       = 0;
+    $smtp_retries    = 0;
+    $smtp_queued     = 0;
+    $smtp_t_or_f     = 0;
+
+    $smtp_check_mail = 0;
+    $smtp_check_rcpt = 0;
+    $smtp_notifies   = 0;
+    $smtp_dsns       = 0;
+    $smtp_undefs     = 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Parse smtp log line
+#
+# usage: &process_smtp_line ($buf);
+#
+
+sub process_smtp_line () {
+    my ($line) = @_;
+
+
+    if ($line !~ / sendmail\[\d+\]: /) {
+	return 0;
+    }
+
+
+    # from
+# Jul 16 03:22:12 server123 sendmail[4977]: e6G2M7O04977: from=<jsmith at server321.domain.com>, size=981, class=0, nrcpts=1, msgid=<200007152000.VAA24441 at server321.domain.com>, proto=ESMTP, daemon=MTA, relay=server321.domain.com [10.0.0.65]
+#   0 Month, 1 Day, 2 hh:mm:ss, 3 nodename, 4 sendmail[NNNNN]:, 5 msg-id:, 6 from=FROM\,, 7 size=NNNNN\,, ...
+    if ($line =~ /: from=.*, size=(\d+)/i) {
+	$smtp_froms ++;
+	$size = $1;
+	$smtp_sizes += $size;
+	if ($size > $smtp_MaxSize) {
+	    $smtp_MaxSize = $size;
+	}
+	printf "SMTP_FROM: %s", $line if $debug;
+#	printf "smtp_froms=%s, size=%s, smtp_sizes=%s, smtp_MaxSize=%s\n", $smtp_froms, $size, $smtp_sizes, $smtp_MaxSize if $debug;
+	return 0;
+    }
+
+    # to
+#Jul 16 03:26:32 server123 sendmail[5060]: e6G2PqO05058: to=<info at domain1.pt>, delay=00:00:35, xdelay=00:00:35, mailer=esmtp, pri=120745, relay=server321.domain.com. [10.0.0.65], dsn=2.0.0, stat=Sent (DAA19487 Message accepted for delivery)
+#Jul 16 03:15:16 server123 sendmail[4828]: e6EBXrO12616: to=<sales at mail.domain2.pt>, delay=1+14:41:13, xdelay=00:00:55, mailer=esmtp, pri=3001977, relay=mail.domain2.pt. [11.0.0.130], dsn=4.0.0, stat=Deferred: Connection refused by mail.domain2.pt.
+#Jul 16 22:31:20 server123 sendmail[881]: e6GLUxP00881: to=<info at domain3.pt>, delay=00:00:11, xdelay=00:00:11, mailer=esmtp, pri=37973, relay=mail.domain4.pt. [12.0.0.15], dsn=5.0.0, stat=Service unavailable
+#Jul 24 18:33:05 server999 sendmail[15932]: SAA15929: to=<jsmith at domain4.pt>, ctladdr=<jjjj at domain9.pt> (16306/1984), delay=00:00:10, xdelay=00:00:09, mailer=esmtp, relay=mail.domain4.pt. [13.0.0.3], stat=Sent (Ok)
+    if ($line =~ /: to=/) {
+	if ($line =~ /, delay=(\d+)*\+*(\d+):(\d+):(\d+), .*, stat=Sent/i) {
+	    $seconds = 86400*$1 + 3600*$2 + 60*$3 + $4;
+
+	    $smtp_seconds += $seconds;
+	    if ($seconds > $smtp_MaxSeconds) {
+		$smtp_MaxSeconds = $seconds;
+	    }
+	    $smtp_sent ++;
+	    printf "SMTP_SENT: %s", $line if $debug;
+#	    printf "seconds=%s, smtp_seconds=%s, smtp_MaxSeconds=%s, smtp_sent=%s\n", $seconds, $smtp_seconds, $smtp_MaxSeconds, $smtp_sent if $debug;
+	    return 0;
+	}
+	if ($line =~ /, dsn=5/i) {
+	    $smtp_fail++;
+	    printf "SMTP_FAIL: %s", $line if $debug;
+#	    printf "smtp_fail=%s\n", $smtp_fail if $debug;
+	    return 0;
+	}
+	if (($line =~ /, dsn=4/i) || ($line =~ /, stat=Deferred:/i)) {
+	    $smtp_retries++;
+	    printf "SMTP_RETRY: %s", $line if $debug;
+#	    printf "smtp_retries=%s\n", $smtp_retries if $debug;
+	    return 0;
+	}
+	if ($line =~ /, stat=queued/i) {
+	    $smtp_queued++;
+	    printf "SMTP_QUEUE: %s", $line if $debug;
+#	    printf "smtp_queued=%s\n", $smtp_queued if $debug;
+	    return 0;
+	}
+	$smtp_t_or_f++;
+	printf "SMTP_T_OR_F: %s", $line if $debug;
+#	printf "smtp_t_or_f=%s\n", $smtp_t_or_f if $debug;
+	return 0;
+    }
+
+    # ruleset=check_mail
+#Jul 16 22:24:43 server123 sendmail[604]: e6GLNMO00604: ruleset=check_mail, arg1=<Mary.Wilson at domain10.pt>, relay=server321.domain.com [10.0.0.65], reject=451 4.1.8 <Mary.Wilson at domain10.pt>... Domain of sender address Mary.Wilson at domain10.pt does not resolve
+    if ($line =~ /: ruleset=check_mail, /i) {
+	$smtp_check_mail ++;
+	printf "SMTP_CHECK_MAIL: %s", $line if $debug;
+#	printf "smtp_check_mail=%s\n", $smtp_check_mail if $debug;
+	return 0;
+    }
+
+    # ruleset=check_rcpt
+#Jul 19 16:54:55 server123 sendmail[11437]: e6JFsoO11437: ruleset=check_rcpt, arg1=<xyz at domain777.net>, relay=a.b.c.net [6.1.6.7], reject=550 5.7.1 <xyz at domain777.net>... Relaying denied
+#Jul 19 17:34:54 server123 sendmail[12479]: e6JGYKO12479: ruleset=check_rcpt, arg1=<Edgar.Silva at mail.soso.domain8888.pt>, relay=individual [10.0.0.67], reject=450 4.7.1 <Edgar.Silva at mail.soso.domain8888.pt>... Can not check MX records for recipient host mail.soso.domain8888.pt
+    if ($line =~ /: ruleset=check_rcpt, /i) {
+	$smtp_check_rcpt ++;
+	printf "SMTP_CHECK_RCPT: %s", $line if $debug;
+#	printf "smtp_check_rcpt=%s\n", $smtp_check_rcpt if $debug;
+	return 0;
+    }
+
+    # postmaster notify:
+#Jul 17 05:30:04 server123 sendmail[10016]: e6EKWRO24933: e6H401o10016: postmaster notify: Cannot send message within 2 days
+    if ($line =~ /: postmaster notify: /i) {
+	$smtp_notifies ++;
+	printf "SMTP_NOTIFIES: %s", $line if $debug;
+#	printf "smtp_notifies=%s\n", $smtp_notifies if $debug;
+	return 0;
+    }
+
+    # DSN
+#Jul 18 22:28:58 server123 sendmail[7172]: e6ILQlO07170: e6ILSwO07172: DSN: Service unavailable
+#Jul 19 14:38:00 server123 sendmail[1846]: e6HBWSO21997: e6JDU0t01846: DSN: Cannot send message within 2 days
+#Jul 19 17:33:51 server123 sendmail[12272]: e6JGTlO12270: e6JGXpO12272: DSN: Return receipt
+    if ($line =~ /: DSN: /i) {
+	$smtp_dsns ++;
+	printf "SMTP_DSN: %s", $line if $debug;
+#	printf "smtp_dsns=%s\n", $smtp_dsns if $debug;
+	return 0;
+    }
+
+    $smtp_undefs ++;
+    printf "SMTP_UNDEF: %s", $line if $debug;
+#    printf "smtp_undefs=%s\n", $smtp_undefs if $debug;
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Put the smtp values for output
+#
+# usage: &put_smtp();
+#
+
+sub put_smtp() {
+
+    &put_output("smtp_from",  sprintf("%8.2f", $smtp_froms));
+    &put_output("smtp_tops",  sprintf("%8.2f", $smtp_MaxSize));
+    if ($smtp_froms) {
+	&put_output("smtp_sizes",  sprintf("%8.2f", $smtp_sizes/$smtp_froms));
+    } else {
+	&put_output("smtp_sizes",  sprintf("%8.2f", 0));
+    }
+    &put_output("smtp_sent",  sprintf("%8.2f", $smtp_sent));
+    &put_output("smtp_maxd",  sprintf("%8.2f", $smtp_MaxSeconds));
+    if ($smtp_sent) {
+	&put_output("smtp_delay", sprintf("%8.2f", $smtp_seconds/$smtp_sent));
+    } else {
+	&put_output("smtp_delay", sprintf("%8.2f", 0));
+    }
+    &put_output("smtp_fail",  sprintf("%8.2f", $smtp_fail));
+    &put_output("smtp_rtrs",  sprintf("%8.2f", $smtp_retries));
+    &put_output("smtp_queued",  sprintf("%8.2f", $smtp_queued));
+    &put_output("smtp_torf",  sprintf("%8.2f", $smtp_t_or_f));
+    &put_output("smtp_c_ml",  sprintf("%8.2f", $smtp_check_mail));
+    &put_output("smtp_c_rt",  sprintf("%8.2f", $smtp_check_rcpt));
+    &put_output("smtp_ntfs",  sprintf("%8.2f", $smtp_notifies));
+    &put_output("smtp_dsns",  sprintf("%8.2f", $smtp_dsns));
+
+    &put_output("smtp_undf",  sprintf("%8.2f", $smtp_undefs));
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Get values for mailq columns
+#
+# usage: &measure_mailq( );
+#
+
+sub measure_mailq () {
+
+    open (MFD, "$MAILQCMD |");
+    $line = <MFD>;
+    close (MFD);
+
+    if ($line =~ /(\d+)/i) {
+	$mailq_t = $1;
+    } else {
+	$mailq_t = 0;
+    }
+    $mailq_total += $mailq_t;
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# init mailq vars
+#
+# usage: &init_mailq_vars();
+#
+
+sub init_mailq_vars() {
+    $mailq_total      = 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Put the mailq values for output
+#
+# usage: &put_mailq();
+#
+
+sub put_mailq() {
+
+    &put_output("mailq_total",  sprintf("%8.2f", $mailq_total));
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# init merit_radius vars
+#
+# usage: &init_merit_radius_vars();
+#
+
+sub init_merit_radius_vars() {
+    $merit_radius_auth          = 0;
+    $merit_radius_auth_ok       = 0;
+    $merit_radius_auth_nok      = 0;
+
+    $merit_radius_acct_start    = 0;
+    $merit_radius_acct_stop     = 0;
+
+    $merit_radius_rem_auth      = 0;
+    $merit_radius_rem_auth_ok   = 0;
+    $merit_radius_rem_auth_nok  = 0;
+
+    $merit_radius_undefs        = 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Get values for merit_radius columns
+#
+# usage: &measure_merit_radius( );
+#
+
+sub measure_merit_radius () {
+
+
+    #################################### insert bail out for too much
+    #################################### time spent ??
+    $buf = <$Merit_RADIUSFD>;
+    while ($buf) {
+	## process line read and check for eof
+	if ($buf) {
+	    &process_merit_radius_line ($buf);
+	}
+	if ($Merit_RADIUSFD->eof) {
+	    printf "Merit_RADIUS: eof on $Merit_RADIUSFile\n" if $debug;
+	    last; # get out of while($buf)
+	}
+	$buf = <$Merit_RADIUSFD>;
+    } ## while ($buf)
+
+
+    # test for file change via different inode or filesize decrease
+    $dev = $ino = $mode = $nlink = $uid = $gid = $rdev =
+	$size = $atime = $mtime = $ctime = $blksize = $blocks = '';
+    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+     $atime,$mtime,$ctime,$blksize,$blocks) = stat($Merit_RADIUSFile);
+    if (!$dev) {
+	&logit ("can't stat $Merit_RADIUSFile");
+	warn "$progname: can't stat $Merit_RADIUSFile\n";
+	return 1;
+    }
+    printf "Merit_RADIUSFD: merit_radius_ino=%s vs. ino=%s\tmerit_radius_size=%s vs. size=%s\n", $merit_radius_ino, $ino, $merit_radius_size, $size if $debug;
+    if (($merit_radius_ino != $ino) || ($merit_radius_size > $size)) {
+	undef $Merit_RADIUSFD;
+	printf "Merit_RADIUS: file change on $Merit_RADIUSFile\n" if $debug;
+	$Merit_RADIUSFD = new IO::File "$Merit_RADIUSFile", "r";
+	if (!defined ($Merit_RADIUSFD)) {
+	    &logit ("can't re-open $Merit_RADIUSFile");
+	    warn "$progname: can't re-open $Merit_RADIUSFile\n";
+	    $merit_radius_ino = $merit_radius_size = 0;
+	    return 2;
+	}
+	$merit_radius_ino = $ino;
+	$merit_radius_size = $size;
+    }
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Parse merit_radius log line
+#
+# usage: &process_merit_radius_line ($buf);
+#
+
+sub process_merit_radius_line () {
+    my ($line) = @_;
+
+
+### AUTH RECEIVED
+# Mon Jul 24 00:02:16 2000: Received-Authentication: 214/28832 'luser' from 13.12.15.17 port 25 PPP
+
+    if ($line =~ /: Received-Authentication: .* from /i) {
+	$merit_radius_auth ++;
+	printf "Merit_RADIUS_AUTH: %s", $line if $debug;
+	printf "merit_radius_auth=%s\n", $merit_radius_auth if $debug;
+	return 0;
+    }
+
+### AUTH OK
+# Mon Jul 24 00:02:16 2000: Authentication: 214/28832 'luser2' from 13.12.25.17 port 35 PPP - OK -- total 0, holding 0
+
+    if ($line =~ /: Authentication: .* from .* OK /i) {
+	$merit_radius_auth_ok ++;
+	printf "Merit_RADIUS_AUTH_OK: %s", $line if $debug;
+	printf "merit_radius_auth_ok=%s\n", $merit_radius_auth_ok if $debug;
+	return 0;
+    }
+
+### AUTH FAILED
+# Mon Jul 24 01:49:20 2000: Authentication: 201/29347 'luser3' from 13.16.19.20 port 2 PPP - FAILED Authentication failure -- total 0, holding 0
+
+    if ($line =~ /: Authentication: .* from .* FAILED Authentication /i) {
+	$merit_radius_auth_nok ++;
+	printf "Merit_RADIUS_AUTH_NOK: %s", $line if $debug;
+	printf "merit_radius_auth_nok=%s\n", $merit_radius_auth_nok if $debug;
+	return 0;
+    }
+
+### ACCT START RECEIVED
+# Mon Jul 24 00:02:16 2000: Received-Accounting: 215/8376 'luser4' from 13.16.15.17 port 35 $"5200DB70" PPP/13.16.19.25 Start
+### ACCT STOP RECEIVED
+# Mon Jul 24 00:02:19 2000: Received-Accounting: 176/8377 'luser5' from 13.16.11.18 port 1 $"040065AE" PPP/13.16.24.22 Stop/User-Request
+# Wed Aug  9 16:55:15 2000: getpwnam: good line for luser6 on file
+    if ( ($line =~ /: Received-Accounting: .* from /i) ||
+	 ($line =~ /: getpwnam: good line for /i) ){
+	printf "Merit_RADIUS_IGNORE: %s", $line if $debug;
+	return 0;
+    }
+
+### ACCT START OK
+# Mon Jul 24 00:02:16 2000: Accounting: 215/8376 'luser6' from 13.16.15.17 port 35 $"5200DB70" PPP/13.16.19.24 Start - OK -- total 0, holding 0
+
+    if ($line =~ /: Accounting: .* from .* Start - OK /i) {
+	$merit_radius_acct_start ++;
+	printf "Merit_RADIUS_ACCT_START: %s", $line if $debug;
+	printf "merit_radius_acct_start=%s\n", $merit_radius_acct_start if $debug;
+	return 0;
+    }
+
+### ACCT STOP OK
+# Mon Jul 24 00:02:19 2000: Accounting: 176/8377 'luser7' from 13.16.11.18 port 1 $"040065AE" PPP/13.16.24.22 Stop/User-Request - OK -- total 0, holding 0
+
+    if ($line =~ /: Accounting: .* from .* Stop.* OK /i) {
+	$merit_radius_acct_stop ++;
+	printf "Merit_RADIUS_ACCT_STOP: %s", $line if $debug;
+	printf "merit_radius_acct_stop=%s\n", $merit_radius_acct_stop if $debug;
+	return 0;
+    }
+
+### REMOTE AUTH RECEIVED
+# Mon Jul 24 20:53:38 2000: Received-AUTHENTICATE: 167/44566 'luser9 at realm.com' via some.host.com from some.nas.com port 6 PPP
+
+    if ($line =~ /: Received-AUTHENTICATE: .* via .* from /i) {
+	$merit_radius_rem_auth ++;
+	printf "Merit_RADIUS_REM_AUTH: %s", $line if $debug;
+	printf "merit_radius_rem_auth=%s\n", $merit_radius_rem_auth if $debug;
+	return 0;
+    }
+
+### REMOTE AUTH OK
+# Mon Jul 24 20:53:38 2000: AUTHENTICATE: 167/44566 'luser9 at realm.com' via some.host.com from some.nas.com port 6 PPP - OK -- total 0, holding 0
+
+    if ($line =~ /: AUTHENTICATE: .* via .* from .* OK /i) {
+	$merit_radius_rem_auth_ok ++;
+	printf "Merit_RADIUS_REM_AUTH_OK: %s", $line if $debug;
+	printf "merit_radius_rem_auth_ok=%s\n", $merit_radius_rem_auth_ok if $debug;
+	return 0;
+    }
+
+### REMOTE AUTH FAILED
+# Mon Jul 24 14:05:56 2000: AUTHENTICATE: 230/37578 'luser9 at realm.com' via some.host.com from i-Pass VNAS\0\0\0\0 port 1 - FAILED Authentication failure -- total 0, holding 0
+
+    if ($line =~ /: AUTHENTICATE: .* via .* from .* FAILED Authentication /i) {
+	$merit_radius_rem_auth_nok ++;
+	printf "Merit_RADIUS_REM_AUTH_NOK: %s", $line if $debug;
+	printf "merit_radius_rem_auth_nok=%s\n", $merit_radius_rem_auth_nok if $debug;
+	return 0;
+    }
+
+
+    $merit_radius_undefs ++;
+    printf "Merit_RADIUS_UNDEF: %s", $line if $debug;
+    printf "merit_radius_undefs=%s\n", $merit_radius_undefs if $debug;
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Put the merit_radius values for output
+#
+# usage: &put_merit_radius();
+#
+
+sub put_merit_radius() {
+
+    &put_output("merit_radius_auth",  sprintf("%8.2f", $merit_radius_auth));
+    &put_output("merit_radius_auth_ok",  sprintf("%8.2f", $merit_radius_auth_ok));
+    &put_output("merit_radius_auth_nok",  sprintf("%8.2f", $merit_radius_auth_nok));
+    &put_output("merit_radius_acct_start",  sprintf("%8.2f", $merit_radius_acct_start));
+    &put_output("merit_radius_acct_stop",  sprintf("%8.2f", $merit_radius_acct_stop));
+    &put_output("merit_radius_rem_auth",  sprintf("%8.2f", $merit_radius_rem_auth));
+    &put_output("merit_radius_rem_auth_ok",  sprintf("%8.2f", $merit_radius_rem_auth_ok));
+    &put_output("merit_radius_rem_auth_nok",  sprintf("%8.2f", $merit_radius_rem_auth_nok));
+
+    &put_output("merit_radius_undefs",  sprintf("%8.2f", $merit_radius_undefs));
+
+    return 0;
+}
+
+
+
+# -------------------------------------------------------------------
+#
+# init pop vars
+#
+# usage: &init_pop_vars();
+#
+
+sub init_pop_vars() {
+    $pop_connect      = 0;
+    $pop_login        = 0;
+    $pop_logout       = 0;
+
+    $pop_failure      = 0;
+    $pop_refused      = 0;
+
+    $pop_net_error    = 0;
+    $pop_local_error  = 0;
+
+    $pop_undefs       = 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Get values for pop columns
+#
+# usage: &measure_pop( );
+#
+
+sub measure_pop () {
+
+
+    #################################### insert bail out for too much
+    #################################### time spent ??
+    $buf = <$POPFD>;
+    while ($buf) {
+	## process line read and check for eof
+	if ($buf) {
+	    &process_pop_line ($buf);
+	}
+	if ($POPFD->eof) {
+	    printf "POP: eof on $POPFile\n" if $debug;
+	    last; # get out of while($buf)
+	}
+	$buf = <$POPFD>;
+    } ## while ($buf)
+
+
+    # test for file change via different inode or filesize decrease
+    $dev = $ino = $mode = $nlink = $uid = $gid = $rdev =
+	$size = $atime = $mtime = $ctime = $blksize = $blocks = '';
+    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+     $atime,$mtime,$ctime,$blksize,$blocks) = stat($POPFile);
+    if (!$dev) {
+	&logit ("can't stat $POPFile");
+	warn "$progname: can't stat $POPFile\n";
+	return 1;
+    }
+    printf "POPFD: pop_ino=%s vs. ino=%s\tpop_size=%s vs. size=%s\n", $pop_ino, $ino, $pop_size, $size if $debug;
+    if (($pop_ino != $ino) || ($pop_size > $size)) {
+	undef $POPFD;
+	printf "POP: file change on $POPFile\n" if $debug;
+	$POPFD = new IO::File "$POPFile", "r";
+	if (!defined ($POPFD)) {
+	    &logit ("can't re-open $POPFile");
+	    warn "$progname: can't re-open $POPFile\n";
+	    $pop_ino = $pop_size = 0;
+	    return 2;
+	}
+	$pop_ino = $ino;
+	$pop_size = $size;
+    }
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Parse pop log line
+#
+# usage: &process_pop_line ($buf);
+#
+
+sub process_pop_line () {
+    my ($line) = @_;
+
+
+    if ($line !~ / ipop3d\[\d+\]: /) {
+        return 0;
+    }
+
+### connect
+# Aug 11 07:01:50 host1 ipop3d[13929]: connect from 14.5.8.10
+
+    if ($line =~ /: connect from /i) {
+	$pop_connect ++;
+	printf "POP_CONNECT: %s", $line if $debug;
+	printf "pop_connect=%s\n", $pop_connect if $debug;
+	return 0;
+    }
+
+### login + auth
+# Aug 11 07:01:57 host1 ipop3d[13928]: Login user=luser2 host=host.domain.pt [13.16.6.27] nmsgs=0/0
+# Aug 11 07:02:06 host1 ipop3d[13936]: Auth user=luser3 host=2-4-4.domain.pt [13.16.2.18] nmsgs=0/0
+
+    if ( ($line =~ /: Login user=/i) ||
+	 ($line =~ /: Auth user=/i) ) {
+	$pop_login ++;
+	printf "POP_LOGIN: %s", $line if $debug;
+	printf "pop_login=%s\n", $pop_login if $debug;
+	return 0;
+    }
+
+### logout
+# Aug 11 07:01:50 host1 ipop3d[13929]: Logout user=luser4 host=[14.6.8.10] nmsgs=0 ndele=0
+# Aug 11 11:20:24 host1 ipop3d[1866]: Autologout user=luser5 host=3-0-0.domain.pt [13.16.1.18]
+
+    if ($line =~ /: .*[lL]ogout user=/i) {
+	$pop_logout ++;
+	printf "POP_LOGOUT: %s", $line if $debug;
+	printf "pop_LOGOUT=%s\n", $pop_logout if $debug;
+	return 0;
+    }
+
+### failure
+# Aug 11 09:19:19 host1 ipop3d[22171]: Login failure user=luser44 host=4-0-0.domain.pt [13.16.12.1]
+# Aug 11 09:19:22 host1 ipop3d[22171]: AUTHENTICATE LOGIN failure host=4-0-0.domain.pt [13.16.12.1]
+# Aug 11 09:47:47 host1 ipop3d[25308]: AUTHENTICATE luser323 failure host=[13.12.24.24]
+
+    if ($line =~ / failure /i) {
+	$pop_failure ++;
+	printf "POP_FAILURE: %s", $line if $debug;
+	printf "pop_failure=%s\n", $pop_failure if $debug;
+	return 0;
+    }
+
+### refused
+# Aug 11 13:32:14 host1 ipop3d[28886]: refused connect from 13.17.8.28
+
+    if ($line =~ /: refused connect from /i) {
+	$pop_refused ++;
+	printf "POP_REFUSED: %s", $line if $debug;
+	printf "pop_refused=%s\n", $pop_refused if $debug;
+	return 0;
+    }
+
+### local_error
+# Aug 11 11:50:36 host1 ipop3d[13132]: Error opening or locking INBOX user=luser10 host=3-4-3.domain.pt [13.16.4.7]
+
+    if ($line =~ /: Error opening or locking INBOX user=/i) {
+	$pop_local_error ++;
+	printf "POP_LOCAL_ERROR: %s", $line if $debug;
+	printf "pop_local_error=%s\n", $pop_local_error if $debug;
+	return 0;
+    }
+
+### net_error
+# Aug 11 07:36:14 host1 ipop3d[15759]: Command stream end of file while reading line user=luser234 host=9-9-9-domain.pt [13.16.4.5]
+# Aug 11 09:50:09 host1 ipop3d[24960]: Connection reset by peer while reading line user=luser555 host=[12.5.19.16]
+# Aug 11 12:15:01 host1 ipop3d[16601]: Connection timed out while reading line user=luser7985 host=4-5-6.domain.pt [13.16.1.15]
+
+    if ( ($line =~ /: Command stream end of file while reading line user=/i) ||
+	 ($line =~ /: Connection reset by peer while reading line user=/i) ||
+	 ($line =~ /: Connection timed out while reading line user=/i) ){
+	$pop_net_error ++;
+	printf "POP_NET_ERROR: %s", $line if $debug;
+	printf "pop_net_error=%s\n", $pop_net_error if $debug;
+	return 0;
+    }
+
+
+    $pop_undefs ++;
+    printf "POP_UNDEF: %s", $line if $debug;
+    printf "pop_undefs=%s\n", $pop_undefs if $debug;
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Put the pop values for output
+#
+# usage: &put_pop();
+#
+
+sub put_pop() {
+
+    &put_output("pop_connect",  sprintf("%8.2f", $pop_connect));
+    &put_output("pop_login",  sprintf("%8.2f", $pop_login));
+    &put_output("pop_logout",  sprintf("%8.2f", $pop_logout));
+
+    &put_output("pop_failure",  sprintf("%8.2f", $pop_failure));
+    &put_output("pop_refused",  sprintf("%8.2f", $pop_refused));
+
+    &put_output("pop_net_error",  sprintf("%8.2f", $pop_net_error));
+    &put_output("pop_local_error",  sprintf("%8.2f", $pop_local_error));
+
+    &put_output("pop_undefs",  sprintf("%8.2f", $pop_undefs));
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Get values for radiator radius columns
+#
+# usage: &measure_radius( );
+#
+
+sub measure_radius () {
+    #################################### insert bail out for too much
+    #################################### time spent ??
+
+  my $upper_ts= time;
+
+#Begin GET Accounting
+
+    $query  = "SELECT ACCT_SESSION_TIME,ACCT_STATUS_TYPE FROM ACCOUNTING ";
+    $query .= " WHERE ACCT_STATUS_TYPE = 'Stop'";
+    $query .= " AND TIMESTAMP > $radius_base_ts";
+    $query .= " AND TIMESTAMP < $upper_ts";
+
+    ($rad_time,$rad_sessions) = calculateRadVals($query);
+
+    ## incremental/accumulated values
+##    $radius_inc_time += $rad_time;
+##    $radius_inc_sessions += $rad_sessions;
+
+#END GET Accounting
+
+##    `$ECHO "$radius_inc_time:$radius_inc_sessions" > $ACCUM_radius_DB`;
+    $radius_base_ts += ($upper_ts - $radius_base_ts);
+    return 0;
+}
+
+##
+# IN:   query
+# RET:  time, sessions
+##
+sub calculateRadVals{
+  my $query = shift(@_);
+
+#print "radius query: $query\n";
+
+    my ($rad_t,$rad_s)= (0,0);
+    $sth = $RADdbh->prepare($query);
+    $sth ->execute();
+
+    $"=" \t ";
+    while ( @row = $sth -> fetchrow_array()){
+        #print "$row[0].$row[1]: $eca\n";
+        $rad_t += $row[0];
+        $rad_s++;
+    }
+
+    #print "Time: $rad_t seconds\t Sess: $rad_s sessions\n";
+    return ($rad_t,$rad_s);
+}
+
+
+# -------------------------------------------------------------------
+#
+# Put the radiator radius  values for output
+#
+# usage: &put_radius();
+#
+
+sub put_radius() {
+
+    &put_output("rad_time",  sprintf("%8.2f", $rad_time));
+    &put_output("rad_sessions",  sprintf("%8.2f", $rad_sessions));
+
+#incremental graph
+##    &put_output("radius_inc_time",  sprintf("%8.2f", $radius_inc_time));
+ ##   &put_output("radius_inc_sessions",  sprintf("%8.2f", $radius_inc_sessions));
+
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Get values for dns columns
+#
+# usage: &measure_dns( );
+#
+
+sub measure_dns () {
+
+
+    #################################### insert bail out for too much
+    #################################### time spent ??
+    $buf = <$DNSFD>;
+    while ($buf) {
+	## process line read and check for eof
+	if ($buf) {
+	    &process_dns_line ($buf);
+	}
+	if ($DNSFD->eof) {
+	    printf "DNS: eof on $DNSFile\n" if $debug;
+	    last; # get out of while($buf)
+	}
+	$buf = <$DNSFD>;
+    } ## while ($buf)
+
+
+    # test for file change via different inode or filesize decrease
+    $dev = $ino = $mode = $nlink = $uid = $gid = $rdev =
+	$size = $atime = $mtime = $ctime = $blksize = $blocks = '';
+    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+     $atime,$mtime,$ctime,$blksize,$blocks) = stat($DNSFile);
+    if (!$dev) {
+	&logit ("can't stat $DNSFile");
+	warn "$progname: can't stat $DNSFile\n";
+	return 1;
+    }
+    printf "DNSFD: dns_ino=%s vs. ino=%s\tdns_size=%s vs. size=%s\n", $dns_ino, $ino, $dns_size, $size if $debug;
+    if (($dns_ino != $ino) || ($dns_size > $size)) {
+	undef $DNSFD;
+	printf "DNS: file change on $DNSFile\n" if $debug;
+	$DNSFD = new IO::File "$DNSFile", "r";
+	if (!defined ($DNSFD)) {
+	    &logit ("can't re-open $DNSFile");
+	    warn "$progname: can't re-open $DNSFile\n";
+	    $dns_ino = $dns_size = 0;
+	    return 2;
+	}
+	$dns_ino = $ino;
+	$dns_size = $size;
+    }
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# init dns vars
+#
+# usage: &init_dns_vars();
+#
+
+sub init_dns_vars() {
+
+    $dns_usage_started       = 0;
+    $dns_nstats_started      = 0;
+    $dns_xstats_started      = 0;
+
+    &init_dns_usage_vars();
+    &init_dns_nstats_vars();
+    &init_dns_xstats_vars();
+
+    &init_odns_vars();
+}
+sub init_dns_usage_vars () {
+    $dns_cpu_u      = 0;
+    $dns_cpu_s      = 0;
+    $dns_ccpu_u     = 0;
+    $dns_ccpu_s     = 0;
+}
+sub init_dns_nstats_vars () {
+    $dns_a          = 0;
+    $dns_ptr        = 0;
+    $dns_mx         = 0;
+    $dns_any        = 0;
+
+    $dns_ns         = 0;
+    $dns_soa        = 0;
+    $dns_axfr       = 0;
+    $dns_aaaa       = 0;
+    $dns_other      = 0;
+}
+sub init_dns_xstats_vars () {
+    $dns_rr         = 0;
+    $dns_rq         = 0;
+    $dns_rother     = 0;
+
+    $dns_sans       = 0;
+    $dns_snaans     = 0;
+    $dns_snxd       = 0;
+    $dns_sother     = 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# init odns vars    (save old values)
+#
+# usage: &init_odns_vars();
+#
+
+sub init_odns_vars() {
+    &init_odns_usage_vars();
+    &init_odns_nstats_vars();
+    &init_odns_xstats_vars();
+}
+
+sub init_odns_usage_vars() {
+    $odns_cpu_u      = $dns_cpu_u      ;
+    $odns_cpu_s      = $dns_cpu_s      ;
+    $odns_ccpu_u     = $dns_ccpu_u     ;
+    $odns_ccpu_s     = $dns_ccpu_s     ;
+
+    &init_dns_usage_vars();
+}
+sub init_odns_nstats_vars() {
+    $odns_a          = $dns_a          ;
+    $odns_ptr        = $dns_ptr        ;
+    $odns_mx         = $dns_mx         ;
+    $odns_any        = $dns_any        ;
+
+    $odns_ns         = $dns_ns         ;
+    $odns_soa        = $dns_soa        ;
+    $odns_axfr       = $dns_axfr       ;
+    $odns_aaaa       = $dns_aaaa       ;
+    $odns_other      = $dns_other      ;
+
+    &init_dns_nstats_vars();
+}
+sub init_odns_xstats_vars() {
+    $odns_rr         = $dns_rr         ;
+    $odns_rq         = $dns_rq         ;
+    $odns_rother     = $dns_rother     ;
+
+    $odns_sans       = $dns_sans       ;
+    $odns_snaans     = $dns_snaans     ;
+    $odns_snxd       = $dns_snxd       ;
+    $odns_sother     = $dns_sother     ;
+
+    &init_dns_xstats_vars();
+}
+
+
+# -------------------------------------------------------------------
+#
+# calc dns delta
+#
+# usage: &calc_dns_delta();
+#
+
+sub calc_dns_delta() {
+    &calc_dns_usage_delta();
+    &calc_dns_nstats_delta();
+    &calc_dns_xstats_delta();
+}
+
+sub calc_dns_usage_delta() {
+    my $temp = 0;
+
+    if ($dns_cpu_u < $odns_cpu_u) {
+	$odns_cpu_u = $dns_cpu_u;
+    } else {
+	$temp = $dns_cpu_u; $dns_cpu_u = $dns_cpu_u - $odns_cpu_u; $odns_cpu_u = $temp;
+    }
+    if ($dns_cpu_s < $odns_cpu_s) {
+	$odns_cpu_s = $dns_cpu_s;
+    } else {
+	$temp = $dns_cpu_s; $dns_cpu_s = $dns_cpu_s - $odns_cpu_s; $odns_cpu_s = $temp;
+    }
+    if ($dns_ccpu_u < $odns_ccpu_u) {
+	$odns_ccpu_u = $dns_ccpu_u;
+    } else {
+	$temp = $dns_ccpu_u; $dns_ccpu_u = $dns_ccpu_u - $odns_ccpu_u; $odns_ccpu_u = $temp;
+    }
+    if ($dns_ccpu_s < $odns_ccpu_s) {
+	$odns_ccpu_s = $dns_ccpu_s;
+    } else {
+	$temp = $dns_ccpu_s; $dns_ccpu_s = $dns_ccpu_s - $odns_ccpu_s; $odns_ccpu_s = $temp;
+    }
+}
+sub calc_dns_nstats_delta() {
+    my $temp = 0;
+
+    if ($dns_a < $odns_a) {
+	$odns_a = $dns_a;
+    } else {
+	$temp = $dns_a; $dns_a = $dns_a - $odns_a; $odns_a = $temp;
+    }
+    if ($dns_ptr < $odns_ptr) {
+	$odns_ptr = $dns_ptr;
+    } else {
+	$temp = $dns_ptr; $dns_ptr = $dns_ptr - $odns_ptr; $odns_ptr = $temp;
+    }
+    if ($dns_mx < $odns_mx) {
+	$odns_mx = $dns_mx;
+    } else {
+	$temp = $dns_mx; $dns_mx = $dns_mx - $odns_mx; $odns_mx = $temp;
+    }
+    if ($dns_any < $odns_any) {
+	$odns_any = $dns_any;
+    } else {
+	$temp = $dns_any; $dns_any = $dns_any - $odns_any; $odns_any = $temp;
+    }
+
+    if ($dns_ns < $odns_ns) {
+	$odns_ns = $dns_ns;
+    } else {
+	$temp = $dns_ns; $dns_ns = $dns_ns - $odns_ns; $odns_ns = $temp;
+    }
+    if ($dns_soa < $odns_soa) {
+	$odns_soa = $dns_soa;
+    } else {
+	$temp = $dns_soa; $dns_soa = $dns_soa - $odns_soa; $odns_soa = $temp;
+    }
+    if ($dns_axfr < $odns_axfr) {
+	$odns_axfr = $dns_axfr;
+    } else {
+	$temp = $dns_axfr; $dns_axfr = $dns_axfr - $odns_axfr; $odns_axfr = $temp;
+    }
+    if ($dns_aaaa < $odns_aaaa) {
+	$odns_aaaa = $dns_aaaa;
+    } else {
+	$temp = $dns_aaaa; $dns_aaaa = $dns_aaaa - $odns_aaaa; $odns_aaaa = $temp;
+    }
+    if ($dns_other < $odns_other) {
+	$odns_other = $dns_other;
+    } else {
+	$temp = $dns_other; $dns_other = $dns_other - $odns_other; $odns_other = $temp;
+    }
+}
+sub calc_dns_xstats_delta() {
+    my $temp = 0;
+
+    if ($dns_rr < $odns_rr) {
+	$odns_rr = $dns_rr;
+    } else {
+	$temp = $dns_rr; $dns_rr = $dns_rr - $odns_rr; $odns_rr = $temp;
+    }
+    if ($dns_rq < $odns_rq) {
+	$odns_rq = $dns_rq;
+    } else {
+	$temp = $dns_rq; $dns_rq = $dns_rq - $odns_rq; $odns_rq = $temp;
+    }
+    if ($dns_rother < $odns_rother) {
+	$odns_rother = $dns_rother;
+    } else {
+	$temp = $dns_rother; $dns_rother = $dns_rother - $odns_rother; $odns_rother = $temp;
+    }
+
+    if ($dns_sans < $odns_sans) {
+	$odns_sans = $dns_sans;
+    } else {
+	$temp = $dns_sans; $dns_sans = $dns_sans - $odns_sans; $odns_sans = $temp;
+    }
+    if ($dns_snaans < $odns_snaans) {
+	$odns_snaans = $dns_snaans;
+    } else {
+	$temp = $dns_snaans; $dns_snaans = $dns_snaans - $odns_snaans; $odns_snaans = $temp;
+    }
+    if ($dns_snxd < $odns_snxd) {
+	$odns_snxd = $dns_snxd;
+    } else {
+	$temp = $dns_snxd; $dns_snxd = $dns_snxd - $odns_snxd; $odns_snxd = $temp;
+    }
+    if ($dns_sother < $odns_sother) {
+	$odns_sother = $dns_sother;
+    } else {
+	$temp = $dns_sother; $dns_sother = $dns_sother - $odns_sother; $odns_sother = $temp;
+    }
+}
+
+
+# -------------------------------------------------------------------
+#
+# Parse dns log line
+#
+# usage: &process_dns_line ($buf);
+#
+
+sub process_dns_line () {
+    my ($line) = @_;
+
+#
+# Oct 24 14:27:49 Ns named[17279]: USAGE 972394069 970586866 CPU=188.82u/82.79s CHILDCPU=0u/0s
+# Oct 24 14:27:49 Ns named[17279]: NSTATS 972394069 970586866 0=6 A=322014 NS=25 SOA=415 PTR=35772 MX=111 SRV=110 ANY=238
+# Oct 24 14:27:49 Ns named[17279]: XSTATS 972394069 970586866 RR=293985 RNXD=22941 RFwdR=205718 RDupR=3603 RFail=508 RFErr=0 RErr=141 RAXFR=0 RLame=2636 ROpts=0 SSysQ=58851 SAns=205888 SFwdQ=169140 SDupQ=23529 SErr=0 RQ=358773 RIQ=0 RFwdQ=0 RDupQ=8397 RTCP=206 SFwdR=205718 SFail=3 SFErr=0 SNaAns=204478 SNXD=45736
+#
+    if ($line !~ / named\[\d+\]: (USAGE|NSTATS|XSTATS) /) {
+	return 0;
+    }
+
+
+# Oct 24 14:27:49 Ns named[17279]: USAGE 972394069 970586866 CPU=188.82u/82.79s CHILDCPU=0u/0s
+    if ($line =~ /: USAGE \d+ \d+ CPU=([\d\.]+)u\/([\d\.]+)s CHILDCPU=([\d\.]+)u\/([\d\.]+)s/) {
+
+	$dns_cpu_u = $1;
+	$dns_cpu_s = $2;
+	$dns_ccpu_u = $3;
+	$dns_ccpu_s = $4;
+
+	printf "DNS_USAGE: %s", $line if $debug;
+	printf "dns_cpu_u=%s, dns_cpu_s=%s, dns_ccpu_u=%s, dns_ccpu_s=%s\n", $dns_cpu_u, $dns_cpu_s, $dns_ccpu_u, $dns_ccpu_s if $debug;
+
+	if ($dns_usage_started) {
+	    &calc_dns_usage_delta(); # puts delta into vars to print -&- saves into old
+	} else {
+	    $dns_usage_started = 1;
+	    &init_odns_usage_vars();  # saves old and cleans current values
+	}
+
+# Oct 24 14:27:49 Ns named[17279]: NSTATS 972394069 970586866 0=6 A=322014 NS=25 SOA=415 PTR=35772 MX=111 SRV=110 ANY=238
+    } elsif ($line =~ /: NSTATS \d+ \d+ /) {
+	my $l;
+
+	($l = $line) =~ s/^.*: NSTATS \d+ \d+ //;  # trim beginning
+	chop $l;
+
+	@types = split(' ',$l);
+
+	$dns_other = 0;
+	while (@types) {
+	    ($t,$v) = split ('=', pop @types);
+	    if ($t eq 'A') {
+		$dns_a = $v;
+	    } elsif ($t eq 'PTR') {
+		$dns_ptr = $v;
+	    } elsif ($t eq 'MX') {
+		$dns_mx = $v;
+	    } elsif ($t eq 'ANY') {
+		$dns_any = $v;
+	    } elsif ($t eq 'NS') {
+		$dns_ns = $v;
+	    } elsif ($t eq 'SOA') {
+		$dns_soa = $v;
+	    } elsif ($t eq 'AXFR') {
+		$dns_axfr = $v;
+	    } elsif ($t eq 'AAAA') {
+		$dns_aaaa = $v;
+	    } else {
+		$dns_other += $v;
+	    }
+	}
+
+	printf "DNS_NSTATS: %s", $line if $debug;
+	printf "dns_a=%s, dns_ptr=%s, dns_mx=%s, dns_any=%s, dns_ns=%s, dns_soa=%s, dns_axfr=%s, dns_aaaa=%s, dns_other=%s\n", $dns_a, $dns_ptr, $dns_mx, $dns_any, $dns_ns, $dns_soa, $dns_axfr, $dns_aaaa, $dns_other if $debug;
+
+	if ($dns_nstats_started) {
+	    &calc_dns_nstats_delta(); # puts delta into vars to print -&- saves into old
+	} else {
+	    $dns_nstats_started = 1;
+	    &init_odns_nstats_vars();  # saves old and cleans current values
+	}
+
+# Oct 24 14:27:49 Ns named[17279]: XSTATS 972394069 970586866 RR=293985 RNXD=22941 RFwdR=205718 RDupR=3603 RFail=508 RFErr=0 RErr=141 RAXFR=0 RLame=2636 ROpts=0 SSysQ=58851 SAns=205888 SFwdQ=169140 SDupQ=23529 SErr=0 RQ=358773 RIQ=0 RFwdQ=0 RDupQ=8397 RTCP=206 SFwdR=205718 SFail=3 SFErr=0 SNaAns=204478 SNXD=45736
+    } elsif ($line =~ /: XSTATS \d+ \d+ /) {
+	my $l;
+
+	($l = $line) =~ s/^.*: XSTATS \d+ \d+ //;  # trim beginning
+	chop $l;
+
+	@types = split(' ',$l);
+
+	$dns_rother = $dns_sother = 0;
+	while (@types) {
+	    ($t,$v) = split ('=', pop @types);
+	    if ($t eq 'RR') {
+		$dns_rr = $v;
+	    } elsif ($t eq 'RQ') {
+		$dns_rq = $v;
+	    } elsif ($t =~ /^R/) {
+		$dns_rother += $v;
+	    } elsif ($t eq 'SAns') {
+		$dns_sans = $v;
+	    } elsif ($t eq 'SNaAns') {
+		$dns_snaans = $v;
+	    } elsif ($t eq 'SNXD') {
+		$dns_snxd = $v;
+	    } elsif ($t =~ /^S/) {
+		$dns_sother += $v;
+	    }
+	}
+
+	printf "DNS_XSTATS: %s", $line if $debug;
+	printf "dns_rr=%s, dns_rq=%s, dns_rother=%s, dns_sans=%s, dns_snaans=%s, dns_snxd=%s, dns_sother=%s\n", $dns_rr, $dns_rq, $dns_rother, $dns_sans, $dns_snaans, $dns_snxd, $dns_sother if $debug;
+
+	if ($dns_xstats_started) {
+	    &calc_dns_xstats_delta(); # puts delta into vars to print -&- saves into old
+	} else {
+	    $dns_xstats_started = 1;
+	    &init_odns_xstats_vars();  # saves old and cleans current values
+	}
+
+    }
+
+    return 0;
+}
+
+
+# -------------------------------------------------------------------
+#
+# Put the dns values for output
+#
+# usage: &put_dns();
+#
+
+sub put_dns() {
+
+    &put_output("dns_cpu_u",  sprintf("%8.2f", $dns_cpu_u));
+    &put_output("dns_cpu_s",  sprintf("%8.2f", $dns_cpu_s));
+    &put_output("dns_ccpu_u",  sprintf("%8.2f", $dns_ccpu_u));
+    &put_output("dns_ccpu_s",  sprintf("%8.2f", $dns_ccpu_s));
+
+    &put_output("dns_a",  sprintf("%8.2f", $dns_a));
+    &put_output("dns_ptr",  sprintf("%8.2f", $dns_ptr));
+    &put_output("dns_mx",  sprintf("%8.2f", $dns_mx));
+    &put_output("dns_any",  sprintf("%8.2f", $dns_any));
+
+    &put_output("dns_ns",  sprintf("%8.2f", $dns_ns));
+    &put_output("dns_soa",  sprintf("%8.2f", $dns_soa));
+    &put_output("dns_axfr",  sprintf("%8.2f", $dns_axfr));
+    &put_output("dns_aaaa",  sprintf("%8.2f", $dns_aaaa));
+    &put_output("dns_other",  sprintf("%8.2f", $dns_other));
+
+    &put_output("dns_rr",  sprintf("%8.2f", $dns_rr));
+    &put_output("dns_rq",  sprintf("%8.2f", $dns_rq));
+    &put_output("dns_rother",  sprintf("%8.2f", $dns_rother));
+
+    &put_output("dns_sans",  sprintf("%8.2f", $dns_sans));
+    &put_output("dns_snaans",  sprintf("%8.2f", $dns_snaans));
+    &put_output("dns_snxd",  sprintf("%8.2f", $dns_snxd));
+    &put_output("dns_sother",  sprintf("%8.2f", $dns_sother));
+
+    return 0;
+}
+

Added: trunk/orca/contrib/orcaservices/orcaservices_running.pl.in
==============================================================================
--- trunk/orca/contrib/orcaservices/orcaservices_running.pl.in	(original)
+++ trunk/orca/contrib/orcaservices/orcaservices_running.pl.in	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,41 @@
+# orcaservices_running: warn if orcaservices files are not up to date.
+#
+# Copyright (C) 2000 Carlos Canau and KPNQwest Portugal
+# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+
+use strict;
+use POSIX qw(strftime);
+
+# Set this to the list of directories that contain the output from
+# percoservices.se.
+my @stats_dirs = ('@ORCASERVICES_DIR@');
+
+foreach my $stats_dir (@stats_dirs) {
+
+  die "$0: unable to change to `$stats_dir'" unless chdir $stats_dir;
+
+  die "$0: unable to open `.' for reading: $!\n" unless opendir(DIR, '.');
+
+  my @hosts = sort grep { $_ !~ /^\./ } readdir(DIR);
+
+  closedir(DIR);
+
+  print "Now in $stats_dir\n";
+
+  my $percol = strftime("percol-%Y-%m-%d", localtime());
+
+  foreach my $host (@hosts) {
+    my $file = "$host/$percol";
+    unless (-f $file) {
+      warn "$0: $file does not exist.\n";
+      next;
+    }
+    my $age = (-M $file)*(24*60);
+    if ( $age > 8) {
+      $file= sprintf "%35s", $file;
+      $age = sprintf "%8.2f", $age;
+      warn "$0: $file is $age minutes old.\n";
+      next;
+    }
+  }
+}

Added: trunk/orca/contrib/orcaservices/restart_orcaservices.sh.in
==============================================================================
--- trunk/orca/contrib/orcaservices/restart_orcaservices.sh.in	(original)
+++ trunk/orca/contrib/orcaservices/restart_orcaservices.sh.in	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# This stops and restarts orcaservices.se.
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+
+# Kill any running orcaservicess.
+$bindir/stop_orcaservices
+
+# Start the orcaservices.
+$bindir/start_orcaservices

Added: trunk/orca/contrib/orcaservices/S99orcaservices.sh.in
==============================================================================
--- trunk/orca/contrib/orcaservices/S99orcaservices.sh.in	(original)
+++ trunk/orca/contrib/orcaservices/S99orcaservices.sh.in	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+
+case "$1" in
+'start')
+	if [ -x $bindir/start_orcaservices ]; then
+		umask 022
+		$bindir/start_orcaservices
+	else
+		echo "$0: $bindir/start_orcaservices does not exist or is not executable."
+	fi
+	;;
+
+'stop')
+	if [ -x $bindir/stop_orcaservices ]; then
+		$bindir/stop_orcaservices
+	fi
+	;;
+
+*)
+	echo "Usage: $0 { start | stop }"
+	exit 1
+	;;
+
+esac
+exit 0

Added: trunk/orca/contrib/orcaservices/stop_orcaservices.sh.in
==============================================================================
--- trunk/orca/contrib/orcaservices/stop_orcaservices.sh.in	(original)
+++ trunk/orca/contrib/orcaservices/stop_orcaservices.sh.in	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+AWK=@AWK@
+
+# Kill any running orcallators.
+pids=`/usr/ucb/ps auxww | $AWK '/orcaservices.pl/ && !/awk/ {print $2}'`
+if test "$pids" != ""; then
+  echo "Killing pids $pids."
+  kill -HUP $pids
+  sleep 1
+  pids=`/usr/ucb/ps auxww | $AWK '/orcaservices.pl/ && !/awk/ {print $2}'`
+  if test "$pids" != ""; then
+    kill -TERM $pids
+    sleep 1
+    pids=`/usr/ucb/ps auxww | $AWK '/orcaservices.pl/ && !/awk/ {print $2}'`
+    if test "$pids" != ""; then
+      kill -9 $pids
+      sleep 1
+    fi
+  fi
+fi

Added: trunk/orca/contrib/orcaservices/orcaservices.cfg.in
==============================================================================
--- trunk/orca/contrib/orcaservices/orcaservices.cfg.in	(original)
+++ trunk/orca/contrib/orcaservices/orcaservices.cfg.in	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,395 @@
+base_dir		@RRD_DIR@/orcaservices
+rrd_dir			.
+state_file		orca.state
+html_dir		@HTML_DIR at -services
+expire_images		1
+find_times		0:10 1:00 6:00 12:00 19:00
+
+warn_email		root at localhost
+late_interval		interval + 30
+
+
+#
+# ATTENTION: hardcoded /var/orca/orcaservices/ in find_files
+# you might need to change this to your values
+#
+group orcaservices {
+find_files		/var/orca/orcaservices/(.*)/(?:(?:orcaservices)|(?:percol))-\d{4}-\d{2}-\d{2}(?:\.(?:Z|gz|bz2))?
+column_description	first_line
+date_source		column_name timestamp
+date_format		%s
+interval		300
+reopen			1
+filename_compare	sub {
+			  my ($ay, $am, $ad) = $a =~ /-(\d{4})-(\d\d)-(\d\d)/;
+			  my ($by, $bm, $bd) = $b =~ /-(\d{4})-(\d\d)-(\d\d)/;
+			  if (my $c = (( $ay       <=>  $by) ||
+			               ( $am       <=>  $bm) ||
+			               (($ad >> 3) <=> ($bd >> 3)))) {
+			    return 2*$c;
+			  }
+			  $ad <=> $bd;
+			}
+}
+
+#
+# ATTENTION: change this to your values
+#
+html_top_title		Services Status
+
+#
+# ATTENTION: change this to your values
+#
+html_page_header
+  <a href="http://www.kpnQwest.pt/">
+    <img border=0 alt="kpnQwest Portugal"
+     src="http://www.kpnqwest.pt/images/kqlogopt_mini.gif"
+     width=101 height=61></a>
+  <spacer type=vertical size=4>
+
+html_page_footer
+  <spacer type=vertical size=20>
+  <font face="Arial,Helvetica">
+    These plots brought to you by your local system administrator.
+  </font>
+
+
+plot {
+title			%g SMTP Mail Queue
+source			orcaservices
+data			mailq_total
+legend			Msgs. in queue (5m)
+y_legend		Number of Messages
+line_type		line2
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#SMTP_Mail_Queue
+}
+
+plot {
+title			%g SMTP Messages in 5 minutes
+source			orcaservices
+data			smtp_from
+data			smtp_sent
+legend			Messages In (5m)
+legend			Messages Out (5m)
+y_legend		Number of Messages
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#SMTP_Messages_in_5_minutes
+}
+
+plot {
+title			%g SMTP Size
+source			orcaservices
+data			smtp_sizes
+data			smtp_tops
+line_type		area
+line_type		line1
+legend			5 min average
+legend			Peak 5 minute
+y_legend		Message size (bytes)
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#SMTP_Size
+}
+
+plot {
+title			%g SMTP Delay
+source			orcaservices
+data			smtp_delay
+data			smtp_maxd
+line_type		area
+line_type		line1
+legend			5 min average
+legend			Peak 5 minute
+y_legend		Message Delay (seconds)
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#SMTP_Delay
+}
+
+plot {
+title			%g SMTP Retries and Queueing
+source			orcaservices
+data			smtp_rtrs
+data			smtp_queued
+legend			Retries (5m)
+legend			Messages Queued (5m)
+y_legend		Number of Messages
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#SMTP_Retries_and_Queueing
+}
+
+plot {
+title			%g SMTP Failed
+source			orcaservices
+data			smtp_torf
+data			smtp_c_ml
+data			smtp_c_rt
+data			smtp_ntfs
+legend			Temp or Fatal Error (5m)
+legend			Check Mail (5m)
+legend			Check Rcpt (5m)
+legend			Portmaster Notifies (5m)
+y_legend		Number of Messages
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#SMTP_Failed
+}
+
+plot {
+title			%g SMTP DSN and Undefs
+source			orcaservices
+data			smtp_dsns
+data			smtp_undf
+legend			Number of DSNs (5m)
+legend			Undefined log (5m)
+y_legend		Number of Messages
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#SMTP_DSN_and_Undefs
+}
+
+
+
+
+plot {
+title			%g MERIT RADIUS AUTH in 5 minutes
+source			orcaservices
+data			radius_auth
+data			radius_auth_ok
+data			radius_auth_nok
+legend			Auth (5m)
+legend			Auth OK (5m)
+legend			Auth FAILED (5m)
+y_legend		Number of Auth Packets
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#MERIT_RADIUS_AUTH_in_5_minutes
+}
+
+plot {
+title			%g MERIT RADIUS ACCT in 5 minutes
+source			orcaservices
+data			radius_acct_start
+data			radius_acct_stop
+legend			Start records (5m)
+legend			Stop records (5m)
+y_legend		Number of Acct Packets
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#MERIT_RADIUS_ACCT_in_5_minutes
+}
+
+plot {
+title			%g MERIT RADIUS REMOTE AUTH in 5 minutes
+source			orcaservices
+data			radius_rem_auth
+data			radius_rem_auth_ok
+data			radius_rem_auth_nok
+legend			Remote Auth (5m)
+legend			Remote Auth OK (5m)
+legend			Remote Auth FAILED (5m)
+y_legend		Number of Remote Auth Packets
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#MERIT_RADIUS_REMOTE_AUTH_in_5_minutes
+}
+
+plot {
+title			%g MERIT RADIUS UNDEFS in 5 minutes
+source			orcaservices
+data			radius_undefs
+legend			Undef lines (5m)
+y_legend		Number of undef lines
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#MERIT_RADIUS_UNDEFS_in_5_minutes
+}
+
+
+
+plot {
+title			%g POP SESSIONS in 5 minutes
+source			orcaservices
+data			pop_connect
+data			pop_login
+data			pop_logout
+legend			Connect (5m)
+legend			Login (5m)
+legend			Logout (5m)
+y_legend		Units in 5 minutes
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#POP_SESSIONS_in_5_minutes
+}
+
+plot {
+title			%g POP DENIED in 5 minutes
+source			orcaservices
+data			pop_failure
+data			pop_refused
+legend			Failures (5m)
+legend			Refused (5m)
+y_legend		Units in 5 minutes
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#POP_DENIED_in_5_minutes
+}
+
+plot {
+title			%g POP FAILURES in 5 minutes
+source			orcaservices
+data			pop_net_error
+data			pop_local_error
+legend			Network errors (5m)
+legend			Local errors (5m)
+y_legend		Units in 5 minutes
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#POP_FAILURES_in_5_minutes
+}
+
+plot {
+title			%g POP UNDEFS in 5 minutes
+source			orcaservices
+data			pop_undefs
+legend			Undefs (5m)
+y_legend		Units in 5 minutes
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#POP_UNDEFS_in_5_minutes
+}
+
+plot {
+title			%g Radius time usage
+source			orcaservices
+line_type		line2
+data			rad_time/60
+legend			Time consumption (5 min)
+y_legend		Minutes
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#Radius_time_usage
+}
+
+plot {
+title			%g Radius sessions
+source			orcaservices
+line_type		line2
+data			rad_sessions
+legend			Number of Sessions (5 min)
+y_legend		Terminated Sessions
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#Radius_sessions
+}
+
+
+
+plot {
+title			%g NAMED CPU Usage in 1 hour
+source			orcaservices
+data			dns_cpu_u
+data			dns_cpu_s
+data			dns_ccpu_u
+data			dns_ccpu_s
+line_type		line2
+line_type		line2
+line_type		line2
+line_type		line2
+legend			User
+legend			System
+legend			Child User
+legend			Child System
+y_legend		Seconds in 1 hour
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#NAMED_CPU_Usage_in_1_hour
+}
+
+plot {
+title			%g NAMED Major queries
+source			orcaservices
+data			dns_a
+data			dns_ptr
+data			dns_mx
+data			dns_any
+line_type		line2
+line_type		line2
+line_type		line2
+line_type		line2
+legend			A
+legend			PTR
+legend			MX
+legend			ANY
+y_legend		Units in 1 hour
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#NAMED_Major_queries
+}
+
+plot {
+title			%g NAMED Minor queries
+source			orcaservices
+data			dns_ns
+data			dns_soa
+data			dns_axfr
+data			dns_aaaa
+data			dns_other
+line_type		line2
+line_type		line2
+line_type		line2
+line_type		line2
+line_type		line2
+legend			NS
+legend			SOA
+legend			AXFR
+legend			AAAA
+legend			OTHER
+y_legend		Units in 1 hour
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#NAMED_Minor_queries
+}
+
+plot {
+title			%g NAMED Received
+source			orcaservices
+data			dns_rr
+data			dns_rq
+data			dns_rother
+line_type		line2
+line_type		line2
+line_type		line2
+legend			R-Responses
+legend			R-Queries
+legend			R-OTHER
+y_legend		Units in 1 hour
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#NAMED_Received
+}
+
+plot {
+title			%g NAMED Sent
+source			orcaservices
+data			dns_sans
+data			dns_snaans
+data			dns_snxd
+data			dns_sother
+line_type		line2
+line_type		line2
+line_type		line2
+line_type		line2
+legend			S-Answer
+legend			S-NA Answer
+legend			S-Negative
+legend			S-OTHER
+y_legend		Units in 1 hour
+data_min		0
+data_max		U
+href			http://o-s.kpnqwest.pt/orcaservices.html#NAMED_Sent
+}

Added: trunk/orca/contrib/orcaservices/README
==============================================================================
--- trunk/orca/contrib/orcaservices/README	(original)
+++ trunk/orca/contrib/orcaservices/README	Sat Jul 13 21:25:42 2002
@@ -0,0 +1,155 @@
+##
+##
+## OrcaServices.pl, a log generating services usage monitor
+##
+##
+
+##
+## This program logs many different services usage to a log file
+## for later processing.
+##
+
+##
+## Author: Carlos Canau <Carlos.Canau at KPNQwest.pt>.
+## Documentation:	Jose Carlos <jcp at KPNQwest.pt>.
+##
+
+##
+## Portions adapted from Orcallator.se written by Blair Zajac
+## Portions ported to perl from Orcallator.se written by Blair Zajac
+## other portions adapted from several other open source scripts
+##
+##
+
+PERL_SCRIPTS
+	orcaservices_running
+		warn if orcaservices files are not up to date.
+		Not changed by canau.
+	orcaservices.pl
+		main data collector
+
+SHELL_SCRIPTS
+	restart_orcaservices
+		guess!
+	stop_orcaservices
+		I'll give you a hint... stopping
+	start_orcaservices
+		need a hint, look above
+	S99orcaservices
+		used for automatic start of orcaservices
+
+Other Files:
+ 	orcaservices.cfg
+
+		Configuration of services to monitor
+		graph details etc
+
+        $libdir/orcaservices.$HOSTNAME
+                services can be disabled editing this file.
+                $libdir defaults to /usr/local/lib
+
+                Services can be disabled using the param for file with
+                the switch for input file and setting it to off: ex:
+                --smtp_logfile=off
+
+        $libdir/orcaservices.DB.$HOSTNAME
+                $libdir defaults to /usr/local/lib
+                auth info for accessing database
+                SYNTAX:  proto:drv:database:user:pass
+                CAREFUL: mind the file permissions! chmod 0600
+
+Other Notes:
+	Changed scripts have the original copy in [FILE_NAME].ORIG
+
+###########################################################################
+INSTALLATION STEPS
+###########################################################################
+
+1) Install Time-HiRes -or- disable  line "use Time::HiRes" in the code
+
+2) Install DBI -or- disable line "use  DBI" in the code -AND- don't do
+radius stats via the "--radius_db=off" parameter
+
+3) cd [base_dir]/orca-0.26/
+   ./configure  [OPTIONS]
+   make
+   make install
+
+   * if orcaservices should run at boottime
+
+   make orcaservices_run_at_boot
+
+   Most of the skeleton code of orcaservices comes from orcallator. So
+   everything is very similar.
+
+4) You might need to edit orcaservices.pl to suit your needs. Look for
+   code need the ATTENTION string.  You'll probably need to edit
+   orcaservices.cfg.in.
+
+
+###########################################################################
+CURRENT VALUES
+###########################################################################
+
+NAMED
+-----
+DEFAULT: $def_dns_logfile = "/var/log/named";
+DISABLE: --dns_logfile=off
+
+	Reads hourly stats from named log file.
+
+SENDMAIL
+--------
+DEFAULT: $def_smtp_logfile = "/var/log/syslog";
+DISABLE: --smtp_logfile=off
+
+	Reads syslog from sendmail.
+
+MERIT RADIUS
+------------
+DEFAULT: $def_merit_radius_logfile = "/usr/local/etc/raddb/logfile";
+DISABLE: --merit_radius_logfile=off
+
+	Reads syslog from Merit Radius.
+
+POP3
+----
+DEFAULT: $def_pop_logfile = "/var/log/ipop3d.log";
+DISABLE: --pop_logfile=off
+
+	Reads syslog from ipop3d.
+
+RADIUS FROM DATABASE
+--------------------
+DEFAULT: $def_radius_auth = "/usr/local/lib/orcaservices.DB.$nodename";
+DISABLE: --radius_db=off
+
+
+	Reads Radius stop records from Database and do stats.  You
+	might need to change the SQL query in the code.  You'll have
+	to create the orcaservices.DB.$hostname file with the database
+	options.
+
+MAILQ
+-----
+DEFAULT: $def_mailq = "on";
+DISABLE: --mailq=off
+
+
+###########################################################################
+TODO
+###########################################################################
+
+. better installation
+. better documentation
+. more types of monitorization
+. rip WWW code from orcallator.se or re-write newer
+. ...
+
+###########################################################################
+FINAL RAVINGS
+###########################################################################
+
+Feel free to extend this package.  Any bug fixes and enhancements sent
+to o-s at kqnet.pt will be appreciated, dissected, scorned and probably
+included in future releases (not necessarily in that order :-)))).

Modified: trunk/orca/orcallator/orcallator_running.pl.in
==============================================================================
--- trunk/orca/orcallator/orcallator_running.pl.in	(original)
+++ trunk/orca/orcallator/orcallator_running.pl.in	Sat Jul 13 21:25:42 2002
@@ -1,6 +1,6 @@
 # orcallator_running: warn if orcallator files are not up to date.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and GeoCities, Inc.
+# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
 
 use strict;
 use POSIX qw(strftime);

Modified: trunk/orca/orcallator/Makefile.in
==============================================================================
--- trunk/orca/orcallator/Makefile.in	(original)
+++ trunk/orca/orcallator/Makefile.in	Sat Jul 13 21:25:42 2002
@@ -4,8 +4,8 @@
 exec_prefix	= @exec_prefix@
 bindir		= @bindir@
 libdir		= @libdir@
-MKDIR		= @MKDIR@
 INSTALL		= @INSTALL@
+MKDIR		= @MKDIR@
 PERL_HEAD	= @PERL_HEAD@
 ORCALLATOR_DIR	= @ORCALLATOR_DIR@
 RRD_DIR		= @RRD_DIR@
@@ -56,7 +56,6 @@
 
 Makefile:	Makefile.in
 		cd .. && CONFIG_FILES=orcallator/Makefile ./config.status
-		$(MAKE)
 
 orcallator.cfg:			orcallator.cfg.in
 		cd .. && CONFIG_FILES=orcallator/orcallator.cfg ./config.status

Modified: trunk/orca/orcallator/orcallator.cfg.in
==============================================================================
--- trunk/orca/orcallator/orcallator.cfg.in	(original)
+++ trunk/orca/orcallator/orcallator.cfg.in	Sat Jul 13 21:25:42 2002
@@ -1,5 +1,8 @@
 # Orca configuration file for orcallator files.
 
+# Require at least this version of Orca.
+require			Orca 0.263
+
 # base_dir is prepended to the paths find_files, html_dir, rrd_dir,
 # and state_file only if the path does not match the regular
 # expression ^\\?\.{0,2}/, which matches /, ./, ../, and \./.
@@ -34,6 +37,14 @@
 warn_email		root at localhost
 late_interval		interval + 30
 
+# These parameters specify which plots to generate.
+generate_hourly_plot	0
+generate_daily_plot	1
+generate_weekly_plot	1
+generate_monthly_plot	1
+generate_quarterly_plot	1
+generate_yearly_plot	1
+
 # This defines where the find the source data files and the format of
 # those files.  Notes about the fields:
 # find_files
@@ -53,9 +64,7 @@
 find_files		@ORCALLATOR_DIR@/(.*)/(?:(?:orcallator)|(?:percol))-\d{4}-\d{2}-\d{2}(?:\.(?:Z|gz|bz2))?
 column_description	first_line
 date_source		column_name timestamp
-date_format		%s
 interval		300
-reopen			1
 filename_compare	sub {
 			  my ($ay, $am, $ad) = $a =~ /-(\d{4})-(\d\d)-(\d\d)/;
 			  my ($by, $bm, $bd) = $b =~ /-(\d{4})-(\d\d)-(\d\d)/;
@@ -103,12 +112,15 @@
 source			orcallator
 data			usr%
 data			sys%
-data			100 - usr% - sys%
+data			wio%
+data			idle%
 line_type		area
 line_type		stack
 line_type		stack
+line_type		stack
 legend			User
 legend			System
+legend			Wait IO
 legend			Idle
 y_legend		Percent
 data_min		0
@@ -228,56 +240,28 @@
 href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#web_server_error_rate
 }
 
+# Interface bits per second for 10 Mbit interfaces.
 plot {
-title			%g Interface Bits Per Second: be0
-source			orcallator
-data			1024 * 8 * be0InKB/s
-data			1024 * 8 * be0OuKB/s
-line_type		area
-line_type		line1
-legend			Input
-legend			Output
-y_legend		Bits/s
-data_min		0
-data_max		100000000
-href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_bits_per_second
-}
-
-plot {
-title			%g Interface Bits Per Second: elxl0
+title			%g Interface Bits Per Second: $1
 source			orcallator
-data			1024 * 8 * elxl0InKB/s
-data			1024 * 8 * elxl0OuKB/s
+data			1024 * 8 * ((?:(?:elxl)|(?:le)|(?:qe))\d+)InKB/s
+data			1024 * 8 * $1OuKB/s
 line_type		area
 line_type		line1
 legend			Input
 legend			Output
 y_legend		Bits/s
 data_min		0
-data_max		100000000
-href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_bits_per_second
-}
-
-plot {
-title			%g Interface Bits Per Second: hme0
-source			orcallator
-data			1024 * 8 * hme0InKB/s
-data			1024 * 8 * hme0OuKB/s
-line_type		area
-line_type		line1
-legend			Input
-legend			Output
-y_legend		Bits/s
-data_min		0
-data_max		100000000
+data_max		10000000
 href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_bits_per_second
 }
 
+# Interface bits per second for 100 Mbit interfaces.
 plot {
-title			%g Interface Bits Per Second: hme1
+title			%g Interface Bits Per Second: $1
 source			orcallator
-data			1024 * 8 * hme1InKB/s
-data			1024 * 8 * hme1OuKB/s
+data			1024 * 8 * ((?:(?:be)|(?:hme))\d+)InKB/s
+data			1024 * 8 * $1OuKB/s
 line_type		area
 line_type		line1
 legend			Input
@@ -288,40 +272,26 @@
 href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_bits_per_second
 }
 
+# Interface bits per second for 1 Gbit interfaces.
 plot {
-title			%g Interface Bits Per Second: le0
-source			orcallator
-data			1024 * 8 * le0InKB/s
-data			1024 * 8 * le0OuKB/s
-line_type		area
-line_type		line1
-legend			Input
-legend			Output
-y_legend		Bits/s
-data_min		0
-data_max		10000000
-href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_bits_per_second
-}
-
-plot {
-title			%g Interface Bits Per Second: le1
+title			%g Interface Bits Per Second: $1
 source			orcallator
-data			1024 * 8 * le1InKB/s
-data			1024 * 8 * le1OuKB/s
+data			1024 * 8 * (v?ge\d+)InKB/s
+data			1024 * 8 * $1OuKB/s
 line_type		area
 line_type		line1
 legend			Input
 legend			Output
 y_legend		Bits/s
 data_min		0
-data_max		10000000
+data_max		1000000000
 href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_bits_per_second
 }
 
 plot {
 title			%g Interface Packets Per Second: $1
 source			orcallator
-data			(.*\d)Ipkt/s
+data			(.*\d+)Ipkt/s
 data			$1Opkt/s
 line_type		area
 line_type		line1
@@ -337,7 +307,7 @@
 plot {
 title			%g Interface Errors Per Second: $1
 source			orcallator
-data			(.*\d)IErr/s
+data			(.*\d+)IErr/s
 data			$1OErr/s
 line_type		area
 line_type		line1
@@ -350,40 +320,40 @@
 }
 
 plot {
-title			%g Interface Nocanput Rate
+title			%g Interface Deferred Packet Rate
 source			orcallator
-data			(.*\d)NoCP/s
+data			(.*\d+)Defr/s
 line_type		area
 legend			$1
-y_legend		Nocanput/s
+y_legend		Defers/s
 data_min		0
 flush_regexps		1
-href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_nocanput_rate
+href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_deferred_packet_rate
 }
 
 plot {
-title			%g Interface Deferred Packet Rate
+title			%g Interface Collisions
 source			orcallator
-data			(.*\d)Defr/s
+data			(.*\d+)Coll%
 line_type		area
 legend			$1
-y_legend		Defers/s
+y_legend		Percent
 data_min		0
+data_max		200
 flush_regexps		1
-href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_deferred_packet_rate
+href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_collisions
 }
 
 plot {
-title			%g Interface Collisions
+title			%g Interface Nocanput Rate
 source			orcallator
-data			(.*\d)Coll%
+data			(.*\d+)NoCP/s
 line_type		area
 legend			$1
-y_legend		Percent
+y_legend		Nocanput/s
 data_min		0
-data_max		200
 flush_regexps		1
-href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_collisions
+href			http://www.gps.caltech.edu/~blair/orca/docs/orcallator.html#interface_nocanput_rate
 }
 
 plot {

Modified: trunk/orca/orcallator/orcallator.se
==============================================================================
--- trunk/orca/orcallator/orcallator.se	(original)
+++ trunk/orca/orcallator/orcallator.se	Sat Jul 13 21:25:44 2002
@@ -4,23 +4,57 @@
 // This program logs many different system quantities to a log file
 // for later processing.
 //
-// Author: Blair Zajac <bzajac at akamai.com>.
+// Author: Blair Zajac <blair at gps.caltech.edu>.
 //
 // Portions copied from percollator.se written by Adrian Cockroft.
 //
-// Version 1.23: Feb 25, 2000	When orcallator was running on a system with
-//				DiskSuite, the same physical disk was listed
-//				multiple times when it appeared in the same
-//				metadevice.  The solution to the problem is
-//				not to build the c0t0d0 name but use the long
-//				disk name provided by the long_name string.
-//				Patch contributed by Paul Haldane
-//				<Paul.Haldane at newcastle.ac.uk>.
+// Version 1.28b4: Mar 27, 2001	Recoded measure_disk() to access the RAWDISK
+//				interface to sys_kstat device information to
+//				allow the activity on Sun's A1000 and Clariion
+//				Raid controller drives to be seen.  Apparently
+//				the pseudo drivers do not update the kstat
+//				interface.  It is also inverts the fix
+//				provided by version 1.23 to avoid over-counting
+//				md devices.  By suppressing stats from slices
+//				and metadevices and instead reporting on full
+//				devices such as c0t0d0 or sd0.  Note: This may
+//				have introduced an interaction with the
+//				live_rules.se class monitoring of drive
+//				performance.  Prevent floppy disks and tape
+//				drives from RAWDISK.  Added wio% to measure
+//				wait time since the idle calculation is wrong
+//				without this.  Prevent filesystems mounted
+//				under /snapshots from being seen.  Patch
+//				contributed by Alan LeGrand
+//				<alegrand at wallace.com>.
+// Version 1.27: Mar 27, 2001	Print the portion of time running in idle mode
+//				with some process waiting for block I/O as
+//				wio% and otherwise completely idle time as
+//				idle%.
+// Version 1.26: Feb  5, 2001	Make sure to check the return from stat() on
+//				the web server access log in case the file is
+//				missing.  Use fstat() instead of stat() when a
+//				file descriptor is available.
+// Version 1.25: Mar 30, 2000	Fix a typo where nil was misspelled as nik.
+// Version 1.24: Mar 25, 2000	When orcallator.se was running on a system
+//				with an older version of SE the p_vmstat.scan
+//				variable is an integer and the sprintf to
+//				%8.3f fails, resulting in a perceived scan rate
+//				of 0 pages per second.  Now always add 0.0 to
+//				p_vmstat.scan to get a double.
+// Version 1.23: Feb 25, 2000	When orcallator.se was running on a system
+//				with DiskSuite, the same physical disk was
+//				listed multiple times when it appeared in
+//				several metadevices.  The solution to the
+//				problem is not to build the c0t0d0 name but
+//				use the long disk name provided by the
+//				long_name string.  Patch contributed by Paul
+//				Haldane <Paul.Haldane at newcastle.ac.uk>.
 // Version 1.22: Jan 14, 2000	Include code to record NFS v2 and v3 server
-//				statistics.  The new statistics are: nfss_calls,
-//				the number of NFS calls to the NFS server,
-//				nfss_bad, the number of bad NFS calls per
-//				second, and v{2,3}{reads,writes}, which are
+//				statistics.  The new statistics are:
+//				nfss_calls, the number of NFS calls to the NFS
+//				server, nfss_bad, the number of bad NFS calls
+//				per second, and v{2,3}{reads,writes}, which are
 //				nfss_calls broken down into NFS version 2 and
 //				NFS version 3 calls.  The sum of v{2,3}{reads,
 //				writes} will be less than nfss_calls as the
@@ -29,7 +63,7 @@
 //				Haldane <Paul.Haldane at newcastle.ac.uk>.  This
 //				code is enabled by the standard -DWATCH_OS or
 //				individually by -DWATCH_NFS_SERVER.  The
-//				define -DWATCH_NFS has been supperseded by
+//				define -DWATCH_NFS has been superseded by
 //				-DWATCH_NFS_CLIENT, but to keep backwards
 //				compatibility, -DWATCH_NFS_CLIENT will be
 //				defined if -DWATCH_NFS is defined.
@@ -69,7 +103,7 @@
 //				mount point's disk space and inode capacity,
 //				usage, available for non-root users and
 //				percent used.  This comes from Duncan Lawie
-//				tyger at hoopoes.com. Add some smarts so that if
+//				tyger at hoopoes.com.  Add some smarts so that if
 //				the number of interfaces, physical disks, or
 //				mounted partitions changes, then a new header
 //				is printed.  This will prevent column name and
@@ -120,6 +154,7 @@
 #define WATCH_NFS_CLIENT	1
 #define WATCH_NFS_SERVER	1
 #define WATCH_MOUNTS		1
+#define USE_RAWDISK		1
 #define WATCH_DISK		1
 #define WATCH_DNLC		1
 #define WATCH_INODE		1
@@ -283,7 +318,7 @@
 int		hz;				// Clock tick rate.
 int		page_size;			// Page size in bytes.
 long		boot_time;			// Boot time of the system.
-long		interval = SAMPLE_INTERVAL;	// Sampling interval. 
+long		interval = SAMPLE_INTERVAL;	// Sampling interval.
 
 #ifdef WATCH_CPU
 int		can_read_kernel = 0;		// If the kernel can be read.
@@ -377,6 +412,251 @@
 
 #endif
 
+// RAWDISK BEGIN
+#ifdef USE_RAWDISK
+#include <sys_kstat.se>
+// This extention accesses the sys_kstat.se interface to the kstat IO
+// queues to extract info on drives not available in the kstat.se
+// kstat$disk interface.  Global data shared between function calls.
+struct RawDisk {
+  // Exposed interface (matches kstat)
+  char long_name[16];
+  char short_name[8];
+  double reads;
+  double kreads;
+  double writes;
+  double kwrites;
+  double avg_wait;
+  double avg_serv;
+  double service;
+  double wait_percent;
+  double run_percent;
+
+  // Hidden internal registers to track sys_kstats counters.
+  int       _number;		// kstat disk #
+  ulonglong _nread;		// Number of bytes read
+  ulonglong _nwritten;		// Number of bytes written
+  uint      _reads;		// Number of read operations
+  uint      _writes;		// Number of write operations
+  longlong  _wtime;		// Cumulative wait (pre-service) time
+  longlong  _wlentime;		// Cumulative wait length*time product
+  longlong  _wlastupdate;	// Last time wait queue changed
+  longlong  _rtime;		// Cumulative run (service) time
+  longlong  _rlentime;		// Cumulative run length*time product
+  longlong  _rlastupdate;	// Last time run queue changed
+  uint      _wcnt;		// Count of elements in wait state
+  uint      _rcnt;		// Count of elements in run state
+};
+
+// Define global for tracking raw disk data.
+#define MAX_RAWDISKS	512
+RawDisk		RAW_disk[MAX_RAWDISKS];
+int		RAW_disk_map=0;
+int		RAW_disk_count=0;
+double		RAW_disk_lastupdate;
+
+// Function to scan kstat and map short device names to long device names.
+raw_disk_map() {
+  int i;
+  int j=0;
+  char long_name[16];
+  char short_name[16];
+
+  // SE for 2.6 & 2.7 appears to have a bug where MAX_DISK is too
+  // large when an A1000 raid controller is present.  It's not really
+  // SE as iostat had to be patched for the same bug.  The bug appears
+  // to be tied to a failure to update the kstat interface diskinfo
+  // uses to map short names to long names.  Since raw_disk_update has
+  // already identified how many physical devices are present and they
+  // are listed first we limit our self to mapping the first
+  // RAW_disk_count device name.
+  for (i=0; i<RAW_disk_count; i++) {
+    strcpy(long_name,GLOBAL_disk_info[i].long_name);
+    if (long_name[0] == 'c' && strchr(long_name, 's') == nil) {
+      strcpy(short_name,GLOBAL_disk_info[i].short_name);
+      for (j=0; j<RAW_disk_count;j++) {
+        if (strcmp(RAW_disk[j].short_name, short_name) == 0) {
+          strcpy(RAW_disk[j].long_name, long_name);
+          break;
+        }
+      }
+    }
+  }
+  RAW_disk_map = 0;
+}
+
+raw_disk_update() {
+  int         rdisk;
+  ulong       ul;
+  kstat_ctl_t kc[1];
+  kstat_t     kp[1];
+  kstat_t     nkp[1];
+  kstat_io_t  kio;
+  ulonglong   _nread;
+  ulonglong   _nwritten;
+  uint        _reads;
+  uint        _writes;
+  longlong    _wtime;
+  longlong    _wlentime;
+  longlong    _wlastupdate;
+  longlong    _rtime;
+  longlong    _rlentime;
+  longlong    _rlastupdate;
+  longlong    _wcnt;
+  longlong    _rcnt;
+
+  double      read_writes;
+  double      big_etime;
+  double      elapsed_etime;
+  double      hz_etime;
+  double      nanosecond = NANOSEC;
+  double      update;
+  double      delta;
+  timeval_t   time_update[1];
+  ulong       time_void;
+  char        short_name[8];
+
+  gettimeofday(time_update,time_void);
+  update = time_update[0].tv_sec + (time_update[0].tv_usec / 1000000.0);
+  delta  = update - RAW_disk_lastupdate;
+  RAW_disk_lastupdate = update;
+
+  kc[0] = kstat_open();
+  // Read them.
+  if (kstat_read(kc,kp,0) == -1) {
+    perror("raw_disk_update:kstat_read");
+    exit(1);
+  }
+
+  // Traverse the chain looking for IO events.
+  for (ul=kc[0].kc_chain; ul !=0; ul=nkp[0].ks_next) {
+    struct_fill(nkp[0],ul);
+    if (nkp[0].ks_type == KSTAT_TYPE_IO) {
+      strcpy(short_name, nkp[0].ks_name);
+      if (short_name[0] != 'm' &&
+          short_name[0] != 'n' &&
+          strchr(short_name,',') == nil) {
+        // Try to locate device.
+        for (rdisk=0; rdisk<RAW_disk_count;rdisk++) {
+          if (strcmp(RAW_disk[rdisk].short_name, short_name) == 0) {
+            break;
+          }
+        }
+
+        // It must be new.  Add it!
+        if (rdisk == RAW_disk_count) {
+          // Must be a tape drive or something else.  Schedule device
+          // name map cycle.
+          RAW_disk_map = 1;
+          strcpy(RAW_disk[rdisk].long_name, short_name);
+          strcpy(RAW_disk[rdisk].short_name, short_name);
+          RAW_disk[rdisk]._reads       = 0;
+          RAW_disk[rdisk]._nread       = 0;
+          RAW_disk[rdisk]._rlentime    = 0;
+          RAW_disk[rdisk]._rlastupdate = boot_time;
+          RAW_disk[rdisk]._rcnt        = 0;
+          RAW_disk[rdisk]._writes      = 0;
+          RAW_disk[rdisk]._nwritten    = 0;
+          RAW_disk[rdisk]._wlentime    = 0;
+          RAW_disk[rdisk]._wlastupdate = boot_time;
+          RAW_disk[rdisk]._wcnt        = 0;
+          RAW_disk_count++;
+        }
+
+        // Update the device registers.
+        if (kstat_read(kc,nkp,0) == -1) {
+          perror("raw_disk_update:kstat_read error");
+          exit(1);
+        } else {
+          // Read sys_kstat device IO queue to find out about recent
+          // activity.  We validate data that is returned.  Solaris
+          // 2.6 has occasional glitches when updating certain disks
+          // (c0t0d0) so we cover up the glitches by using data from
+          // the previous cycle.  Eventually, we will get a good
+          // update.  Fixing the data is not necessarily the best
+          // choice.  Currently only kio.nread glitches.  Correcting
+          // the error forces the IOs to get attributed to the next IO
+          // cycle.
+          struct_fill(kio,nkp[0].ks_data);
+          _nread  =  kio.nread;
+          if (RAW_disk[rdisk]._nread > _nread) {
+            _nread = RAW_disk[rdisk]._nread;
+          }
+          _reads = kio.reads;
+	  if (RAW_disk[rdisk]._reads > _reads) {
+            _reads = RAW_disk[rdisk]._reads;
+          }
+          _rlentime    = kio.rlentime;
+          _rtime       = kio.rtime;
+          _rlastupdate = kio.wlastupdate;
+          _rcnt        = kio.rcnt;
+          _nwritten    = kio.nwritten;
+          if (RAW_disk[rdisk]._nwritten > _nwritten) {
+            _nwritten = RAW_disk[rdisk]._nwritten;
+          }
+          _writes = kio.writes;
+          if (RAW_disk[rdisk]._writes > _writes) {
+            _writes = RAW_disk[rdisk]._nwritten;
+          }
+          _wlentime    = kio.wlentime;
+          _wtime       = kio.wtime;
+          _wlastupdate = kio.wlastupdate;
+          _wcnt        = kio.wcnt;
+
+          elapsed_etime = (_wlastupdate - RAW_disk[rdisk]._wlastupdate);
+          if (elapsed_etime > 0)  {
+            hz_etime = elapsed_etime / nanosecond;
+            big_etime = 1024.0 * hz_etime;
+          } else {
+            elapsed_etime = nanosecond;
+            hz_etime = 1.0;
+            big_etime = 1024.0;
+          }
+          RAW_disk[rdisk].reads  =(_reads-RAW_disk[rdisk]._reads)  /hz_etime;
+          RAW_disk[rdisk].kreads =(_nread-RAW_disk[rdisk]._nread)  /big_etime;
+          RAW_disk[rdisk].writes =(_writes-RAW_disk[rdisk]._writes)/hz_etime;
+          RAW_disk[rdisk].kwrites=(_nwritten-RAW_disk[rdisk]._nwritten) / big_etime;
+
+          read_writes = elapsed_etime * (RAW_disk[rdisk].reads + RAW_disk[rdisk].writes) / 1024.0;
+          if (read_writes > 0) {
+            RAW_disk[rdisk].avg_wait = (_wlentime - RAW_disk[rdisk]._wlentime) / read_writes;
+            RAW_disk[rdisk].avg_serv = (_rlentime - RAW_disk[rdisk]._rlentime) / read_writes;
+            RAW_disk[rdisk].service  = RAW_disk[rdisk].avg_wait + RAW_disk[rdisk].avg_serv;
+          } else {
+            RAW_disk[rdisk].avg_wait = 0.0;
+            RAW_disk[rdisk].avg_serv = 0.0;
+            RAW_disk[rdisk].service  = 0.0;
+          }
+
+          // Update the counters.
+          RAW_disk[rdisk].run_percent  = 100.0 * (_rtime  - RAW_disk[rdisk]._rtime) / elapsed_etime;
+          RAW_disk[rdisk].wait_percent = 100.0 * (_wtime - RAW_disk[rdisk]._wtime) / elapsed_etime;
+          RAW_disk[rdisk]._writes      = _writes;
+          RAW_disk[rdisk]._nwritten    = _nwritten;
+          RAW_disk[rdisk]._wlastupdate = _wlastupdate;
+          RAW_disk[rdisk]._wlentime    = _wlentime;
+          RAW_disk[rdisk]._wtime       = _wtime;
+          RAW_disk[rdisk]._wcnt        = _wcnt;
+          RAW_disk[rdisk]._reads       = _reads;
+          RAW_disk[rdisk]._nread       = _nread;
+          RAW_disk[rdisk]._rlastupdate = _rlastupdate;
+          RAW_disk[rdisk]._rlentime    = _rlentime;
+          RAW_disk[rdisk]._rtime       = _rtime;
+          RAW_disk[rdisk]._rcnt        = _rcnt;
+        }
+      }
+    }
+  }
+  kstat_close(kc);
+
+  // Map long device names for any drives that we just discovered.
+  if (RAW_disk_map == 1) {
+    raw_disk_map();
+  }
+}
+#endif
+// RAWDISK_END
+
 // Variables for handling output.
 string		compress = getenv("COMPRESSOR"); // How to compress logs.
 ulong		ofile;				// File pointer to the logging file.
@@ -486,15 +766,16 @@
       interval = atoi(argv[1]);
       break;
     default:
-      fprintf(stderr, "usage: se [Defines] %s [interval]\n", program_name);
-      fprintf(stderr, "%s can use the following environmental variables:\n", program_name);
-      fprintf(stderr, "   setenv OUTDIR      /var/orcallator/logs - log file directory, default stdout\n");
-      fprintf(stderr, "   setenv WEB_SERVER  apache - string to search for number of web servers\n");
-      fprintf(stderr, "   setenv WEB_LOG     /ns-home/httpd-80/logs/access - location of web server log\n");
-      fprintf(stderr, "   setenv GATEWAY     some.where.com - special address to monitor\n");
-      fprintf(stderr, "   setenv SEARCHURL   srch.cgi - match for search scripts, default is search.cgi\n");
-      fprintf(stderr, "   setenv COMPRESSOR  \"gzip -9\" - compress previous day logs using this command\n");
-      fprintf(stderr, "Defines:\n");
+      fprintf(stderr, "usage: se [-Defines] %s [interval]\n", program_name);
+      fprintf(stderr, "The default interval is %d seconds.\n", SAMPLE_INTERVAL);
+      fprintf(stderr, "%s uses the following environmental variables:\n", program_name);
+      fprintf(stderr, "   OUTDIR       directory to write log files, output to stdout if not set\n");
+      fprintf(stderr, "   WEB_SERVER   string to search for number of web servers, i.e. httpd\n");
+      fprintf(stderr, "   WEB_LOG      location of web server access log, i.e. /httpd/logs/access\n");
+      fprintf(stderr, "   GATEWAY      special address to monitor, i.e. some.where.com\n");
+      fprintf(stderr, "   SEARCHURL    match for search scripts, default is search.cgi\n");
+      fprintf(stderr, "   COMPRESSOR   compress previous days logs with this command, i.e. \"gzip -9\"\n");
+      fprintf(stderr, "Add these defines to enable monitoring of specific subsystems:\n");
       fprintf(stderr, "   -DWATCH_WEB        watch web server access logs\n");
       fprintf(stderr, "   -DWATCH_PROXY      use WEB_LOG as a NCSA style proxy log\n");
       fprintf(stderr, "   -DWATCH_SQUID      use WEB_LOG as a Squid log\n");
@@ -611,11 +892,14 @@
   // Initialize the web server watching variables.  Move the file pointer
   // to the end of the web access log and note the current time.
   if (www_log_filename != nil) {
-    www_fd = fopen(www_log_filename, "r");
+    www_fd   = fopen(www_log_filename, "r");
+    www_ino  = 0;
+    www_size = 0;
     if (www_fd != 0) {
-      stat(www_log_filename, www_stat);
-      www_ino  = www_stat[0].st_ino;
-      www_size = www_stat[0].st_size;
+      if (fstat(www_fd, www_stat) == 0) {
+        www_ino  = www_stat[0].st_ino;
+        www_size = www_stat[0].st_size;
+      }
       // Move to the end of the file.
       fseek(www_fd, 0, 2);
     }
@@ -667,6 +951,10 @@
   tmp_rfsproccnt_v2 = kstat$rfsproccnt_v2;
   tmp_rfsproccnt_v3 = kstat$rfsproccnt_v3;
 #endif
+
+#ifdef USE_RAWDISK
+   raw_disk_update();
+#endif
 }
 
 measure_os(long now, tm_t tm_now)
@@ -763,16 +1051,16 @@
   states = "wwwwwwwwwww";
   strftime(tm_buf, sizeof(tm_buf), "%T", tm_now);
 
-  states[0] = state_char(lr_disk$dr.state); 
-  states[1] = state_char(lr_net$nr.state);     
-  states[2] = state_char(lr_rpcclient$r.state); 
-  states[3] = state_char(lr_swapspace$s.state);     
-  states[4] = state_char(lr_ram$ram.state);    
-  states[5] = state_char(lr_kmem$kmem.state);   
-  states[6] = state_char(lr_cpu$cpu.state);    
-  states[7] = state_char(lr_mutex$m.state);     
-  states[8] = state_char(lr_dnlc$dnlc.state);   
-  states[9] = state_char(lr_inode$inode.state);   
+  states[0] = state_char(lr_disk$dr.state);
+  states[1] = state_char(lr_net$nr.state);
+  states[2] = state_char(lr_rpcclient$r.state);
+  states[3] = state_char(lr_swapspace$s.state);
+  states[4] = state_char(lr_ram$ram.state);
+  states[5] = state_char(lr_kmem$kmem.state);
+  states[6] = state_char(lr_cpu$cpu.state);
+  states[7] = state_char(lr_mutex$m.state);
+  states[8] = state_char(lr_dnlc$dnlc.state);
+  states[9] = state_char(lr_inode$inode.state);
   states[10]= state_char(lr_tcp$tcp.state);
 
   put_output(" timestamp",  sprintf("%10d", now));
@@ -825,7 +1113,7 @@
       // the previous and current mpid over a 5 second interval to
       // calculate the long interval difference.
       mpid_current += mpid5_diff;
-      mpid_now      = mpid5_now;   
+      mpid_now      = mpid5_now;
     }
     else {
       sleep(sleep_till - now);
@@ -850,11 +1138,13 @@
   // double, so cast everything to double using + 0.0.
   put_output(" usr%",    sprintf("%5.1f", pvm.user_time + 0.0));
   put_output(" sys%",    sprintf("%5.1f", pvm.system_time + 0.0));
+  put_output(" wio%",    sprintf("%5.1f", pvm.wait_time + 0.0));
+  put_output("idle%",    sprintf("%5.1f", pvm.idle_time + 0.0));
   put_output(" 1runq",   sprintf("%6.2f", tmp_kstat_misc.avenrun_1min/256.0));
   put_output(" 5runq",   sprintf("%6.2f", tmp_kstat_misc.avenrun_5min/256.0));
   put_output("15runq",   sprintf("%6.2f", tmp_kstat_misc.avenrun_15min/256.0));
   put_output("#proc",    sprintf("%5lu",  tmp_kstat_misc.nproc));
-  put_output("scanrate", sprintf("%8.3f", pvm.scan));
+  put_output("scanrate", sprintf("%8.3f", pvm.scan + 0.0));
 
   // Calculate the rate of new process spawning.
   if (can_read_kernel != 0) {
@@ -890,9 +1180,9 @@
   current_count = 0;
   for (i=0; i<tmp_nr.net_count; i++) {
     // Skip unused interfaces.
-//    if (GLOBAL_net[i].up == 0) {
-//      continue;
-//    }
+//  if (GLOBAL_net[i].up == 0) {
+//    continue;
+//  }
     ++current_count;
     put_output(sprintf("%5sIpkt/s", tmp_nr.names[i]),
 	       sprintf("%11.3f", GLOBAL_net[i].ipackets));
@@ -1002,6 +1292,13 @@
       if (tmp_mnt.mnt_mountp =~ "^/cdrom/") {
         continue;
       }
+
+      // Skip snapshot file systems to avoid output format changes as
+      // they are mounted and umounted.
+      if (tmp_mnt.mnt_mountp =~ "^/snapshots/") {
+        continue;
+      }
+
       if (statvfs(tmp_mnt.mnt_mountp, vfs_array) == -1) {
         continue;
       }
@@ -1069,6 +1366,7 @@
   double total_writek;
   int    previous_count = -1;
   int    i;
+  int    disk_count;
 
   mean_disk_busy = 0.0;
   peak_disk_busy = 0.0;
@@ -1076,20 +1374,48 @@
   total_writes   = 0.0;
   total_readk    = 0.0;
   total_writek   = 0.0;
+  disk_count     = 0;
+
+#ifdef USE_RAWDISK
+  for (i=0; i<RAW_disk_count; i++) {
+    // Block the listing of tape drives for now.
+    if (RAW_disk[i].short_name[1] == 't' && RAW_disk[i].short_name[0] == 's') {
+      continue;
+    }
+    // Block the listing of floppy drives for now.
+    if (RAW_disk[i].short_name[0] == 'f' && RAW_disk[i].short_name[1] == 'd') {
+      continue;
+    }
+    disk_count++;
+    put_output(sprintf("disk_runp_%s", RAW_disk[i].long_name),
+               sprintf("%16.5f", RAW_disk[i].run_percent));
+    total_reads    += RAW_disk[i].reads;
+    total_writes   += RAW_disk[i].writes;
+    total_readk    += RAW_disk[i].kreads;
+    total_writek   += RAW_disk[i].kwrites;
+    mean_disk_busy += RAW_disk[i].run_percent;
+    if (RAW_disk[i].run_percent > peak_disk_busy) {
+       peak_disk_busy = RAW_disk[i].run_percent;
+    }
+  }
+#else
   for (i=0; i<GLOBAL_disk_count; i++) {
+    disk_count++;
     put_output(sprintf("disk_runp_%s", GLOBAL_disk[i].info.long_name),
                sprintf("%16.5f", GLOBAL_disk[i].run_percent));
-    total_reads     += GLOBAL_disk[i].reads;
-    total_writes    += GLOBAL_disk[i].writes;
-    total_readk     += GLOBAL_disk[i].kreads;
-    total_writek    += GLOBAL_disk[i].kwrites;
+    total_reads    += GLOBAL_disk[i].reads;
+    total_writes   += GLOBAL_disk[i].writes;
+    total_readk    += GLOBAL_disk[i].kreads;
+    total_writek   += GLOBAL_disk[i].kwrites;
     mean_disk_busy += GLOBAL_disk[i].run_percent;
     if (GLOBAL_disk[i].run_percent > peak_disk_busy) {
       peak_disk_busy = GLOBAL_disk[i].run_percent;
     }
   }
-  if (GLOBAL_disk_count != 0) {
-    mean_disk_busy = mean_disk_busy/GLOBAL_disk_count;
+#endif
+
+  if (disk_count != 0) {
+    mean_disk_busy = mean_disk_busy/disk_count;
   }
 
   put_output("disk_peak", sprintf("%9.3f", peak_disk_busy));
@@ -1101,9 +1427,9 @@
 
   // If the number of disks has changed, say due to a add_drv, then print
   // new headers.
-  if (previous_count != GLOBAL_disk_count) {
+  if (previous_count != disk_count) {
     print_header   = 1;
-    previous_count = GLOBAL_disk_count;
+    previous_count = disk_count;
   }
 }
 #endif
@@ -1274,7 +1600,7 @@
 #elif WATCH_YAHOO
   /*
    * Yahoo log format.  Fields in square brackets will only appear in the
-   * log file if the data actually exists (ie. you will never see a null
+   * log file if the data actually exists (i.e. you will never see a null
    * Referrer field).  Further, fields labelled here with "(CONFIG)" will
    * only appear if they are enabled via the YahooLogOptions configuration
    * directive.
@@ -1343,7 +1669,7 @@
   if (ishead == 0) {
     dwnld_totalz += z;
   }
-  
+
 #else	/* common or netscape proxy formats */
   strtok(nil, " ");		/* -.           */
   strtok(nil, " ");		/* -.           */
@@ -1439,7 +1765,7 @@
       break;
   }
   word = strtok(nil, " [");		/* [transfer total time x.xxx. */
-  if (word == nik) {
+  if (word == nil) {
     return;
   }
   xf = atof(word);
@@ -1528,42 +1854,48 @@
       /*
        * See if the file has been switched or truncated.
        */
-      stat(www_log_filename, www_stat);
-      if (www_ino != www_stat[0].st_ino || www_size > www_stat[0].st_size) {
-        if (www_fd != 0) {
-          /* Close the old log file. */
-          fclose(www_fd);
-        }
+      if (stat(www_log_filename, www_stat) == 0) {
+        if (www_ino != www_stat[0].st_ino || www_size > www_stat[0].st_size) {
+          /*
+           * Close the old log file.
+           */
+          if (www_fd != 0) {
+            fclose(www_fd);
+          }
 
-        /*
-         * The log file has changed, open the new one.
-         */
-        www_fd = fopen(www_log_filename, "r");
-        if (www_fd != 0) {
-          www_ino = www_stat[0].st_ino;
-          buf[BUFSIZ-1] = 127;
-          while(fgets(buf, BUFSIZ, www_fd) != nil) {
-            httpops += 1.0;
-            if (www_gatelen > 0) {
-              if (strncmp(buf, www_gateway, www_gatelen) == 0) {
-                gateops += 1.0;
+          /*
+           * The log file has changed, open the new one.
+           */
+          www_fd = fopen(www_log_filename, "r");
+          if (www_fd != 0) {
+            fstat(www_fd, www_stat);
+            www_ino = www_stat[0].st_ino;
+            buf[BUFSIZ-1] = 127;
+            while(fgets(buf, BUFSIZ, www_fd) != nil) {
+              httpops += 1.0;
+              if (www_gatelen > 0) {
+                if (strncmp(buf, www_gateway, www_gatelen) == 0) {
+                  gateops += 1.0;
+                }
               }
-            }
-            accesslog(buf);
+              accesslog(buf);
 
-            /*
-             * If the line is longer than the buffer, then ignore the rest
-             * of the line.
-             */
-            while (buf[BUFSIZ-1] == 0    &&
-                   buf[BUFSIZ-2] != '\n') {
-              buf[BUFSIZ-1] = 127;
-              if (fgets(buf, BUFSIZ, www_fd) == nil) {
-                break;
+              /*
+               * If the line is longer than the buffer, then ignore
+               * the rest of the line.
+               */
+              while (buf[BUFSIZ-1] == 0    &&
+                     buf[BUFSIZ-2] != '\n') {
+                buf[BUFSIZ-1] = 127;
+                if (fgets(buf, BUFSIZ, www_fd) == nil) {
+                  break;
+                }
               }
             }
           }
         }
+        /* Remember size for next time. */
+        www_size = www_stat[0].st_size;
       }
 
       www5_now      = gethrtime();
@@ -1574,9 +1906,6 @@
         httpops5 = dtmp;
       }
       lastops = httpops;
-
-      /* Remember size for next time. */
-      www_size = www_stat[0].st_size;
     }
   }
   else {

Modified: trunk/orca/orcallator/orcallator_column.pl
==============================================================================
--- trunk/orca/orcallator/orcallator_column.pl	(original)
+++ trunk/orca/orcallator/orcallator_column.pl	Sat Jul 13 21:25:45 2002
@@ -1,13 +1,14 @@
 # orcallator_column: display selected columns from orcallator output.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and GeoCities, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!/GeoCities, Inc.
 
 use strict;
 
 $| = 1;
 
-# This is the list of columns to plot.
-my @column_titles;
+# This is the list of regular expressions that match column names to
+# plot.
+my @column_regexs;
 
 # Plot the maximum data.
 my $display_max = 0;
@@ -16,12 +17,19 @@
 my $col_width             = 9;
 my $string_format         = "%${col_width}s";
 my $number_format         = "%${col_width}.2f";
-my @default_column_titles = qw(httpop/s http/p5s httpb/s NoCP);
+my @default_column_regexs = qw(httpop/s http/p5s httpb/s NoCP);
 
 while (@ARGV and $ARGV[0] =~ /^-\w/) {
   my $arg = shift;
   if ($arg eq '-c') {
-    push(@column_titles, shift);
+    unless (@ARGV) {
+      die "$0: no argument for -c.\n";
+    }
+    my $value = shift;
+    unless (defined $value) {
+      die "$0: undefined value passed to -c.\n";
+    }
+    push(@column_regexs, $value);
   }
   elsif ($arg eq '-m') {
     $display_max = 1;
@@ -35,18 +43,23 @@
   -m instead of printing all the data, show only the maximum value
 If no -c options are given, then by default the following column titles
 are used:
-  @default_column_titles
+  @default_column_regexs
+If you want to process standard input, then you must list - on the
+command line.
 END
   exit 1;
 }
 
 # If no column titles were set, then choose these.
- at column_titles = @default_column_titles unless @column_titles;
+ at column_regexs = @default_column_regexs unless @column_regexs;
+
+# Compile the regular expressions.
+my @column_res = map { qr/$_/ } @column_regexs;
 
 # Unless the maximum is choosen, add the date to the list of columns.
-unshift(@column_titles, 'locltime');
+unshift(@column_regexs, 'locltime');
 
-# Find the length of the longest file.
+# Find the string length of the longest filename.
 my $col1_length = 0;
 foreach my $file (@ARGV) {
   my $len = length($file);
@@ -56,47 +69,55 @@
 
 for (my $a=0; $a<@ARGV; ++$a) {
   my $file = $ARGV[$a];
-  open(FILE, $file) or die "$0: unable to open `$file' for reading: $!\n";
+  open(FILE, $file) or
+    die "$0: unable to open `$file' for reading: $!\n";
 
-  my @line = split(' ', <FILE>);
+  # Read the file and on each line look for redefinitions of the
+  # column names.
+  my @column_titles;
   my @column_pos;
-  my @data;
+  my $column_pos_set;
+  my %max_values;
+  while (<FILE>) {
+    my @line = split;
 
-  # Find the columns that contain the names.
-  my @col_titles = @column_titles;
-  for (my $i=0; $i<@col_titles; ++$i) {
-    my $name = $col_titles[$i];
-    my $col = -1;
-    for (my $j=0; $j<@line; ++$j) {
-      if ($line[$j] =~ /$name/) {
-        $col = $j;
-        $col_titles[$i] = $line[$j];
-        last;
+    # If the line has the string timestamp in it, then use it to find
+    # the proper column number for the requested data.
+    if (/timestamp/) {
+      @column_titles = ();
+      @column_pos    = ();
+      foreach my $regex (@column_regexs) {
+        my $re = qr/$regex/;
+        for (my $j=0; $j<@line; ++$j) {
+          my $column_title = $line[$j];
+          if ($column_title =~ $re) {
+            push(@column_pos,    $j);
+            push(@column_titles, $column_title);
+            unless (defined $max_values{$column_title}) {
+              $max_values{$column_title} = -1e20;
+            }
+          }
+        }
       }
+      $column_pos_set = 1;
+      next;
     }
-    die "$0: cannot column matching `$name' in $file.\n" if $col == -1;
-    push(@column_pos, $col);
-    push(@data, -1e20);
-  }
 
-  printf $col1_format, "Machine";
-  grep { printf "$string_format ", $_ } @col_titles;
-  print "\n";
+    next unless $column_pos_set;
 
-  while (<FILE>) {
-    my @line = split;
     my @d = @line[@column_pos];
     if ($display_max) {
-      for (my $i=0; $i<@data; ++$i) {
+      for (my $i=0; $i<@d; ++$i) {
+        my $column_title = $column_titles[$i];
         if (is_numeric($d[$i])) {
-          $data[$i] = $d[$i] if $d[$i] > $data[$i];
-        }
-        else {
-          $data[$i] = $d[$i];
+          if ($d[$i] > $max_values{$column_title}) {
+            $max_values{$column_title} = $d[$i];
+          }
+        } else {
+          $max_values{$column_title} = $d[$i];
         }
       }
-    }
-    else {
+    } else {
       printf $col1_format, $file;
       foreach my $d (@d) {
         printf is_numeric($d) ? "$number_format " : "$string_format ", $d;
@@ -105,12 +126,17 @@
     }
   }
 
+  printf $col1_format, "Machine";
+  grep { printf "$string_format ", $_ } @column_titles;
+  print "\n";
+
   close(FILE);
 
   if ($display_max) {
     printf $col1_format, $file;
-    foreach my $d (@data) {
-      printf is_numeric($d) ? "$number_format " : "$string_format ", $d;
+    foreach my $title (@column_titles) {
+      my $max = $max_values{$title};
+      printf is_numeric($max) ? "$number_format " : "$string_format ", $max;
     }
     print "\n";
   }
@@ -127,13 +153,12 @@
   $! = 0;
   my($num, $unparsed) = strtod($str);
   if (($str eq '') || ($unparsed != 0) || $!) {
-    return undef;
+    return;
   } else {
     return $num;
   }
 }
 
 sub is_numeric {
-  my $a = shift;
-  defined getnum($a);
+  defined getnum(shift);
 }

Modified: trunk/orca/orcallator/start_orcallator.sh.in
==============================================================================
--- trunk/orca/orcallator/start_orcallator.sh.in	(original)
+++ trunk/orca/orcallator/start_orcallator.sh.in	Sat Jul 13 21:25:45 2002
@@ -13,25 +13,41 @@
 UNAME=@UNAME@
 ORCALLATOR_DIR=@ORCALLATOR_DIR@
 SE=@SE@
-WATCH_WEB="@WATCH_WEB@"
+
+# WEB_LOG contains the location of the web server log file that
+# orcallator.se should read.
 WEB_LOG=@WEB_LOG@
 
+# WATCH_WEB contains the command line options to SE to tell
+# orcallator.se the format of the web server logs.
+WATCH_WEB="-DWATCH_WEB"               # For NCSA style access log
+WATCH_WEB="-DWATCH_WEB -DWATCH_PROXY" # For proxy NCSA style access log
+WATCH_WEB="-DWATCH_WEB -DWATCH_SQUID" # For Squid style access log
+WATCH_WEB="@WATCH_WEB@"
+
+# These are the various patch defines to make sure SE works around
+# various problems.
+SE_PATCHES=
+#SE_PATCHES="$SE_PATCHES -DLE_PATCH"
+#SE_PATCHES="$SE_PATCHES -DHME_PATCH"
+#SE_PATCHES="$SE_PATCHES -DHME_PATCH_IFSPEED"
+
 # Check if the SE executable was found upon configure.
 if test -z "$SE"; then
-  echo "When you configured Orca the se executable was not found.  If you"
-  echo "do not have the SE toolkit installed on your system, then follow"
-  echo "the steps in section 8 of INSTALL."
-  echo ""
-  echo "Once you have the SE toolkit installed on your system, then either"
-  echo "rerun configure so that it finds se, or edit start_orcallator.sh"
-  echo "and define SE to the location of se."
+  cat <<END 1>&2
+When you configured Orca the se executable was not found.  If you
+do not have the SE toolkit installed on your system, then follow
+the steps in section 10 of INSTALL file that came with Orca.
+
+Once you have the SE toolkit installed on your system, then either
+rerun configure so that it finds se, or edit start_orcallator.sh
+and define SE to the location of se.
+END
   exit 1
 fi
 
 if test ! -x "$SE"; then
-  echo "The SE executable at"
-  echo "  $SE"
-  echo "does not exist or is not executable.  Please correct this problem."
+  echo "$0: the SE executable at $SE does not exist or is not executable." 1>&2
   exit 1
 fi
 
@@ -39,6 +55,12 @@
 # anything past the first `.'.
 uname=`$UNAME -n | $CUT -d. -f1`
 
+# Make sure the hostname can be found.
+if test -z "$uname"; then
+  echo "$0: cannot determine the hostname of this system." 1>&2
+  exit 1
+fi
+
 # The directory these files go into is $ORCALLATOR_DIR/HOSTNAME
 OUTDIR=$ORCALLATOR_DIR/$uname
 
@@ -48,7 +70,7 @@
 # Check if orcallator is already running.
 pids=`/usr/ucb/ps auxww | $AWK '/orcallator.se/ && !/awk/ {print $2}'`
 if test "$pids" != ""; then
-  echo "Orcallator already running.  Exiting."
+  echo "$0: orcallator already running." 1>&2
   exit 1
 fi
 
@@ -67,13 +89,13 @@
 fi
 
 if test ! -d $OUTDIR; then
-  echo "Unable to create $OUTDIR/" 1>&2
+  echo "$0: unable to create $OUTDIR/" 1>&2
   exit 2
 fi
 
 # Now start the logging.
 echo "Starting logging"
-$SE $LE_PATCH -DWATCH_OS $WATCH_WEB $libdir/orcallator.se &
+nohup $SE $SE_PATCHES -DWATCH_OS $WATCH_WEB $libdir/orcallator.se &
 
 # Write the PID of orcallator to a file to make killing easier.
 pid=$!

Modified: trunk/orca/config/PerlHead1.in
==============================================================================
--- trunk/orca/config/PerlHead1.in	(original)
+++ trunk/orca/config/PerlHead1.in	Sat Jul 13 21:25:45 2002
@@ -1,4 +1,2 @@
 #!@PERL@ -w # -*- perl -*-
 
-require 5.004_01;
-

Modified: trunk/orca/config/PerlHead2.in
==============================================================================
--- trunk/orca/config/PerlHead2.in	(original)
+++ trunk/orca/config/PerlHead2.in	Sat Jul 13 21:25:45 2002
@@ -5,5 +5,3 @@
 & eval 'exec perl -w -S $0 $argv:q'
     if 0;
 
-require 5.004_01;
-

Modified: trunk/orca/TODO
==============================================================================
--- trunk/orca/TODO	(original)
+++ trunk/orca/TODO	Sat Jul 13 21:25:45 2002
@@ -1,16 +1,27 @@
-XXX Fix the bug where if a legend is listed in a plot {} then the
-XXX number of colored boxes in the generated plot are more than the
-XXX data that appears there.
+* Bug: If there is no match made in a find_files, then handle this case.
+  See the message in my Sent box at 11/8/2000 4:00 PM with a subject
+  Unable to view orca graphs.
 
 This is a pretty comprehensive to-do list for Orca and the related data
 gathering tools.  Any comments and additions to this list are welcome.
 
-To motivate the discussion of this to do list, let me give some background
-on our setup.  GeoCities site has over 100 hosts.  I've been running
-orcallator.se on some hosts since September 1998 that have stored over
-300 source text files. Currently I have 34472 files using 7.3 gigabytes
-of storage.  I have 9 different orcallator.cfg for different classes
-of machines.
+To motivate the discussion of this to do list, let me give some
+background on our setup.  GeoCities site has over 100 hosts.  I've
+been running orcallator.se on some hosts since September 1998 that
+have stored over 300 source text files. Currently I have 34472 files
+using 7.3 gigabytes of storage.  I have 9 different orcallator.cfg for
+different classes of machines.
+
+* Orca: Have an install option just for orcallator.se and not the
+        Orca whole pacckage.
+
+* Orca: Add flag to put Orca in background or daemonize it.
+
+* Orca: bug fix:
+
+	Fix the bug where if a legend is listed in a plot {} then the
+	number of colored boxes in the generated plot are more than
+	the data that appears there.
 
 * Orca: Load arbitrarily formatted source text files.
 
@@ -251,6 +262,11 @@
 	Since orcallator.se measures HTTP proxy and caching statistics,
 	update orcallator.cfg.in to display these data sets.
 
+* orcallator.se: Temperature measurements
+
+	Since /usr/platform/sun4u/sbin/prtdiag -v measures the ambient
+	and CPU temperature, get orcallator.se to measure this data.
+
 * Orca:
 
 	Do what it takes to remove the same Ethernet port listings in
@@ -338,7 +354,7 @@
           Also, suggestions for what to do if things are bad.
         + Finer resolution (more graphs) on each Data Set.
           For example, a graph for each disk, when you click on that graph
-          you get a graph for each: 
+          you get a graph for each:
           Bytes read
           Bytes written
           KBytes read
@@ -384,7 +400,7 @@
           or swap thrashing.
           Maybe we should plot the sr field of vmstat. p.329
         + Page Usage
-          Unless you know how memory subsystems work, 
+          Unless you know how memory subsystems work,
           this graph is hard to read. The only obvious
           thing this graph tells you is if the Free List
           is too small. The Free List can be fine, but you

Modified: trunk/orca/INSTALL
==============================================================================
--- trunk/orca/INSTALL	(original)
+++ trunk/orca/INSTALL	Sat Jul 13 21:25:45 2002
@@ -2,8 +2,9 @@
 
  1) Install Perl 5.004_01 or later.
 
- 2) Decide where Orca's binaries, RRD, HTML, and orcallator directories
-    will reside.  Make sure performance concerns are handled.
+ 2) Decide where Orca's binaries, RRD, HTML, and orcallator
+    directories will reside.  Make sure performance concerns are
+    handled.
 
  3) Determine which Perl modules need compiling and installing.
     Optionally download newer versions of these modules.
@@ -36,16 +37,21 @@
 
  1) Install Perl 5.004_01 or later.
 
-    This step is too large to go into here.  The bottom line is to follow
-    the instructions at
+    This step is too large to go into here.  The bottom line is to
+    follow the instructions at
 
-       http://language.perl.com/info/software.html
+       http://www.perl.com/pub/language/info/software.html
 
- 2) Decide where Orca's binaries, RRD, HTML, and orcallator directories
-    will reside.  Make sure performance concerns are handled.
+    or download a binary package from
 
-    First choose the location where Orca will be installed.  By default,
-    Orca will install into the following structure:
+       http://aspn.activestate.com/ASPN/Downloads/ActivePerl/
+
+ 2) Decide where Orca's binaries, RRD, HTML, and orcallator
+    directories will reside.  Make sure performance concerns are
+    handled.
+
+    First choose the location where Orca will be installed.  By
+    default, Orca will install into the following structure:
 
     $prefix                     Prefix, set with --prefix=
     $prefix/bin                 Binaries, set with --bindir=
@@ -54,8 +60,8 @@
     $prefix/var/orca/rrd        RRD directory, set with --with-rrd-dir
     $prefix/var/orca/orcallator Orcallator directory, set with --with-orcallator-dir
 
-    The HTML output directory is not set by default and must be specified
-    by the Orca administrator.
+    The HTML output directory is not set by default and must be
+    specified by the Orca administrator.
 
     By default $prefix is set to /usr/local.  The -- arguments shown
     above should be given to the configure script described below
@@ -64,58 +70,99 @@
     --prefix=/opt/orca to the configure script.
 
     Because Orca is extremely IO intensive, I recommend the following
-    architecture.  Choose one host that can locally mount all the RRD data
-    files and the directory containing the HTML and image files that are
-    viewed by Orca users.  If these two locations must be on separate
-    hosts and one directory must be NFS mounted to the Orca host, then
-    I recommend that the RRD data file be local instead of the HTML and
-    image files, since the RRD files are much more read/write intensive.
+    architecture.  Choose one host that can locally mount all the RRD
+    data files and the directory containing the HTML and image files
+    that are viewed by Orca users.  If these two locations must be on
+    separate hosts and one directory must be NFS mounted to the Orca
+    host, then I recommend that the RRD data file be local instead of
+    the HTML and image files, since the RRD files are much more
+    read/write intensive.
 
     If you are going to use the orcallator Orca addon to monitor your
-    Sun Solaris systems, then you will in addition need to decide where
-    to have orcallator store its data files.  By default, these data
-    files are written to once every 5 minutes, so IO is not an issue.
-    The issue here is that orcallator needs to run as root and all of
-    the orcallator output files from all your hosts need to be written
-    into the same NFS shared directory that Orca can read.  It is not too
-    important that the directory that orcallator writes into be mounted
-    locally on the machine that Orca will run on, since Orca will only
-    read each file every five minutes.
-
-    If you are running orcallator on a system running a web, proxy,
-    or Squid server, you can have orcallator watch the logs generated
-    by these programs.  In this case, note the location of the log file
+    Sun Solaris systems, then you will in addition need to decide
+    where to have orcallator store its data files.  By default, these
+    data files are written to once every 5 minutes, so IO is not an
+    issue.  The issue here is that orcallator needs to run as root and
+    all of the orcallator output files from all your hosts need to be
+    written into the same NFS shared directory that Orca can read.  It
+    is not too important that the directory that orcallator writes
+    into be mounted locally on the machine that Orca will run on,
+    since Orca will only read each file every five minutes.
+
+    If you are running orcallator on a system running a web, proxy, or
+    Squid server, you can have orcallator watch the logs generated by
+    these programs.  In this case, note the location of the log file
     for the configure script.
 
- 3) Determine which Perl modules need compiling and installing.
+ 3) Configure Orca.
+
+    Now that you have decided where the RRD, HTML, and optionally the
+    orcallator data files and the web server access logs, are located,
+    run the configure script with the following arguments:
+
+    % ./configure --prefix=ORCA_PREFIX_DIRECTORY \
+                  --with-rrd-dir=RRD_DIR_LOCATION \
+                  --with-html-dir=HTML_DIR_LOCATION \
+                  --with-orcallator-dir=ORCALLATOR_DIR_LOCATION \
+                  --with-TYPE-log=LOG_LOCATION
+
+    If you choose nothing else, the --with-html-dir must always be
+    used, otherwise configure will fail.
+
+    If you use a web, proxy, or Squid server, you can have orcallator
+    gather statistics from the log file.  Use this table to decide
+    which configure option to use.  Note that the Apache and NCSA
+    servers use the Common Log Format.
+
+    Log Type                                   Configure Option
+    ----------------------------------------------------------------
+    Common Log Format                          --with-ncsa-log=FILE
+    Common Log Format with Proxy Information   --with-proxy-log=FILE
+    Squid Log Format                           --with-squid-log=FILE
+
+    Configure will let you use only one of these --with-TYPE-log
+    options.
+
+    The configure script will find where your version of Perl and some
+    other assorted programs are located.  It will also determine if
+    you have the necessary Perl modules to run Orca.  If it does not
+    find the required modules, the modules that are included with the
+    Orca distribution will be built.
+
+    Configure will also determine if you run one of the operating
+    systems where a shared librrd.so library will be built and
+    installed in $libdir.
+
+ 4) Determine which Perl modules need compiling and installing.
     Optionally download newer versions of these modules.
 
-    Orca requires the following Perl modules at the specified versions:
+    Orca requires the following Perl modules at the specified
+    versions:
 
     Name			Required Version	Included With Orca
-    -----------------------------------------------------------------------
+    ----------------------------------------------------------------------
     Data::Dumper		2.101 or greater	2.101
-    Digest::MD5			2.09 or greater		2.09
+    Digest::MD5			2.13 or greater		2.13
     Math::IntervalSearch	1.05 or greater		1.05
-    RRDs			1.0.13 or greater	1.0.13
-    Storable			0.6.9 or greater	0.6.9
+    RRDs			1.0.33 or greater	1.0.33
+    Storable			1.0.11 or greater	1.0.11
 
     All five of these modules are included with the Orca distribution
-    in the packages directory.  When you configure Orca in step 4),
+    in the packages directory.  When you configure Orca in step 3),
     configure will determine if you need any of these modules compiled
     and installed.  configure will then modify the packages/Makefile
     file to only build those modules that need to be installed.
 
-    All of the modules except for Math::IntervalSearch require a compiler
-    and generate shared libraries by default.
+    All of the modules except for Math::IntervalSearch require a
+    compiler and generate shared libraries by default.
 
     If you wish to download and install modules that have been updated
-    since this Orca package has been assembled, please use the following
-    information.
+    since this Orca package has been assembled, please use the
+    following information.
 
     Data::Dumper
 
-      http://www.perl.com/CPAN/authors/id/GSAR/Data-Dumper-2.101.tar.gz
+      http://www.perl.com/CPAN/authors/id/G/GS/GSAR/Data-Dumper-2.101.tar.gz
 
       % gunzip -c Data-Dumper-2.101.tar.gz | tar xvf -
       % cd Data-Dumper-2.101
@@ -126,10 +173,10 @@
 
     Digest::MD5
 
-      http://www.perl.com/CPAN/authors/id/GAAS/Digest-MD5-2.09.tar.gz
+      http://www.perl.com/CPAN/authors/id/G/GA/GAAS/Digest-MD5-2.13.tar.gz
 
-      % gunzip -c Digest-MD5-2.09.tar.gz | tar xvf -
-      % cd Digest-MD5-2.09
+      % gunzip -c Digest-MD5-2.13.tar.gz | tar xvf -
+      % cd Digest-MD5-2.13
       % perl Makefile.PL
       % make
       % make test
@@ -137,7 +184,6 @@
 
     Math::IntervalSearch
 
-      ftp://ftp.gps.caltech.edu/pub/blair/Perl/Math-Interpolate-1.05.tar.gz
       http://www.perl.com/CPAN/authors/id/B/BZ/BZAJAC/Math-Interpolate-1.05.tar.gz
 
       % gunzip -c Math-Interpolate-1.05.tar.gz | tar xvf -
@@ -149,15 +195,15 @@
 
     RRDs
 
-      http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/pub/
+      http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub
 
-      RRDs is the Perl module that comes with RRDtool, a package written
-      by Tobias Oetiker.
+      RRDs is the Perl module that comes with RRDtool, a package
+      written by Tobias Oetiker.
 
       % gunzip -c rrdtool-?.??.??.tar.gz | tar xvf -
       % cd rrdtool-?.??.??
       % sh configure --verbose
-      % make                                [ To optimize: make CFLAGS=-O ]
+      % make
       % cd perl-shared
       % make test
       % make install
@@ -167,52 +213,15 @@
 
     Storable
 
-      http://www.perl.com/CPAN/authors/id/RAM/Storable-0.6.9.tar.gz
+      http://www.perl.com/CPAN/authors/id/R/RA/RAM/Storable-1.0.11.tar.gz
 
-      % gunzip -c Storable-0.6.9.tar.gz | tar xvf -
-      % cd Storable-0.6.9
+      % gunzip -c Storable-1.0.11.tar.gz | tar xvf -
+      % cd Storable-1.0.11
       % perl Makefile.PL
       % make
       % make test
       % make install
 
- 4) Configure Orca.
-
-    Now that you have decided where the RRD, HTML, and optionally the
-    orcallator data files and the web server access logs, are located,
-    run the configure script with the following arguments:
-
-    % ./configure --prefix=ORCA_PREFIX_DIRECTORY \
-                  --with-rrd-dir=RRD_DIR_LOCATION \
-                  --with-html-dir=HTML_DIR_LOCATION \
-                  --with-orcallator-dir=ORCALLATOR_DIR_LOCATION \
-                  --with-TYPE-log=LOG_LOCATION
-
-    If you choose nothing else, the --with-html-dir must always be used,
-    otherwise configure will fail.
-
-    If you use a web, proxy, or Squid server, you can have orcallator
-    gather statistics from the log file.  Use this table to decide which
-    configure option to use:
-
-    Log Type                                    Configure Option
-    -----------------------------------------------------------------
-    NCSA/Common Log Format                      --with-ncsa-log=FILE
-    Common Log Format with Proxy Information    --with-proxy-log=FILE
-    Squid Log Format                            --with-squid-log=FILE
-
-    Configure will let you use only one of these --with-TYPE-log options.
-
-    The configure script will find where your version of Perl and some
-    other assorted programs are located.  It will also determine if you
-    have the necessary Perl modules to run Orca.  If it does not find
-    the required modules, the modules that are included with the Orca
-    distribution will be built.
-
-    Configure will also determine if you run one of the operating
-    systems where a shared librrd.so library will be built and installed
-    in $libdir.
-
  5) Make Orca and any necessary Perl modules.
 
     To make Orca and these Perl modules run the following command:
@@ -221,8 +230,8 @@
 
  6) Test if the Perl modules properly compiled.
 
-    To check if the Perl modules were properly compiled run the following
-    command:
+    To check if the Perl modules were properly compiled run the
+    following command:
 
     % make test_modules
 
@@ -239,36 +248,36 @@
     HTML and image filenames that Orca creates have changed names.
     There are two separate issues.
 
-    The first is that the naming scheme for all generated HTML and image
-    (either PNG or GIF) files have changed.  Unless you want to leave
-    files with old names around wasting disk space, I recommend you cd
-    into your HTML directories and delete all files there.
-
-    The second issue is that the RRD data files have also changed names
-    and unless you want to reload all of your source data files and
-    waste more disk space on unused RRD files, I suggest that you run
-    following command:
+    The first is that the naming scheme for all generated HTML and
+    image (either PNG or GIF) files have changed.  Unless you want to
+    leave files with old names around wasting disk space, I recommend
+    you cd into your HTML directories and delete all files there.
+
+    The second issue is that the RRD data files have also changed
+    names and unless you want to reload all of your source data files
+    and waste more disk space on unused RRD files, I suggest that you
+    run following command:
 
     % make upgrade
 
     This will look through the all of the directories that Orca will
     install into and use (namely the $prefix, $exec_prefix, $bindir,
-    $libdir, $ORCALLATOR_DIR, and $RRD_DIR directories) and perform any
-    necessary file renaming.
+    $libdir, $ORCALLATOR_DIR, and $RRD_DIR directories) and perform
+    any necessary file renaming.
 
-    If you have some new directories that are not included in the above
-    list directories that make upgrade will cover, you can run the
-    src/upgrage_installation program with a list of directories to parse
-    and rename.  If you want to see what upgrage_installation will rename
-    without actually doing the rename, give it the -n option before any
-    directory names.
+    If you have some new directories that are not included in the
+    above list directories that make upgrade will cover, you can run
+    the src/upgrage_installation program with a list of directories to
+    parse and rename.  If you want to see what upgrage_installation
+    will rename without actually doing the rename, give it the -n
+    option before any directory names.
 
     Here is a description of the various differences between versions.
 
     0.23 -> 0.24
 
-       The following substitutions are now done to create any RRD, HTML and
-       image files.
+       The following substitutions are now done to create any RRD,
+       HTML and image files.
 
           orcallator -> o
           orca       -> o
@@ -280,20 +289,21 @@
 
     0.20 -> 0.21
 
-       Between version 0.20 and 0.21 of Orca, a major name change occurred
-       in all of the installed and generated files.  Any filenames
-       containing percollator, percol, and perc had the name orcallator
-       substituted in place.  Filenames containing the word percent are
-       properly protected and will not be renamed to contain the word
-       orcallatorent.  Percollator.se has been renamed to
-       orcallator.se and its output files are now named orcallator.
-       The default percollator.cfg has been renamed to orcallator.cfg
-       and the version of orcallator.cfg included here now looks for data
-       filenames of the form orcallator-1999-05-08 and percol-1999-05-8.
-       If you are running an Orca installation 0.20 or older and want to
-       rename all of the files and directories in your Orca installation
-       to the new scheme, then kill any running percollator.se's before
-       installing and running the following commands
+       Between version 0.20 and 0.21 of Orca, a major name change
+       occurred in all of the installed and generated files.  Any
+       filenames containing percollator, percol, and perc had the name
+       orcallator substituted in place.  Filenames containing the word
+       percent are properly protected and will not be renamed to
+       contain the word orcallatorent.  Percollator.se has been
+       renamed to orcallator.se and its output files are now named
+       orcallator.  The default percollator.cfg has been renamed to
+       orcallator.cfg and the version of orcallator.cfg included here
+       now looks for data filenames of the form orcallator-1999-05-08
+       and percol-1999-05-8.  If you are running an Orca installation
+       0.20 or older and want to rename all of the files and
+       directories in your Orca installation to the new scheme, then
+       kill any running percollator.se's before installing and running
+       the following commands
 
  9) Install Orca.
 
@@ -306,18 +316,24 @@
 10) [Solaris Only and Optional] Install orcallator.
     a) Install the SE toolkit.
 
-       Perform the installation instructions as listed on the web page
+       Get the SE toolkit and use the installation instructions at
+
+         http://www.setoolkit.com/
+
+       If you are running 2.6 or greater, then download SE 3.2 or
+       greater.  Otherwise you will need SE 3.0.
+
+       The web site
 
          http://www.sun.com/sun-on-net/performance/se3/
 
-       If you are running 2.6 or greater, then download SE 3.1 or greater.
-       Otherwise you will need SE 3.0.
+       is an older SE web site that contains other useful information.
 
-    b) Apply a patch to the SE 3.0 toolkit.  If you are running any other
-       release of SE, then do not install the patch.
+    b) Apply a patch to the SE 3.0 toolkit.  If you are running any
+       other release of SE, then do not install the patch.
 
-       By default the SE toolkit will install into /opt/RICHPse.
-       Run this command:
+       By default the SE toolkit will install into /opt/RICHPse.  Run
+       this command:
 
        % cd /opt/RICHPse % patch -s <
        THIS_DIR/patches/p_netstat_class.se.diff
@@ -325,8 +341,8 @@
     c) Examine Orca/orcallator programs.
 
        Orca's installation scripts also installs several programs and
-       configuration files necessary to have Orca monitor many different
-       statistics of your Sun Solaris systems.
+       configuration files necessary to have Orca monitor many
+       different statistics of your Sun Solaris systems.
 
        The following tools are installed in the $prefix/bin directory:
 
@@ -336,19 +352,21 @@
          orcallator_column  - print selected columns from orcallator output
          orcallator_running - run to see if any orcallators are not running
 
-    d) Install orcallator boot and halt time start/stop scripts
-       in /etc/rc?.d/.
+    d) Install orcallator boot and halt time start/stop scripts in
+       /etc/rc?.d/.
 
-       If you wish to have orcallator run when the machine boots, you can
-       install the included S99orcallator file into the proper /etc/*.d/
-       directories.  To make installing this easier, you can say
+       If you wish to have orcallator run when the machine boots, you
+       can install the included S99orcallator file into the proper
+       /etc/*.d/ directories.  To make installing this easier, you can
+       say
 
        % make orcallator_run_at_boot
 
        from either the top level Makefile or the orcallator/Makefile.
-       It will remove any old orcallator files and install S99orcallator
-       into /etc/init.d/orcallator, /etc/init.d/rc0.d/K01orcallator,
-       /etc/init.d/rc1.d/K01orcallator, and /etc/rc3.d/S99orcallator.
+       It will remove any old orcallator files and install
+       S99orcallator into /etc/init.d/orcallator,
+       /etc/init.d/rc0.d/K01orcallator,
+       /etc/init.d/rc1.d/K01orcallator and /etc/rc3.d/S99orcallator.
 
     e) Run start_orcallator on all systems.
 
@@ -356,17 +374,18 @@
 
        % $prefix/bin/start_orcallator
 
-       Orcallator will not generate an output data file until the first
-       update interval, which will be between 2.5 to 7.5 minutes after
-       orcallator is started.
+       Orcallator will not generate an output data file until the
+       first update interval, which will be between 2.5 to 7.5 minutes
+       after orcallator is started.
 
     f) Edit orcallator.cfg.
 
        You need to edit the installed orcallator.cfg file and remove
        all unneeded references.  In particular, you'll want to change
-       warn_email, which is the email address that receives emails when
-       orcallator generated files are out of date, which may signify a
-       orcallator program that has died and is no longer gathering data.
+       warn_email, which is the email address that receives emails
+       when orcallator generated files are out of date, which may
+       signify a orcallator program that has died and is no longer
+       gathering data.
 
 11) Run Orca.
 

Modified: trunk/orca/lib/homesteaders.cfg
==============================================================================
--- trunk/orca/lib/homesteaders.cfg	(original)
+++ trunk/orca/lib/homesteaders.cfg	Sat Jul 13 21:25:45 2002
@@ -73,7 +73,7 @@
       <td width=388 align=right>
         <font face="Arial,Helvetica" size=2>
           <a href="http://www.ee.ethz.ch/~oetiker">Tobias Oetiker</a>
-          <a href="mailto:oetiker at ee.ethz.ch">&lt;oetiker at ee.ethz.ch&gt;</a> 
+          <a href="mailto:oetiker at ee.ethz.ch">&lt;oetiker at ee.ethz.ch&gt;</a>
           and&nbsp;<a href="http://www.bungi.com">Dave&nbsp;Rand</a>&nbsp;
           <a href="mailto:dlr at bungi.com">&lt;dlr at bungi.com&gt;</a>
         </font>
@@ -86,7 +86,7 @@
   <font face="Arial,Helvetica">
     Please email requests for enhancements, comments, or suggestions
     to Dr. Blair Zajac
-    <a href="mailto:blair at akamai.com">&lt;blair at akamai.com&gt;</a>.
+    <a href="mailto:blair at gps.caltech.edu">&lt;blair at gps.caltech.edu&gt;</a>.
   </font>
 
 # These are the same plot except one of them do not allow deletions.

Modified: trunk/orca/lib/Makefile.in
==============================================================================
--- trunk/orca/lib/Makefile.in	(original)
+++ trunk/orca/lib/Makefile.in	Sat Jul 13 21:25:45 2002
@@ -3,8 +3,8 @@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 libdir		= @libdir@
-MKDIR		= @MKDIR@
 INSTALL		= @INSTALL@
+MKDIR		= @MKDIR@
 
 all:		Makefile orca.gif.hex rrdtool.gif.hex
 
@@ -39,4 +39,3 @@
 
 Makefile: Makefile.in
 	cd .. && CONFIG_FILES=lib/Makefile ./config.status
-	$(MAKE)

Modified: trunk/orca/lib/Orca/HTMLFile.pm
==============================================================================
--- trunk/orca/lib/Orca/HTMLFile.pm	(original)
+++ trunk/orca/lib/Orca/HTMLFile.pm	Sat Jul 13 21:25:45 2002
@@ -1,6 +1,6 @@
 # Orca::HTMLFile: Manage the creation of HTML files.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::HTMLFile;
 
@@ -35,7 +35,7 @@
   print FD <<END;
 <html>
 <head>
-<title>$title</title>
+<title>Orca - $title</title>
 </head>
 <body bgcolor="#ffffff">
 
@@ -69,7 +69,7 @@
       <font FACE="Arial,Helvetica" size=2>
         Orca-$ORCA_VERSION by
         <a href="http://www.gps.caltech.edu/~blair/">Blair Zajac</a>
-        <a href="mailto:blair\@akamai.com">blair\@akamai.com</a>.
+        <a href="mailto:blair\@blair.gps.caltech.edu">blair\@gps.caltech.edu</a>.
       </font>
     </td>
     <td width=120 valign=center>

Modified: trunk/orca/lib/Orca/OpenFileHash.pm
==============================================================================
--- trunk/orca/lib/Orca/OpenFileHash.pm	(original)
+++ trunk/orca/lib/Orca/OpenFileHash.pm	Sat Jul 13 21:25:45 2002
@@ -1,6 +1,6 @@
 # Orca::OpenFileHash: Cache open file descriptors for the whole program.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::OpenFileHash;
 

Modified: trunk/orca/lib/Orca/Config.pm
==============================================================================
--- trunk/orca/lib/Orca/Config.pm	(original)
+++ trunk/orca/lib/Orca/Config.pm	Sat Jul 13 21:25:45 2002
@@ -1,6 +1,6 @@
-# Orca::Config: Manage configuration options for Orca.
+# Orca::Config: Manage configuration parameters for Orca.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::Config;
 
@@ -9,7 +9,15 @@
 use Exporter;
 use Orca::Constants     qw($opt_verbose
                            $is_sub_re
-                           die_when_called);
+                           die_when_called
+                           $ORCA_VERSION
+                           @CONST_IMAGE_PLOT_TYPES
+                           %CONST_IMAGE_PLOT_INFO
+                           @IMAGE_PLOT_TYPES
+                           @IMAGE_PDP_COUNTS
+                           @IMAGE_TIME_SPAN
+                           $MAX_PLOT_TYPE_LENGTH
+                           $INCORRECT_NUMBER_OF_ARGS);
 use Orca::SourceFileIDs qw(@sfile_fids);
 use vars qw(@EXPORT_OK @ISA $VERSION);
 
@@ -22,86 +30,127 @@
 
 # The following array and hashes hold the contents of the
 # configuration file.
-use vars         qw(%config_options %config_groups @config_plots);
-push(@EXPORT_OK, qw(%config_options %config_groups @config_plots));
-
-# These are state variables for reading the config file.  The
-# $pcl_group_name variable holds the name of the group when a
-# group is being defined.  If $pcl_group_name is '', then a group
-# configuration is not being read.  $pcl_plot_index is a string that
-# represents a number that is used as an index into @plots.  If the
-# string is negative, including -0, then the plot configuration is not
-# being defined, otherwise it holds the index into the @plots array
-# the is being defined.
+use vars         qw(%config_global
+                    @config_groups
+                    @config_groups_names
+                    @config_plots);
+push(@EXPORT_OK, qw(%config_global
+                    @config_groups
+                    @config_groups_names
+                    @config_plots));
+
+# This is a list of global parameters that control which plots
+# (i.e. monthly, yearly) are created.
+my $pre_plot_type  = 'generate_';
+my $post_plot_type = '_plot';
+my @plot_type_global_elements = map { "$pre_plot_type$_$post_plot_type" }
+                                @CONST_IMAGE_PLOT_TYPES;
+
+# The pcl_* variables are used to read the configuration file and how
+# to treat each configuration file parameter.
+
+# These are state variables are used for reading the config file.  The
+# variables pcl_group_index and pcl_plot_index are strings that
+# represent a number that is used as an index into @config_groups and
+# @config_plots respectively.  If the string is negative, including
+# -0, then the configuration is not being defined, otherwise it holds
+# the index into the appropriate array that is being defined.
+my $pcl_group_index = '-0';
+my $pcl_plot_index  = '-0';
 my $pcl_group_name  = '';
-my $pcl_plot_index = '-0';
 
-# The following options go into the options and files hashes.  If you
-# add any elements to pcl_plot_append_elements, make sure to update
+# This keeps track of group names that have been loaded.
+my %pcl_group_name_to_index;
+
+# The @pcl_X_elements are the list of valid options for the global,
+# group and plot sections of the configuration file.
+my %pcl_global_elements        =   (base_dir            => 1,
+                                    expire_images       => 1,
+                                    find_times          => 1,
+                                    html_dir            => 1,
+                                    html_page_footer    => 1,
+                                    html_page_header    => 1,
+                                    html_top_title      => 1,
+                                    late_interval       => 1,
+                                    max_filename_length => 1,
+                                    require             => 1,
+                                    rrd_dir             => 1,
+                                    state_file          => 1,
+                                    warn_email          => 1);
+map { $pcl_global_elements{$_} = 1 } @plot_type_global_elements;
+my %pcl_group_elements         =   (column_description  => 1,
+                                    date_parse          => 1,
+                                    date_source         => 1,
+                                    filename_compare    => 1,
+                                    find_files          => 1,
+                                    interval            => 1,
+                                    late_interval       => 1,
+                                    reopen              => 1);
+my %pcl_plot_elements          =   (base                => 1,
+                                    color               => 1,
+                                    data                => 1,
+                                    data_min            => 1,
+                                    data_max            => 1,
+                                    data_type           => 1,
+                                    flush_regexps       => 1,
+                                    href                => 1,
+                                    legend              => 1,
+                                    line_type           => 1,
+                                    logarithmic         => 1,
+                                    plot_height         => 1,
+                                    plot_min            => 1,
+                                    plot_max            => 1,
+                                    plot_width          => 1,
+                                    required            => 1,
+                                    rigid_min_max       => 1,
+                                    source              => 1,
+                                    summary_format      => 1,
+                                    title               => 1,
+                                    y_legend            => 1);
+
+# %pcl_group_append_elements and %pcl_plot_append_elements define
+# those parameters that generate a list of values and every appearance
+# of one in the configuration file appends the value to the array.  If
+# an entry is added to %pcl_plot_append_elements, make sure to update
 # Orca::SourceFile::add_plots.
-my @pcl_option_elements        = qw(base_dir
-                                    expire_images
-                                    find_times
-                                    html_dir
-                                    html_page_footer
-                                    html_page_header
-                                    html_top_title
-                                    late_interval
-                                    rrd_dir
-                                    state_file
-                                    sub_dir
-                                    warn_email);
-my @pcl_group_elements         = qw(column_description
-                                    date_format
-                                    date_source
-                                    filename_compare
-                                    find_files
-                                    interval
-                                    reopen);
-my @pcl_plot_elements          = qw(base
-                                    color
-                                    data
-                                    data_min
-                                    data_max
-                                    data_type
-                                    flush_regexps
-                                    href
-                                    legend
-                                    line_type
-                                    logarithmic
-                                    plot_height
-                                    plot_min
-                                    plot_max
-                                    plot_width
-                                    required
-                                    rigid_min_max
-                                    source
-                                    title
-                                    y_legend);
-my @pcl_plot_append_elements   = qw(color
-                                    data
-                                    legend
-                                    line_type);
-my @pcl_filepath_elements      = qw(find_files
-                                    html_dir
-                                    rrd_dir
-                                    state_file);
-my @pcl_no_arg_elements        = qw(flush_regexps
-                                    logarithmic
-                                    required
-                                    rigid_min_max);
-my %pcl_option_keep_as_array   =   ();
-my %pcl_group_keep_as_array    =   (column_description => 1,
-                                    date_source        => 1,
-                                    find_files         => 1);
-my %pcl_plot_keep_as_array     =   (data               => 1);
-
-# The following variables are used to check that the configuration file
-# contains the required options.  the @cc_required_* are the names of
-# the options that must occur in a configuration file.  The @cc_optional_*
-# options are options set to '' if they are not set in the configuration
-# file.
-my @cc_required_option         = qw(html_dir
+my %pcl_group_append_elements  =   ();
+my %pcl_plot_append_elements   =   (color               => 1,
+                                    data                => 1,
+                                    data_min            => 1,
+                                    data_max            => 1,
+                                    data_type           => 1,
+                                    legend              => 1,
+                                    line_type           => 1,
+                                    summary_format      => 1);
+
+# This is a list of parameters that need their paths cleaned up.
+my %pcl_filepath_elements      =   (find_files          => 1,
+                                    html_dir            => 1,
+                                    rrd_dir             => 1,
+                                    state_file          => 1);
+
+# This is a list of parameters that do not require an argument and
+# when there is no argument for the parameter, the value is set to
+# true.
+my %pcl_no_arg_elements        =   (flush_regexps       => 1,
+                                    logarithmic         => 1,
+                                    required            => 1,
+                                    rigid_min_max       => 1);
+
+# These are a list of parameters that keep all of the arguments to the
+# parameter, not just the first one.  Internally, the parameter value
+# is stored as a reference to an array.
+my %pcl_global_keep_as_array   =   ('require'           => 1);
+my %pcl_group_keep_as_array    =   (column_description  => 1,
+                                    date_source         => 1,
+                                    find_files          => 1);
+my %pcl_plot_keep_as_array     =   (data                => 1);
+
+# The following variables are used to check that the configuration
+# file contains the required parameters and that the parameters are
+# set to the correct values.  The @cc_required_* are the names of the
+# parameters that must occur in a configuration file.
+my @cc_required_global         = qw(html_dir
                                     rrd_dir
                                     state_file);
 my @cc_required_group          = qw(column_description
@@ -110,258 +159,519 @@
                                     interval);
 my @cc_required_plot           = qw(data
                                     source);
-my @cc_optional_option         = qw(expire_images
+
+# The parameters listed in @cc_default_is_true_* are set to 1 if they
+# are not set in the configuration file.
+my @cc_default_is_true_global  =   @plot_type_global_elements;
+my @cc_default_is_true_group   =   ();
+my @cc_default_is_true_plot    =   ();
+
+# The parameters listed in @cc_default_is_false_* are set to '' if
+# they are not set in the configuration file.
+my @cc_default_is_false_global = qw(expire_images
+                                    find_times
                                     html_page_footer
                                     html_page_header
                                     html_top_title
                                     late_interval
-                                    sub_dir
                                     warn_email);
-my @cc_optional_group          = qw(reopen);
-my @cc_optional_plot           = qw(flush_regexps
+my @cc_default_is_false_group  = qw(date_parse
+                                    reopen);
+my @cc_default_is_false_plot   = qw(flush_regexps
                                     href
+                                    late_interval
                                     plot_width
                                     plot_height);
 
+# These parameters are set to true if they do not appear in the
+# configuration file.
+my %pcl_global_default_is_true = map { ($_, 1) } @plot_type_global_elements;
+my %pcl_group_default_is_true  =   ();
+my %pcl_plot_default_is_true   =   ();
+
+
 # This is the default list of colors.
-my @cc_default_colors          =   ('00ff00',	# Green
-                                    '0000ff',	# Blue
-                                    'ff0000',	# Red
-                                    'a020f0',	# Magenta
-                                    'ffa500',	# Orange
-                                    'a52a2a',	# Brown
-                                    '00ffff',	# Cyan
-                                    '00aa00',	# Dark Green
-                                    'eeee00',	# Yellow
-                                    '5e5e5e',	# Dark Gray
-                                    '0000aa');	# Dark Blue
+my @cc_default_colors          =   ('00ff00',   # Green
+                                    '0000ff',   # Blue
+                                    'ff0000',   # Red
+                                    'a020f0',   # Magenta
+                                    'ffa500',   # Orange
+                                    'a52a2a',   # Brown
+                                    '00ffff',   # Cyan
+                                    '00aa00',   # Dark Green
+                                    'eeee00',   # Yellow
+                                    '707070',   # Dark Gray
+                                    'be711d',   # Rust 11
+                                    'dad1ff',   # Lilas
+                                    '7df5cb',   # Biz green
+                                    'ff81a9',   # Pink
+                                    'ffe114',   # Golden
+                                    '96a125',   # Olive
+                                    'ffd8ae',   # Peaches
+                                    'bebebe',   # Light Grey
+                                    'ebeec3',   # Taupe
+                                    '860033',   # Bourgogne
+                                    '19a48a',   # Ocean green
+                                    'b8a390',   # VLB
+                                    'a3c5a6',   # Blackboard green
+                                    'ffd2b2',   # Light orange
+                                    '000000',   # Black
+                                    'fff8bd',   # Post-it (tm) Yellow
+                                    'c7eaff',   # Ice blue
+                                    'd3ff52');  # Gatorade green
 
 sub get_color {
   $cc_default_colors[$_[0] % @cc_default_colors];
 }
 
+# Increment this count for each error in the configuration file.
+my $number_errors = 0;
+
 # This variable stores the anonymous subroutine that compares FIDs
 # when a group in the configuration files does not contain a
 # filename_compare parameter.
 my $cmp_fids_sub;
 
+# This subroutine takes a string and compiles it into a subroutine.
+sub compile_sub {
+  unless (@_ == 4) {
+    confess "$0: Orca::Config::compile_sub $INCORRECT_NUMBER_OF_ARGS";
+  }
+
+  my ($option, $where, $config_filename, $expr) = @_;
+
+  $expr = "sub { $expr }" if $expr !~ /$is_sub_re/o;
+
+  my $sub;
+  {
+    local $SIG{__DIE__}  = 'DEFAULT';
+    local $SIG{__WARN__} = \&die_when_called;
+    $sub = eval $expr;
+  }
+
+  if ($@) {
+    warn "$0: cannot evalulate `$option' in $where in ",
+         "`$config_filename':\n   $expr\nOutput: $@\n";
+    return;
+  } else {
+    return $sub;
+  }
+}
+
+# This subroutine takes an expression and creates an anonymous
+# subroutine that calculates the late interval.
+sub compile_late_interval {
+  unless (@_ == 3) {
+    confess "$0: Orca::Config::compile_late_interval $INCORRECT_NUMBER_OF_ARGS";
+  }
+
+  my ($where, $config_filename, $expr) = @_;
+
+  $expr =~ s/\binterval\b/\$_[0]/g;
+  my $sub = compile_sub('late_interval',
+                        $where,
+                        $config_filename,
+                        $expr);
+  return unless $sub;
+
+  local $SIG{__DIE__}  = 'DEFAULT';
+  local $SIG{__WARN__} = \&die_when_called;
+  eval '&$sub(3.1415926) + 0;';
+  if ($@) {
+    warn "$0: cannot execute `late_interval' in $where in ",
+         "`$config_filename':\n   $expr\nOutput: $@\n";
+    return;
+  } else {
+    return $sub;
+  }
+}
+
+# This subroutine takes an array reference, a list of number of
+# elements that should be in the array, and the default value to use
+# if there are no set values.  For the array elements that are not
+# set, use the last set value.
+sub fill_append_elements {
+  unless (@_ == 3) {
+    die "Orca::Config::fill_append_elements $INCORRECT_NUMBER_OF_ARGS";
+  }
+
+  my ($array_ref, $number_datas, $default_value) = @_;
+
+  unless (defined $array_ref->[0]) {
+    $array_ref->[0] = $default_value;
+  }
+  for (my $k=1; $k<$number_datas; ++$k) {
+    unless (defined $array_ref->[$k]) {
+      $array_ref->[$k] = $array_ref->[$k-1];
+    }
+  }
+}
+
 sub check_config {
   my $config_filename = shift;
 
-  # If rrd_dir is not set, then use base_dir.  Only die if both are
+  # Check that the required version of Orca is being used.
+  if (defined $config_global{require}) {
+    my @require = @{$config_global{require}};
+    if (@require == 2) {
+      unless ($require[0] eq 'Orca') {
+        ++$number_errors;
+        warn "$0: error: `require' only accepts `Orca' as first argument in ",
+             "`$config_filename'.\n";
+      }
+      my $number = $require[1];
+      if ($number !~ /^\d+(?:\.\d*)?$/ and $number !~ /^\.\d+$/) {
+        ++$number_errors;
+        warn "$0: error: `require' second argument `$number' is not a number ",
+             "in `$config_filename'.\n";
+      } elsif ($ORCA_VERSION < $number) {
+        ++$number_errors;
+        warn "$0: Orca version $ORCA_VERSION less than required version ",
+             "$number specified in `$config_filename'.\n";
+      }
+    } else {
+      ++$number_errors;
+      warn "$0: error: `require' needs two arguments in `$config_filename'.\n";
+    }
+  }
+
+  # If rrd_dir is not set, then use base_dir.  Only warn if both are
   # not set.
-  unless (defined $config_options{rrd_dir}) {
-    if (defined $config_options{base_dir}) {
-      $config_options{rrd_dir} = $config_options{base_dir};
+  unless (defined $config_global{rrd_dir}) {
+    if (defined $config_global{base_dir}) {
+      $config_global{rrd_dir} = $config_global{base_dir};
     } else {
-      die "$0: error: must define `rrd_dir' in `$config_filename'.\n";
+      ++$number_errors;
+      warn "$0: error: must set `rrd_dir' in `$config_filename'.\n";
     }
   }
 
   # Check that we the required options are satisfied.
-  foreach my $option (@cc_required_option) {
-    unless (defined $config_options{$option}) {
-      die "$0: error: must define `$option' in `$config_filename'.\n";
+  my $required_error = 0;
+  foreach my $option (@cc_required_global) {
+    unless (defined $config_global{$option}) {
+      $required_error = 1;
+      ++$number_errors;
+      warn "$0: error: must set `$option' in `$config_filename'.\n";
     }
   }
 
+  # Quit now if there were any required options that were not set
+  # since use of then will cause uninitialized warnings.
+  if ($required_error) {
+    die "$0: loading configuration file `$config_filename' got ",
+        "$number_errors error(s).\n";
+  }
+
   # Check if the html_dir and rrd_dir directories exist.
   foreach my $dir_key ('html_dir', 'rrd_dir') {
-    my $dir = $config_options{$dir_key};
-    die "$0: error: please create $dir_key `$dir'.\n" unless -d $dir;
+    my $dir = $config_global{$dir_key};
+    unless (-d $dir) {
+      ++$number_errors;
+      warn "$0: error: please create $dir_key `$dir'.\n";
+    }
   }
 
-  # Set any optional options to '' if it isn't defined.
-  foreach my $option (@cc_optional_option) {
-    $config_options{$option} = '' unless defined $config_options{$option};
+  # Set any optional global parameters to '' if it isn't defined in
+  # the configuration file.
+  foreach my $option (@cc_default_is_false_global) {
+    $config_global{$option} = '' unless defined $config_global{$option};
   }
 
-  # Late_interval is a valid mathematical expression. Replace the word
-  # interval with $_[0].  Try the subroutine to make sure it works.
-  unless ($config_options{late_interval}) {
-    $config_options{late_interval} = 'interval';
-  }
-  my $expr = "sub { $config_options{late_interval}; }";
-  $expr =~ s/interval/\$_[0]/g;
-  my $sub;
-  {
-    local $SIG{__DIE__}  = 'DEFAULT';
-    local $SIG{__WARN__} = \&die_when_called;
-    $sub = eval $expr;
+  # Set any optional global parameters to 1 if it isn't defined in the
+  # configuration file.
+  foreach my $option (@cc_default_is_true_global) {
+    $config_global{$option} = 1 unless defined $config_global{$option};
   }
-  if ($@) {
-    die "$0: cannot evaluate `late_interval' in `$config_filename':\n   ",
-        "$expr\nOutput: $@\n";
+
+  # Set the max_filename_length if it is not set and check it
+  # otherwise.
+  my $mfl = $config_global{max_filename_length};
+  if (defined $mfl) {
+    unless ($mfl =~ /^\d+$/ and $mfl > 63) {
+      ++$number_errors;
+      warn "$0: error: max_filename_length `$mfl' is not a number > 63.\n";
+    }
+  } else {
+    $config_global{max_filename_length} = 235;
   }
-  {
-    local $SIG{__DIE__}  = 'DEFAULT';
-    local $SIG{__WARN__} = \&die_when_called;
-    eval '&$sub(3.1415926) + 0;';
+
+  # Late_interval is a valid mathematical expression. Replace the word
+  # interval with $_[0].  Try the subroutine to make sure it works.
+  unless ($config_global{late_interval}) {
+    $config_global{late_interval} = 'interval';
   }
-  if ($@) {
-    die "$0: cannot execute `late_interval' in `$config_filename':\n   ",
-         "$expr\nOutput: $@\n";
+  my $global_late_interval_expr = $config_global{late_interval};
+  my $sub = compile_late_interval('global section',
+                                  $config_filename,
+                                  $config_global{late_interval});
+  if ($sub) {
+    $config_global{late_interval} = $sub;
+  } else {
+    ++$number_errors;
   }
-  $config_options{late_interval} = $sub;
 
   # Convert the list of find_times into an array of fractional hours.
   my @find_times;
-  unless (defined $config_options{find_times}) {
-    $config_options{find_times} = '';
-  }
-  foreach my $find_time (split(' ', $config_options{find_times})) {
+  foreach my $find_time (split(' ', $config_global{find_times})) {
     if (my ($hours, $minutes) = $find_time =~ /^(\d{1,2}):(\d{2})/) {
       # Because of the regular expression match we're doing, the hours
       # and minutes will only be positive, so check for hours > 23 and
       # minutes > 59.
       unless ($hours < 24) {
-        warn "$0: warning: ignoring find_times `$find_time': hours must be less than 24.\n";
+        ++$number_errors;
+        warn "$0: warning: ignoring find_times `$find_time': hours must be ",
+             "less than 24.\n";
         next;
       }
       unless ($minutes < 60) {
-        warn "$0: warning: ignoring find_times `$find_time': minutes must be less than 60.\n";
+        ++$number_errors;
+        warn "$0: warning: ignoring find_times `$find_time': minutes must be ",
+             "less than 60.\n";
         next;
       }
       push(@find_times, $hours + $minutes/60.0);
     } else {
+      ++$number_errors;
       warn "$0: warning: ignoring find_times `$find_time': illegal format.\n";
     }
   }
-  $config_options{find_times} = [ sort { $a <=> $b } @find_times ];
+  $config_global{find_times} = [ sort { $a <=> $b } @find_times ];
+
+  # Using the parameters in the configuration file, generate the list
+  # of plots to create.
+  @IMAGE_PLOT_TYPES = ();
+  @IMAGE_PDP_COUNTS = ();
+  @IMAGE_TIME_SPAN  = ();
+  $MAX_PLOT_TYPE_LENGTH = 0;
+  foreach my $type (@CONST_IMAGE_PLOT_TYPES) {
+    if ($config_global{"$pre_plot_type$type$post_plot_type"}) {
+      my $data_ref = $CONST_IMAGE_PLOT_INFO{$type};
+      unless ($data_ref) {
+        die "$0: internal error: \$CONST_IMAGE_PLOT_INFO{$type} is ",
+            "undefined.\n";
+      }
+      push(@IMAGE_PLOT_TYPES, $type);
+      push(@IMAGE_PDP_COUNTS, $data_ref->[0]);
+      push(@IMAGE_TIME_SPAN,  $data_ref->[1]);
+      my $type_length = length($type);
+      if ($type_length > $MAX_PLOT_TYPE_LENGTH) {
+        $MAX_PLOT_TYPE_LENGTH = $type_length;
+      }
+    }
+  }
+
+  # There must be at least one timespan plot.
+  unless (@IMAGE_PLOT_TYPES) {
+    ++$number_errors;
+    warn "$0: error: generate_*_plots parameters turn off all plots in ",
+         "`$config_filename'.\n";
+  }
 
   # There must be at least one group.
-  unless (keys %config_groups) {
-    die "$0: error: must define at least one `group' in `$config_filename'.\n";
+  unless (@config_groups) {
+    ++$number_errors;
+    warn "$0: error: must define at least one `group' in ",
+         "`$config_filename'.\n";
   }
 
   # For each group parameter there are required options.
-  foreach my $group_name (keys %config_groups) {
-    my $group = $config_groups{$group_name};
+  for (my $i=0; $i<@config_groups; ++$i) {
+    my $group      = $config_groups[$i];
+    my $group_name = $config_groups_names[$i];
 
+    $required_error = 0;
     foreach my $option (@cc_required_group) {
       unless (defined $group->{$option}) {
-        die "$0: error: must define `$option' for `group $group_name' ",
-            "in `$config_filename'.\n";
+        $required_error = 1;
+        ++$number_errors;
+        warn "$0: error: must set `$option' for `group $group_name' ",
+             "in `$config_filename'.\n";
       }
     }
 
-    # Optional group options will be set to '' here if they haven't
-    # been set by the user.
-    foreach my $option (@cc_optional_group) {
+    # Quit now if there were any required options that were not set
+    # since use of then will cause uninitialized warnings.
+    if ($required_error) {
+      die "$0: loading configuration file `$config_filename' got ",
+          "$number_errors error(s).\n";
+    }
+
+    # Set any optional group parameters to '' if it isn't defined in
+    # the configuration file.
+    foreach my $option (@cc_default_is_false_group) {
       $group->{$option} = '' unless defined $group->{$option};
     }
 
-    # Create the filename comparison function.  The function must be
-    # handle input ala sort() via the package global $a and $b variables.
-    if (defined $group->{filename_compare} or !$cmp_fids_sub) {
-      my $expr = defined $group->{filename_compare} ?
-                 $group->{filename_compare} :
-                 'sub { $a cmp $b }';
-      $expr = "sub { $expr }" if $expr !~ /$is_sub_re/o;
-      my $sub;
-      {
-        local $SIG{__DIE__}  = 'DEFAULT';
-        local $SIG{__WARN__} = \&die_when_called;
-        $sub = eval $expr;
+    # Set any optional group parameters to 1 if it isn't defined in
+    # the configuration file.
+    foreach my $option (@cc_default_is_true_group) {
+      $group->{$option} = 1 unless defined $group->{$option};
+    }
+
+    # Check that the interval is a number.
+    unless ($group->{interval} =~ /^\d+$/ and $group->{interval} > 0) {
+      ++$number_errors;
+      warn "$0: error: interval `$group->{interval}' for `group $group_name' ",
+           "is not an integer greater than 0 in `$config_filename'.\n";
+    }
+
+    # Check the late_interval.  If it does not exist, then use the
+    # global one.
+    my $expr;
+    if ($expr = $group->{late_interval}) {
+      $sub = compile_late_interval("`group $group_name'",
+                                   $config_filename,
+                                   $expr);
+      if ($sub) {
+        $group->{late_interval} = $sub;
+      } else {
+        ++$number_errors;
       }
+    } else {
+      $expr = $global_late_interval_expr;
+      $group->{late_interval} = $config_global{late_interval};
+    }
+    {
+      local $SIG{__DIE__}  = 'DEFAULT';
+      local $SIG{__WARN__} = \&die_when_called;
+      $sub = $group->{late_interval};
+      my $value;
+      eval '$value = &$sub($group->{interval});';
       if ($@) {
-        if ($group->{filename_compare}) {
-          die "$0: cannot compile `filename_compare' for group `$group_name' ",
-              "in `$config_filename':\n   $expr\nOutput: $@\n";
-        } else {
-          die "$0: internal error: cannot compile default ",
-              "`filename_compare':\n   $expr\nOutput: $@\n";
-        }
+        ++$number_errors;
+        warn "$0: cannot execute `late_interval' in `group $group_name' in ",
+             "`$config_filename':\n   $expr\nOutput: $@\n";
+      } elsif ($value !~ /^\d+$/ and $value <= 0) {
+        ++$number_errors;
+        warn "$0: `late_interval' in `group $group_name' did not generate an ",
+             "integer `$value' greater than 0.\n";
       }
+      $group->{late_interval} = $value;
+    }
 
-      # This subroutine looks fine.  Now change all the variables to use
-      # file IDs instead.
-      $expr =~ s/\$a(\W)/\$sfile_fids[\$a]$1/g;
-      $expr =~ s/\$b(\W)/\$sfile_fids[\$b]$1/g;
-      {
-        no strict;
-        local $SIG{__DIE__}  = 'DEFAULT';
-        local $SIG{__WARN__} = \&die_when_called;
-        $sub = eval $expr;
-      }
-      if ($@) {
-        if ($group->{filename_compare}) {
-          die "$0: cannot compile `filename_compare' for group `$group_name' ",
-              "in `$config_filename':\n   $expr\nOutput: $@\n";
+    # There are three intervals associated with each file.  The first
+    # is the data update interval.  This is the same interval used to
+    # generate the RRDs.  The second interval is the interval before
+    # the file is considered late and is larger than the data update
+    # interval.  This interval is calculated by using the mathematical
+    # expression given in the `late_interval' configuration option.
+    # If `late_interval' is not defined, then it gets defaulted to the
+    # data update interval.  The last interval is the interval to use
+    # to tell the program when to attempt to read the file next.
+    # Because it can take some time for the source files to be
+    # updated, we don't want to read the file immediately after the
+    # data update interval is done.  For this reason, choose a read
+    # interval that is somewhere in between the data source interval
+    # and the late_interval.  Use the multiplicative average of the
+    # data update interval and the late interval since the resulting
+    # value is closer to the data update interval.  Ie:
+    # (20 + 5)/2 = 12.5.  Sqrt(20*5) = 10.
+    $group->{read_interval} = sqrt($group->{interval}*$group->{late_interval});
+
+    # Create the filename comparison function.  The function must be
+    # handle input ala sort() via the package global $a and $b variables.
+    if ($group->{filename_compare} or !$cmp_fids_sub) {
+      $expr = $group->{filename_compare} ?
+              $group->{filename_compare} :
+              'sub { $a cmp $b }';
+      if (compile_sub('filename_compare',
+                      "`group $group_name'",
+                      $config_filename,
+                      $expr)) {
+        # This subroutine looks fine.  Now change all the variables to
+        # use file IDs instead.
+        $expr =~ s/\$a(\W)/\$sfile_fids[\$a]$1/g;
+        $expr =~ s/\$b(\W)/\$sfile_fids[\$b]$1/g;
+        $sub  = compile_sub('filename_compare',
+                            "group `$group_name'",
+                            $config_filename,
+                            $expr);
+        if ($sub) {
+          $cmp_fids_sub = $sub if !$group->{filename_compare};
+          $group->{filename_compare} = $sub;
         } else {
-          die "$0: internal error: cannot compile default ",
-              "`filename_compare':\n   $expr\nOutput: $@\n";
+          ++$number_errors;
         }
+      } else {
+        ++$number_errors;
       }
-      $cmp_fids_sub = $sub if !$group->{filename_compare};
-      $group->{filename_compare} = $sub;
     } else {
       $group->{filename_compare} = $cmp_fids_sub;
     }
 
     # Check that the date_source is either column_name followed by a
     # column name or file_mtime for the file modification time.  If a
-    # column_name is used, then the date_format is required.
+    # column_name is used, then compile the data_parse subroutine if
+    # it exists.
     my $date_source = $group->{date_source}[0];
+    $group->{date_parse} = 0;
     if ($date_source eq 'column_name') {
-      unless (@{$group->{date_source}} == 2) {
-        die "$0: error: incorrect number of arguments for `date_source' for ",
-            "`group $group_name'.\n";
-      }
-      unless (defined $group->{date_format}) {
-        die "$0: error: must define `date_format' with ",
-            "`date_source columns ...' for `group $group_name'.\n";
+      if (@{$group->{date_source}} != 2) {
+        ++$number_errors;
+        warn "$0: error: incorrect number of arguments for `date_source' for ",
+             "`group $group_name'.\n";
+      } elsif (my $expr = $group->{date_parse}) {
+        unless ($group->{date_parse} = compile_sub('date_parse',
+                                                   "group `$group_name'",
+                                                   $config_filename,
+                                                   $expr)) {
+          ++$number_errors;
+        }
       }
     } else {
       unless ($date_source eq 'file_mtime') {
-        die "$0: error: illegal argument for `date_source' for ",
+        ++$number_errors;
+        warn "$0: error: illegal argument for `date_source' for ",
              "`group $group_name'.\n";
       }
     }
     $group->{date_source}[0] = $date_source;
 
-    # Validate the regular expression for find_files and get a unique list
-    # of them.  Check if the regular expressions contain any ()'s that will
-    # place the found files into different groups.  If any ()'s are found,
-    # then the output HTML and image tree will use subdirectories for each
-    # group.
+    # Validate the regular expression for find_files and get a unique
+    # list of them.  Check if the regular expressions contain any ()'s
+    # that will place the found files into different groups.  If any
+    # ()'s are found, then the output HTML and image tree will use
+    # subdirectories for each group.
     #
-    # In this comment, all path names are Perl escaped, so the directory
-    # . would be written as \. instead.
+    # In this code comment, all path names are Perl escaped, so the
+    # directory . would be written as \. instead.
     #
-    # Since we do not want to search on the current directory, find any
-    # text that begins a regular expression with a \./ and remove it.  Also
-    # Remove any matches for /\./ in the path since they are unnecessary.
-    # However, do not remove searches for /./, since this can match single
-    # character files or directories.
-    my $sub_dir = 0;
+    # Since we do not want to search on the current directory, find
+    # any find_files' that begin a regular expression with a \./ and
+    # remove it.  Also remove any matches for /\./ in the path since
+    # they are unnecessary.  However, do not remove searches for /./,
+    # since this can match single character files or directories.
     my %find_files;
-    my $number_finds = @{$group->{find_files}};
-    for (my $i=0; $i<$number_finds; ++$i) {
-      my $orig_find = $group->{find_files}[$i];
-      my $find      = $orig_find;
-      $find         =~ s:^\\\./+::;
-      $find         =~ s:/+\\\./+:/:g;
-      $find         = $orig_find unless $find;
-      $group->{find_files}[$i] = $find;
-      my $test_string          = 'abcdefg';
-      local $SIG{__DIE__}      = 'DEFAULT';
-      local $SIG{__WARN__}     = \&die_when_called;
+    my $find_files = $group->{find_files};
+    my $number_finds = @$find_files;
+    for (my $j=0; $j<$number_finds; ++$j) {
+      my $orig_find        = $find_files->[$j];
+      my $find             = $orig_find;
+      $find                =~ s:^\\\./+::;
+      $find                =~ s:/+\\\./+:/:g;
+      $find                = $orig_find unless $find;
+      $find_files->[$j]    = $find;
+      my $test_string      = 'abcdefg';
+      local $SIG{__DIE__}  = 'DEFAULT';
+      local $SIG{__WARN__} = \&die_when_called;
       eval { $test_string =~ /$find/ };
       if ($@) {
-        die "$0: error: illegal regular expression in `find_files $orig_find' ",
-            "for `files $group_name' in `$config_filename':\n$@\n";
+        ++$number_errors;
+        warn "$0: error: illegal regular expression in `find_files ",
+             "$orig_find' for `files $group_name' in ",
+             "`$config_filename':\n$@\n";
+      } else {
+        $find_files{$find} = 1;
       }
-      $find_files{$find} = 1;
-      $sub_dir = 1 if $find =~ m:\(.+\):;
     }
     $group->{find_files} = [sort keys %find_files];
-    $group->{sub_dir}    = $sub_dir || $config_options{sub_dir};
   }
 
   # There must be at least one plot.
   unless (@config_plots) {
-    die "$0: error: must define at least one `plot' in `$config_filename'.\n";
+    ++$number_errors;
+    warn "$0: error: must define at least one `plot' in `$config_filename'.\n";
   }
 
   # Foreach plot there are required options.  Create default options
@@ -370,23 +680,39 @@
     my $plot = $config_plots[$i];
 
     my $j = $i + 1;
+    $required_error = 0;
     foreach my $option (@cc_required_plot) {
       unless (defined $plot->{$option}) {
-        die "$0: error: must define `$option' for `plot' #$j in ",
-            "`$config_filename'.\n";
+        $required_error = 1;
+        ++$number_errors;
+        warn "$0: error: must set `$option' for `plot' #$j in ",
+             "`$config_filename'.\n";
       }
     }
 
+    # Quit now if there were any required options that were not set
+    # since use of then will cause uninitialized warnings.
+    if ($required_error) {
+      die "$0: loading configuration file `$config_filename' got ",
+          "$number_errors error(s).\n";
+    }
+
     # Create an array for each plot that will have a list of images that
     # were generated from this plot.
     $plot->{creates} = [];
 
-    # Optional options will be set to '' here if they haven't been set
-    # by the user.
-    foreach my $option (@cc_optional_plot) {
+    # Set any optional plot parameters to '' if it isn't defined in
+    # the configuration file.
+    foreach my $option (@cc_default_is_false_plot) {
       $plot->{$option} = '' unless defined $plot->{$option};
     }
 
+    # Set any optional plot parameters to 1 if it isn't defined in
+    # the configuration file.
+    foreach my $option (@cc_default_is_true_plot) {
+      $plot->{$option} = 1 unless defined $plot->{$option};
+    }
+
     # Set the default plot width and height.
     $plot->{plot_width}  =  500 unless $plot->{plot_width};
     $plot->{plot_height} =  125 unless $plot->{plot_height};
@@ -394,54 +720,76 @@
     # Make sure the base is either 1000 or 1024.
     if (defined $plot->{base} && length($plot->{base})) {
       if ($plot->{base} != 1000 and $plot->{base} != 1024) {
-        die "$0: error: plot #$j must define base to be either 1000 or 1024.\n";
+        ++$number_errors;
+        warn "$0: error: plot #$j must set base to be either 1000 or 1024.\n";
       }
     } else {
       $plot->{base} = 1000;
     }
 
-    # Set the plot minimum and maximum values to U unless they are
-    # set.
-    $plot->{data_min} = 'U' unless defined $plot->{data_min};
-    $plot->{data_max} = 'U' unless defined $plot->{data_max};
+    # Get the number of data's in this plot.
+    my $number_datas = @{$plot->{data}};
+
+    # If the data_min and data_max are not set, then set it to U.  Use
+    # the last set data_min and data_max for those that are not set.
+    $plot->{data_min} = [] unless defined $plot->{data_min};
+    $plot->{data_max} = [] unless defined $plot->{data_max};
+    fill_append_elements($plot->{data_min}, $number_datas, 'U');
+    fill_append_elements($plot->{data_max}, $number_datas, 'U');
 
     # The data type must be either gauge, absolute, or counter.
-    if (defined $plot->{data_type}) {
-      my $type = substr($plot->{data_type}, 0, 1);
-      if ($type eq 'g' or $type eq 'G') {
-        $plot->{data_type} = 'GAUGE';
-      } elsif ($type eq 'c' or $type eq 'C') {
-        $plot->{data_type} = 'COUNTER';
-      } elsif ($type eq 'a' or $type eq 'A') {
-        $plot->{data_type} = 'ABSOLUTE';
-      } elsif ($type eq 'd' or $type eq 'D') {
-        $plot->{data_type} = 'DERIVE';
+    $plot->{data_type} = [] unless defined $plot->{data_type};
+    for (my $k=0; $k<@{$plot->{data_type}}; ++$k) {
+      my $data_type = $plot->{data_type}[$k];
+      my $first_char = lc(substr($data_type, 0, 1));
+      if ($first_char eq 'g') {
+        $plot->{data_type}[$k] = 'GAUGE';
+      } elsif ($first_char eq 'c') {
+        $plot->{data_type}[$k] = 'COUNTER';
+      } elsif ($first_char eq 'a') {
+        $plot->{data_type}[$k] = 'ABSOLUTE';
+      } elsif ($first_char eq 'd') {
+        $plot->{data_type}[$k] = 'DERIVE';
       } else {
-        die "$0: error: `data_type $plot->{data_type}' for `plot' #$j in ",
-            "`$config_filename' must be gauge, counter, derive, or absolute.\n";
+        ++$number_errors;
+        my $l = $k + 1;
+        warn "$0: error: `data_type #$l `$data_type' for `plot' #$j in ",
+             "`$config_filename' must be gauge, counter, derive, or ",
+             "absolute.\n";
       }
-    } else {
-      $plot->{data_type} = 'GAUGE';
     }
+    fill_append_elements($plot->{data_type}, $number_datas, 'GAUGE');
 
-    # The data source needs to be a valid group name.
-    my $source = $plot->{source};
-    unless (defined $config_groups{$source}) {
-      die "$0: error: plot #$j `source $source' references non-existant ",
-          "`group' in `$config_filename'.\n";
-    }
-    unless ($plot->{source}) {
-      die "$0: error: plot #$j `source $source' requires one group_name ",
-          "argument in `$config_filename'.\n";
+    # The data source needs to be a valid group name.  Replace the
+    # group's name with its index.
+    my $source = delete $plot->{source};
+    unless (defined $source) {
+      ++$number_errors;
+      warn "$0: error: plot #$j `source $source' requires one group_name ",
+           "argument in `$config_filename'.\n";
+      next;
     }
+    my $source_index = $pcl_group_name_to_index{$source};
+    unless (defined $source_index) {
+      ++$number_errors;
+      warn "$0: error: plot #$j `source $source' references non-existant ",
+           "`group' in `$config_filename'.\n";
+      next;
+    }
+    $plot->{source_index} = $source_index;
 
     # Set the legends of any columns not defined.
     $plot->{legend} = [] unless defined $plot->{legend};
-    my $number_datas = @{$plot->{data}};
     for (my $k=@{$plot->{legend}}; $k<$number_datas; ++$k) {
       $plot->{legend}[$k] = "@{$plot->{data}[$k]}";
     }
 
+    # If the generic y_legend is not set, then set it equal to the
+    # first legend.
+    unless (defined $plot->{y_legend}) {
+      $plot->{y_legend} = $plot->{legend}[0];
+    }
+
     # Set the colors of any data not defined.
     $plot->{color} = [] unless defined $plot->{color};
     for (my $k=@{$plot->{color}}; $k<$number_datas; ++$k) {
@@ -449,6 +797,7 @@
     }
 
     # Check each line type setting.
+    $plot->{line_type} = [] unless defined $plot->{line_type};
     for (my $k=0; $k<$number_datas; ++$k) {
       if (defined $plot->{line_type}[$k]) {
       my $line_type = $plot->{line_type}[$k];
@@ -459,7 +808,8 @@
         } elsif ($line_type =~ /^stack$/i) {
           $line_type = 'STACK';
         } else {
-          die "$0: error: plot #$j illegal `line_type' `$line_type'.\n";
+          ++$number_errors;
+          warn "$0: error: plot #$j illegal `line_type' `$line_type'.\n";
         }
         $plot->{line_type}[$k] = $line_type;
       } else {
@@ -467,11 +817,11 @@
       }
     }
 
-    # If the generic y_legend is not set, then set it equal to the
-    # first legend.
-    unless (defined $plot->{y_legend}) {
-      $plot->{y_legend} = $plot->{legend}[0];
-    }
+    # If the summary_format is not set, then set it to a reasonable
+    # default.  Use the last set summary_format for those that are not
+    # set.
+    $plot->{summary_format} = [] unless defined $plot->{summary_format};
+    fill_append_elements($plot->{summary_format}, $number_datas, '%9.3lf %S');
 
     # If the title is not set, then set it equal to all of the legends
     # with the group name prepended.
@@ -485,6 +835,11 @@
     }
   }
 
+  if ($number_errors) {
+    die "$0: loading configuration file `$config_filename' got ",
+        "$number_errors error(s).\n";
+  }
+
   1;
 }
 
@@ -504,6 +859,8 @@
   $path;
 }
 
+# Go through each input line separately and keep a state of the type
+# of object being processed between global, group and plot options.
 sub process_config_line {
   my ($config_filename, $line_number, $line) = @_;
 
@@ -515,24 +872,28 @@
   # options that do not require an option argument and do not supply
   # one.
   if ($key ne '}') {
-    if (grep {$key eq $_} @pcl_no_arg_elements) {
+    if ($pcl_no_arg_elements{$key}) {
       push(@line, 1) unless @line;
     } else {
       unless (@line) {
-        warn "$0: warning: option `$key' needs arguments in `$config_filename' line $line_number.\n";
+        ++$number_errors;
+        warn "$0: warning: option `$key' needs arguments in ",
+             "`$config_filename' line $line_number.\n";
         return;
       }
     }
   }
 
-  # Clean up paths in the following order:
+  # If the option is a file path option, then clean up paths in the
+  # following order:
   # 1) Trim the path.
   # 2) Prepend the base_dir to paths that are not prepended by
   #    ^\\?\.{0,2}/, which matches /, ./, ../, and \./.
   # 3) Trim the resulting path.
-  if (grep {$key eq $_} @pcl_filepath_elements) {
-    my $base_dir = defined $config_options{base_dir}?
-      _trim_path($config_options{base_dir}) : '';
+  if ($pcl_filepath_elements{$key}) {
+    my $base_dir = defined $config_global{base_dir} ?
+                  _trim_path($config_global{base_dir}) :
+                  '';
     for (my $i=0; $i<@line; ++$i) {
       my $path = _trim_path($line[$i]);
       if ($base_dir) {
@@ -544,47 +905,51 @@
 
   my $value = "@line";
 
-  # Process the line differently if we're reading for a particular
-  # option.  This one is for groups.
-  if ($pcl_group_name) {
-    if ($key eq '}') {
-      $pcl_group_name = '';
-      return;
-    }
-    unless (grep {$key eq $_} @pcl_group_elements) {
-      warn "$0: warning: directive `$key' unknown for group at line $line_number in `$config_filename'.\n";
-      return;
-    }
-
-    if (defined $config_groups{$pcl_group_name}{$key}) {
-      warn "$0: warning: `$key' for group already defined at line $line_number in `$config_filename'.\n";
-    }
-    if ($pcl_group_keep_as_array{$key}) {
-      $config_groups{$pcl_group_name}{$key} = [ @line ];
-    } else {
-      $config_groups{$pcl_group_name}{$key} = $value;
-    }
-    return;
+  # Now check if a group or plot is being processed by examining the
+  # state variables.
+  my $index_ref;
+  my $config_ref;
+  my $pcl_elements_ref;
+  my $pcl_keep_as_array_ref;
+  my $pcl_append_elements_ref;
+  my $label;
+  if (substr($pcl_group_index, 0, 1) ne '-') {
+    $index_ref               = \$pcl_group_index;
+    $config_ref              = \@config_groups;
+    $pcl_elements_ref        = \%pcl_group_elements;
+    $pcl_keep_as_array_ref   = \%pcl_group_keep_as_array;
+    $pcl_append_elements_ref = \%pcl_group_append_elements;
+    $label                   = "group `$pcl_group_name'";
+  } elsif (substr($pcl_plot_index, 0, 1) ne '-') {
+    $index_ref               = \$pcl_plot_index;
+    $config_ref              = \@config_plots;
+    $pcl_elements_ref        = \%pcl_plot_elements;
+    $pcl_keep_as_array_ref   = \%pcl_plot_keep_as_array;
+    $pcl_append_elements_ref = \%pcl_plot_append_elements;
+    $label                   = "plot #$pcl_plot_index";
   }
 
-  # Handle options for plot.
-  if ($pcl_plot_index !~ /^-/) {
+  # At this point a group or plot is being read.
+  if ($index_ref) {
     if ($key eq '}') {
-      ++$pcl_plot_index;
-      $pcl_plot_index = "-$pcl_plot_index";
+      ++$$index_ref;
+      $$index_ref = "-$$index_ref";
       return;
     }
-    unless (grep {$key eq $_} @pcl_plot_elements) {
-      warn "$0: warning: directive `$key' unknown for plot at line $line_number in `$config_filename'.\n";
+
+    unless ($pcl_elements_ref->{$key}) {
+      ++$number_errors;
+      warn "$0: warning: directive `$key' unknown for $label at line ",
+           "$line_number in `$config_filename'.\n";
       return;
     }
 
     # Handle those elements that can just append.
-    if (grep { $key eq $_ } @pcl_plot_append_elements) {
-      unless (defined $config_plots[$pcl_plot_index]{$key}) {
-        $config_plots[$pcl_plot_index]{$key} = [];
+    if ($pcl_append_elements_ref->{$key}) {
+      unless (defined $config_ref->[$$index_ref]{$key}) {
+        $config_ref->[$$index_ref]{$key} = [];
       }
-      if ($pcl_plot_keep_as_array{$key}) {
+      if ($pcl_keep_as_array_ref->{$key}) {
         push(@{$config_plots[$pcl_plot_index]{$key}}, [ @line ]);
       } else {
         push(@{$config_plots[$pcl_plot_index]{$key}}, $value);
@@ -592,57 +957,78 @@
       return;
     }
 
-    if (defined $config_plots[$pcl_plot_index]{$key}) {
-      warn "$0: warning: `$key' for plot already defined at line $line_number in `$config_filename'.\n";
+    if (defined $config_ref->[$$index_ref]{$key}) {
+      ++$number_errors;
+      warn "$0: warning: `$key' for $label already defined at line ",
+           "$line_number in `$config_filename'.\n";
       return;
     }
-    if ($pcl_plot_keep_as_array{$key}) {
-      $config_plots[$pcl_plot_index]{$key} = [ @line ];
+
+    if ($pcl_keep_as_array_ref->{$key}) {
+      $config_ref->[$$index_ref]{$key} = [ @line ];
     } else {
-      $config_plots[$pcl_plot_index]{$key} = $value;
+      $config_ref->[$$index_ref]{$key} = $value;
     }
     return;
   }
 
-  # Take care of generic options.
-  if (grep {$key eq $_} @pcl_option_elements) {
-    if ($pcl_option_keep_as_array{$key}) {
-      $config_options{$key} = [ @line ];
+  # At this point the line is either a global option or the
+  # declaration of a group or a plot.  Take care of global parameters.
+  if ($pcl_global_elements{$key}) {
+    if ($pcl_global_keep_as_array{$key}) {
+      $config_global{$key} = [ @line ];
     } else {
-      $config_options{$key} = $value;
+      $config_global{$key} = $value;
     }
     return;
   }
 
-  # Take care of a group.
+  # At this point a group or a plot is being defined.
   if ($key eq 'group') {
     unless (@line) {
       die "$0: error: group needs a group name followed by { at ",
           "line $line_number in `$config_filename'.\n"
     }
-    $pcl_group_name = shift(@line);
+    $pcl_group_index =~ s:^-::;
+    $pcl_group_name =  shift(@line);
     unless (@line == 1 and $line[0] eq '{' ) {
-      warn "$0: warning: '{' required after `group $pcl_group_name' at ",
-           "line $line_number in `$config_filename'.\n";
-    }
-    if (defined $config_groups{$pcl_group_name}) {
-      warn "$0: warning: `group $key' at line $line_number in ",
-           "`$config_filename' previously defined.\n";
+      ++$number_errors;
+      if ($pcl_group_name eq '{') {
+        warn "$0: warning: 'group_name {' required after `group' at ",
+             "line $line_number in `$config_filename'.\n";
+      } else {
+        warn "$0: warning: '{' required after `group $pcl_group_name' at ",
+             "line $line_number in `$config_filename'.\n";
+      }
     }
+    if (defined $pcl_group_name_to_index{$pcl_group_name}) {
+      ++$number_errors;
+      die "$0: warning: `group $key' at line $line_number in ",
+          "`$config_filename' previously defined.\n";
+    }
+    $config_groups[$pcl_group_index]{index}      = $pcl_group_index;
+    $config_groups_names[$pcl_group_index]       = $pcl_group_name;
+    $pcl_group_name_to_index{$pcl_group_name}    = $pcl_group_index;
     return;
   }
 
   # Take care of plots to make.  Include in each plot its index.
   if ($key eq 'plot') {
     $pcl_plot_index =~ s:^-::;
-    $config_plots[$pcl_plot_index]{_index} = $pcl_plot_index;
+    $config_plots[$pcl_plot_index]{index} = $pcl_plot_index;
     unless (@line == 1 and $line[0] eq '{') {
-      warn "$0: warning: '{' required after `plot' at line $line_number in `$config_filename'.\n";
+      ++$number_errors;
+      $label = "@line";
+      $label = " $label" if $label;
+      warn "$0: warning: '{' required immediately after plot in `plot$label' ",
+           "at line $line_number in `$config_filename'.\n";
     }
     return;
   }
 
-  warn "$0: warning: unknown directive `$key' at line $line_number in `$config_filename'.\n";
+  ++$number_errors;
+  warn "$0: warning: unknown directive `$key' at line $line_number in ",
+       "`$config_filename'.\n";
 }
 
 sub load_config {
@@ -683,7 +1069,8 @@
     $line_number = $.;
   }
 
-  # Process any remaining line.
+  # If there is any remaining text, then process it as a complete
+  # line.
   if ($complete_line) {
     process_config_line($config_filename, $line_number, $complete_line);
   }

Modified: trunk/orca/lib/Orca/RRDFile.pm
==============================================================================
--- trunk/orca/lib/Orca/RRDFile.pm	(original)
+++ trunk/orca/lib/Orca/RRDFile.pm	Sat Jul 13 21:25:46 2002
@@ -1,6 +1,6 @@
 # Orca::RRDFile: Manage RRD file creation and updating.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::RRDFile;
 
@@ -9,13 +9,14 @@
 use RRDs;
 use Orca::Constants qw($opt_verbose
           	       $ORCA_RRD_VERSION
-                       $incorrect_number_of_args
                        @RRA_PDP_COUNTS
-                       @RRA_ROW_COUNTS);
-use Orca::Config    qw(%config_options
-                       %config_groups
+                       @RRA_ROW_COUNTS
+                       $INCORRECT_NUMBER_OF_ARGS);
+use Orca::Config    qw(%config_global
+                       @config_groups
+                       @config_groups_names
                        @config_plots);
-use Orca::Utils     qw(recursive_mkdir);
+use Orca::Utils     qw(name_to_fsname recursive_mkdir);
 use vars            qw($VERSION);
 
 $VERSION = substr q$Revision: 0.01 $, 10;
@@ -25,49 +26,52 @@
 # order of these indexes change, make sure to rearrange the
 # constructor in new.
 sub I_RRD_FILENAME     () { 0 }
-sub I_NAME             () { 1 }
+sub I_DATA_EXPRESSION  () { 1 }
 sub I_NEW_DATA         () { 2 }
 sub I_CREATED_IMAGES   () { 3 }
 sub I_PLOT_REF         () { 4 }
-sub I_INTERVAL         () { 5 }
-sub I_RRD_VERSION      () { 6 }
-sub I_CHOOSE_DATA_SUBS () { 7 }
-sub I_RRD_UPDATE_TIME  () { 8 }
+sub I_DATA_NUMBER      () { 5 }
+sub I_INTERVAL         () { 6 }
+sub I_RRD_VERSION      () { 7 }
+sub I_CHOOSE_DATA_SUBS () { 8 }
+sub I_RRD_UPDATE_TIME  () { 9 }
 
 sub new {
-  unless (@_ == 5) {
-    confess "$0: Orca::RRDFile::new $incorrect_number_of_args";
+  unless (@_ == 6) {
+    confess "$0: Orca::RRDFile::new $INCORRECT_NUMBER_OF_ARGS";
   }
 
   my ($class,
-      $group_name,
+      $group_index,
       $subgroup_name,
-      $name,
-      $plot_ref) = @_;
-
-  # Remove any special characters from the unique name and do some
-  # replacements.
-  $name = &::escape_name($name);
-
-  # Create the paths to the data directory.
-  my $rrd_dir = $config_options{rrd_dir};
-  if ($config_groups{$group_name}{sub_dir}) {
-    $rrd_dir .= "/$subgroup_name";
-    unless (-d $rrd_dir) {
-      warn "$0: making directory `$rrd_dir'.\n";
-      recursive_mkdir($rrd_dir);
-    }
+      $data_expression,
+      $plot_ref,
+      $data_number) = @_;
+
+  # Escape any special characters from the data expression and do some
+  # replacements to make the name shorter.  Leave space at the end of
+  # the name to append '.rrd'.
+  $data_expression = name_to_fsname($data_expression, 4);
+
+  # Create the path to the RRD directory and filename.
+  my $group_name = $config_groups_names[$group_index];
+  my $dir = "$config_global{rrd_dir}/" .
+            name_to_fsname("${group_name}_${subgroup_name}", 0);
+  unless (-d $dir) {
+    warn "$0: making directory `$dir'.\n";
+    recursive_mkdir($dir);
   }
-  my $rrd_filename = "$rrd_dir/$name.rrd";
+  my $rrd_filename = "$dir/$data_expression.rrd";
 
   # Create the new object.
   my $self = bless [
     $rrd_filename,
-    $name,
+    $data_expression,
     {},
     {},
     $plot_ref,
-    int($config_groups{$group_name}{interval}+0.5),
+    $data_number,
+    int($config_groups[$group_index]{interval}+0.5),
     $ORCA_RRD_VERSION,
     {},
     -2
@@ -120,8 +124,8 @@
   $_[0]->[I_RRD_FILENAME];
 }
 
-sub name {
-  $_[0]->[I_NAME];
+sub data_expression {
+  $_[0]->[I_DATA_EXPRESSION];
 }
 
 sub rrd_update_time {
@@ -171,13 +175,14 @@
 
     # Assume that a maximum of two time intervals are needed before a
     # data source value is set to unknown.
-    my $interval = $self->[I_INTERVAL];
-   
-    my $data_source = "DS:Orca$ORCA_RRD_VERSION:" .
-                      $self->[I_PLOT_REF]{data_type};
-    $data_source   .= sprintf ":%d:", 2*$interval;
-    $data_source   .= $self->[I_PLOT_REF]{data_min} . ':';
-    $data_source   .= $self->[I_PLOT_REF]{data_max};
+    my $interval    = $self->[I_INTERVAL];
+    my $data_number = $self->[I_DATA_NUMBER];
+    my $data_source = "DS:Orca$ORCA_RRD_VERSION:"                  .
+                      $self->[I_PLOT_REF]{data_type}[$data_number] .
+                      sprintf(":%d:", 2*$interval)                 .
+                      $self->[I_PLOT_REF]{data_min}[$data_number]  .
+                      ':'                                          .
+                      $self->[I_PLOT_REF]{data_max}[$data_number];
     my @options = ($rrd_filename,
                    '-b', $times[0]-1,
                    '-s', $interval,
@@ -186,7 +191,7 @@
     # Create the round robin archives.  Take special care to not
     # create two RRA's with the same number of primary data points.
     # This can happen if the interval is equal to one of the
-    # consoldated intervals.
+    # consolidated intervals.
     my $count          = int($RRA_ROW_COUNTS[0]*300.0/$interval + 0.5);
     my @one_pdp_option = ("RRA:AVERAGE:0.5:1:$count");
 

Modified: trunk/orca/lib/Orca/DataFile.pm
==============================================================================
--- trunk/orca/lib/Orca/DataFile.pm	(original)
+++ trunk/orca/lib/Orca/DataFile.pm	Sat Jul 13 21:25:46 2002
@@ -1,6 +1,6 @@
 # Orca::DataFile: Base class for managing source data, RRD and image files.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::DataFile;
 

Modified: trunk/orca/lib/Orca/NewState.pm
==============================================================================
--- trunk/orca/lib/Orca/NewState.pm	(original)
+++ trunk/orca/lib/Orca/NewState.pm	Sat Jul 13 21:25:46 2002
@@ -1,6 +1,6 @@
 # Orca::NewState: Keep state information between invocations of Orca.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::NewState;
 

Modified: trunk/orca/lib/Orca/Constants.pm
==============================================================================
--- trunk/orca/lib/Orca/Constants.pm	(original)
+++ trunk/orca/lib/Orca/Constants.pm	Sat Jul 13 21:25:46 2002
@@ -1,18 +1,15 @@
 # Orca::Constants.pm: Global constants for Orca.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::Constants;
 
 use strict;
 use Exporter;
-use vars qw(@EXPORT_OK @ISA $VERSION $ORCA_VERSION $ORCA_RRD_VERSION);
-
+use vars qw(@EXPORT_OK @ISA $VERSION);
 @ISA     = qw(Exporter);
 $VERSION = substr q$Revision: 0.01 $, 10;
 
-# Define the constants.
-
 # ORCA_VERSION		This version of Orca.
 # ORCA_RRD_VERSION	This is the version number used in creating the DS
 #			names in RRDs.  This should be updated any time a
@@ -20,89 +17,149 @@
 #			RRD files.  The DS name is a concatentation of the
 #			string Orca with this string of digits.
 # DAY_SECONDS		The number of seconds in one day.
-$ORCA_VERSION        =    '0.26beta1';
-$ORCA_RRD_VERSION    =    19990222;
+# IS_WIN32		If Orca is running on a Windows platform.
+use vars         qw($ORCA_VERSION $ORCA_RRD_VERSION);
+push(@EXPORT_OK, qw($ORCA_VERSION $ORCA_RRD_VERSION DAY_SECONDS IS_WIN32));
+$ORCA_VERSION        =  '0.263';
+$ORCA_RRD_VERSION    =  19990222;
 sub DAY_SECONDS      () { 24*60*60 };
-push(@EXPORT_OK, qw($ORCA_VERSION $ORCA_RRD_VERSION DAY_SECONDS));
+sub IS_WIN32         () { $^O eq 'MSWin32' };
 
-# These define the name of the different RRAs create in each RRD file,
-# how many primary data points go into a consolidated data point, and
-# how far back in time they go.
+# These define the name of the different round robin archives (RRAs)
+# to create in each RRD file, how many primary data points go into a
+# consolidated data point, and how far back in time they go.
 #
-# The first RRA one is every 5 minutes for 200 hours, the second is
-# every 30 minutes for 31 days, the third is every 2 hours for 100
-# days, and the last is every day for 3 years.
+# The first RRA is every 5 minutes for 200 hours, the second is every
+# 30 minutes for 31 days, the third is every 2 hours for 100 days, and
+# the last is every day for 3 years.
 #
-# The first array holds the names of the different plot types to
-# create.  The second array holds the number of 300 second intervals
-# are used to create a consolidated data point.  The third array is
-# the number of consolidated data points held in the RRA.
+# The first array holds the names of the different RRAs and is also
+# used in the list of plots to create.  The second array holds the
+# number of 300 second intervals are used to create a consolidated
+# data point.  The third array is the number of consolidated data
+# points held in the RRA.
 use vars         qw(@RRA_PLOT_TYPES @RRA_PDP_COUNTS @RRA_ROW_COUNTS);
 push(@EXPORT_OK, qw(@RRA_PLOT_TYPES @RRA_PDP_COUNTS @RRA_ROW_COUNTS));
- at RRA_PLOT_TYPES = qw(daily weekly monthly yearly);
- at RRA_PDP_COUNTS =   (    1,     6,     24,   288);
- at RRA_ROW_COUNTS =   ( 2400,  1488,   1200,  1098);
-
-# Define the different plots to create.  These settings do not need to
-# be exactly the same as the RRA definitions, but they can be.  Here
-# create a quarterly plot (100 days) between the monthly and yearly
-# plots.  The quarterly plot is updated daily.  The last array here
-# holds the number of days back in time to place data in the plot.  Be
-# careful to not increase this so much that the number of data points
-# to plot are greater than the number of pixels available for the
-# image, otherwise there will be a 30% slowdown due to a reduction
+BEGIN {
+  @RRA_PLOT_TYPES = qw(daily weekly monthly yearly);
+  @RRA_PDP_COUNTS =   (    1,     6,     24,   288);
+  @RRA_ROW_COUNTS =   ( 2400,  1488,   1200,  1098);
+}
+
+# Define all of the the different possible plots to create.  This
+# structure allows allows the user via the configuration file to turn
+# off particular plots to create, such the monthly one.  In addition
+# to the plot types that are structured in the RRD via its RRA's,
+# there is an additional hourly plot that is listed before the daily
+# plot and an additional quarterly plot (100 days) created between the
+# monthly and yearly plots.  The quarterly plot is updated daily.
+#
+# For each plot type, the first value in the array reference is the
+# number of 300 second intervals are used in a plot.  The second value
+# is the number of seconds graphed in the plots.  Be careful to not
+# increase the time interval so much that the number of data points to
+# plot are greater than the number of pixels available for the image,
+# otherwise there will be a 30% slowdown due to a reduction
 # calculation to resample the data to the lower resolution for the
 # plot.  For example, with 40 days of 2 hour data, there are 480 data
 # points.  For no slowdown to occur, the image should be at least 481
 # pixels wide.
-use vars         qw(@IMAGE_PLOT_TYPES @IMAGE_PDP_COUNTS @IMAGE_DAYS_BACK);
-push(@EXPORT_OK, qw(@IMAGE_PLOT_TYPES @IMAGE_PDP_COUNTS @IMAGE_DAYS_BACK));
- at IMAGE_PLOT_TYPES = (@RRA_PLOT_TYPES[0..2], 'quarterly', $RRA_PLOT_TYPES[3]);
- at IMAGE_PDP_COUNTS = (@RRA_PDP_COUNTS[0..2], @RRA_PDP_COUNTS[3, 3]);
- at IMAGE_DAYS_BACK  = (  1.5,  10,  40, 100, 428);
-# Data points ->    (432  , 480, 480, 100, 428);
-
-# This subroutine is compiled once to prevent compiling of the
-# subroutine sub { die $_[0] } every time an eval block is entered.
-sub die_when_called {
-  die $_[0];
+#
+# The @CONST_IMAGE_PLOT_TYPES variable contains the order in which
+# plots are created and all of the elements of
+# @CONST_IMAGE_PLOT_TITLES should appear as keys in
+# @CONST_IMAGE_PLOT_INFO.
+use vars         qw(@CONST_IMAGE_PLOT_TYPES %CONST_IMAGE_PLOT_INFO);
+push(@EXPORT_OK, qw(@CONST_IMAGE_PLOT_TYPES %CONST_IMAGE_PLOT_INFO));
+BEGIN {
+  @CONST_IMAGE_PLOT_TYPES = qw(hourly daily weekly monthly quarterly yearly);
+  %CONST_IMAGE_PLOT_INFO   =
+  ('hourly'    => [$RRA_PDP_COUNTS[0],   1.5*60*60],        #  18 data points
+   'daily'     => [$RRA_PDP_COUNTS[0],   1.5*DAY_SECONDS],  # 432 data points
+   'weekly'    => [$RRA_PDP_COUNTS[1],  10  *DAY_SECONDS],  # 480 data points
+   'monthly'   => [$RRA_PDP_COUNTS[2],  40  *DAY_SECONDS],  # 480 data points
+   'quarterly' => [$RRA_PDP_COUNTS[3], 100  *DAY_SECONDS],  # 100 data points
+   'yearly'    => [$RRA_PDP_COUNTS[3], 428  *DAY_SECONDS]); # 428 data points
+
+  # Ensure that the number of elements of @CONST_IMAGE_PLOT_TYPES
+  # exactly matches the keys of %CONST_IMAGE_PLOT_INFO.
+  unless (@CONST_IMAGE_PLOT_TYPES == keys %CONST_IMAGE_PLOT_INFO) {
+      die "$0: internal error: number of elements in ",
+          "\@CONST_IMAGE_PLOT_TYPES does not match number of keys in ",
+          "\%CONST_IMAGE_PLOT_INFO.\n";
+  }
+
+  foreach my $title (@CONST_IMAGE_PLOT_TYPES) {
+    unless (defined $CONST_IMAGE_PLOT_INFO{$title}) {
+      die "$0: internal error: element `$title' in ",
+          "\@CONST_IMAGE_PLOT_TYPES is not a key in ",
+          "\%CONST_IMAGE_PLOT_INFO.\n";
+    }
+  }
 }
-push(@EXPORT_OK, qw(die_when_called));
+
+# These variables hold copies of @CONST_IMAGE_PLOT_TYPES and
+# @CONST_IMAGE_PLOT_INFO with only those plot types that are specified
+# in the configuration file.
+use vars         qw(@IMAGE_PLOT_TYPES @IMAGE_PDP_COUNTS @IMAGE_TIME_SPAN);
+push(@EXPORT_OK, qw(@IMAGE_PLOT_TYPES @IMAGE_PDP_COUNTS @IMAGE_TIME_SPAN));
+
+# This holds the length of the longest plot type string that is
+# specified in the configuration file.
+use vars         qw($MAX_PLOT_TYPE_LENGTH);
+push(@EXPORT_OK, qw($MAX_PLOT_TYPE_LENGTH));
 
 # These variables are set once at program start depending upon the
-# command line arguments.
-#
+# command line arguments:
+# $opt_daemon			Daemonize Orca.
 # $opt_generate_gifs		Generate GIFs instead of PNGs.
+# $opt_log_filename		Output log filename.
 # $opt_once_only		Do only one pass through Orca.
-# $opt_rrd_update_only		Do not generate any images.
+# $opt_no_html			Do not generate any HTML files.
+# $opt_no_images		Do not generate any image files.
 # $opt_verbose			Be verbose about my running.
-#
-use vars         qw($opt_generate_gifs
+use vars         qw($opt_daemon
+                    $opt_generate_gifs
+                    $opt_log_filename
+                    $opt_no_html
+                    $opt_no_images
                     $opt_once_only
-                    $opt_rrd_update_only
                     $opt_verbose
                     $IMAGE_SUFFIX);
-push(@EXPORT_OK, qw($opt_generate_gifs
+push(@EXPORT_OK, qw($opt_daemon
+                    $opt_generate_gifs
+                    $opt_log_filename
+                    $opt_no_html
+                    $opt_no_images
                     $opt_once_only
-                    $opt_rrd_update_only
                     $opt_verbose
                     $IMAGE_SUFFIX));
+$opt_daemon          = 0;
 $opt_generate_gifs   = 0;
+$opt_log_filename    = '';
+$opt_no_html         = 0;
+$opt_no_images       = 0;
 $opt_once_only       = 0;
-$opt_rrd_update_only = 0;
 $opt_verbose         = 0;
 $IMAGE_SUFFIX        = 'png';
 
+# This constant stores the commonly used string to indicate that a
+# subroutine has been passed an incorrect number of arguments.
+use vars qw($INCORRECT_NUMBER_OF_ARGS);
+push(@EXPORT_OK, qw($INCORRECT_NUMBER_OF_ARGS));
+$INCORRECT_NUMBER_OF_ARGS = "passed incorrect number of arguments.\n";
+
+# This subroutine is compiled once to prevent compiling of the
+# subroutine sub { die $_[0] } every time an eval block is entered.
+sub die_when_called {
+  die $_[0];
+}
+push(@EXPORT_OK, qw(die_when_called));
+
 # This contains the regular expression string to check if a string
 # contains the "sub {" and "}" portions or this should be added.
 use vars         qw($is_sub_re);
 push(@EXPORT_OK, qw($is_sub_re));
 $is_sub_re = '^\s*sub\s*{.*}\s*$';
 
-# This constant stores the commonly used string to indicate that a
-# subroutine has been passed an incorrect number of arguments.
-use vars qw($incorrect_number_of_args);
-push(@EXPORT_OK, qw($incorrect_number_of_args));
-$incorrect_number_of_args = "passed incorrect number of arguments.\n";
-
 1;

Modified: trunk/orca/lib/Orca/OldState.pm
==============================================================================
--- trunk/orca/lib/Orca/OldState.pm	(original)
+++ trunk/orca/lib/Orca/OldState.pm	Sat Jul 13 21:25:46 2002
@@ -1,13 +1,13 @@
 # Orca::OldState: Keep state information between invocations of Orca.
 #
-# Copyright (C) 1998-2000 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::OldState;
 
 use strict;
 use Carp;
 use Orca::Constants     qw($opt_verbose
-                           $incorrect_number_of_args);
+                           $INCORRECT_NUMBER_OF_ARGS);
 use Orca::SourceFileIDs qw(@sfile_fids);
 use vars                qw(@EXPORT_OK @ISA $VERSION);
 
@@ -28,7 +28,7 @@
 # This loads the old source file state information.
 sub load_old_state {
   unless (@_ == 1) {
-    confess "$0: Orca::OldState::load_old_state $incorrect_number_of_args";
+    confess "$0: Orca::OldState::load_old_state $INCORRECT_NUMBER_OF_ARGS";
   }
 
   my $state_file = shift;
@@ -85,7 +85,7 @@
 # Write the state information for the source data files.
 sub save_old_state {
   unless (@_ == 2) {
-    confess "$0: Orca::OldState::save_old_state $incorrect_number_of_args";
+    confess "$0: Orca::OldState::save_old_state $INCORRECT_NUMBER_OF_ARGS";
   }
 
   my ($state_file, $state_ref) = @_;

Modified: trunk/orca/lib/Orca/SourceFile.pm
==============================================================================
--- trunk/orca/lib/Orca/SourceFile.pm	(original)
+++ trunk/orca/lib/Orca/SourceFile.pm	Sat Jul 13 21:25:46 2002
@@ -1,6 +1,6 @@
 # Orca::SourceFile: Manage the watching and loading of source data files.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::SourceFile;
 
@@ -9,10 +9,11 @@
 use Digest::MD5         qw(md5);
 use Storable            qw(dclone);
 use Orca::Constants     qw($opt_verbose
-                           $incorrect_number_of_args
-                           die_when_called);
-use Orca::Config        qw(%config_options
-                           %config_groups
+                           die_when_called
+                           $INCORRECT_NUMBER_OF_ARGS);
+use Orca::Config        qw(%config_global
+                           @config_groups
+                           @config_groups_names
                            @config_plots
                            get_color);
 use Orca::OldState      qw($orca_old_state);
@@ -21,6 +22,7 @@
 use Orca::SourceFileIDs qw(@sfile_fids);
 use Orca::ImageFile;
 use Orca::RRDFile;
+use Orca::Utils         qw(email_message);
 use vars                qw(@ISA $VERSION);
 
 @ISA     = qw(Orca::DataFile);
@@ -28,7 +30,7 @@
 
 # This is a static variable that lists all of the column names for a
 # particular group.
-my %group_column_names;
+my @group_column_names;
 
 # This caches the reference to the array holding the column
 # descriptions for files that have their column descriptions in the
@@ -47,13 +49,13 @@
 # using the ORCA_DATAFILE_LAST_INDEX index.  Define these constant
 # subroutines as indexes into the array.  If the order of these
 # indexes change, make sure to rearrange the constructor in new.
-sub I_INTERVAL           () { ORCA_DATAFILE_LAST_INDEX +  1 }
-sub I_LATE_INTERVAL      () { ORCA_DATAFILE_LAST_INDEX +  2 }
-sub I_READ_INTERVAL      () { ORCA_DATAFILE_LAST_INDEX +  3 }
-sub I_REOPEN             () { ORCA_DATAFILE_LAST_INDEX +  4 }
-sub I_DATE_SOURCE        () { ORCA_DATAFILE_LAST_INDEX +  5 }
-sub I_DATE_FORMAT        () { ORCA_DATAFILE_LAST_INDEX +  6 }
-sub I_WARN_EMAIL         () { ORCA_DATAFILE_LAST_INDEX +  7 }
+sub I_GROUP_INDEX        () { ORCA_DATAFILE_LAST_INDEX +  1 }
+sub I_INTERVAL           () { ORCA_DATAFILE_LAST_INDEX +  2 }
+sub I_LATE_INTERVAL      () { ORCA_DATAFILE_LAST_INDEX +  3 }
+sub I_READ_INTERVAL      () { ORCA_DATAFILE_LAST_INDEX +  4 }
+sub I_REOPEN             () { ORCA_DATAFILE_LAST_INDEX +  5 }
+sub I_DATE_SOURCE        () { ORCA_DATAFILE_LAST_INDEX +  6 }
+sub I_DATE_PARSE         () { ORCA_DATAFILE_LAST_INDEX +  7 }
 sub I_MY_RRD_LIST        () { ORCA_DATAFILE_LAST_INDEX +  8 }
 sub I_ALL_RRD_REF        () { ORCA_DATAFILE_LAST_INDEX +  9 }
 sub I_GROUP_KEYS         () { ORCA_DATAFILE_LAST_INDEX + 10 }
@@ -67,60 +69,36 @@
 sub I_IS_CURRENT_DAY     () { ORCA_DATAFILE_LAST_INDEX + 18 }
 
 sub new {
-  unless (@_ == 9) {
-    confess "$0: Orca::SourceFile::new passed $incorrect_number_of_args";
+  unless (@_ == 3) {
+    confess "$0: Orca::SourceFile::new passed $INCORRECT_NUMBER_OF_ARGS";
   }
 
-  my ($class,
-      $fid,
-      $interval,
-      $late_interval,
-      $reopen,
-      $column_description,
-      $date_source,
-      $date_format,
-      $warn_email) = @_;
+  my ($class, $group_index, $fid) = @_;
 
   my $self = $class->SUPER::new($fid);
 
+  my $config_group = $config_groups[$group_index];
+
   # Set the last value to preexpand the array.
   $self->[I_IS_CURRENT_DAY]     = undef;
-  $self->[I_INTERVAL]           = $interval;
-  $self->[I_LATE_INTERVAL]      = int(&$late_interval($interval) + 0.5);
-  $self->[I_REOPEN]             = $reopen;
-  $self->[I_DATE_SOURCE]        = $date_source;
-  $self->[I_DATE_FORMAT]        = $date_format;
-  $self->[I_WARN_EMAIL]         = $warn_email;
+  $self->[I_GROUP_INDEX]        = $group_index;
+  $self->[I_INTERVAL]           = $config_group->{interval};
+  $self->[I_LATE_INTERVAL]      = $config_group->{late_interval};
+  $self->[I_READ_INTERVAL]      = $config_group->{read_interval};
+  $self->[I_REOPEN]             = $config_group->{reopen};
+  $self->[I_DATE_SOURCE]        = $config_group->{date_source};
+  $self->[I_DATE_PARSE]         = $config_group->{date_parse};
   $self->[I_MY_RRD_LIST]        = [];
   $self->[I_ALL_RRD_REF]        = undef;
   $self->[I_GROUP_KEYS]         = {};
   $self->[I_CHOOSE_DATA_SUB]    = undef;
 
-  $self->[I_COLUMN_DESCRIPTION] = $column_description;
+  $self->[I_COLUMN_DESCRIPTION] = $config_group->{column_description};
   $self->[I_LAST_DATA_TIME]     = -1;
   $self->[I_LAST_READ_TIME]     = -1;
   $self->[I_FIRST_LINE]         =  0;
   $self->[I_DATE_COLUMN_INDEX]  = undef;
 
-  # There are three intervals associated with each file.  The first is
-  # the data update interval.  This is the same interval used to
-  # generate the RRDs.  The second interval is the interval before the
-  # file is considered late and is larger than the data update
-  # interval.  This interval is calculated by using the mathematical
-  # expression given in the `late_interval' configuration option.  If
-  # `late_interval' is not defined, then it gets defaulted to the data
-  # update interval.  The last interval is the interval to use to tell
-  # the program when to attempt to read the file next.  Because it can
-  # take some time for the source files to be updated, we don't want
-  # to read the file immediately after the data update interval is
-  # done.  For this reason, choose a read interval that is somewhere
-  # in between the data source interval and the late interval.  Use
-  # the multiplicative average of the data update interval and the
-  # late interval since the resulting value is closer to the data
-  # update interval.  Ie: (20 + 5)/2 = 12.5.  Sqrt(20*5) = 10.
-  my $read_interval = sqrt($self->[I_INTERVAL]*$self->[I_LATE_INTERVAL]);
-  $self->[I_READ_INTERVAL] = int($read_interval + 0.5);
-
   # Load in any state information for this file.
   my $filename = $sfile_fids[$fid];
   my @column_description;
@@ -147,7 +125,7 @@
 #  } else {
 #  }
 #  # If the source data file does not exist in the state database, then
-#  # create a new default entry.  If the file does not exist, then reset to 
+#  # create a new default entry.  If the file does not exist, then reset to
 #  # If the source file's mtime is the same as stored in the saved
 #  # state file, then load all the information from it, otherwise do
 #  # not keep any of it and load the file freshly.
@@ -200,10 +178,10 @@
 sub add_groups {
   my $self = shift;
 
-  foreach my $group_name (@_) {
-    $self->[I_GROUP_KEYS]{$group_name} = 1;
+  foreach my $group_index (@_) {
+    $self->[I_GROUP_KEYS]{$group_index} = 1;
     foreach my $description (@{$self->[I_COLUMN_DESCRIPTION]}) {
-      $group_column_names{$group_name}{$description} = 1;
+      $group_column_names[$group_index]{$description} = 1;
     }
   }
 }
@@ -273,20 +251,23 @@
 sub add_plots {
   # Make sure that the user has called the add_groups method and
   # inserted at least one key.
-  unless (keys %group_column_names) {
-    confess "$0: Orca::SourceFile::add_groups must be called before add_plots.\n";
+  unless (@group_column_names) {
+    confess "$0: Orca::SourceFile::add_groups must be called before ",
+            "add_plots.\n";
   }
 
   unless (@_ == 5) {
-    confess "$0: Orca::SourceFile::add_plots passed wrong number of arguments.\n";
+    confess "$0: Orca::SourceFile::add_plots $INCORRECT_NUMBER_OF_ARGS";
   }
 
   my ($self,
-      $group_name,
+      $group_index,
       $subgroup_name,
       $rrd_data_files_ref,
       $image_files_ref) = @_;
 
+  my $group_name = $config_groups_names[$group_index];
+
   # See if we have already done all the work for a plot with this group_name,
   # subgroup_name, and column description.  Use an MD5 hash instead of a very
   # long key.  Store into a hash the column names found in this file for this
@@ -335,9 +316,9 @@
 
     my $plot = $config_plots[$i];
 
-    # Skip this plot if the group_name do not match.  Increment the
-    # index of the next plot to handle.
-    if ($plot->{source} ne $group_name) {
+    # Skip this plot if the source group indexes does not match.
+    # Increment the index of the next plot to handle.
+    if ($plot->{source_index} != $group_index) {
       if ($oldest_regexp_index == $i) {
         $handle_regexps = 0;
         ++$oldest_regexp_index;
@@ -411,7 +392,22 @@
 
         # Copy any items over that haven't been created for this new
         # data source.  Make sure that any new elements added to
-        # pcl_plot_append_elements show up here.
+        # pcl_plot_append_elements show up here.  The first data_min,
+        # data_max, data_type, and summary_format are always set and
+        # if any later ones are not set, then use the previously set
+        # one.
+        unless (defined $plot->{data_min}[$new_data_index]) {
+          $plot->{data_min}[$new_data_index] =
+            $plot->{data_min}[$new_data_index-1];
+        }
+        unless (defined $plot->{data_max}[$new_data_index]) {
+          $plot->{data_max}[$new_data_index] =
+            $plot->{data_max}[$new_data_index-1];
+        }
+        unless (defined $plot->{data_type}[$new_data_index]) {
+          $plot->{data_type}[$new_data_index] =
+            $plot->{data_type}[$new_data_index-1];
+        }
         unless (defined $plot->{color}[$new_data_index]) {
           $plot->{color}[$new_data_index] = get_color($new_data_index);
         }
@@ -421,6 +417,10 @@
         unless (defined $plot->{line_type}[$new_data_index]) {
           $plot->{line_type}[$new_data_index] = $plot->{line_type}[0];
         }
+        unless (defined $plot->{summary_format}[$new_data_index]) {
+          $plot->{summary_format}[$new_data_index] =
+            $plot->{summary_format}[$new_data_index-1];
+        }
 
         # Replace the regular expression in any legend elements.
         my $legend = $plot->{legend}[$new_data_index];
@@ -542,7 +542,7 @@
         if (defined ($pos = $column_description{$element})) {
           $datas[$j][$k]  = "\$_[$pos]";
           $match_one_data = 1;
-        } elsif (defined $group_column_names{$group_name}{$element}) {
+        } elsif (defined $group_column_names[$group_index]{$element}) {
           my $m = $old_i + 1;
           if ($required) {
             warn "$0: $element in `data @{$plot->{data}[$j]}' in plot #$m ",
@@ -637,43 +637,55 @@
     my @my_short_rrds;
     my @name_with_subgroup;
     my @name_without_subgroup;
-    my $previous_group    = '';
-    my $previous_subgroup = '';
+    my $previous_data_type     = '';
+    my $previous_group_index   = -1;
+    my $previous_subgroup_name = '';
     for (my $j=0; $j<@substituted_data_expressions; ++$j) {
 
+      # Include in the original data expression the data_type that RRD
+      # will apply to the input data.
+      my $data_type                   = lc($plot->{data_type}[$j]);
       my $original_data_expression    = join('_', @{$plot->{data}[$j]});
       my $substituted_data_expression = $substituted_data_expressions[$j];
 
-      my $name_with_subgroup = "${group_name}_${subgroup_name}_${original_data_expression}";
-      push(@name_with_subgroup, $name_with_subgroup);
-      push(@name_without_subgroup, "${group_name}_${original_data_expression}");
+      my $name_with_subgroup = "${group_name}_${subgroup_name}_${data_type}_${original_data_expression}";
+      push(@name_with_subgroup,    $name_with_subgroup);
+      push(@name_without_subgroup, "${group_name}_${data_type}_${original_data_expression}");
 
-      # Create a short name that may exclude the group and subgroup if the
-      # previous data had the same group and subgroup.
+      # If the current data expression is very similar to the previous
+      # one, then do not include the group, subgroup and data_type.
       my $short_name_with_subgroup;
-      if ($group_name eq $previous_group) {
-        if ($subgroup_name eq $previous_subgroup) {
-          $short_name_with_subgroup = "__$original_data_expression";
-        } else {
-          $short_name_with_subgroup = "_${subgroup_name}_${original_data_expression}";
-          $previous_subgroup        = $subgroup_name;
-        }
+      if ($group_index == $previous_group_index) {
+        $short_name_with_subgroup  = '_';
+      } else {
+        $short_name_with_subgroup  = "${group_name}_";
+        $previous_group_index      = $group_index;
+      }
+      if ($subgroup_name eq $previous_subgroup_name) {
+        $short_name_with_subgroup .= '_';
       } else {
-        $previous_group           = $group_name;
-        $previous_subgroup        = $subgroup_name;
-        $short_name_with_subgroup = $name_with_subgroup;
+        $short_name_with_subgroup .= "${subgroup_name}_";
+        $previous_subgroup_name    = $subgroup_name;
       }
+      if ($data_type eq $previous_data_type) {
+        $short_name_with_subgroup .= '_';
+      } else {
+        $short_name_with_subgroup .= "${data_type}_";
+        $previous_data_type        = $data_type;
+      }
+      $short_name_with_subgroup   .= $original_data_expression;
 
-      # Create a new RRD only if it doesn't already exist and if a valid
-      # get data subroutine is created.  Keep the choose_data_sub for this
-      # file.
+      # Create a new RRD only if it doesn't already exist and if a
+      # valid get data subroutine is created.  Keep the
+      # choose_data_sub for this file.
       if (defined $substituted_data_expression) {
         $choose_data_expr .= "    '$name_with_subgroup', $substituted_data_expression,\n";
         unless (defined $rrd_data_files_ref->{$name_with_subgroup}) {
-          my $rrd_file = Orca::RRDFile->new($group_name,
+          my $rrd_file = Orca::RRDFile->new($group_index,
                                             $subgroup_name,
-                                            $name_with_subgroup,
-                                            $plot);
+                                            "${data_type}_${original_data_expression}",
+                                            $plot,
+                                            $j);
           $rrd_data_files_ref->{$name_with_subgroup} = $rrd_file;
         }
         $self->[I_ALL_RRD_REF]            = $rrd_data_files_ref;
@@ -686,10 +698,10 @@
     # Generate a new plot for these data.
     my $image;
     my $all_names_with_subgroup = join(',', @name_with_subgroup);
-    if (defined ($image = $image_files_ref->{hash}{$all_names_with_subgroup})) {
+    if (defined ($image = $image_files_ref->{hash}{$all_names_with_subgroup})){
       $image->add_rrds(@my_rrds);
     } else {
-      $image = Orca::ImageFile->new($group_name,
+      $image = Orca::ImageFile->new($group_index,
                                     $subgroup_name,
                                     join(',', @my_short_rrds),
                                     join(',', @name_without_subgroup),
@@ -741,7 +753,7 @@
   my $load_data   = $file_status != 0;
   if ($file_status == -1) {
     my $message = "file `$sfile_fids[$fid]' did exist and is now gone.";
-    ::email_message($self->[I_WARN_EMAIL], $message);
+    email_message($config_global{warn_email}, $message);
     warn "$0: warning: $message\n";
     unless ($fd) {
       $self->[I_LAST_READ_TIME] = -1;
@@ -761,7 +773,7 @@
       ($old_is_current_day == $current_day)) {
     my $message = "file `$sfile_fids[$fid]' was current and now is not.";
     warn "$0: warning: $message\n";
-    ::email_message($self->[I_WARN_EMAIL], $message);
+    email_message($config_global{warn_email}, $message);
   }
 
   # If we don't have to load the data from this file yet, then test to
@@ -799,12 +811,22 @@
     <$fd> if $self->[I_FIRST_LINE];
   }
 
-  # Load in all of the data possible and send it to each plot.
   my $date_column_index = $self->[I_DATE_COLUMN_INDEX];
   my $use_file_mtime    = $self->[I_DATE_SOURCE][0] eq 'file_mtime';
   my $number_added      = 0;
   my $close_once_done   = 0;
   my $number_columns    = @{$self->[I_COLUMN_DESCRIPTION]};
+
+  # Get the filename if the measurement time is loaded from the file
+  # instead of from the last modified time and the time should be
+  # parsed using the date_parse subroutine.
+  my $date_parse = $self->[I_DATE_PARSE];
+  my $filename;
+  if (!$use_file_mtime and $date_parse) {
+    $filename = $sfile_fids[$self->fid];
+  }
+
+  # Load in all of the data possible and send it to each plot.
   while (defined(my $line = <$fd>)) {
     # Skip the line if the word timestamp appears in it.  This is a
     # temporary fix for orcallator.se to place a new information line
@@ -817,11 +839,19 @@
     # define the column names, 2) the number of columns loaded is not
     # equal to the number of columns in the column description.
     if ($self->[I_FIRST_LINE] and @line != $number_columns) {
-      warn "$0: number of columns in line $. of `$sfile_fids[$fid]' does not match column description.\n";
+      warn "$0: number of columns in line $. of `$sfile_fids[$fid]' does not ",
+           "match column description.\n";
       next;
     }
 
-    my $time = $use_file_mtime ? $self->file_mtime : $line[$date_column_index];
+    my $time;
+    if ($use_file_mtime) {
+      $time = $self->file_mtime;
+    } elsif ($filename) {
+      $time = &$date_parse($filename, $line[$date_column_index]);
+    } else {
+      $time = $line[$date_column_index];
+    }
     $last_data_time = $time if $time > $last_data_time;
 
     # If the file status from the source data file is greater than
@@ -842,7 +872,9 @@
         }
       } else {
         $close_once_done = 1;
-        warn "$0: internal error: expecting RRD name `$rrd_key' but no data loaded from `" . $self->filename . "' at time ", scalar localtime($time), " ($time).\n";
+        warn "$0: internal error: expecting RRD name `$rrd_key' but no data ",
+             "loaded from `", $self->filename, "' at time ",
+             scalar localtime($time), " ($time).\n";
       }
     }
     ++$number_added if $add;

Modified: trunk/orca/lib/Orca/Utils.pm
==============================================================================
--- trunk/orca/lib/Orca/Utils.pm	(original)
+++ trunk/orca/lib/Orca/Utils.pm	Sat Jul 13 21:25:46 2002
@@ -1,24 +1,50 @@
 # Orca::Utils: Small utility subroutines.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::Utils;
 
 use strict;
 use Carp;
 use Exporter;
-use Orca::Constants     qw($incorrect_number_of_args);
+use Digest::MD5         qw(md5_base64);
+use Orca::Constants     qw($INCORRECT_NUMBER_OF_ARGS);
+use Orca::Config        qw(%config_global);
 use Orca::SourceFileIDs qw(new_fids);
 use vars qw(@EXPORT_OK @ISA $VERSION);
 
- at EXPORT_OK = qw(gcd perl_glob recursive_mkdir unique);
+ at EXPORT_OK = qw(email_message
+                gcd name_to_fsname
+                perl_glob
+                recursive_mkdir
+                unique);
 @ISA       = qw(Exporter);
 $VERSION   = substr q$Revision: 0.01 $, 10;
 
+# Email the list of people a message.
+sub email_message {
+  my ($people, $subject) = @_;
+
+  return unless $people;
+
+  if (open(SENDMAIL, "|/usr/lib/sendmail -oi -t")) {
+    print SENDMAIL <<"EOF";
+To: $people
+Subject: Orca: $subject
+
+Orca: $subject
+EOF
+    close(SENDMAIL) or
+      warn "$0: warning: sendmail did not close: $!\n";
+  } else {
+    warn "$0: warning: cannot fork for sendmail: $!\n";
+  }
+}
+
 # Return the greatest common divisor.
 sub gcd {
   unless (@_ == 2) {
-    confess "$0: Orca::Utils::gcd $incorrect_number_of_args";
+    confess "$0: Orca::Utils::gcd $INCORRECT_NUMBER_OF_ARGS";
   }
   my ($m, $n) = @_;
   if ($n > $m) {
@@ -33,6 +59,77 @@
   $n;
 }
 
+# Replace special characters from names, remove redundant characters,
+# and shorten the names so the maximum path name is not exceeded.  If
+# the name is still too long such that the maximum filename path
+# length ($config_global{max_filename_length}) may be exceeded by
+# appending -daily.html or other names to the name, then compute a MD5
+# hash of the name, trim the name the name to max_filename_length
+# minus at least 23 plus the postfix length characters to leave space
+# for a 22 byte base64 MD5 digest, plus a separating '-', and plus the
+# postfix.
+sub name_to_fsname {
+  unless (@_ == 2) {
+    confess "$0: Orca::Utils::name_to_fsname $INCORRECT_NUMBER_OF_ARGS";
+  }
+
+  my ($name, $postfix_length) = @_;
+
+  $name =~ s/:/_/g;
+  $name =~ s:/:_per_:g;
+  $name =~ s:\s+:_:g;
+  $name =~ s:%:_pct_:g;
+  $name =~ s:#:_num_:g;
+  $name =~ s:\*:_X_:g;
+
+  # Trim anything containing orcallator and orca to o.
+  $name =~ s:orcallator:o:g;
+  $name =~ s:orca:o:g;
+
+  # Remove trailing _'s.
+  $name =~ s:_+$::;
+  $name =~ s:_+,:,:g;
+
+  # Replace multiple _'s with one _, except when they follow a , which
+  # happens when the same group and subgroup appear for a new data
+  # source.
+  $name =~ s:,_{2,}:\200:g;
+  $name =~ s:_{2,}:_:g;
+  $name =~ s:\200:,__:g;
+
+  my $max_filename_length = $config_global{max_filename_length};
+  if (length($name)+$postfix_length > $max_filename_length) {
+
+    my $md5         = md5_base64($name);
+    my $trim_length = $max_filename_length - 23 - $postfix_length;
+    $name           = substr($name, 0, $trim_length) . "-$md5";
+
+    # Be careful to convert any /, \ or + characters to _.  The /
+    # character definitely needs to be modified since / is a valid
+    # base64 character and can't be used since we don't want a
+    # directory.
+    $name =~ s:[/\\\+]:_:g;
+  }
+
+  $name;
+}
+
+sub old_name_to_fsname {
+  my $name = shift;
+  $name =~ s/:/_/g;
+  $name =~ s:/:_per_:g;
+  $name =~ s:\s+:_:g;
+  $name =~ s:%:_percent_:g;
+  $name =~ s:#:_number_:g;
+  $name =~ s:\*:_X_:g;
+  $name =~ s:([_,]){2,}:$1:g;
+
+  # Remove trailing _'s.
+  $name =~ s:_+$::;
+  $name =~ s:_+,:,:g;
+  $name;
+}
+
 # Find all files matching a particular Perl regular expression and
 # return file ids.
 sub perl_glob {

Modified: trunk/orca/lib/Orca/SourceFileIDs.pm
==============================================================================
--- trunk/orca/lib/Orca/SourceFileIDs.pm	(original)
+++ trunk/orca/lib/Orca/SourceFileIDs.pm	Sat Jul 13 21:25:46 2002
@@ -2,7 +2,7 @@
 # identifiers.  The primary purpose of this module is to keep only two
 # copies of all the filenames used by Orca.
 #
-# Copyright (C) 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::SourceFileIDs;
 

Modified: trunk/orca/lib/Orca/ImageFile.pm
==============================================================================
--- trunk/orca/lib/Orca/ImageFile.pm	(original)
+++ trunk/orca/lib/Orca/ImageFile.pm	Sat Jul 13 21:25:46 2002
@@ -1,6 +1,6 @@
 # Orca::ImageFile: Manage the creation of PNG or GIF plot files.
 #
-# Copyright (C) 1998, 1999 Blair Zajac and Yahoo!, Inc.
+# Copyright (C) 1998-2001 Blair Zajac and Yahoo!, Inc.
 
 package Orca::ImageFile;
 
@@ -9,15 +9,16 @@
 use RRDs;
 use Orca::Constants qw($opt_generate_gifs
                        $opt_verbose
-                       DAY_SECONDS
                        $IMAGE_SUFFIX
                        @IMAGE_PLOT_TYPES
                        @IMAGE_PDP_COUNTS
-                       @IMAGE_DAYS_BACK);
-use Orca::Config    qw(%config_options
-                       %config_groups
+                       @IMAGE_TIME_SPAN
+                       $MAX_PLOT_TYPE_LENGTH
+                       $INCORRECT_NUMBER_OF_ARGS);
+use Orca::Config    qw(%config_global
+                       @config_groups
                        @config_plots);
-use Orca::Utils     qw(recursive_mkdir);
+use Orca::Utils     qw(name_to_fsname recursive_mkdir);
 
 use vars            qw($VERSION);
 
@@ -27,7 +28,7 @@
 # Define these constant subroutines as indexes into the array.  If
 # the order of these indexes change, make sure to rearrange the
 # constructor in new.
-sub I_GROUP_NAME       () {  0 }
+sub I_GROUP_INDEX      () {  0 }
 sub I_SUBGROUP_NAME    () {  1 }
 sub I_NO_SUBGROUP_NAME () {  2 }
 sub I_NAME             () {  3 }
@@ -44,11 +45,11 @@
 
 sub new {
   unless (@_ == 8) {
-    confess "$0: Orca::ImageFile::new passed incorrect number of arguments.\n";
+    confess "$0: Orca::ImageFile::new $INCORRECT_NUMBER_OF_ARGS";
   }
 
   my ($class,
-      $group_name,
+      $group_index,
       $subgroup_name,
       $name,
       $no_subgroup_name,
@@ -64,24 +65,27 @@
   }
 
   # Remove any special characters from the unique name and do some
-  # replacements.
-  $name = &::escape_name($name);
+  # replacements.  Leave space at the end of the name to append a
+  # string of the form '-daily.png' and optionally '.meta' if the
+  # configuration file specifies that images should be expired.
+  my $max_length = $MAX_PLOT_TYPE_LENGTH + 2 + length($IMAGE_SUFFIX);
+  if ($config_global{expire_images}) {
+  $max_length += 5;
+  }
+  $name = name_to_fsname($name, $max_length);
 
   # Create the paths to the html directory and subdirectories.
-  my $html_dir     = $config_options{html_dir};
-  if ($config_groups{$group_name}{sub_dir}) {
-    $html_dir .= "/$subgroup_name";
-    # Create the html_dir directories if necessary.
-    unless (-d $html_dir) {
-      warn "$0: making directory `$html_dir'.\n";
-      recursive_mkdir($html_dir);
-    }
+  my $html_dir     = "$config_global{html_dir}/$subgroup_name";
+  # Create the html_dir directories if necessary.
+  unless (-d $html_dir) {
+    warn "$0: making directory `$html_dir'.\n";
+    recursive_mkdir($html_dir);
   }
   my $image_basename = "$html_dir/$name";
 
   # Create the new object.
   my $self = bless [
-    $group_name,
+    $group_index,
     $subgroup_name,
     $no_subgroup_name,
     $name,
@@ -95,7 +99,7 @@
   ], $class;
 
   my $plot_end_time = $self->plot_end_time;
-  my $interval      = int($config_groups{$group_name}{interval}+0.5);
+  my $interval      = int($config_groups[$group_index]{interval}+0.5);
   for (my $i=0; $i<@IMAGE_PLOT_TYPES; ++$i) {
     # Load the data that helps this class determine if a particular
     # image file, such as the daily image, is current or needs to be
@@ -120,7 +124,7 @@
     # Generate the unique plot title cotaining the period title for this
     # plot.
     $self->[I_PLOT_LEGEND_BASE+$i] =
-      &::Capatialize($plot_type) .
+      &::capatialize($plot_type) .
       ' ' .
       ::replace_subgroup_name($plot_ref->{title}, $subgroup_name);
   }
@@ -171,10 +175,11 @@
   my @legends;
   my $max_legend_length = 0;
   for (my $i=0; $i<$data_sources; ++$i) {
-    my $legend         = ::replace_subgroup_name($plot_ref->{legend}[$i], $subgroup_name);
+    my $legend         = ::replace_subgroup_name($plot_ref->{legend}[$i],
+                                                 $subgroup_name);
     my $line_type      = $plot_ref->{line_type}[$i];
     my $color          = $plot_ref->{color}[$i];
-    push(@options, "$line_type:average$i#$color:$legend");
+    push(@options,       "$line_type:average$i#$color:$legend");
     $legend            =~ s:%:\200:g;
     $legend            =~ s:\200:%%:g;
     my $legend_length  = length($legend);
@@ -188,12 +193,13 @@
   # Generate the legends containing the current, average, minimum, and
   # maximum values on the plot.
   for (my $i=0; $i<$data_sources; ++$i) {
-    my $legend = $legends[$i];
-    $legend   .= ' ' x ($max_legend_length - length($legend));
-    push(@options, "GPRINT:average$i:LAST:$legend  Current\\: %9.3lf %S",
-                   "GPRINT:average$i:AVERAGE:Average\\: %9.3lf %S",
-                   "GPRINT:average$i:MIN:Min\\: %9.3lf %S",
-                   "GPRINT:average$i:MAX:Max\\: %9.3lf %S\\l"
+    my $legend          = $legends[$i];
+    $legend            .= ' ' x ($max_legend_length - length($legend));
+    my $summary_format  = $plot_ref->{summary_format}[$i];
+    push(@options, "GPRINT:average$i:LAST:$legend  Current\\: $summary_format",
+                   "GPRINT:average$i:AVERAGE:Average\\: $summary_format",
+                   "GPRINT:average$i:MIN:Min\\: $summary_format",
+                   "GPRINT:average$i:MAX:Max\\: $summary_format\\l"
         );
   }
 
@@ -233,8 +239,8 @@
   $_[0]->[I_NAME];
 }
 
-sub group_name {
-  $_[0]->[I_GROUP_NAME];
+sub group_index {
+  $_[0]->[I_GROUP_INDEX];
 }
 
 sub subgroup_name {
@@ -283,7 +289,7 @@
   my ($self, $i) = @_;
 
   my $plot_type       = $IMAGE_PLOT_TYPES[$i];
-  my $image_days_back = $IMAGE_DAYS_BACK[$i];
+  my $image_time_span = $IMAGE_TIME_SPAN[$i];
 
   # Get the time stamp of the last data point entered into the RRDs
   # that are used to generate this image.
@@ -311,7 +317,7 @@
       $image_filename,
       @{$self->[I_GRAPH_OPTIONS]},
       '-t', $self->[I_PLOT_LEGEND_BASE+$i],
-      '-s', ($plot_end_time-$image_days_back*DAY_SECONDS),
+      '-s', ($plot_end_time-$image_time_span),
       '-e', $plot_end_time,
       '-w', $plot_ref->{plot_width},
       '-h', $plot_ref->{plot_height},
@@ -329,9 +335,8 @@
 
     # Expire the image at the correct time using a META file if
     # requested.
-    if ($config_options{expire_images}) {
+    if ($config_global{expire_images}) {
       if (open(META, "> $image_filename.meta")) {
-        my $time = 
         print META "Expires: ",
                    _expire_string($plot_end_time + $plot_age + 30),
                    "\n";
@@ -349,7 +354,7 @@
 sub _expire_string {
   my @gmtime  = gmtime($_[0]);
   my ($wday)  = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat')[$gmtime[6]];
-  my ($month) = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep', 
+  my ($month) = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep',
                  'Oct','Nov','Dec')[$gmtime[4]];
   my ($mday, $year, $hour, $min, $sec) = @gmtime[3,5,2,1,0];
   if ($mday<10) {$mday = "0$mday";}

Modified: trunk/orca/lib/download.cfg
==============================================================================
--- trunk/orca/lib/download.cfg	(original)
+++ trunk/orca/lib/download.cfg	Sat Jul 13 21:25:46 2002
@@ -6,25 +6,21 @@
 files 24hour_mean {
 watch_files		24hour_mean
 column_description	date 24hour_mean
-date_format		%m/%d/%y
 }
 
 files 24hour_sd {
 watch_files		24hour_sd
 column_description	date 24hour_sd
-date_format		%m/%d/%y
 }
 
 files core_mean {
 watch_files		core_mean
 column_description	date core_mean
-date_format		%m/%d/%y
 }
 
 files core_sd {
 watch_files		core_sd
 column_description	date core_sd
-date_format		%m/%d/%y
 }
 
 

Modified: trunk/orca/lib/time_gets.cfg
==============================================================================
--- trunk/orca/lib/time_gets.cfg	(original)
+++ trunk/orca/lib/time_gets.cfg	Sat Jul 13 21:25:47 2002
@@ -26,7 +26,6 @@
 find_files		/home/bzajac/time_gets/(.*)/data.\d{8}
 column_description	first_line
 date_source		column_name timestamp
-date_format		%s
 interval		300
 reopen			1
 }

Modified: trunk/orca/FAQ
==============================================================================
--- trunk/orca/FAQ	(original)
+++ trunk/orca/FAQ	Sat Jul 13 21:25:47 2002
@@ -1,7 +1,402 @@
-Orcallator:
- 1) Why are my Ethernet bits/second measurements all 0?
+This is a FAQ (Frequently Asked Questions) for Orca and the tools that
+gather data for it.
 
-    On 2.5.1 or older Solaris operating system releases, the kernel does
-    not measure the bits/second going through a particular device.  I
-    believe some later kernel and device driver patches may fix this,
-    but Solaris 2.6 and greater definitely does measure this.
+Please email submissions to the FAQ to orca-users at yahoogroups.com.
+
+Version: 1.06 May 10, 2001
+
+General
+-------
+
+  1.1) What is the m, k, u, or some other character following the
+       numbers in the Y axis scale?
+  1.2) Why is my Y axis scale have such large numbers?
+  1.3) Why are there random characters at the end of my HTML and GIF
+       or PNG images names, i.e.
+       o_host3_disk_runp_c0t6d0...disk_runp_c-4QyP2ziXlrwXj8eG_n_A.html?
+
+Warning Messages
+----------------
+
+  2.1) Number of columns in line '1,2,3.....' of
+      ../orcallator/.../percol-2000-09-26 does not match column
+      description.
+  2.2) Warning: file `../orcallator/.../temp-percol-2001-02-22' was
+       current and now is not.
+
+Solaris/Orcallator.se
+---------------------
+
+  3.1) What do I do about the error "/opt/RICHPse/bin/se: Unsupported
+       platform: sparcv9 SunOS 5.8"?
+  3.2) Why does orcallator.se die, in particular when I log out of the
+       system that I started it on?
+  3.3) Why is the page scan rate is always zero even though sar says
+       it is not?
+  3.4) Why are all the NFS server statistics zero?
+  3.5) Why are my Ethernet bits/second measurements all zero?
+  3.6) Why do I get the error "Fatal: member: txunderruns vanished!:
+       Near line 201"?
+  3.7) Why do I get the error "Fatal: member: txunderruns0 vanished!:
+       Near line 255"?
+  3.8) Why do I get the error "Fatal: member: framming vanished!: Near
+       line 160"?
+  3.9) Why do I get the error "Fatal: member: drop vanished!: Near
+       line 285"?
+ 3.10) Why do I get the error "Fatal: member: XXXXX vanished!: Near
+       line YYY"?
+ 3.11) Why don't I get plots for my Veritas filesystems?
+ 3.12) Why don't I get plots for my RSM filesystems?
+ 3.13) Why don't I get any Interface Bits Per Second data for my qe
+       board?
+ 3.14) Orcallator.se core dumps.
+
+General
+-------
+
+  1.1) What is the m, k, u, or some other character following the
+       numbers in the Y axis scale?
+
+       This is SI magnitude symbol to scale the number by.  Here is a
+       table of symbols and scaling factors.
+
+         a  10e-18 Ato
+         f  10e-15 Femto
+         p  10e-12 Pico
+         n  10e-9  Nano
+         u  10e-6  Micro
+         m  10e-3  Milli
+         k  10e3   Kilo
+         M  10e6   Mega
+         G  10e9   Giga
+         T  10e12  Terra
+         P  10e15  Peta
+         E  10e18  Exa
+
+       So if you see "250 m" in the Y axis, this means 0.25.
+
+       The page
+
+         http://www.physlink.com/reference_dprefixes.cfm
+
+       is also a good reference for this information.
+
+  1.2) Why is my Y axis scale have such large numbers?
+
+       See question 1) above.  Most likely there is a scaling letter
+       after your number that means the true value is several orders
+       of magnitude smaller than you think it is.
+
+  1.3) Why are there random characters at the end of my HTML and GIF
+       or PNG images names, i.e.
+       o_host3_disk_runp_c0t6d0...disk_runp_c-4QyP2ziXlrwXj8eG_n_A.html?
+
+       The way Orca generates HTML and image filenames uses all of the
+       input data sources.  With plots that contain a large amount of
+       different data, the filename can exceed the maximum filename
+       length for the operating system and Orca will not be able to
+       create the file.
+
+       The solution is to limit the filename length to less than 255
+       characters.  This could be performed by simply trimming the
+       filename down to less than 255 characters, but then the
+       filename may not be unique and two distinct HTML files and/or
+       images may end up being written to the same file.  The solution
+       used by Orca is to calculate the MD5 hash of the full length
+       filename, trim the filename down and insert the MD5 into the
+       short filename, which will guarantee uniqueness.
+
+Warning Messages
+----------------
+
+  2.1) Number of columns in line '1,2,3.....' of
+      ../orcallator/...../percol-2000-09-26 does not match column
+      description.
+
+      When Orca sees a line in an input data file that does not have
+      the same number of columns as defined at the top of the file,
+      then Orca will complain and ignore the line.
+
+  2.2) Warning: file `../orcallator/.../temp-percol-2001-02-22' was
+       current and now is not.
+
+       First, Orca considers a file to be current if the file's last
+       modified time is within `late_interval' seconds of the current
+       time.  In other words, Orca checks if a process is modifying
+       the file to keep it current.  The `late_interval' value is
+       determined by the configuration file or set to the `interval'
+       value if the configuration file does not set `late_interval'.
+
+       Orca stat()s the file when it first looks for files using the
+       `find_files' and determines that the file is current.  Any time
+       after that Orca reads the file, it stat()s the file again and
+       determines if it is current.  If there was a previous stat()
+       and the file was current followed by another stat() and the
+       file is not current, then the message is printed.
+
+       The appearance of this message means that the process that has
+       been updating the file has stopped updating it and this may be
+       worth looking into.
+
+       This message is also seen when the data gathering program,
+       e.g. orcallator.se, opens a new log file at the end of a day
+       and the old log file is no longer updated.  Orca tries to
+       manage this situation when a file is no longer updated at the
+       end of a day.
+
+       If the actual measurement interval is not consistent with
+       Orca's configuration file "interval" 300 seconds, then Orca's
+       "interval" should be modified to match the actual measurement
+       interval.  If you need to do this, then delete the RRD files
+       because they will keep the old "interval" and the input data
+       will need to be reloaded into new RRD files.
+
+       Increasing the "late_interval" may also remove this error.
+
+Solaris/Orcallator.se
+---------------------
+
+  3.1) What do I do about the error "/opt/RICHPse/bin/se: Unsupported
+       platform: sparcv9 SunOS 5.8"?
+
+       There are two solutions.  SE 3.2 is now available and you can
+       upgrade to this version.  It is available at:
+
+         http://www.setoolkit.com/
+
+       If you are using an SE version less than 3.2, then do this:
+
+         cd /opt/RICHPse/bin
+         ln se.sparc.5.7   se.sparc.5.8
+         ln se.sparcv9.5.7 se.sparcv9.5.8
+
+  3.2) Why does my background orcallator.se process die, in particular
+       when I log out of the system that I started it on?
+
+       This sounds like orcallator.se is started under the Bourne
+       shell, which kills background processes unless the process is
+       started with nohup:
+
+         nohup se orcallator.se &
+
+  3.3) Why is the page scan rate is always zero even though sar says
+       it is not?
+
+       It has been observed that on Solaris 2.5.1 the page scan rate
+       is always zero.  This occurs with orcallator.se version 1.23 or
+       older.  The problem is that on older versions of SE the
+       p_vmstat.scan variable is an integer and orcallator.se was
+       assuming a double.  The fix is to upgrade to orcallator.se 1.24
+       or newer.
+
+  3.4) Why are all the NFS server statistics zero?
+
+       On Solaris 2.6 there is a bug in the SE toolkit that prevents
+       orcallator.se from getting the NFS server statistics.  To fix
+       this, edit your RICHPse/include/kstat.se file and change #ifdef
+       to #if near the top of the file where it says
+
+         #ifdef MINOR_VERSION >= 70
+         # define rfs_counter_t uint64_t
+         #else
+
+       to
+
+         #if MINOR_VERSION >= 70
+         # define rfs_counter_t uint64_t
+         #else
+
+  3.5) Why are my Ethernet bits/second measurements all zero?
+
+       On 2.5.1 or older Solaris operating system releases, the kernel
+       does not measure the bits/second going through a particular
+       device.  I believe some later kernel and device driver patches
+       may fix this, but Solaris 2.6 and greater definitely does
+       measure this.
+
+  3.6) Why do I get the error "Fatal: member: txunderruns vanished!:
+       Near line 201"?
+
+       This problem occurs with SE 2.5.0.2 and FDDI 5.0
+       interfaces.  There are three possible fixes:
+         1) Upgrade to SE 3.0.
+         2) Visit the SE 2.5.0.2 download page and get the FDDI patch.
+         3) Add the latest patch to FDDI which should reinstate the
+            metric that went missing.
+
+  3.7) Why do I get the error "Fatal: member: txunderruns0 vanished!:
+       Near line 255"?
+
+       This problem occurs with Solaris 2.5 and hme interfaces.  There
+       are three possible fixes:
+
+         1) Upgrade to a later Solaris release.
+         2) Get the hme patch for Solaris 2.5.
+         3) As a temporary work-around, change the member "defer" to
+            "missing1" in the ks_hme_network structure in
+            /opt/RICHPse/include/kstat.se like this:
+
+            #ifdef MINOR_VERSION >= 51
+            ulong defer;
+            #else
+            ulong missing1;
+            #endif
+
+            The next build of SE 3.0 will figure this out
+            automatically.
+
+  3.8) Why do I get the error "Fatal: member: framming vanished!: Near
+       line 160"?
+
+       This problem occurs with Solaris 2.5.1 and le interfaces.  The
+       le patch for Solaris 2.5.1 corrects the spelling from framming
+       to framing.  SE 3.0 tries to detect this patch, but if you
+       don't have the patch directory in /var/sadm/patch it can't tell
+       that the patch is installed.  There are three fixes.
+
+         1) Upgrade to Solaris 2.6.
+         2) Reinstall the le patch for Solaris 2.5.1.
+         3) Create the directory /var/sadm/patch/103903-03 by hand.
+         4) As a temporary work-around, run scripts using se
+            -DLE_PATCH script.se to force the update or edit
+            start_orcallator.se and enable the appropriate SE_PATCHES
+            variable.
+
+  3.9) Why do I get the error "Fatal: member: drop vanished!: Near
+       line 285"?
+
+       This has been observed on Solaris 2.6 using SE version 3.0.
+       Upgrade to the latest version of SE.
+
+ 3.10) Why do I get the error "Fatal: member: XXXXX vanished!: Near
+       line YYY"?
+
+       This happens when Sun changes some of the kernel names for
+       particular variables that the SE package is expecting to find.
+       For example, one error was that
+
+       SE has some conditional compile flags that tell it to look for
+       the new name.  Try adding these to the command line options for
+       SE or editing start_orcallator.sh to enable some of the
+       defines.
+
+         1) -DLE_PATCH=1
+         2) -DHME_PATCH=1
+         3) -DHME_PATCH_IFSPEED=1
+         4) -DMULTICAST_PATCH=1
+         5) -DROBUST_LISTENQ=1
+
+       If a particular define does not fix the problem, then don't run
+       SE with it.
+
+ 3.11) Why don't I get plots for my Veritas filesystems?
+
+       Version 1.13 or later of orcallator.se should be able to
+       generate filesystem statistics for Veritas filesystems.  The
+       first thing to try is to upgrade to the latest SE and
+       orcallator.se release.
+
+ 3.12) Why don't I get plots for my RSM filesystems?
+
+       I don't think orcallator.se records data from RSM disks.
+
+       However, to make sure, can you look through the first line of
+       the output orcallator files and see if the RSM filesystems
+       are listed there?  Look for the disk_runp_ string.  If you see
+       the filesystems there, then the Orca configuration file needs
+       to be updated to plot this data.  In this case, email me the
+       names of the filesystems as listed in the output file and the
+       Orca configuration file can be updated to plot the data.
+
+       Otherwise, orcallator.se or the underlying SE header files will
+       need to be modified to find RSM filesystems.  Since I don't
+       have access to a system with RSM on it, this is something
+       that somebody else will need to take on.  Hint, hint...
+
+ 3.13) Why don't I get any Interface Bits Per Second data for my qe
+       board?
+
+       Most likely you are either running Solaris 7 or older or
+       Solaris 8 with SE version 3.1 or older.  You must run Solaris 8
+       to get qe bits per second data.  Apply the following patches to
+       include/kstat.se and include/netif.se:
+
+         *** kstat.se.orig       Fri Feb  9 01:44:14 2001
+         -- kstat.se    Fri Feb  9 14:31:46 2001
+         ***************
+         *** 646,651 ****
+         --- 646,661 ----
+               ulong_t no_tbufs;
+               ulong_t no_rbufs;
+               ulong_t rx_late_collisions;
+         + #if MINOR_VERSION >= 70
+         +     ulong_t  rbytes;
+         +     ulong_t  obytes;
+         +     ulong_t  multircv;
+         +     ulong_t  multixmt;
+         +     ulong_t  brdcstrcv;
+         +     ulong_t  brdcstxmt;
+         +     ulong_t  norcvbuf;
+         +     ulong_t  noxmtbuf;
+         + #endif
+
+           };
+
+         *** netif.se.orig       Fri Feb  9 01:45:06 2001
+         --- netif.se    Fri Feb  9 14:31:10 2001
+         ***************
+         *** 229,236 ****
+         --- 229,241 ----
+                 nocanput       = if_qe.nocanput;
+                 defer          = if_qe.excess_defer;
+                 nocarrier      = if_qe.nocarrier;
+         + #if MINOR_VERSION >= 70
+         +       ooctets        = if_qe.obytes + if_qe.multixmt + if_qe.brdcstxmt;
+         +       ioctets        = if_qe.rbytes + if_qe.multircv + if_qe.brdcstrcv;
+         + #else
+                 ooctets        = 0;
+                 ioctets        = 0;
+         + #endif
+                 break;
+               case NETIF_BF:
+                 kstat$bf.number$ = number$ - (if_max[NETIF_QE] + 1);
+
+ 3.14) Orcallator.se core dumps.
+
+       Some of the SE include files can cause core dumps if there are
+       oddities on the system.  Apply the following patches:
+
+         --- diskinfo.se.orig       Fri Jan 12 11:20:09 2001
+         +++ diskinfo.se Tue Feb 27 19:37:28 2001
+         @@ -197,7 +197,12 @@
+              points_at[n] = '\0';
+
+              // chop off the :a at the end
+         -    strcpy(strrchr(points_at, ':'), "");
+         +    while (--n >= 0) {
+         +      if (points_at[n] == ':') {
+         +        points_at[n] = '\0';
+         +        break;
+         +      }
+         +    }
+
+              // hack off ../../devices from the start
+              sscanf(points_at, "../../devices%s", &points_at);
+
+
+         --- mnt_class.se.orig   Fri Jan 12 11:20:09 2001
+         +++ mnt_class.se        Tue Feb 27 19:53:34 2001
+         @@ -96,7 +96,12 @@
+                number$ = -1;
+                return;
+              }
+         -    strcpy(strchr(buf, '\n'), "");
+         +    for (i=0; i<sizeof(buf); ++i) {
+         +      if (buf[i] == '\n') {
+         +        buf[i] = '\0';
+         +        break;
+         +      }
+         +    }
+              i = 0;
+              for(p=strtok(buf, "\t"); p != nil; p=strtok(nil, "\t")) {
+                switch(i) {

Modified: trunk/orca/CHANGES
==============================================================================
--- trunk/orca/CHANGES	(original)
+++ trunk/orca/CHANGES	Sat Jul 13 21:25:47 2002
@@ -1,478 +1,891 @@
+Thu May 10 17:24:54 PDT 2001
+
+	* Release Orca version 0.27b1.
+
+Thu May 10 16:05:29 PDT 2001
+
+	* CHANGES: Make have proper whitespaces.
+	* NEWS: Ditto.
+	* FAQ: Ditto.
+	* src/orca.pl.in: Spell check.
+	* orcallator/orcallator.se: Upgrade to orcallator.se 1.28b3.
+	  Recoded measure_disk() to access the RAWDISK interface to
+	  sys_kstat device information to allow the activity on Sun's
+	  A1000 and Clariion Raid controller drives to be seen.
+	  Apparently the pseudo drivers do not update the kstat
+	  interface.  It is also inverts the fix provided by version
+	  1.23 to avoid over-counting md devices.  By suppressing
+	  stats from slices and metadevices and instead reporting on
+	  full devices such as c0t0d0 or sd0.  Note: This may have
+	  introduced an interaction with the live_rules.se class
+	  monitoring of drive performance.  Prevent floppy disks and
+	  tape drives from RAWDISK.  Added wio% to measure wait time
+	  since the idle calculation is wrong without this.  Prevent
+	  filesystems mounted under /snapshots from being seen.  Patch
+	  contributed by Alan LeGrand <alegrand at wallace.com>.
+	* INSTALL: Modify any broken URLs to installation instructions
+	  or to downloadable files.
+	* README: Change the email address blair at akamai.com to
+	  blair at gps.caltech.edu.
+	* lib/Orca/HTMLFile.pm: Ditto.
+	* src/orca.pl.in: Ditto.
+	* lib/homesteaders.cfg: Ditto.
+	* orcallator/orcallator.se: Ditto.
+
+Thu Mar 29 15:27:02 PST 2001
+
+	* src/orca.pl.in: Move &email_message from src/orca.pl.in to
+	  lib/Orca/Utils.pm since it is an utility function.
+	* lib/Orca/Utils.pm: Ditto.
+
+Thu Mar 29 15:18:20 PST 2001
+
+	* src/orca.pl.in: Add clearer instructions on how to disable
+	  Orca from sending email to the warn_email addresses.
+
+Wed Mar 28 22:28:41 PST 2001
+
+	* lib/Orca/ImageFile.pm: Remove an unnecessary assignment to a
+	  variable from the result of a print statement.
+
+Wed Mar 28 21:34:43 PST 2001
+
+	* src/orca.pl.in: Rename the make_*_plot parameters to
+	  generate_*_plot.
+	* lib/Orca/Config.pm: Ditto.
+	* orcallator/orcallator.cfg.in: Ditto.
+	* NEWS: Ditto.
+
+Tue Mar 27 15:19:11 PST 2001
+
+	* orcallator/orcallator_column.pl: Now handle when input file
+	  column names change or the number of columns increase or
+	  decrease.
+
+Tue Mar 27 11:26:39 PST 2001
+
+	* orcallator/orcallator.cfg.in: Update orcallator.cfg.in to
+	  fix a bug in plotting the CPU usage plots where the idle%
+	  time was calculated by subtracting the user percent time
+	  usr% and the system percent time sys% from 100%.  This did
+	  not take into account the wait on IO time wio% that the
+	  system measures and hence the idle% was overestimated.  Now
+	  plot the correct idle% and the wio%.
+
+Tue Mar 27 11:24:36 PST 2001
+
+	* orcallator/orcallator.se: Upgrade to orcallator.se 1.27.
+	  Print the portion of time running in idle mode with some
+	  process waiting for block I/O as wio% and otherwise
+	  completely idle time as idle%.
+
+Thu Mar 15 15:31:29 PST 2001
+
+	* Include and require Digest::MD5 2.13.
+
+Wed Mar 14 20:29:58 PST 2001
+
+	* Include and require Storable 1.0.11.
+
+Fri Mar  2 16:35:20 PST 2001
+
+	* Now the same data expression can be used in plots with
+	  different RRD data types (GAUGE, COUNTER, etc.).
+
+Wed Feb 28 10:30:19 PST 2001
+
+	* Remove the "sub_dir" configuration file parameter and now
+	  always create sub directories for RRD, image and HTML
+	  files.  This removes the problem when a simple Orca
+	  configuration file was used and Orca did not create
+	  subdirectories and then additional groups where added to the
+	  configuration file Orca would begin to use subdirectories
+	  and the existing RRD, image and HTML files would be in the
+	  wrong location.  In this case, Orca would reload all of the
+	  input data.
+	* The created HTML files now all include the group name to
+	  avoid collisions between the same subgroup name in different
+	  groups.
+	* The Orca generated RRD filenames had the subgroup name in it
+	  which is the same as the directory it is placed in.  Remove
+	  the subgroup name from the filename to save memory.  Also,
+	  place the group name in the directory's name to prevent
+	  collisons between name named subgroups in different groups.
+
+Tue Feb 27 12:15:15 PST 2001
+
+	* src/orca.pl.in: Fix a bug where Orca's documentation states
+	  that the configuration file can specify different data_types
+	  for each data in a plot but the code did not.  Make the
+	  modifications to support this feature.
+
+Mon Feb 26 22:16:17 PST 2001
+
+	* Add a new command line option named -no-images which
+	  suppresses image generation.  Remove the command line option
+	  -r which told Orca to only update the RRD files and not
+	  generate HTML and image files.  To replace -r functionality,
+	  use both -no-images and -no-html command line options.
+	* Add a new command line option -daemon that puts Orca in the
+	  background or daemonizes it.  It is recommended that when
+	  this command line option is used that -logfile is used.
+	  Patch supplied by Bruce Johnson
+	  <Bruce.Johnson at PictureVision.com>.
+
+Mon Feb 26 22:19:56 PST 2001
+
+	* Add a new command line option -logfile that specifies a
+	  filename that STDOUT and STDERR are redirected to so that
+	  all messages, warnings and errors are printed to the file.
+	  Now when a SIGPIPE is caught, messages will continue to be
+	  printed unless -logfile was not given to Orca.  Patch
+	  supplied by Bruce Johnson <Bruce.Johnson at PictureVision.com>.
+
+Mon Feb 26 13:28:06 PST 2001
+
+	* Include and require Storable 1.0.10.
+
+Sun Feb 25 19:34:32 PST 2001
+
+	* lib/Orca/Config.pm: When loading a configuration file, now
+	  do a complete check of it for errors before quitting,
+	  instead of quitting after a single error.
+
+Sat Feb 24 13:28:45 PST 2001
+
+	* Fix a bug where Orca's documentation states that the
+	  configuration file can specify different data_min and
+	  data_max for each data in a plot but the code did not.  Make
+	  the modifications to support this feature.
+
+Fri Feb 23 22:32:43 PST 2001
+
+	* orcallator/orcallator.cfg.in: Greatly simplify
+	  orcallator.cfg.in to use Orca's regular expression matching
+	  features to make the Interface Bits Per Second plots instead
+	  of listing each possible interface.
+	* Include and require RRDtool 1.0.33.
+
+Mon Feb 19 19:50:19 PST 2001
+
+	* Include and require RRDtool 1.0.30.
+
+Sat Feb 10 13:14:49 PST 2001
+
+	* orcallator/orcallator.cfg.in: Add input and output bits per
+	  second plots to orcallator.cfg.in for ge0, qe0, qe1, qe2,
+	  qe3 and vge0 interfaces.
+
+Thu Feb  8 15:55:29 PST 2001
+
+	* By default, now create an hourly plot that shows the last
+	  1.5 hours of data.  Add a global "make_hourly_plot"
+	  configuration file parameter that turns this plot
+	  off.  Hourly plot creation is disabled in orcallator.cfg.in
+	  since orcallator.se by default measures the system every 5
+	  minutes and the plots look blocky.
+
+Wed Feb  7 16:43:26 PST 2001
+
+	* The previous fix for the
+	    `Use on uninitialized value in array element at (eval X)
+	    line 1, <DATA> line Y'
+	  warning did not work on Perl 5.004_05.  Modify the fix so
+	  that it will work on this older version of Perl.
+
+Mon Feb  5 17:27:02 PST 2001
+
+	* orcallator/orcallator.se: Update to orcallator.se 1.26.
+	  Make sure to check the return from stat() on the web server
+	  access log in case the file is missing.  Use fstat() instead
+	  of stat() when a file descriptor is available.
+
+Mon Feb  5 14:48:32 PST 2001
+
+	* src/orca.pl.in: If Orca's output was being piped to a
+	  process, such as less, and the process was killed or exited
+	  before Orca did, then Orca would not remove the lock
+	  directory.  Orca now catches SIGPIPEs and exits cleanly.  If
+	  Orca catches any signal other than SIGPIPE, it will print to
+	  STDOUT and STDERR some final messages, otherwise it will not
+	  print anything, since STDOUT and STDERR may have been
+	  attached to a process that exited.
+
+Mon Feb  5 11:59:48 PST 2001
+
+	* src/orca.pl.in: Fix the warning message in src/orca.pl.in
+	    `Use on uninitialized value in array element at (eval X)
+	    line 1, <DATA> line Y'
+	  when Orca was run with Perl 5.6.0.  The problem was that the
+	  filename_compare subroutine was eval'ed in Orca::Config
+	  while the sort was being performed in the main package and
+	  the $a and $b that the compare subroutine expected were not
+	  being set.  This problem is probably responsible for
+	  problems where there are missing data from the plots.  Since
+	  the filename sort tells Orca the order in which to load data
+	  into the RRD files and the sort will have newer data files
+	  listed before older data files, once newer data is entered
+	  into an RRD file you cannot add older data resulting in
+	  missing data in the output plots.  The solution to this is
+	  to remove the RRD files and rerun Orca with all of the input
+	  data files.
+
+Sat Feb  3 12:23:33 PST 2001
+
+	* lib/Orca/Config.pm: Add a new configuration file option
+	  named "require" that allows the configuration file to
+	  specify the minimum required version of Orca.
+
+Wed Jan 31 15:40:05 PST 2001
+
+	* Add a new configuration file option for plots named
+	  summary_format which specifies the format for the summary
+	  values as passed to the RRDtool GPRINT function.  The same
+	  format is used for each number within a single summary line,
+	  but you can specify multiple summary_format options if there
+	  are multiple plots on the graph.  The default value, which
+	  has not changed from previous Orca versions, is '%9.3lf
+	  %S'.  Patch from Alex Howansky <alex at wankwood.com>.
+
+	* Add a new command line option -no-html to instruct Orca to
+	  skip generating HTML files.  Patch from Alex Howansky
+	  <alex at wankwood.com>.
+
+Wed Jan 31 14:08:24 PST 2001
+
+	* Update all of the www.egroups.com URLs and email addresses
+	  to reflect that Egroups was purchased by Yahoo!.
+
+Mon Nov  6 16:38:58 PST 2000
+
+	* Include the orcaservices package in the contrib directory
+	  which was written by Carlos Canau <Carlos.Canau at KPNQwest.pt>
+	  and documented by Jose Carlos <jcp at KPNQwest.pt>.  This
+	  package allows monitoring of many different types of Unix
+	  services, such as DNS, SMTP, POP, etc.
+
+Thu Nov  2 11:20:15 PST 2000
+
+	* Include and require Digest::MD5 2.12.
+
+Wed Nov  1 16:06:13 PST 2000
+
+	* Add a contrib directory for contributed tools.  Add the
+	  first tool which is rotates Orca's plots so that daily plots
+	  can be archived.  This script is named rotate_orca_graphs.
+
+Thu Oct 26 13:37:38 PDT 2000
+
+	* Add new global configuration file parameters,
+	  "make_daily_plot", "make_weekly_plot", "make_monthly_plot",
+	  "make_quarterly_plot", and "make_yearly_plot", that when
+	  given an argument of 0, do not create the specified plot.
+
+Mon Oct 23 16:02:45 PDT 2000
+
+	* Include and require RRDtool 1.0.28.
+
+Wed Sep 13 13:28:29 PDT 2000
+
+	* Include and require RRDtool 1.0.27.
+
+Sun Sep 10 12:01:14 PDT 2000
+
+	* Include and require RRDtool 1.0.26.
+
+Sun Aug 27 21:58:28 PDT 2000
+
+	* Include and require RRDtool 1.0.25.
+
+	* Include Digest::MD5 2.11.
+
+Mon Jul  3 14:32:57 PDT 2000
+
+	* Include and require RRDtool 1.0.24.
+
+Mon Jul  3 11:16:04 PDT 2000
+
+	* Change all mailing list and HTML references from onelist.com
+	  to egroups.com.
+
+Thu Jun  1 12:38:18 PDT 2000
+
+	* In start_orcallator.se start se with nohup.
+
+Sat May  6 13:47:05 PDT 2000
+
+	* Include and require RRDtool 1.0.21.
+
+Mon Apr 17 10:43:14 PDT 2000
+
+	* Remove the date_format configuration option, as it was never
+	  supported.
+
+	* To support converting arbitrary strings in the input source
+	  data files that somehow represent time into an Unix epoch
+	  time usable by Orca, introduce a new group configuration
+	  option named date_parse, which is an arbitrary Perl
+	  subroutine that is given two arguments, the first being the
+	  name of the file where the data is loaded and the second the
+	  string from the `date_source' column that contains some time
+	  information.  The subroutine should return the Unix epoch
+	  time.  If this option is not specified, then Orca assumes
+	  that the string holds the Unix epoch time.
+
+	  This Perl subroutine is only used if the file's date source
+	  is not specified to be the file's last modified time as
+	  indicated to Orca by use of the B<date_source> file_mtime
+	  configuration file option.
+
+Mon Apr 17 10:43:13 PDT 2000
+
+	* Replace the small color scheme with a longer list designed
+	  by Guy Dallaire <gdallair-nospam at criq.qc.ca>.
+
+Thu Apr 13 16:09:07 PDT 2000
+
+	* Include and require RRDtool 1.0.16.
+
+Mon Apr  3 16:40:18 PDT 2000
+
+	* Include and require Storable 0.6.11.
+
+Sun Apr  2 10:53:31 PDT 2000
+
+	* Include and require RRDtool 1.0.14.
+
+Thu Mar 30 18:20:34 PST 2000
+
+	* Update to orcallator.se 1.25.  Fix a typo where nil was
+	  misspelled as nik.
+
+Thu Mar 30 13:37:10 PST 2000
+
+	* Allow the "late_interval" configuration parameter to appear
+	  in a configuration file group.  If it does not appear in a
+	  group listing, then use the global "late_interval" value.
+
+Wed Mar 29 21:11:38 PST 2000
+
+	* Include and require Storable 0.6.10 which fixes a compile
+	  problem of against certain Perl's.
+
+Sat Mar 25 12:26:52 PST 2000
+
+	* Upgrade to orcallator.se 1.24.  When orcallator.se was
+	  running on a system with an older version of SE the
+	  p_vmstat.scan variable is an integer and the sprintf to
+	  %8.3f fails, resulting in a perceived scan rate of 0 pages
+	  per second.  Now always add 0.0 to p_vmstat.scan to get a
+	  double.
+
+Sat Mar 11 11:16:49 PST 2000
+
+	* Change the version string from 0.26beta1 to 0.27.
+
+Fri Mar 10 19:00:00 PST 2000
+
+	* Release version 0.26 of Orca.
+
 Thu Mar  9 12:23:24 PST 2000
 
-	Remove from the INSTALL file the instructions to increase the
-	file descriptor limit to 256.  This should no longer be
-	necessary with the improvements to the code.
+	* Remove from the INSTALL file the instructions to increase
+	  the file descriptor limit to 256.  This should no longer be
+	  necessary with the improvements to the code.
 
 Thu Mar  9 12:20:39 PST 2000
 
-	Reduce the number of open files for the open file descriptor
-	cache from roughly 200 to 100.  Change the code so that if a
-	open of a file or pipe fails, then close two open file
-	descriptors and try again.  It used to be that an attempt
-	would be made if only a pipe failed.
+	* Reduce the number of open files for the open file descriptor
+	  cache from roughly 200 to 100.  Change the code so that if a
+	  open of a file or pipe fails, then close two open file
+	  descriptors and try again.  It used to be that an attempt
+	  would be made if only a pipe failed.
 
 Wed Mar  8 12:02:07 PST 2000
 
-	Due to some changes at onelist.com, the name of this mailing
-	must change.  The -help at the end of orca-help is being
-	reserved for the mailing list named "orca".  As such, I'm
-	renaming this list to orca-users at onelist.com.  All references
-	to the old name in the package were similarly changed.
+	* Due to some changes at onelist.com, the name of this mailing
+	  must change.  The -help at the end of orca-help is being
+	  reserved for the mailing list named "orca".  As such, I'm
+	  renaming this list to orca-users at onelist.com.  All
+	  references to the old name in the package were similarly
+	  changed.
 
 Sun Mar  5 20:27:38 PST 2000
 
-	Include and require Storable 0.6.9.
+	* Include and require Storable 0.6.9.
 
 Wed Mar  1 14:40:26 PST 2000
 
-	Require the latest versions of all the modules Orca uses.
+	* Require the latest versions of all the modules Orca uses.
 
 Wed Mar  1 13:33:00 PST 2000
 
-	Only build RRDtool if it is needed.
+	* Only build RRDtool if it is needed.
 
 Tue Feb 29 17:43:15 PST 2000
 
-	To prevent Orca from performing all the gunzip, uncompress,
-	and bunzip2 system calls to get the first line of the source
-	file, store the first line in the state file and use it when
-	constructing the Orca::SourceFile object.
+	* To prevent Orca from performing all the gunzip, uncompress,
+	  and bunzip2 system calls to get the first line of the source
+	  file, store the first line in the state file and use it when
+	  constructing the Orca::SourceFile object.
 
 Tue Feb 29 12:16:22 PST 2000
 
-	Update orcallator.cfg.in to plot the NFS server calls per
-	second and also the v{2,3}{reads,writes}.
+	* Update orcallator.cfg.in to plot the NFS server calls per
+	  second and also the v{2,3}{reads,writes}.
 
 Tue Feb 29 12:02:45 PST 2000
 
-	Update the POD documentation for data_type by copying the
-	exact text from the rrdcreate.pod file.
+	* Update the POD documentation for data_type by copying the
+	  exact text from the rrdcreate.pod file.
 
 Sat Feb 26 13:29:16 PST 2000
 
-	If Orca::OpenFileHash::open tries to open a pipe for
-	compressed input and it cannot be opened, then shrink the
-	maximum number of open file descriptors and close enough
-	descriptors to attempt the pipe again.
+	* If Orca::OpenFileHash::open tries to open a pipe for
+	  compressed input and it cannot be opened, then shrink the
+	  maximum number of open file descriptors and close enough
+	  descriptors to attempt the pipe again.
 
 Fri Feb 25 17:15:37 PST 2000
 
-	Upgrade to orcallator.se 1.23.  When orcallator was running on
-	a system with DiskSuite, the same physical disk was listed
-	multiple times when it appeared in the same metadevice.  The
-	solution to the problem is not to build the c0t0d0 name but
-	use the long disk name provided by the long_name string.
-	Patch contributed by Paul Haldane
-	<Paul.Haldane at newcastle.ac.uk>.
-
-	To facilitate Orca loading in a huge amount of data in one
-	pass, add a new group configuration file parameter that tells
-	Orca how to sort the filenames and when data loaded from them
-	can be flushed to disk.  The new parameters name is
-	"filename_compare" and takes a Perl subroutine that behaves
-	like a subroutine given to sort.  Data is flushed to disk when
-	the subroutine returns a number greater than 1.
+	* Upgrade to orcallator.se 1.23.  When orcallator was running
+	  on a system with DiskSuite, the same physical disk was
+	  listed multiple times when it appeared in several
+	  metadevices.  The solution to the problem is not to build
+	  the c0t0d0 name but use the long disk name provided by the
+	  long_name string.  Patch contributed by Paul Haldane
+	  <Paul.Haldane at newcastle.ac.uk>.
+
+	* To facilitate Orca loading in a huge amount of data in one
+	  pass, add a new group configuration file parameter that
+	  tells Orca how to sort the filenames and when data loaded
+	  from them can be flushed to disk.  The new parameters name
+	  is "filename_compare" and takes a Perl subroutine that
+	  behaves like a subroutine given to sort.  Data is flushed to
+	  disk when the subroutine returns a number greater than 1.
 
 Fri Feb 25 16:49:44 PST 2000
 
-	Save the state more often so that if Orca quits in the middle,
-	it does not have to reload all the data from the files again,
-	even if the data has already been loaded into the RRD files.
+	* Save the state more often so that if Orca quits in the
+	  middle, it does not have to reload all the data from the
+	  files again, even if the data has already been loaded into
+	  the RRD files.
 
 Fri Feb 25 16:35:29 PST 2000
 
-	Have configure determine the best ps commmand to run to get
-	information on the current running Orca process.
+	* Have configure determine the best ps commmand to run to get
+	  information on the current running Orca process.
 
-	Finish splitting up the monolithic orca.pl.in into separate
-	modules.
+	* Finish splitting up the monolithic orca.pl.in into separate
+	  modules.
 
 Fri Feb 25 12:44:43 PST 2000
 
-	start_orcallator.sh refers to percollator.  Change it to refer
-	to orcallator.
+	* start_orcallator.sh refers to percollator.  Change it to refer
+	  to orcallator.
 
-	If two different groups had the same subgroup, then Orca would
-	list both group's subgroup file IDs for both subgroups.  Fix
-	this bug.
+	* If two different groups had the same subgroup, then Orca
+	  would list both group's subgroup file IDs for both
+	  subgroups.  Fix this bug.
 
-	Rename Orca::FileIDs to Orca::SourceFileIDs.
+	* Rename Orca::FileIDs to Orca::SourceFileIDs.
 
 Fri Feb 18 13:00:19 PST 2000
 
-	Apply a patch to Orca::ImageFile so that the legends are
-	properly created with the newer RRDtool.
+	* Apply a patch to Orca::ImageFile so that the legends are
+	  properly created with the newer RRDtool.
 
 Fri Feb 18 12:19:14 PST 2000
 
-	Include and require RRDtool 1.0.13.
+	* Include and require RRDtool 1.0.13.
 
 Thu Feb 17 13:13:39 PST 2000
 
-	Include orcallator.se 1.22, which includes the following
-	changes: Include code to record NFS v2 and v3 server
-	statistics.  The new statistics are: nfss_calls, the number of
-	NFS calls to the NFS server, nfss_bad, the number of bad NFS
-	calls per second, and v{2,3}{reads,writes}, which are
-	nfss_calls broken down into NFS version 2 and NFS version 3
-	calls.  The sum of v{2,3}{reads, writes} will be less than
-	nfss_calls as the other types of NFS calls, such as getattr
-	and lookup, are not included.  Contributed by Paul Haldane
-	<Paul.Haldane at newcastle.ac.uk>.  This code is enabled by the
-	standard -DWATCH_OS or individually by -DWATCH_NFS_SERVER.
-	The define -DWATCH_NFS has been supperseded by
-	-DWATCH_NFS_CLIENT, but to keep backwards compatibility,
-	-DWATCH_NFS_CLIENT will be defined if -DWATCH_NFS is defined.
-
-        Include orcallator.se 1.21, which includes the following
-        changes: Prevent core dumps on extremely long access log
-        lines.
+	* Include orcallator.se 1.22, which includes the following
+	  changes: Include code to record NFS v2 and v3 server
+	  statistics.  The new statistics are: nfss_calls, the number
+	  of NFS calls to the NFS server, nfss_bad, the number of bad
+	  NFS calls per second, and v{2,3}{reads,writes}, which are
+	  nfss_calls broken down into NFS version 2 and NFS version 3
+	  calls.  The sum of v{2,3}{reads, writes} will be less than
+	  nfss_calls as the other types of NFS calls, such as getattr
+	  and lookup, are not included.  Contributed by Paul Haldane
+	  <Paul.Haldane at newcastle.ac.uk>.  This code is enabled by the
+	  standard -DWATCH_OS or individually by
+	  -DWATCH_NFS_SERVER.  The define -DWATCH_NFS has been
+	  superseded by -DWATCH_NFS_CLIENT, but to keep backwards
+	  compatibility, -DWATCH_NFS_CLIENT will be defined if
+	  -DWATCH_NFS is defined.
+
+	* Include orcallator.se 1.21, which includes the following
+	  changes: Prevent core dumps on extremely long access log
+	  lines.
 
 Wed Oct 20 17:39:19 PDT 1999
 
-	Release Orca 0.25.
+	* Release Orca 0.25.
 
 Wed Oct 20 17:37:01 PDT 1999
 
-	Fix that annoying warning from pod2html when orca.html is
-	generated.
+	* Fix that annoying warning from pod2html when orca.html is
+	  generated.
 
-	Include Storable 0.607 but continue to only require 0.603.
+	* Include Storable 0.607 but continue to only require 0.603.
 
-	Add a mention in the POD that sending a HUP to the Orca
-	process forces it to look for new files in the next loop.
-	This is faster than restarting Orca.
-
-	Change the behavior of warnings when data requested to be
-	plotted in the configuration file does not exist in the source
-	data files.  Any resulting errors from this, such as cannot
-	compile errors, are only sent when the verbose level is above
-	1 or when the plot is required.
-
-	Did some renaming of classes and variables in limited places:
-	Orca::SourceDataFile -> Orca::SourceFile
-	files_key            -> group
-	group                -> subgroup
-	gif                  -> image
-
-	Orcallator.se 1.20 now mentions my new email address of
-	blair at akamai.com instead of the old one.
-
-	Move all references to my and Orca's home page from GeoCities
-	(www.geocities.com/~bzking/) to Caltech
-	(www.gps.caltech.edu/~blair/orca/) everywhere.
-
-	In the default orcallator.cfg, make sure it can find compressed
-	orcallator files in the find_files statement.
-
-	Make sure all Makefile's can rebuild themselves from their
-	Makefile.in and make sure that the Makefile target is built when
-	all is built.
-
-	Put in an optimization where Orca would not repeatedly create
-	a new anonymous subroutine to catch warnings when eval's were
-	being performed.
-
-	Add a new make target, orcallator_run_at_boot, which installs
-	into the proper /etc/*.d/ directories the scripts to start
-	orcallator at boot time and stop orcallator at halt time.
-	Update the INSTALL file to mention this.
-
-	Fix an important bug where Orca would crash if column names
-	mentioned in the configuration file did not exist in the source
-	data files.  This fix was in Orca::SourceFile::add_plots.
+	* Add a mention in the POD that sending a HUP to the Orca
+	  process forces it to look for new files in the next
+	  loop.  This is faster than restarting Orca.
+
+	* Change the behavior of warnings when data requested to be
+	  plotted in the configuration file does not exist in the
+	  source data files.  Any resulting errors from this, such as
+	  cannot compile errors, are only sent when the verbose level
+	  is above 1 or when the plot is required.
+
+	* Did some renaming of classes and variables in limited
+	  places:
+	  Orca::SourceDataFile -> Orca::SourceFile
+	  files_key            -> group
+	  group                -> subgroup
+	  gif                  -> image
+
+	* Orcallator.se 1.20 now mentions my new email address of
+	  blair at akamai.com instead of the old one.
+
+	* Move all references to my and Orca's home page from
+	  GeoCities (www.geocities.com/~bzking/) to Caltech
+	  (www.gps.caltech.edu/~blair/orca/) everywhere.
+
+	* In the default orcallator.cfg, make sure it can find
+	  compressed orcallator files in the find_files statement.
+
+	* Make sure all Makefile's can rebuild themselves from their
+	  Makefile.in and make sure that the Makefile target is built
+	  when all is built.
+
+	* Put in an optimization where Orca would not repeatedly
+	  create a new anonymous subroutine to catch warnings when
+	  eval's were being performed.
+
+	* Add a new make target, orcallator_run_at_boot, which
+	  installs into the proper /etc/*.d/ directories the scripts
+	  to start orcallator at boot time and stop orcallator at halt
+	  time.  Update the INSTALL file to mention this.
+
+	* Fix an important bug where Orca would crash if column names
+	  mentioned in the configuration file did not exist in the
+	  source data files.  This fix was in
+	  Orca::SourceFile::add_plots.
 
 Tue Oct 19 18:25:12 PDT 1999
 
-	Make all plots optional by default.  Remove the optional plot
-	keyword and add required, which makes a plot required.
+	* Make all plots optional by default.  Remove the optional
+	  plot keyword and add required, which makes a plot required.
 
 Fri Oct 15 11:25:53 PDT 1999
 
-	Add a new plot in the default orcallator.cfg, the amount of free
-	physical memory.
+	* Add a new plot in the default orcallator.cfg, the amount of
+	  free physical memory.
 
-	Shorten the legend names in orcallator.cfg so that the complete
-	line fits in the generated image.  Also make the Y legend names
-	more consistent with each other.
+	* Shorten the legend names in orcallator.cfg so that the
+	  complete line fits in the generated image.  Also make the Y
+	  legend names more consistent with each other.
 
 Thu Oct 14 15:52:43 PDT 1999
 
-	Create a orcallator/S99orcallator file that can be used to start
-	orcallator.se at boot time and stop it at halt time.
+	* Create a orcallator/S99orcallator file that can be used to
+	  start orcallator.se at boot time and stop it at halt time.
 
 Thu Oct 14 14:44:00 PDT 1999
 
-	Release Orca 0.24.
+	* Release Orca 0.24.
 
 Thu Oct 14 12:17:29 PDT 1999
 
-	Back down to RRDtool 1.0.7 with only my filename length patch
-	applied per Tobi.
+	* Back down to RRDtool 1.0.7 with only my filename length
+	  patch applied per Tobi.
 
-	Revamp the INSTALL, NEWS, and other files to get a release out.
+	* Revamp the INSTALL, NEWS, and other files to get a release
+	  out.
 
-	Up the version number of the included RRDs package to 1.000072
-	since it contains some patches specifically for Orca.
+	* Up the version number of the included RRDs package to
+	  1.000072 since it contains some patches specifically for
+	  Orca.
 
 Wed Oct 13 12:40:29 PDT 1999
 
-	Orcallator.se 1.19 prevents a division by zero in calculating
-	the mean_disk_busy if the number of disks on the system is 0.
-
-	Move the URL http://www.geocities.com/~bzking/orcallator-docs/
-	to http://www.geocities.com/~bzking/docs/orcallator.html.
-
-	In cases where there are a large number of data sources in a
-	single image, then the list of available colors is expired.
-	Now reuse the colors.
+	* Orcallator.se 1.19 prevents a division by zero in
+	  calculating the mean_disk_busy if the number of disks on the
+	  system is 0.
+
+	* Move the URL
+	  http://www.geocities.com/~bzking/orcallator-docs/ to
+	  http://www.geocities.com/~bzking/docs/orcallator.html.
+
+	* In cases where there are a large number of data sources in a
+	  single image, then the list of available colors is
+	  expired.  Now reuse the colors.
 
-	Make sure plots are displayed in each subgroup's HTML files in
-	the order they appear in the configuration file.
+	* Make sure plots are displayed in each subgroup's HTML files
+	  in the order they appear in the configuration file.
 
 Tue Oct 12 10:27:44 PDT 1999
 
-	Update orcallator.cfg to remove the maximum and average disk busy
-	plot and add a plot that displays the run percent for each disk.
+	* Update orcallator.cfg to remove the maximum and average disk
+	  busy plot and add a plot that displays the run percent for
+	  each disk.
 
-	Orcallator 1.18 now renames disk_runp.c?t?d? to disk_runp_c?t?d?.
+	* Orcallator 1.18 now renames disk_runp.c?t?d? to
+	  disk_runp_c?t?d?.
 
 Mon Oct 11 14:31:38 PDT 1999
 
-	Update orcallator.cfg to plot the disk space and inode usage
-	for all locally mounted filesystems.
+	* Update orcallator.cfg to plot the disk space and inode usage
+	  for all locally mounted filesystems.
 
-	Apply a patch to RRDtool that increases the maximum filename
-	length for generated image files from 255 to 1024.
+	* Apply a patch to RRDtool that increases the maximum filename
+	  length for generated image files from 255 to 1024.
 
-	Rename &strip_key_name to &escape_name.
+	* Rename &strip_key_name to &escape_name.
 
 Fri Oct  8 14:23:37 PDT 1999
 
-	Save even more space in Orca generated HTML and image filenames.
-	On large directories, up to 10% disk space can be saved alone
-	in filenames according to du.  Also, if generated filenames are
-	longer than 235 characters, then compute a MD5 hash of the name,
-	trim the name down to 210 characters, and append the MD5 hash.
+	* Save even more space in Orca generated HTML and image
+	  filenames.  On large directories, up to 10% disk space can
+	  be saved alone in filenames according to du.  Also, if
+	  generated filenames are longer than 235 characters, then
+	  compute a MD5 hash of the name, trim the name down to 210
+	  characters, and append the MD5 hash.
 
-	Orcallator.se 1.17 now skips locally mounted /cdrom filesystems.
+	* Orcallator.se 1.17 now skips locally mounted /cdrom
+	  filesystems.
 
-	Increase the number of default known colors to 11.
+	* Increase the number of default known colors to 11.
 
 Wed Oct  6 17:59:05 PDT 1999
 
-	Orcallator.se 1.16 now compresses its log files after it has
-	completed a day's log using the command in the COMPRESSOR
-	environmental variable.  start_orcallator now passed this
-	environmental variable to orcallator.se.
+	* Orcallator.se 1.16 now compresses its log files after it has
+	  completed a day's log using the command in the COMPRESSOR
+	  environmental variable.  start_orcallator now passed this
+	  environmental variable to orcallator.se.
 
 Wed Oct  6 15:19:09 PDT 1999
 
-	Have configure.in look for bzip2, bunzip2, gzip, gunzip, compress,
-	and uncompress.  Define the COMPRESSOR and UNCOMPRESSOR_PIPE as
-	the best compression tool to use and add these names to the list
-	of names being substituted.  This only gets defined if both a
-	compress and uncompression tool is used.
+	* Have configure.in look for bzip2, bunzip2, gzip, gunzip,
+	  compress, and uncompress.  Define the COMPRESSOR and
+	  UNCOMPRESSOR_PIPE as the best compression tool to use and
+	  add these names to the list of names being substituted.
+	  This only gets defined if both a compress and uncompression
+	  tool is used.
 
-	To keep backwards compatibility in orcallator.se, define WATCH_WEB
-	if WATCH_HTTPD is defined.
+	* To keep backwards compatibility in orcallator.se, define
+	  WATCH_WEB if WATCH_HTTPD is defined.
 
 Tue Oct  5 14:54:59 PDT 1999
 
-	Update orcallator.se to 1.15.  kvm$mpid is a int not a long.
-	This caused problems on Solaris 7 hosts running a 64 bit kernel.
+	* Update orcallator.se to 1.15.  kvm$mpid is a int not a long.
+	  This caused problems on Solaris 7 hosts running a 64 bit
+	  kernel.
 
 Fri Oct  1 12:15:47 PDT 1999
 
-	Update orcallator.se to 1.14.  Rename disk.c?t?d? column names
-	to disk_runp.c?t?d? to better reflect the data being recorded
-	and to allow for more per disk information later.
+	* Update orcallator.se to 1.14.  Rename disk.c?t?d? column
+	  names to disk_runp.c?t?d? to better reflect the data being
+	  recorded and to allow for more per disk information later.
 
-	Install the latest RRDtool patch.
+	* Install the latest RRDtool patch.
 
 Thu Sep 29 19:19:23 PDT 1999
 
-	Add some more space between a plot's legend and the minimum,
-	maximum, etc information for a particular piece of data.
+	* Add some more space between a plot's legend and the minimum,
+	  maximum, etc information for a particular piece of data.
 
-	Allow mathematical expressions in plots where the first data
-	contains a regular expression.
+	* Allow mathematical expressions in plots where the first data
+	  contains a regular expression.
 
 Fri Sep 24 11:50:33 PDT 1999
 
-	Many fixes and improvements to orcallator.se.  Fix a bug in the
-	disk_mean calculation where it was being divided by the wrong
-	disk_count.  Now it should be much larger and in scale with
-	disk_peak.  When WATCH_DISK is defined, now print each disk's
-	run percent.  Add a new define WATCH_MOUNTS, which reports each
-	mount point's disk space and inode capacity, usage, available
-	for non-root users and percent used.  This comes from Duncan
-	Lawie tyger at hoopoes.com.  Add some smarts so that if the number
-	of interfaces, physical disk, or mounted partitions changes,
-	then a new header is printed.  This will prevent column name
-	and data mixups when the system configuration changes.
+	* Many fixes and improvements to orcallator.se.  Fix a bug in
+	  the disk_mean calculation where it was being divided by the
+	  wrong disk_count.  Now it should be much larger and in scale
+	  with disk_peak.  When WATCH_DISK is defined, now print each
+	  disk's run percent.  Add a new define WATCH_MOUNTS, which
+	  reports each mount point's disk space and inode capacity,
+	  usage, available for non-root users and percent used.  This
+	  comes from Duncan Lawie tyger at hoopoes.com.  Add some smarts
+	  so that if the number of interfaces, physical disk, or
+	  mounted partitions changes, then a new header is printed.
+	  This will prevent column name and data mixups when the
+	  system configuration changes.
 
 Mon Sep 20 11:18:21 PDT 1999
 
-	Include Storable 0.605 but continue to only require 0.603.
+	* Include Storable 0.605 but continue to only require 0.603.
 
 Tue Sep 14 15:54:38 PDT 1999
 
-	Add the page scan rate to orcallator.se as column scanrate.
+	* Add the page scan rate to orcallator.se as column scanrate.
 
 Tue Sep  7 12:21:52 PDT 1999
 
-	Update the archive URLs for the orca-* mailing lists.
+	* Update the archive URLs for the orca-* mailing lists.
 
 Thu Sep  2 11:03:19 PDT 1999
 
-	Include and require RRDtool 1.0.7.
+	* Include and require RRDtool 1.0.7.
 
-	Make some more minor changes to have Orca run with Perl 5.004_01.
+	* Make some more minor changes to have Orca run with Perl
+	  5.004_01.
 
 Tue Aug 24 11:32:34 PDT 1999
 
-	Include and require Math::Interpolate 1.05.
+	* Include and require Math::Interpolate 1.05.
 
 Thu Aug 19 14:13:16 PDT 1999
 
-	No longer include Compress::Zlib, which was to be used to read in
-	compressed source data files without spawning a separate process.
-	Now it seems easier to just call gunzip -c.
+	* No longer include Compress::Zlib, which was to be used to
+	  read in compressed source data files without spawning a
+	  separate process.  Now it seems easier to just call gunzip
+	  -c.
 
 Wed Aug 18 11:10:21 PDT 1999
 
-	Read in .gz files using gunzip, .Z files using uncompress,
-	and .bz2 files with bunzip2.
+	* Read in .gz files using gunzip, .Z files using uncompress,
+	  and .bz2 files with bunzip2.
 
-	Clean up some bugs where the RRDs::graph -r option would always
-	be used.
+	* Clean up some bugs where the RRDs::graph -r option would
+	  always be used.
 
-	Plots can now take a logarithmic option which specified that
-	the Y axis will have a logarithmic scale.
+	* Plots can now take a logarithmic option which specified that
+	  the Y axis will have a logarithmic scale.
 
 Tue Aug 17 11:50:34 PDT 1999
 
-	Include and require Math::Interpolate 1.04.
+	* Include and require Math::Interpolate 1.04.
 
-	No longer have Orca::RRDFile be a subclass of Orca::DataFile, since
-	Orca::DataFile now handles FIDs and the FID namespace should not be
-	polluted by the RRD filenames.
+	* No longer have Orca::RRDFile be a subclass of
+	  Orca::DataFile, since Orca::DataFile now handles FIDs and
+	  the FID namespace should not be polluted by the RRD
+	  filenames.
 
 Mon Aug 16 12:11:48 PDT 1999
 
-	Design a new module, Orca::FileIDs, for managing the long lists
-	of long filenames for memory and CPU speed improvements.  Now all
-	classes use File IDentifiers (FIDs) instead of filenames.
+	* Design a new module, Orca::FileIDs, for managing the long
+	  lists of long filenames for memory and CPU speed
+	  improvements.  Now all classes use File IDentifiers (FIDs)
+	  instead of filenames.
 
-	Add locking on a particular configuration file.  Make a directory
-	using the configuration filename.
+	* Add locking on a particular configuration file.  Make a
+	  directory using the configuration filename.
 
-	Include and require RRDtool 1.0.6.
+	* Include and require RRDtool 1.0.6.
 
 Fri Aug 13 17:10:23 PDT 1999
 
-	Install librrd.so on Solaris hosts in $libdir so that
-	orcallator.se can attach to it.
+	* Install librrd.so on Solaris hosts in $libdir so that
+	  orcallator.se can attach to it.
 
 Fri Aug 13 15:35:21 PDT 1999
 
-	Include and require RRDtool 1.0.5.
+	* Include and require RRDtool 1.0.5.
 
 Mon Aug  9 10:32:42 PDT 1999
 
-	Include and require RRDtool 1.0.4.
+	* Include and require RRDtool 1.0.4.
 
 Fri Aug  6 09:29:14 PDT 1999
 
-	Include Digest::MD5 2.09 but continue to only require 2.00.
+	* Include Digest::MD5 2.09 but continue to only require 2.00.
 
 Thu Aug  5 20:58:32 PDT 1999
 
-	Make sure start_orcallator looks to see if SE is defined.  If it
-	is not, then print a message stating where to find the SE toolkit.
+	* Make sure start_orcallator looks to see if SE is defined.
+	  If it is not, then print a message stating where to find the
+	  SE toolkit.
 
 Fri Jul 30 09:12:20 PDT 1999
 
-	Update orcallator.cfg to plot the new process spawn rate.
+	* Update orcallator.cfg to plot the new process spawn rate.
 
-	Include and require RRDtool 1.0.3.
+	* Include and require RRDtool 1.0.3.
 
 Thu Jul 29 10:36:20 PDT 1999
 
-	To fix the problem of too long HTML and image file names,
-	shorten the names as they get passed through strip_key_name.
-	Now orcallator -> o, orca -> o, _times_ -> _X_, _percent_ ->
-	_pct_, _number_ -> _num_.  The upgrade_installation will perform
-	these renames on a list of directories.
+	* To fix the problem of too long HTML and image file names,
+	  shorten the names as they get passed through
+	  strip_key_name.  Now orcallator -> o, orca -> o, _times_ ->
+	  _X_, _percent_ -> _pct_, _number_ -> _num_.  The
+	  upgrade_installation will perform these renames on a list of
+	  directories.
 
-	Since orcallator is only one of many different data gatherers,
-	move it into its own directory.
+	* Since orcallator is only one of many different data
+	  gatherers, move it into its own directory.
 
 Wed Jul 28 10:10:53 PDT 1999
 
-	If WATCH_CPU is defined and if the user can read /dev/kmem then
-	orcallator.se will now measure the process spawn rate over a 5
-	minute interval and also record the maximum rate measured over
-	a 5 second interval.
-
-	Add a href field for a plot in the configuration file.	This,
-	if defined, lets you make a particular target type be a HREF to
-	read something about that target type.
+	* If WATCH_CPU is defined and if the user can read /dev/kmem
+	  then orcallator.se will now measure the process spawn rate
+	  over a 5 minute interval and also record the maximum rate
+	  measured over a 5 second interval.
+
+	* Add a href field for a plot in the configuration file.
+	  This, if defined, lets you make a particular target type be
+	  a HREF to read something about that target type.
 
-	Include Digest::MD5 2.08 but continue to only require 2.00.
+	* Include Digest::MD5 2.08 but continue to only require 2.00.
 
 Fri Jul 23 13:41:36 PDT 1999
 
-	Include and require RRDtool 1.0.1.
+	* Include and require RRDtool 1.0.1.
 
 Thu Jul 22 17:06:45 PDT 1999
 
-	Use a blessed reference to an array for the Orca::DataFile,
-	Orca::HTMLFile, Orca::ImageFile, Orca::OpenFileHash,
-	Orca::RRDFile, and Orca::OpenFileHash classes.
+	* Use a blessed reference to an array for the Orca::DataFile,
+	  Orca::HTMLFile, Orca::ImageFile, Orca::OpenFileHash,
+	  Orca::RRDFile, and Orca::OpenFileHash classes.
 
 Mon Jul 19 12:57:56 PDT 1999
 
-	On a fresh install make sure to mkdir RRD_DIR/orcallator.
+	* On a fresh install make sure to mkdir RRD_DIR/orcallator.
 
-	Change the tag name data_dir to rrd_dir to make it clearer what
-	kind of data is being loaded.
+	* Change the tag name data_dir to rrd_dir to make it clearer
+	  what kind of data is being loaded.
 
-	Integrate building of Compress::Zlib into the Makefile structure.
-	Make use of the Zlib 1.1.3 library included with RRDtool for
-	Compress::Zlib.
+	* Integrate building of Compress::Zlib into the Makefile
+	  structure.  Make use of the Zlib 1.1.3 library included with
+	  RRDtool for Compress::Zlib.
 
 Fri Jul 16 11:12:02 PDT 1999
 
-	Include and require RRDtool 1.0.0 and Compress::Zlib 1.05.
+	* Include and require RRDtool 1.0.0 and Compress::Zlib 1.05.
 
-	Update the colors in orcallator.cfg.  In all plots, make one
-	plot use area.
+	* Update the colors in orcallator.cfg.  In all plots, make one
+	  plot use area.
 
 Thu Jul 15 11:35:52 PDT 1999
 
-	As noted by Bob Hoekstra <Bob_Hoekstra at merck.com>, orcallator.se
-	was outputting the same information for ??load as for ??runq.
-	Orcallator.se no longer generates that data and orcallator.cfg
-	no longer generates plots for it.
+	* As noted by Bob Hoekstra <Bob_Hoekstra at merck.com>,
+	  orcallator.se was outputting the same information for ??load
+	  as for ??runq.  Orcallator.se no longer generates that data
+	  and orcallator.cfg no longer generates plots for it.
 
 Wed Jul 14 11:04:09 PDT 1999
 
-	Switch to use PNGs instead of GIFs.  They take up 1/3 less space
-	than GIFs and at least 10% less time to generate.
+	* Switch to use PNGs instead of GIFs.  They take up 1/3 less
+	  space than GIFs and at least 10% less time to generate.
 
-	Rename all variables and comments containing GIF to image.
+	* Rename all variables and comments containing GIF to image.
 
-	Revamp the INSTALL document to reflect the new * -> _times_
-	change and add some documentation of the file descriptor limit.
+	* Revamp the INSTALL document to reflect the new * -> _times_
+	  change and add some documentation of the file descriptor
+	  limit.
 
-	Uncompress and read .Z and .gz compressed input files on the fly.
+	* Uncompress and read .Z and .gz compressed input files on the
+	* fly.
 
 Wed Jul 14 10:22:13 PDT 1999
 
-	Include and require RRDtool 0.99.52.
+	* Include and require RRDtool 0.99.52.
 
 Tue Jul 13 12:34:29 PDT 1999
 
@@ -486,619 +899,649 @@
 
 	Rename the migrate_to_orcallator script to upgrade_installation.
 
-	Per Vadim Shulkin <vadim.shulkin at csfb.com> request, replace the
-	* in all generated filenames with _times_.  Put this rename in
-	the new upgrade_installation script.
+	* Per Vadim Shulkin <vadim.shulkin at csfb.com> request, replace
+	  the * in all generated filenames with _times_.  Put this
+	  rename in the new upgrade_installation script.
 
 Tue Jul  6 18:14:20 PDT 1999
 
-	Include and require RRDtool 0.99.49.
+	* Include and require RRDtool 0.99.49.
 
 Sun Jul  4 16:57:28 PDT 1999
 
-	Include and require RRDtool 0.99.47.
+	* Include and require RRDtool 0.99.47.
 
 Fri Jul  2 18:16:21 PDT 1999
 
-	Include and require RRDtool 0.99.46.
+	* Include and require RRDtool 0.99.46.
 
 Tue Jun 29 13:18:57 PDT 1999
 
-	Add a new option for each plot named base that allows the base
-	for each plot to be either 1000 or 1024.  This allows for plotting
-	of memory or network type of datas.
-
-	Use the new base option in the number of bytes of available swap
-	space plots.
-
-	Include and require RRDtool 0.99.45.
-
-	Make use of RRDtool's 0.99.45 capability to place the SI number
-	suffix to numbers appearing in the legend using the GPRINT
-	command.
+	* Add a new option for each plot named base that allows the
+	  base for each plot to be either 1000 or 1024.  This allows
+	  for plotting of memory or network type of datas.
+
+	* Use the new base option in the number of bytes of available
+	  swap space plots.
+
+	* Include and require RRDtool 0.99.45.
+
+	* Make use of RRDtool's 0.99.45 capability to place the SI
+	  number suffix to numbers appearing in the legend using the
+	  GPRINT command.
 
 Mon Jun 28 11:16:46 PDT 1999
 
-	Now only print found filenames if the verbose level is above one.
-	Orca was generating too much output.
+	* Now only print found filenames if the verbose level is above
+	  one.  Orca was generating too much output.
 
-	When creating all the HTML files, do not write directly to the
-	new filename, instead write to a temporary filename and when
-	the file is closed, then rename it to the final name.  This lets
-	the user view existing HTML files even when the new HTML files
-	are being updated.
+	* When creating all the HTML files, do not write directly to
+	  the new filename, instead write to a temporary filename and
+	  when the file is closed, then rename it to the final name.
+	  This lets the user view existing HTML files even when the
+	  new HTML files are being updated.
 
-	Include RRDtool 0.99.41 but continue to only require 0.99.29.
+	* Include RRDtool 0.99.41 but continue to only require 0.99.29.
 
 Tue Jun 22 10:54:39 PDT 1999
 
-	Include RRDtool 0.99.40 but continue to only require 0.99.29.
+	* Include RRDtool 0.99.40 but continue to only require
+	  0.99.29.
 
 Thu Jun 10 09:39:36 PDT 1999
 
-	When 80% of a host's processes are web serving processes, plotting
-	the total system and number of httpd's together on the same plot
-	makes sense.  However, for people running a tiny web server with
-	only a few processes, this does not make sense, so a separate
-	plot is created.  Noted by Paul Company <paul.company at plpt.com>.
+	* When 80% of a host's processes are web serving processes,
+	  plotting the total system and number of httpd's together on
+	  the same plot makes sense.  However, for people running a
+	  tiny web server with only a few processes, this does not
+	  make sense, so a separate plot is created.  Noted by Paul
+	  Company <paul.company at plpt.com>.
 
 Tue Jun  8 15:16:43 PDT 1999
 
-	Begin the break up orca.pl into separate files for each module.
+	* Begin the break up orca.pl into separate files for each
+	  module.
 
 Tue Jun  8 10:57:39 PDT 1999
 
-	Make the table of contents in INSTALL consistent with the contents
-	of the file.
+	* Make the table of contents in INSTALL consistent with the
+	  contents of the file.
 
 Mon Jun  7 13:01:05 PDT 1999
 
-	Include RRDtool 0.99.32 but continue to only require 0.99.29.
+	* Include RRDtool 0.99.32 but continue to only require
+	  0.99.29.
 
 Thu Jun  3 13:27:09 PDT 1999
 
-	Fix a bug in Orca::SourceDataFile::add_plots where it was
-	dereferencing an undef.
+	* Fix a bug in Orca::SourceDataFile::add_plots where it was
+	  dereferencing an undef.
 
-	Since orcallator.se may watch many different types of web
-	server logs, move some of the common code into CPP defines.
-	Defines are preferred over functions since the function call
-	overhead in SE is larger than having the code inlined.
-
-	Have orcallator.se watch Yahoo! style web access logs if
-	-DWATCH_YAHOO is passed on the command line.
-
-	If any of the environmental variables used by orcallator.se were
-	defined then the value was used, even if the length was zero.
-	Now the length of the variable must be non-zero for the value
-	to be used, otherwise the default value is used.
+	* Since orcallator.se may watch many different types of web
+	  server logs, move some of the common code into CPP defines.
+	  Defines are preferred over functions since the function call
+	  overhead in SE is larger than having the code inlined.
+
+	* Have orcallator.se watch Yahoo! style web access logs if
+	  -DWATCH_YAHOO is passed on the command line.
+
+	* If any of the environmental variables used by orcallator.se
+	  were defined then the value was used, even if the length was
+	  zero.  Now the length of the variable must be non-zero for
+	  the value to be used, otherwise the default value is used.
 
 Wed Jun  2 12:11:44 PDT 1999
 
-	Optimize orcallator.se slightly when it determines the size bin
-	for a particular file served.
+	* Optimize orcallator.se slightly when it determines the size
+	  bin for a particular file served.
 
-	Change the define WATCH_HTTPD in orcallator.se to WATCH_WEB to
-	be consistent with the other WEB_* defines and environmental
-	variables.
+	* Change the define WATCH_HTTPD in orcallator.se to WATCH_WEB
+	  to be consistent with the other WEB_* defines and
+	  environmental variables.
 
 Tue Jun  1 21:53:15 PDT 1999
 
-	For orcallator.se, if the WEB_SERVER environmental variable
-	is set, then the value of of WEB_SERVER is used to count the
-	number of web server processes.  If WEB_SERVER is not defined
-	it defaults to httpd.
+	* For orcallator.se, if the WEB_SERVER environmental variable
+	  is set, then the value of of WEB_SERVER is used to count the
+	  number of web server processes.  If WEB_SERVER is not
+	  defined it defaults to httpd.
 
 Fri May 28 17:39:36 PDT 1999
 
-	Add to the plot title the type of the plot, i.e. 'Yearly',
-	in every GIF.  Requested by Tom Murray <murray at reston.wcom.net>.
+	* Add to the plot title the type of the plot, i.e. 'Yearly',
+	  in every GIF.  Requested by Tom Murray
+	  <murray at reston.wcom.net>.
 
 Thu May 27 10:53:02 PDT 1999
 
-	Release version 0.23.
+	* Release version 0.23.
 
 Thu May 27 09:24:20 PDT 1999
 
-	Add another optimization that saves the result of computing how
-	old each GIF must be before it is recreated.
+	* Add another optimization that saves the result of computing
+	  how old each GIF must be before it is recreated.
 
-	Fix a bug noted by Peter Radcliffe <pir at pir.net> where I missed
-	changing some PERCOLLATOR_DIR variables to ORCALLATOR_DIR in
-	src/start_orcallator.sh.in and src/orcallator_running.pl.in.
+	* Fix a bug noted by Peter Radcliffe <pir at pir.net> where I
+	  missed changing some PERCOLLATOR_DIR variables to
+	  ORCALLATOR_DIR in src/start_orcallator.sh.in and
+	  src/orcallator_running.pl.in.
 
 Wed May 26 17:54:26 PDT 1999
 
-	Release version 0.22.
+	* Release version 0.22.
 
 Wed May 26 12:10:42 PDT 1999
 
-	Move the portions of the code that generate the RRDs::graph
-	options that do not change between invocations to the
-	_update_graph_options method.  This method gets called when the
-	Orca::GIFFile is constructed and any time add_rrds is called.
-	This speeds Orca up slightly.
-
-	Include RRDtool 0.99.31 but continue to only require 0.99.29.
-
-	Add a new quarterly plot that shows the last 100 days.	This is
-	a nice transition between the monthly and yearly plots.
-
-	Change the number of days shown in the yearly plot from 500 to
-	428, which is one year and two months.	Reducing the number
-	of days from 500 by at least one day will speed up the GIF
-	generation time because by default the plot portion of the GIFs
-	are 500 pixels wide.
-
-	Add two new classes Orca::Config::Plot and
-	Orca::Config::FilesGroup that do not do anything yet but
-	will provide an object-oriented interface to config_plots and
-	config_files.  Currently all the values in @$config_plots and
-	%$config_files are now bless objects instead of unblessed objects.
+	* Move the portions of the code that generate the RRDs::graph
+	  options that do not change between invocations to the
+	  _update_graph_options method.  This method gets called when
+	  the Orca::GIFFile is constructed and any time add_rrds is
+	  called.  This speeds Orca up slightly.
+
+	* Include RRDtool 0.99.31 but continue to only require
+	  0.99.29.
+
+	* Add a new quarterly plot that shows the last 100 days.  This
+	  is a nice transition between the monthly and yearly plots.
+
+	* Change the number of days shown in the yearly plot from 500
+	  to 428, which is one year and two months.  Reducing the
+	  number of days from 500 by at least one day will speed up
+	  the GIF generation time because by default the plot portion
+	  of the GIFs are 500 pixels wide.
+
+	* Add two new classes Orca::Config::Plot and
+	  Orca::Config::FilesGroup that do not do anything yet but
+	  will provide an object-oriented interface to config_plots
+	  and config_files.  Currently all the values in
+	  @$config_plots and %$config_files are now bless objects
+	  instead of unblessed objects.
 
 Thu May 20 10:59:26 PDT 1999
 
-	Put a closing ) in a error message in RRDtool 0.99.29.1.
+	* Put a closing ) in a error message in RRDtool 0.99.29.1.
 
-	Fix a bug in queue_data where it was sending data to rrd_update
-	that was already in the RRD file.
+	* Fix a bug in queue_data where it was sending data to
+	  rrd_update that was already in the RRD file.
 
 Wed May 19 10:43:48 PDT 1999
 
-	Remove the load_state and save_state subroutines and replace
-	them with an object-oriented Orca::State class for saving
-	information between Orca invocations.  Use the Storable class
-	to save information instead of a text based method.
-
-	Restructured the code so each Orca::SourceDataFile has only one
-	anonymous subroutine to read in all the valued from a single
-	line of the source data file.  This sped Orca up slightly.
-
-	Add a -r option to Orca to have it not create any HTML or GIF
-	files and only update the RRD files.
-
-	Fix a bug where if the number of columns changed in from
-	one source file to the next source file in a files group,
-	the column index used to get a particular value is the old
-	index for the old file and not the new index for the new file.
-	This fix involved having the Orca::SourceDataFile object run
-	the anonymous subroutines to pick the correct data from a line
-	instead of Orca::RRDFile.
-
-	Remove some unused methods: Orca::OpenFileHash::list,
-	Orca::OpenFileHash::select, Orca::OpenFileHash::sysread_readline
-	Add some more documentation to orcallator.cfg.
+	* Remove the load_state and save_state subroutines and replace
+	  them with an object-oriented Orca::State class for saving
+	  information between Orca invocations.  Use the Storable
+	  class to save information instead of a text based method.
+
+	* Restructured the code so each Orca::SourceDataFile has only
+	  one anonymous subroutine to read in all the valued from a
+	  single line of the source data file.  This sped Orca up
+	  slightly.
+
+	* Add a -r option to Orca to have it not create any HTML or
+	  GIF files and only update the RRD files.
+
+	* Fix a bug where if the number of columns changed in from
+	  one source file to the next source file in a files group,
+	  the column index used to get a particular value is the old
+	  index for the old file and not the new index for the new
+	  file.  This fix involved having the Orca::SourceDataFile
+	  object run the anonymous subroutines to pick the correct
+	  data from a line instead of Orca::RRDFile.
+
+	* Remove some unused methods: Orca::OpenFileHash::list,
+	  Orca::OpenFileHash::select,
+	  Orca::OpenFileHash::sysread_readline.  Add some more
+	  documentation to orcallator.cfg.
 
-	Skip a line in an input source data file if the word timestamp
-	is found in it.  This is a temporary fix.
+	* Skip a line in an input source data file if the word
+	  timestamp is found in it.  This is a temporary fix.
 
 Mon May 17 16:26:17 PDT 1999
 
-	Release version 0.21.
+	* Release version 0.21.
 
 Mon May 17 15:07:33 PDT 1999
 
-	Correct a bug when a source data file cannot be loaded it should
-	not used to look up a Orca::SourceDataFile object.
+	* Correct a bug when a source data file cannot be loaded it
+	  should not used to look up a Orca::SourceDataFile object.
 
-	Reformat all the comments in orca.pl.
+	* Reformat all the comments in orca.pl.
 
 Thu May 13 10:47:41 PDT 1999
 
-	Orca used to delete RRD files if they had an $ORCA_RRD_VERSION
-	number newer then the required version number.	Now use them.
-	Add code to remember the Orca RRD version number so that the
-	GIF creation code works properly with RRD files with a version
-	different than $ORCA_RRD_VERSION.
-
-	Thanks to a configure file and some data from from Eric Blaise
-	<Eric.Blaise at socgen.com>, Orca can now handle plots containing
-	columns of data that do not exist in all input source data files.
-
-	In add_plots, a linear search was used to convert column
-	description names appearing in data statements to an index into
-	the column_description array.  Now use a hash table look up.
+	* Orca used to delete RRD files if they had an
+	  $ORCA_RRD_VERSION number newer then the required version
+	  number.  Now use them.  Add code to remember the Orca RRD
+	  version number so that the GIF creation code works properly
+	  with RRD files with a version different than
+	  $ORCA_RRD_VERSION.
+
+	* Thanks to a configure file and some data from from Eric
+	  Blaise <Eric.Blaise at socgen.com>, Orca can now handle plots
+	  containing columns of data that do not exist in all input
+	  source data files.
+
+	* In add_plots, a linear search was used to convert column
+	  description names appearing in data statements to an index
+	  into the column_description array.  Now use a hash table
+	  look up.
 
 Wed May 12 09:31:43 PDT 1999
 
-	Orca now cleans up all file paths in the input configuration file.
-	If more than one / are found in a row, they are replaced by one /.
-	The base_dir is only prepended to paths if the path does not
-	match ^\\?\.{0,2}/, which will match on /, ./, ../, and \./.
-
-	The paths used to find input files are now passed through
-	the following regular expressions: s:^\\./:: and s:/\\./:/:g.
-	These remove unnecessary searches through the current directory.
-
-	Perl_glob will only return found files and no other type.
-	It will also not follow any directories named `..'.
-
-	Include RRDtool 0.99.29.1 with Orca.  This includes a Makefile
-	patch and does not include a new version of RRDs.pm or librrd.
-
-	In any Makefile.in's that run config.status, they used to run
-	a make from the top level directory.  Now they only run a make
-	from the directory that required the running of config.status.
+	* Orca now cleans up all file paths in the input configuration
+	  file.  If more than one / are found in a row, they are
+	  replaced by one /.  The base_dir is only prepended to paths
+	  if the path does not match ^\\?\.{0,2}/, which will match on
+	  /, ./, ../, and \./.
+
+	* The paths used to find input files are now passed through
+	  the following regular expressions: s:^\\./:: and
+	  s:/\\./:/:g.  These remove unnecessary searches through the
+	  current directory.
+
+	* Perl_glob will only return found files and no other type.
+	  It will also not follow any directories named `..'.
+
+	* Include RRDtool 0.99.29.1 with Orca.  This includes a
+	  Makefile patch and does not include a new version of RRDs.pm
+	  or librrd.
+
+	* In any Makefile.in's that run config.status, they used to
+	  run a make from the top level directory.  Now they only run
+	  a make from the directory that required the running of
+	  config.status.
 
 Tue May 11 16:24:09 PDT 1999
 
-	In places where deep copies of data structures are made and no
-	s///'s are performed on the text form of data, use dclone that
-	comes with Storable instead of using Data::Dumper and eval.
-
-	Do not prepend base_dir to any paths if they begin with either
-	`/' or `./'.
-
-	Require and include RRDtool 0.99.29 with Orca.
-
-	Orca now includes the four Perl packages it depends upon:
-	Digest::MD5 2.07, Math::Interpolate 1.02, RRDtool 0.99.29,
-	and Storable 0.6 at 3.
+	* In places where deep copies of data structures are made and
+	  no s///'s are performed on the text form of data, use dclone
+	  that comes with Storable instead of using Data::Dumper and
+	  eval.
+
+	* Do not prepend base_dir to any paths if they begin with
+	  either `/' or `./'.
+
+	* Require and include RRDtool 0.99.29 with Orca.
+
+	* Orca now includes the four Perl packages it depends upon:
+	  Digest::MD5 2.07, Math::Interpolate 1.02, RRDtool 0.99.29,
+	  and Storable 0.6 at 3.
 
 Mon May 10 10:46:36 PDT 1999
 
-	Update references to Digest::MD5 version 2.07 and require
-	RRDtool 0.99.28.
+	* Update references to Digest::MD5 version 2.07 and require
+	  RRDtool 0.99.28.
 
 Sat May  8 19:29:14 PDT 1999
 
-	Upgrade the instructions to mention Math::Interpolate 1.02
-	instead of Math::Interpolator 1.01.
+	* Upgrade the instructions to mention Math::Interpolate 1.02
+	  instead of Math::Interpolator 1.01.
 
 Thu May  6 13:58:06 PDT 1999
 
-	Orca does not normally display the daily, weekly, monthly,
-	yearly, and everything plots for all the different measurements
-	if there is only one group.  However, it is nice to see all the
-	different measurement plots in one page for a single group, so if
-	now there is only one group, then an Everything group placed at
-	the top of the main index.html file for daily, weekly, monthly,
-	and yearly overviews.
-
-	Make a comment about using gd1.3 versus gd1.2 in INSTALL when
-	building RRDtool.  Because RRDtool comes with gd1.2 and generates
-	smaller GIFs, a comment is made that there is no reason to move
-	to gd1.3.  The bottom line is that gd1.2 is preferred.
-
-	Check if the state file is empty and do not complain if it is.
-
-	Add installation instructions that to install this version
-	of Orca over an older version, a make migrate command will
-	need to be run to renames all files and directories containing
-	percollator, percol, or perc to orcallator in any of the installed
-	Orca directories.
+	* Orca does not normally display the daily, weekly, monthly,
+	  yearly, and everything plots for all the different
+	  measurements if there is only one group.  However, it is
+	  nice to see all the different measurement plots in one page
+	  for a single group, so if now there is only one group, then
+	  an Everything group placed at the top of the main index.html
+	  file for daily, weekly, monthly, and yearly overviews.
+
+	* Make a comment about using gd1.3 versus gd1.2 in INSTALL
+	  when building RRDtool.  Because RRDtool comes with gd1.2 and
+	  generates smaller GIFs, a comment is made that there is no
+	  reason to move to gd1.3.  The bottom line is that gd1.2 is
+	  preferred.
+
+	* Check if the state file is empty and do not complain if it
+	  is.
+
+	* Add installation instructions that to install this version
+	  of Orca over an older version, a make migrate command will
+	  need to be run to renames all files and directories
+	  containing percollator, percol, or perc to orcallator in any
+	  of the installed Orca directories.
 
-	Update orcallator.cfg to look for filenames like
-	orcallator-1999-05-06 and percol-1999-05-06.
+	* Update orcallator.cfg to look for filenames like
+	  orcallator-1999-05-06 and percol-1999-05-06.
 
 Wed May  5 10:43:23 PDT 1999
 
-	Require RRDtool 0.99.27.
+	* Require RRDtool 0.99.27.
 
 Mon May  3 14:51:06 PDT 1999
 
-	Rename everything percollator, perc and percol to orcallator.
+	* Rename everything percollator, perc and percol to
+	  orcallator.
 
 Fri Apr 30 16:34:20 PDT 1999
 
-	Update to install Perl 5.005_03 instead of 5.005_02.
+	* Update to install Perl 5.005_03 instead of 5.005_02.
 
 Fri Apr 23 09:31:28 PDT 1999
 
-	Require RRDtool 0.99.25.
+	* Require RRDtool 0.99.25.
 
 Thu Apr 22 09:21:15 PDT 1999
 
-	Require RRDtool 0.99.24.
+	* Require RRDtool 0.99.24.
 
 Sat Apr 17 12:06:46 PDT 1999
 
-	Change all URLs from
+	* Change all URLs from
 	    http://www.geocities.com/ResearchTriangle/Thinktank/4996/
-	to
+	  to
 	    http://www.geocities.com/~bzking/
 
 Thu Apr  8 17:03:37 PDT 1999
 
-	Require RRDtool 0.99.23.
+	* Require RRDtool 0.99.23.
 
 Wed Mar 31 19:07:41 PST 1999
 
-	When perl_glob cannot open a directory, return an empty
-	array and warn instead of dying.  Fix from J.R. Tietsort
-	<jrtietsort at micron.com>.
+	* When perl_glob cannot open a directory, return an empty
+	  array and warn instead of dying.  Fix from J.R. Tietsort
+	  <jrtietsort at micron.com>.
 
-	Require RRDtool 0.99.22 which contains a memory leak bug fix.
+	* Require RRDtool 0.99.22 which contains a memory leak bug
+	  fix.
 
 Sat Mar 27 10:07:09 PST 1999
 
-	Update references to Digest::MD5 version 2.06 and require
-	RRDtool 0.99.21.
+	* Update references to Digest::MD5 version 2.06 and require
+	  RRDtool 0.99.21.
 
 Thu Mar 25 15:30:00 PST 1999
 
-	Speed up count_proc() in percollator.se by 20% using a patch
-	supplied by Rich Pettit <rpettit at resolute.com>.
+	* Speed up count_proc() in percollator.se by 20% using a patch
+	  supplied by Rich Pettit <rpettit at resolute.com>.
 
 Sat Mar  6 11:50:57 PST 1999
 
-	Update references to Digest::MD5 version 2.04.
+	* Update references to Digest::MD5 version 2.04.
 
 Thu Mar  4 16:42:03 PST 1999
 
-	Require RRDtool 0.99.19.
+	* Require RRDtool 0.99.19.
 
 Mon Mar  1 11:01:01 PST 1999
 
-	Require RRDtool 0.99.18.
+	* Require RRDtool 0.99.18.
 
 Tue Feb 23 09:19:37 PST 1999
 
-	Require RRDtool 0.99.15.
+	* Require RRDtool 0.99.15.
 
-	Die if a unrecognized command line option is given to Orca.
+	* Die if a unrecognized command line option is given to Orca.
 
-	Do group name substitution on the Y legend in GIFs.
+	* Do group name substitution on the Y legend in GIFs.
 
-	Add another consolidation function, DERIVE, to an error message.
+	* Add another consolidation function, DERIVE, to an error
+	  message.
 
-	Change the user, system and idle colors in the CPU usage plot
-	as requested by Alain Swanson <amswanson at micron.com>.
+	* Change the user, system and idle colors in the CPU usage
+	  plot as requested by Alain Swanson <amswanson at micron.com>.
 
-	Change the printing format of usr% and sys% from %4.0f to %5.1f
-	in percollator.se to work around a printing problem reported by
-	Alain Swanson <amswanson at micron.com>.  In SE 3.1 this will now
-	display an extra non-zero digit of measured precision.
+	* Change the printing format of usr% and sys% from %4.0f to
+	  %5.1f in percollator.se to work around a printing problem
+	  reported by Alain Swanson <amswanson at micron.com>.  In SE 3.1
+	  this will now display an extra non-zero digit of measured
+	  precision.
 
-	Always output the header information in percollator.se, even
-	if Orca cannot handle it yet, since the number of columns may
-	change if new hardware is added to the system.
+	* Always output the header information in percollator.se, even
+	  if Orca cannot handle it yet, since the number of columns
+	  may change if new hardware is added to the system.
 
 Mon Feb 22 10:23:21 PST 1999
 
-	Add GIF width and height tags to img src's using the returned
-	GIF size from RRDs::graph.
+	* Add GIF width and height tags to img src's using the
+	  returned GIF size from RRDs::graph.
 
-	Add a space between the ending " for the img src="" and the
-	following alt="" in the generated HTML.
+	* Add a space between the ending " for the img src="" and the
+	  following alt="" in the generated HTML.
 
-	Require RRDtool 0.99.14.
+	* Require RRDtool 0.99.14.
 
-	Add x86 Ethernet device plotting to percollator.cfg.in.
+	* Add x86 Ethernet device plotting to percollator.cfg.in.
 
-	Remove the LAST RRA from all Orca created RRAs since it is not
-	required to get the current value from an RRA.	The current
-	value is obtained by using the LAST consolidation function on
-	the plotted data.
+	* Remove the LAST RRA from all Orca created RRAs since it is
+	  not required to get the current value from an RRA.  The
+	  current value is obtained by using the LAST consolidation
+	  function on the plotted data.
 
 Sun Feb 21 11:03:39 PST 1999
 
-	Make use of RRDtool 0.99.12's legend formatting.
+	* Make use of RRDtool 0.99.12's legend formatting.
 
 Sat Feb 20 20:13:01 PST 1999
 
-	Require RRDtool 0.99.12.
+	* Require RRDtool 0.99.12.
 
 Fri Feb 19 11:55:50 PST 1999
 
-	Move some </a> tags to the end of the image they were referencing
-	to remove some Netscape glitches.
+	* Move some </a> tags to the end of the image they were
+	  referencing to remove some Netscape glitches.
 
-	Minor spelling fix and addition to CHANGES file.
+	* Minor spelling fix and addition to CHANGES file.
 
-	Version 0.20.
+	* Version 0.20.
 
-	Have the Orca logo be a hyperlink to the Orca home page.
+	* Have the Orca logo be a hyperlink to the Orca home page.
 
-	Version 0.19.
+	* Version 0.19.
 
-	Fix a bug in copying SE 3.1's percollator.se changes where it
-	was not skipping the HTTP/1.x code in the NCSA style access log.
-	Now percollator.se can handle log files with or without the code.
+	* Fix a bug in copying SE 3.1's percollator.se changes where
+	  it was not skipping the HTTP/1.x code in the NCSA style
+	  access log.  Now percollator.se can handle log files with or
+	  without the code.
 
 Thu Feb 18 11:54:03 PST 1999
 
-	percollator.se now logs information on integral multiples of
-	the interval.  This is useful for RRD which expects data to be
-	measured on the interval.
-
-	Fix a bug in percollator.se where it was inflating the httpops5
-	number since it was not calculating the actual time interval
-	and instead assuming a 5 second interval.
-
-	Add Squid log processing to percollator.se courtesy of Adrian
-	Cockcroft of Sun Microsystems.
-
-	Rename the configure --with options.  If you want to watch NCSA
-	style access logs, use --with-ncsa-log.  To watch NCSA style
-	proxy access logs, use --with-proxy-log.  And to watch Squid
-	access log, use --with-squid-log.
+	* percollator.se now logs information on integral multiples of
+	  the interval.  This is useful for RRD which expects data to
+	  be measured on the interval.
+
+	* Fix a bug in percollator.se where it was inflating the
+	  httpops5 number since it was not calculating the actual time
+	  interval and instead assuming a 5 second interval.
+
+	* Add Squid log processing to percollator.se courtesy of
+	  Adrian Cockcroft of Sun Microsystems.
+
+	* Rename the configure --with options.  If you want to watch
+	  NCSA style access logs, use --with-ncsa-log.  To watch NCSA
+	  style proxy access logs, use --with-proxy-log.  And to watch
+	  Squid access log, use --with-squid-log.
 
 Wed Feb 17 17:37:35 PST 1999
 
-	Add rrdtool.gif to the GIF files that Orca creates and include
-	a HREF to rrdtool.gif in every HTML file that Orca generates.
+	* Add rrdtool.gif to the GIF files that Orca creates and
+	  include a HREF to rrdtool.gif in every HTML file that Orca
+	  generates.
 
 Tue Feb 16 10:49:07 PST 1999
 
-	Version 0.18.
+	* Version 0.18.
 
-	Minor fixes.
+	* Minor fixes.
 
-	Version 0.17.
+	* Version 0.17.
 
-	Group names are now sorted depending upon the format of the
-	group names.  For example, this now will list nfs13 after nfs5,
-	even though cmp will sort nfs13 before nfs5.
+	* Group names are now sorted depending upon the format of the
+	  group names.  For example, this now will list nfs13 after
+	  nfs5, even though cmp will sort nfs13 before nfs5.
 
-	Created GIFs now print the current measured value in addition
-	to the average measured value.
+	* Created GIFs now print the current measured value in
+	  addition to the average measured value.
 
-	percollator.cfg.in updated to shorten the http and inode with
-	page steals legends to have shorter legends so that RRDtool will
-	plot the whole comment along with the average and last value in
-	the GIF.
+	* percollator.cfg.in updated to shorten the http and inode
+	  with page steals legends to have shorter legends so that
+	  RRDtool will plot the whole comment along with the average
+	  and last value in the GIF.
 
 Mon Feb 15 12:29:18 PST 1999
 
-	Require RRDtool 0.99.11.
+	* Require RRDtool 0.99.11.
 
-	Add versioning information to the DS names created by Orca so new
-	versions of Orca can make older RRD files obsolete.  This feature
-	is now used to make sure that the current measurement using LAST
-	is stored in Orca's RRDs.
+	* Add versioning information to the DS names created by Orca
+	  so new versions of Orca can make older RRD files obsolete.
+	  This feature is now used to make sure that the current
+	  measurement using LAST is stored in Orca's RRDs.
 
 Fri Feb 12 15:10:05 PST 1999
 
-	Require RRDtool 0.99.10.
+	* Require RRDtool 0.99.10.
 
-	When creating a brand new RRD, create new RRAs for the current
-	value measured using the LAST DS type.
+	* When creating a brand new RRD, create new RRAs for the
+	  current value measured using the LAST DS type.
 
 Thu Feb 11 11:48:14 PST 1999
 
-	Require RRDtool 0.99.8.
+	* Require RRDtool 0.99.8.
 
 Thu Feb  4 12:51:54 PST 1999
 
-	Update the installation instructions for SE 3.1 beta.
+	* Update the installation instructions for SE 3.1 beta.
 
 Fri Jan 29 15:38:53 PST 1999
 
-	Require RRDtool 0.99.6.
+	* Require RRDtool 0.99.6.
 
 Thu Jan 28 15:44:07 PST 1999
 
-	If a file uses the first line as a column description and if
-	the following line does not have the same number of columns,
-	then warn and skip that line.
+	* If a file uses the first line as a column description and if
+	  the following line does not have the same number of columns,
+	  then warn and skip that line.
 
-	Require RRDtool 0.99.4.
+	* Require RRDtool 0.99.4.
 
 Tue Jan 26 15:28:26 PST 1999
 
-	Rename Orca::GIFFile::expire_string to
-	Orca::GIFFile::_expire_string.
+	* Rename Orca::GIFFile::expire_string to
+	  Orca::GIFFile::_expire_string.
 
-	Change the default location of the percollator RRDs to be
-	$prefix/var/orca/rrd/percollator instead of $prefix/var/orca/rrd.
+	* Change the default location of the percollator RRDs to be
+	  $prefix/var/orca/rrd/percollator instead of
+	  $prefix/var/orca/rrd.
 
-	Sort the order of RRD files being updated by the RRD's filename.
+	* Sort the order of RRD files being updated by the RRD's
+	  filename.
 
-	Do not make RRD_DIR/percollator
+	* Do not make RRD_DIR/percollator
 
-	Require RRDtool 0.99.2.
+	* Require RRDtool 0.99.2.
 
-	Remove sanity check on group update times that could cause
-	false dies.
+	* Remove sanity check on group update times that could cause
+	  false dies.
 
 Tue Jan 26 10:07:40 PST 1999
 
-	Version 0.16.
+	* Version 0.16.
 
-	Fix a bug in lib/Makefile.in where the variable $(CP) was used
-	but never defined.
+	* Fix a bug in lib/Makefile.in where the variable $(CP) was
+	  used but never defined.
 
-	Fix a bug where watch_data_sources() would do an extra loop each
-	time file updates were looked for.
+	* Fix a bug where watch_data_sources() would do an extra loop
+	  each time file updates were looked for.
 
 Mon Jan 25 15:25:12 PST 1999
 
-	Version 0.15.
+	* Version 0.15.
 
-	Update to use RRDtool 0.99.1.
+	* Update to use RRDtool 0.99.1.
 
-	Rename not_running to percol_running.
+	* Rename not_running to percol_running.
 
-	Update the URL to Tobias Oetiker's RRD web site.
+	* Update the URL to Tobias Oetiker's RRD web site.
 
-	Make sure lib/Makefile does not overwrite old
-	lib/percollator.cfg's when a make install is done.
+	* Make sure lib/Makefile does not overwrite old
+	  lib/percollator.cfg's when a make install is done.
 
 Fri Jan 22 20:17:56 PST 1999
 
-	Create an Orca logo and have the logo appear at the bottom of
-	each HTML file.  The logo is stored as hexadecimal inside the
-	Orca perl script.
+	* Create an Orca logo and have the logo appear at the bottom
+	  of each HTML file.  The logo is stored as hexadecimal inside
+	  the Orca perl script.
 
-	Update percollator.cfg.in to not contain bzajac at geostaff.com
-	any more.  Changed it to root at localhost.
+	* Update percollator.cfg.in to not contain bzajac at geostaff.com
+	  any more.  Changed it to root at localhost.
 
 Thu Jan 21 13:31:50 PST 1999
 
-	Add a configure script to Orca to make installation of Orca and
-	percollator much easier.
+	* Add a configure script to Orca to make installation of Orca
+	  and percollator much easier.
 
-	Add a new file env_percol to set up all the environmental
-	variables so that percollator runs correctly instead of having
-	to edit start_percol, stop_percol, and restart_percol.
+	* Add a new file env_percol to set up all the environmental
+	  variables so that percollator runs correctly instead of
+	  having to edit start_percol, stop_percol, and
+	  restart_percol.
 
 Mon Jan 11 16:58:28 PST 1999
 
-	Require MRTG version 0.04 minimum.  This corresponds to
-	mrtg-19990111.22.
+	* Require MRTG version 0.04 minimum.  This corresponds to
+	  mrtg-19990111.22.
 
 Wed Jan  6 09:47:44 PST 1999
 
-	Version 0.14.
+	* Version 0.14.
 
-	Change the program's name from FMRTG to Orca.
+	* Change the program's name from FMRTG to Orca.
 
-	Change all references of SMRTG to Cricket.
+	* Change all references of SMRTG to Cricket.
 
 Fri Dec 18 13:10:47 PST 1998
 
-	Change all occurances of MRTG in fmrtg to FMRTG.
+	* Change all occurances of MRTG in fmrtg to FMRTG.
 
 Thu Dec 10 16:47:20 PST 1998
 
-	Add percol_column to the list of programs in the percollator
-	directory.  This program makes it easy to read several columns of
-	data from a percollator.se output file instead of trying to look
-	at 1000 character lines that percollator.se generally outputs.
+	* Add percol_column to the list of programs in the percollator
+	  directory.  This program makes it easy to read several
+	  columns of data from a percollator.se output file instead of
+	  trying to look at 1000 character lines that percollator.se
+	  generally outputs.
 
 Thu Dec 10 12:50:19 PST 1998
 
-	Version 0.13.
+	* Version 0.13.
 
-	Found an extra loop in creating the HTML files.  They are now
-	created much faster.
+	* Found an extra loop in creating the HTML files.  They are
+	  now created much faster.
 
-	Add HREFs to the top of the HTML files showing plots from
-	different groups and different data types to make jumping
-	around easier.
+	* Add HREFs to the top of the HTML files showing plots from
+	  different groups and different data types to make jumping
+	  around easier.
 
-	Add more documentation to &create_html_files.
+	* Add more documentation to &create_html_files.
 
-	Add some documentation describing why Digest::MD5 is used.
+	* Add some documentation describing why Digest::MD5 is used.
 
 Wed Dec  9 13:35:07 PST 1998
 
-	Add more documentation to fmrtg and percollator about setting
-	up FMRTG and percollator.se to work together.
+	* Add more documentation to fmrtg and percollator about
+	  setting up FMRTG and percollator.se to work together.
 
 Wed Dec  9 09:55:01 PST 1998
 
-	Version 0.12.
+	* Version 0.12.
 
-	Correct incorrect URL for Digest::MD5 in fmrtg.
+	* Correct incorrect URL for Digest::MD5 in fmrtg.
 
 Tue Dec  8 12:12:07 PST 1998
 
-	Version 0.11.
+	* Version 0.11.
 
-	Update the sample FMRTG configuration files to work properly
-	with the configuration options in FMRTG.
+	* Update the sample FMRTG configuration files to work properly
+	  with the configuration options in FMRTG.
 
-	Switch from MD5 to Digest::MD5, since it is faster.
+	* Switch from MD5 to Digest::MD5, since it is faster.
 
-	Update the documentation to reflect the above changes.
+	* Update the documentation to reflect the above changes.
 
-	Update the code documentation in fmrtg for date_source.
+	* Update the code documentation in fmrtg for date_source.
 
-	Add some more documentation to the percollator/start_percol
-	script.
+	* Add some more documentation to the percollator/start_percol
+	  script.
 
 Fri Dec  4 14:34:13 PST 1998
 
-	Version 0.10.
+	* Version 0.10.

Modified: trunk/orca/NEWS
==============================================================================
--- trunk/orca/NEWS	(original)
+++ trunk/orca/NEWS	Sat Jul 13 21:25:47 2002
@@ -1,3 +1,184 @@
+NEW IN ORCA 0.27b1
+==================
+
+ 1) By default, now create an hourly plot that shows the last 1.5
+    hours of data.  Add a global "generate_hourly_plot" configuration
+    file parameter that when set to 0 turns this plot off.  Hourly
+    plot creation is disabled in orcallator.cfg.in since orcallator.se
+    by default measures the system every 5 minutes and the plots look
+    blocky.
+
+ 2) Fix the warning message in src/orca.pl.in
+
+      Use on uninitialized value in array element at (eval X) line 1,
+      <DATA> line Y
+
+    when Orca was run with Perl 5.6.0.  This bug was in the filename
+    sorting subroutine.
+
+    This problem is probably responsible for problems where there are
+    missing data from generated plots.  Since the filename sorting
+    subroutine tells Orca the order in which to load data into the RRD
+    files and the sorted filename list will have newer data files
+    listed before older data files, once newer data is entered into an
+    RRD file you cannot add older data, resulting in missing data in
+    the output plots.
+
+    If this is a problem, then the solution is to remove the RRD files
+    and rerun Orca with all of the input data files.
+
+ 3) Add a new command line option named -no-images which suppresses
+    image generation.  Remove the command line option -r which told
+    Orca to only update the RRD files and not generate HTML and image
+    files.  To replace -r functionality, use both -no-images and
+    -no-html command line options.
+
+ 4) Add a new command line option -no-html to instruct Orca to skip
+    generating HTML files.  Patch from Alex Howansky
+    <alex at wankwood.com>.
+
+ 5) Add a new command line option -logfile that specifies a filename
+    that STDOUT and STDERR are redirected to so that all messages,
+    warnings and errors are printed to the file.  Now when a SIGPIPE
+    is caught, messages will continue to be printed unless -logfile
+    was not given to Orca.  Patch supplied by Bruce Johnson
+    <Bruce.Johnson at PictureVision.com>.
+
+ 6) Add a new command line option -daemon that puts Orca in the
+    background or daemonizes it.  It is recommended that when this
+    command line option is used that -logfile is used.  Patch supplied
+    by Bruce Johnson <Bruce.Johnson at PictureVision.com>.
+
+ 7) A new contrib directory has been created which is where
+    contributed scripts and programs will be kept.  The first
+    submissions are:
+
+    a) Include the orcaservices package in the contrib directory which
+       was written by Carlos Canau <Carlos.Canau at KPNQwest.pt> and
+       documented by Jose Carlos <jcp at KPNQwest.pt>.  This package
+       allows monitoring of many different types of Unix services,
+       such as DNS, SMTP, POP, etc.
+
+    b) A script to rotate Orca's HTML directory so that the daily
+       plots can be archived.  It is named rotate_orca_graphs.
+
+ 8) Replace the small color scheme used for automatically cycling
+    through plot colors with a longer list designed by Guy Dallaire
+    <gdallair-nospam at criq.qc.ca>.
+
+ 9) To support configurations where it does not make sense to make all
+    of the hourly, daily, weekly, monthly, quarterly, and yearly
+    plots, i.e.  when only one measurement per day is made and having
+    a daily plot would not show anything, Orca now understands the
+    global configuration file options "generate_hourly_plot",
+    "generate_daily_plot", "generate_weekly_plot",
+    "generate_monthly_plot", "generate_quarterly_plot", and
+    "generate_yearly_plot".  When an argument value of 0 is given to
+    the parameter, the plot is not created.  If the particular
+    parameter is not used or the value is not 0, then the plot is
+    created.
+
+10) Add a new configuration file option for plots named
+    "summary_format" which specifies the format for the summary values
+    as passed to the RRDtool GPRINT function.  The same format is used
+    for each number within a single summary line, but you can specify
+    multiple "summary_format"'s options if there are multiple plots on
+    the graph.  The default value, which has not changed from previous
+    Orca versions, is '%9.3lf %S'.  Patch from Alex Howansky
+    <alex at wankwood.com>.
+
+11) Remove the "date_format" configuration option as it was never
+    supported.  This is replaced by a new "date_parse" configuration
+    file parameter which supports converting arbitrary strings in the
+    input source data files that somehow represent time into an Unix
+    epoch time usable by Orca.  The "date_parse" parameter appears in
+    a group field and is an arbitrary Perl subroutine that is given
+    two arguments, the first being the name of the file where the data
+    is loaded and the second the string from the "date_source" column
+    that contains some time information.  The subroutine should return
+    the Unix epoch time.  If this option is not specified, then Orca
+    assumes that the string holds the Unix epoch time.
+
+    This Perl subroutine is only used if the file's date source is not
+    specified to be the file's last modified time as indicated to Orca
+    by use of the "date_source" file_mtime configuration file option.
+
+12) Remove the "sub_dir" configuration file parameter and now always
+    create sub directories for RRD, image and HTML files.  This
+    removes the problem when a simple Orca configuration file was used
+    and Orca did not create subdirectories and then additional groups
+    where added to the configuration file Orca would begin to use
+    subdirectories and the existing RRD, image and HTML files would be
+    in the wrong location.  In this case, Orca would reload all of the
+    input data.
+
+13) Allow the "late_interval" configuration parameter to appear in a
+    configuration file group.  If it does not appear in a group
+    listing, then use the global "late_interval" value.
+
+14) Add a new configuration file option named "require" that allows
+    the configuration file to specify the minimum required version of
+    Orca.
+
+15) Orca now catches SIGPIPEs so the lock directory is properly
+    removed when Orca's STDOUT and/or STDERR is piped to a process,
+    such as less, and the piped to process exits before Orca does.
+
+16) Fix a bug where Orca's documentation stated that the configuration
+    file can specify different data_min, data_max, and data_type's for
+    each data in a plot but the code did not.  Make the modifications
+    in Orca to support this feature.
+
+17) When loading a configuration file, now do a complete check of it
+    for errors before quitting, instead of quitting after a single
+    error.
+
+18) Include and require the following package updates: Digest::MD5
+    2.13, RRDtool 1.0.33 and Storable 1.0.11.
+
+19) The email address blair at akamai.com that I used no longer works, as
+    I have left Akamai.  I can be reached at blair at gps.caltech.edu.
+
+    These following changes are what's new in orcallator.se 1.28 and
+    the orcallator.cfg file since version 1.23 which was included with
+    Orca 0.26.  All of the changes below are taken advantage of in the
+    included orcallator.cfg and start_orcallator files.
+
+20) When orcallator.se was running on a system with an older version
+    of SE the p_vmstat.scan variable is an integer and the sprintf to
+    %8.3f fails, resulting in a perceived scan rate of 0 pages per
+    second.  Now always add 0.0 to p_vmstat.scan to get a double.
+
+21) Fix a typo where nil was misspelled as nik.
+
+22) Make sure to check the return from stat() on the web server access
+    log in case the file is missing.  Use fstat() instead of stat()
+    when a file descriptor is available.
+
+23) Print the portion of time running in idle mode with some process
+    waiting for block I/O as wio% and otherwise completely idle time
+    as idle%.  Update orcallator.cfg.in to fix a bug in plotting the
+    CPU usage plots where the idle% time was calculated by subtracting
+    the user percent time usr% and the system percent time sys% from
+    100%.  This did not take into account the wait on IO time wio%
+    that the system measures and hence the idle% was overestimated.
+    Now plot the correct idle% and the wio%.
+
+24) Recoded measure_disk() to access the RAWDISK interface to
+    sys_kstat device information to allow the activity on Sun's A1000
+    and Clariion Raid controller drives to be seen.  Apparently the
+    pseudo drivers do not update the kstat interface.  It is also
+    inverts the fix provided by version 1.23 to avoid over-counting md
+    devices.  By suppressing stats from slices and metadevices and
+    instead reporting on full devices such as c0t0d0 or sd0.  Note:
+    This may have introduced an interaction with the live_rules.se
+    class monitoring of drive performance.  Prevent floppy disks and
+    tape drives from RAWDISK.  Added wio% to measure wait time since
+    the idle calculation is wrong without this.  Prevent filesystems
+    mounted under /snapshots from being seen.  Patch contributed by
+    Alan LeGrand <alegrand at wallace.com>.
+
+
 NEW IN ORCA 0.26
 ================
 
@@ -10,7 +191,7 @@
     exist and the first line of the file is used to tell Orca what
     columns of data there are.  Now Orca caches this information in
     the state file so that the source data files do no have to be
-    opened everytime Orca starts up.  This has a significant speed
+    opened every time Orca starts up.  This has a significant speed
     improvement when the file is compressed, since a separate process
     is normally spawned to read the file.
 
@@ -67,7 +248,7 @@
     types of NFS calls, such as getattr and lookup, are not included.
     Contributed by Paul Haldane <Paul.Haldane at newcastle.ac.uk>.  This
     code is enabled by the standard -DWATCH_OS or individually by
-    -DWATCH_NFS_SERVER.  The define -DWATCH_NFS has been supperseded
+    -DWATCH_NFS_SERVER.  The define -DWATCH_NFS has been superseded
     by -DWATCH_NFS_CLIENT, but to keep backwards compatibility,
     -DWATCH_NFS_CLIENT will be defined if -DWATCH_NFS is defined.
 
@@ -75,11 +256,12 @@
     physical disk was listed multiple times when it appeared in the
     same metadevice.  The solution to the problem is not to build the
     c0t0d0 name but use the long disk name provided by the long_name
-    string. Patch contributed by Paul Haldane
+    string.  Patch contributed by Paul Haldane
     <Paul.Haldane at newcastle.ac.uk>.
 
 14) Prevent core dumps on extremely long access log lines.
 
+
 NEW IN ORCA 0.25
 ================
 
@@ -105,9 +287,9 @@
  5) The previous default orcallator.cfg would not find compressed
     orcallator files.
 
- 6) Remove the plot configuration option `optional' which made plots
+ 6) Remove the plot configuration option "optional" which made plots
     optional.  Now make plots optional by default and use the keyword
-    `required' to make them required.  If a plot is required, then it
+    "required" to make them required.  If a plot is required, then it
     will always display, even if there is no data loaded for it.
 
  7) Change the behavior of warnings when data requested to be plotted
@@ -119,6 +301,7 @@
  8) Include Storable 0.6.7 but continue to only require Storable
     0.6.3.
 
+
 NEW IN ORCA 0.24
 ================
 
@@ -164,7 +347,7 @@
     view existing pages until the new page is completely finished.
 
 11) All generated HTML and image filenames are now created using a
-   different set of mappings.  Now
+    different set of mappings.  Now
       orcallator -> o
       orca       -> o
       _times_    -> _X_
@@ -258,6 +441,7 @@
 24) Restructure the code to handle different web server access log
     formats easier.
 
+
 NEW IN ORCA 0.23
 ================
 
@@ -265,6 +449,7 @@
     which where using old PERCOLLATOR_DIR variables instead of the new
     ORCALLATOR_DIR.
 
+
 NEW IN ORCA 0.22
 ================
 
@@ -292,14 +477,15 @@
  6) Added some more documentation to orcallator.cfg.
 
  7) Make Orca slightly faster.
- 
+
+
 NEW IN ORCA 0.21
 ================
 
  1) Every file containing the words percollator, percol and perc has
     been renamed to contain the word orcallator.  A new make target
     named migrate will change all filenames in an installed Orca
-    directory to the new names.  This `make migrate' should only be
+    directory to the new names.  This "make migrate" should only be
     run after killing any running percollator.se's and Orca processes
     and before installing this version of Orca.
 
@@ -346,9 +532,9 @@
     regular expressions.
 
 14) Change all references from
-    http://www.geocities.com/ResearchTriangle/Thinktank/4996/
+      http://www.geocities.com/ResearchTriangle/Thinktank/4996/
     to
-    http://www.geocities.com/~bzking/
+      http://www.geocities.com/~bzking/
 
 15) Speed up Orca by using Storable to do deep clones of objects
     instead of using Data::Dumper and eval.

Modified: trunk/orca/packages/Makefile.in
==============================================================================
--- trunk/orca/packages/Makefile.in	(original)
+++ trunk/orca/packages/Makefile.in	Sat Jul 13 21:25:47 2002
@@ -5,6 +5,7 @@
 
 compress_zlib_dir		= @COMPRESS_ZLIB_DIR@
 data_dumper_dir			= @DATA_DUMPER_DIR@
+date_parse_dir			= @DATE_PARSE_DIR@
 digest_md5_dir			= @DIGEST_MD5_DIR@
 math_interpolate_dir		= @MATH_INTERPOLATE_DIR@
 rrdtool_dir			= @RRDTOOL_DIR@
@@ -12,46 +13,51 @@
 
 MAKE_COMPRESS_ZLIB		= @MAKE_COMPRESS_ZLIB@
 MAKE_DATA_DUMPER		= @MAKE_DATA_DUMPER@
+MAKE_DATE_PARSE			= @MAKE_DATE_PARSE@
 MAKE_DIGEST_MD5			= @MAKE_DIGEST_MD5@
 MAKE_MATH_INTERPOLATE		= @MAKE_MATH_INTERPOLATE@
 MAKE_RRDTOOL			= @MAKE_RRDTOOL@
 MAKE_STORABLE			= @MAKE_STORABLE@
-MAKE_TARGETS			= $(MAKE_COMPRESS_ZLIB) $(MAKE_DATA_DUMPER) $(MAKE_DIGEST_MD5) $(MAKE_MATH_INTERPOLATE) $(MAKE_RRDTOOL) $(MAKE_STORABLE)
+MAKE_TARGETS			= $(MAKE_COMPRESS_ZLIB) $(MAKE_DATA_DUMPER) $(MAKE_DATE_PARSE) $(MAKE_DIGEST_MD5) $(MAKE_MATH_INTERPOLATE) $(MAKE_RRDTOOL) $(MAKE_STORABLE)
 
 TEST_COMPRESS_ZLIB		= @TEST_COMPRESS_ZLIB@
 TEST_DATA_DUMPER		= @TEST_DATA_DUMPER@
+TEST_DATE_PARSE			= @TEST_DATE_PARSE@
 TEST_DIGEST_MD5			= @TEST_DIGEST_MD5@
 TEST_MATH_INTERPOLATE		= @TEST_MATH_INTERPOLATE@
 TEST_RRDTOOL			= @TEST_RRDTOOL@
 TEST_STORABLE			= @TEST_STORABLE@
-TEST_TARGETS			= $(TEST_COMPRESS_ZLIB) $(TEST_DATA_DUMPER) $(TEST_DIGEST_MD5) $(TEST_MATH_INTERPOLATE) $(TEST_RRDTOOL) $(TEST_STORABLE)
+TEST_TARGETS			= $(TEST_COMPRESS_ZLIB) $(TEST_DATA_DUMPER) $(TEST_DATE_PARSE) $(TEST_DIGEST_MD5) $(TEST_MATH_INTERPOLATE) $(TEST_RRDTOOL) $(TEST_STORABLE)
 
 INSTALL_PERL_COMPRESS_ZLIB	= @INSTALL_PERL_COMPRESS_ZLIB@
 INSTALL_PERL_DATA_DUMPER	= @INSTALL_PERL_DATA_DUMPER@
+INSTALL_PERL_DATE_PARSE		= @INSTALL_PERL_DATE_PARSE@
 INSTALL_PERL_DIGEST_MD5		= @INSTALL_PERL_DIGEST_MD5@
 INSTALL_PERL_MATH_INTERPOLATE	= @INSTALL_PERL_MATH_INTERPOLATE@
 INSTALL_PERL_RRDTOOL		= @INSTALL_PERL_RRDTOOL@
 INSTALL_PERL_STORABLE		= @INSTALL_PERL_STORABLE@
-INSTALL_PERL_TARGETS		= $(INSTALL_PERL_COMPRESS_ZLIB) $(INSTALL_PERL_DATA_DUMPER) $(INSTALL_PERL_DIGEST_MD5) $(INSTALL_PERL_MATH_INTERPOLATE) $(INSTALL_PERL_RRDTOOL) $(INSTALL_PERL_STORABLE)
+INSTALL_PERL_TARGETS		= $(INSTALL_PERL_COMPRESS_ZLIB) $(INSTALL_PERL_DATA_DUMPER) $(INSTALL_PERL_DATE_PARSE) $(INSTALL_PERL_DIGEST_MD5) $(INSTALL_PERL_MATH_INTERPOLATE) $(INSTALL_PERL_RRDTOOL) $(INSTALL_PERL_STORABLE)
 
 INSTALL_LIB_RRDTOOL		= @INSTALL_LIB_RRDTOOL@
 INSTALL_LIB_TARGETS		= $(INSTALL_LIB_RRDTOOL)
 
 CLEAN_COMPRESS_ZLIB		= @CLEAN_COMPRESS_ZLIB@
 CLEAN_DATA_DUMPER		= @CLEAN_DATA_DUMPER@
+CLEAN_DATE_PARSE		= @CLEAN_DATE_PARSE@
 CLEAN_DIGEST_MD5		= @CLEAN_DIGEST_MD5@
 CLEAN_MATH_INTERPOLATE		= @CLEAN_MATH_INTERPOLATE@
 CLEAN_RRDTOOL			= @CLEAN_RRDTOOL@
 CLEAN_STORABLE			= @CLEAN_STORABLE@
-CLEAN_TARGETS			= $(CLEAN_COMPRESS_ZLIB) $(CLEAN_DIGEST_MD5) $(CLEAN_MATH_INTERPOLATE) $(CLEAN_RRDTOOL) $(CLEAN_STORABLE)
+CLEAN_TARGETS			= $(CLEAN_COMPRESS_ZLIB) $(CLEAN_DATA_DUMPER) $(CLEAN_DATE_PARSE) $(CLEAN_DIGEST_MD5) $(CLEAN_MATH_INTERPOLATE) $(CLEAN_RRDTOOL) $(CLEAN_STORABLE)
 
 DISTCLEAN_COMPRESS_ZLIB		= @DISTCLEAN_COMPRESS_ZLIB@
 DISTCLEAN_DATA_DUMPER		= @DISTCLEAN_DATA_DUMPER@
+DISTCLEAN_DATE_PARSE		= @DISTCLEAN_DATE_PARSE@
 DISTCLEAN_DIGEST_MD5		= @DISTCLEAN_DIGEST_MD5@
 DISTCLEAN_MATH_INTERPOLATE	= @DISTCLEAN_MATH_INTERPOLATE@
 DISTCLEAN_RRDTOOL		= @DISTCLEAN_RRDTOOL@
 DISTCLEAN_STORABLE		= @DISTCLEAN_STORABLE@
-DISTCLEAN_TARGETS		= $(DISTCLEAN_COMPRESS_ZLIB) $(DISTCLEAN_DATA_DUMPER) $(DISTCLEAN_DIGEST_MD5) $(DISTCLEAN_MATH_INTERPOLATE) $(DISTCLEAN_RRDTOOL) $(DISTCLEAN_STORABLE)
+DISTCLEAN_TARGETS		= $(DISTCLEAN_COMPRESS_ZLIB) $(DISTCLEAN_DATA_DUMPER) $(DISTCLEAN_DATE_PARSE) $(DISTCLEAN_DIGEST_MD5) $(DISTCLEAN_MATH_INTERPOLATE) $(DISTCLEAN_RRDTOOL) $(DISTCLEAN_STORABLE)
 
 all:	Makefile $(MAKE_TARGETS)
 
@@ -67,6 +73,12 @@
 $(data_dumper_dir)/Makefile: $(data_dumper_dir)/Makefile.PL $(PERL)
 	cd $(data_dumper_dir) && $(PERL) Makefile.PL
 
+make_date_parse: $(date_parse_dir)/Makefile
+	cd $(date_parse_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)"
+
+$(date_parse_dir)/Makefile: $(date_parse_dir)/Makefile.PL $(PERL)
+	cd $(date_parse_dir) && $(PERL) Makefile.PL
+
 make_digest_md5: $(digest_md5_dir)/Makefile
 	cd $(digest_md5_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)"
 
@@ -85,8 +97,11 @@
 make_rrdtool_zlib: $(rrdtool_dir)/Makefile $(PERL)
 	cd $(rrdtool_dir) && $(MAKE) CFLAGS="$(CFLAGS)" zlib-1.1.3/librrd_z.a
 
-$(rrdtool_dir)/Makefile: $(rrdtool_dir)/Makefile.in
-	cd .. && ./configure @CONFIGURE_COMMAND_LINE@
+$(rrdtool_dir)/Makefile: $(rrdtool_dir)/config.status $(rrdtool_dir)/Makefile.in
+	cd $(rrdtool_dir) && CONFIG_FILES=Makefile ./config.status
+
+$(rrdtool_dir)/config.status:
+	cd $(rrdtool_dir) && ./configure @RRD_CONFIGURE_COMMAND_LINE@
 
 make_storable: $(storable_dir)/Makefile
 	cd $(storable_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)"
@@ -104,6 +119,9 @@
 test_data_dumper: $(data_dumper_dir)/Makefile
 	cd $(data_dumper_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)" test
 
+test_date_parse: $(date_parse_dir)/Makefile
+	cd $(date_parse_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)" test
+
 test_digest_md5: $(digest_md5_dir)/Makefile
 	cd $(digest_md5_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)" test
 
@@ -129,6 +147,9 @@
 install_perl_data_dumper: $(data_dumper_dir)/Makefile
 	cd $(data_dumper_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)" install
 
+install_perl_date_parse: $(date_parse_dir)/Makefile
+	cd $(date_parse_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)" install
+
 install_perl_digest_md5: $(digest_md5_dir)/Makefile
 	cd $(digest_md5_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)" install
 
@@ -148,7 +169,19 @@
 		echo 'cd $(compress_zlib_dir) && $(MAKE) clean';	\
 		(cd $(compress_zlib_dir) && $(MAKE) clean);		\
 	fi
-	
+
+clean_data_dumper:
+	@if test -r $(data_dumper_dir)/Makefile; then 			\
+		echo 'cd $(data_dumper_dir) && $(MAKE) clean';		\
+		(cd $(data_dumper_dir) && $(MAKE) clean);		\
+	fi
+
+clean_date_parse:
+	@if test -r $(date_parse_dir)/Makefile; then 			\
+		echo 'cd $(date_parse_dir) && $(MAKE) clean';		\
+		(cd $(date_parse_dir) && $(MAKE) clean);		\
+	fi
+
 clean_digest_md5:
 	@if test -r $(digest_md5_dir)/Makefile; then 			\
 		echo 'cd $(digest_md5_dir) && $(MAKE) clean';		\
@@ -175,6 +208,10 @@
 
 distclean_compress_zlib:	clean_compress_zlib
 
+distclean_data_dumper:		clean_data_dumper
+
+distclean_date_parse:		clean_date_parse
+
 distclean_digest_md5:		clean_digest_md5
 
 distclean_math_interpolate:	clean_math_interpolate
@@ -186,4 +223,3 @@
 
 Makefile: Makefile.in
 	cd .. && CONFIG_FILES=packages/Makefile ./config.status
-	$(MAKE)

Modified: trunk/orca/packages/Digest-MD5-2.13/MD5.pm
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.13/MD5.pm	(original)
+++ trunk/orca/packages/Digest-MD5-2.13/MD5.pm	Sat Jul 13 21:25:47 2002
@@ -3,7 +3,7 @@
 use strict;
 use vars qw($VERSION @ISA @EXPORT_OK);
 
-$VERSION = '2.09';  # $Date: 1999/08/05 23:24:05 $
+$VERSION = '2.13';  # $Date: 2001/03/14 05:50:15 $
 
 require Exporter;
 *import = \&Exporter::import;
@@ -11,9 +11,20 @@
 
 require DynaLoader;
 @ISA=qw(DynaLoader);
-Digest::MD5->bootstrap($VERSION);
 
-*reset = \&new;
+eval {
+    Digest::MD5->bootstrap($VERSION);
+};
+if ($@) {
+    # Try to load the pure perl version
+    require Digest::Perl::MD5;
+
+    Digest::Perl::MD5->import(qw(md5 md5_hex md5_base64));
+    push(@ISA, "Digest::Perl::MD5");  # make OO interface work
+}
+else {
+    *reset = \&new;
+}
 
 1;
 __END__
@@ -30,7 +41,6 @@
  $digest = md5($data);
  $digest = md5_hex($data);
  $digest = md5_base64($data);
-    
 
  # OO style
  use Digest::MD5;
@@ -111,6 +121,9 @@
 message we calculate the digest for.  The return value is the $md5
 object itself.
 
+In most cases you want to make sure that the $io_handle is set up to
+be in binmode().
+
 =item $md5->digest
 
 Return the binary digest for the message.
@@ -202,7 +215,7 @@
 This library is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.
 
- Copyright 1998-1999 Gisle Aas.
+ Copyright 1998-2000 Gisle Aas.
  Copyright 1995-1996 Neil Winton.
  Copyright 1991-1992 RSA Data Security, Inc.
 
@@ -246,6 +259,6 @@
 The original MD5 interface was written by Neil Winton
 (C<N.Winton at axion.bt.co.uk>).
 
-This release was made by Gisle Aas <gisle at aas.no>
+This release was made by Gisle Aas <gisle at ActiveState.com>
 
 =cut

Modified: trunk/orca/packages/Digest-MD5-2.13/t/files.t
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.13/t/files.t	(original)
+++ trunk/orca/packages/Digest-MD5-2.13/t/files.t	Sat Jul 13 21:25:48 2002
@@ -7,10 +7,10 @@
 # This is the output of: 'md5sum Changes README MD5.pm MD5.xs rfc1321.txt'
 #
 my $EXPECT = <<EOT;
-b9071b32f32f43369a924eccf577d9c3  Changes
-95b8301e390d5a12ea5a544e9dfa89a0  README
-59a47ddf31ab471af4e4ab644fde3338  MD5.pm
-709a74b880357389287af3c9936f97a4  MD5.xs
+832bac36f489f93a3d6dadd20d55b105  Changes
+e2447354c8b24340bc49e38f8d00bf3b  README
+dcc1f89cf6144d81e5f9d291d9849ef1  MD5.pm
+61debd0ec12e131e1ba220e2f3ad2d26  MD5.xs
 754b9db19f79dbc4992f7166eb0f37ce  rfc1321.txt
 EOT
 

Deleted: trunk/orca/packages/Digest-MD5-2.13/t/digest.t

Deleted: trunk/orca/packages/Digest-MD5-2.13/t/rfc2202.t

Deleted: trunk/orca/packages/Digest-MD5-2.13/t/md5.t

Modified: trunk/orca/packages/Digest-MD5-2.13/MANIFEST
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.13/MANIFEST	(original)
+++ trunk/orca/packages/Digest-MD5-2.13/MANIFEST	Sat Jul 13 21:25:48 2002
@@ -1,41 +1,13 @@
 README			Guess what?
 MANIFEST		This file
-MD2/MD2.pm		Digest::MD2 Perl Module
-MD2/MD2.xs		MD2 XS implementation
-MD2/Makefile.PL		Perl Makefile builder
-MD2/rfc1319.txt		The MD2 Message-Digest Algorithm
-MD2/t/badfile.t         Try addfile() on unopened file
-MD2/t/md2.t		Test if Digest::MD2 works
-MD2/typemap		Supplementary typemap
 MD5.pm			Digest::MD5 Perl Module
 hints/dec_osf.pl	Workaround for DEC compiler bug
 hints/irix_6.pl		Workaround for IRIX compiler bug
-lib/MD5.pm		MD5 backwards compatibility stuff
-lib/Digest.pm		Loading frontend
-lib/Digest/HMAC.pm      HMAC implementation
-lib/Digest/HMAC_MD5.pm  HMAC using MD5
-lib/Digest/HMAC_SHA1.pm HMAC using SHA-1
 MD5.xs			MD5 Perl 'XS' source file
 typemap			Supplementary typemap
 Makefile.PL		Perl Makefile builder
-SHA1/Makefile.PL	Perl Makefile builder
-SHA1/SHA1.pm		Digest::SHA1 module
-SHA1/SHA1.xs		SHA-1 XS implementation
-SHA1/fip180-1.gif       SHA-1 specification illustration
-SHA1/fip180-1.html      SHA-1 specification
-SHA1/lib/SHA.pm		SHA backwards compatibility stuff
-SHA1/t/badfile.t        Try addfile() on unopened file
-SHA1/t/sha.t		Uwe's old test
-SHA1/t/sha1.t		Test if Digest::SHA1 works
-SHA1/typemap		Supplementary typemap
 rfc1321.txt		The MD5 Message-Digest Algorithm
-rfc2104.txt		HMAC: Keyed-Hashing for Message Authentication
 t/badfile.t             Try addfile() on unopened file
-t/digest.t		Test Digest.pm loader
 t/files.t		Check a few files.
-t/md5.t			Test suite using standard Perl conventions
 t/md5-aaa.t		Exercise padding code
-t/rfc2202.t		Test Cases for HMAC-MD5 and HMAC-SHA-1
 Changes			Version history
-examples/mddriver.pl	Example driver script after mddriver.c in RFC 1321
-examples/twdigest.pl	Example code to format a digest like Tripwire

Modified: trunk/orca/packages/Digest-MD5-2.13/Changes
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.13/Changes	(original)
+++ trunk/orca/packages/Digest-MD5-2.13/Changes	Sat Jul 13 21:25:48 2002
@@ -1,3 +1,42 @@
+2001-03-13   Gisle Aas <gisle at ActiveState.com>
+
+   Release 2.13
+
+   Moved all other Digest:: modules out of the Digest-MD5 dist.
+
+
+
+2000-09-18   Gisle Aas <gisle at ActiveState.com>
+
+   Release 2.12
+
+   Avoid pointer cast warning for machines with bigger ints
+   than pointers.  Patch by Robin Barker <rmb1 at cise.npl.co.uk>.
+
+
+
+2000-08-19   Gisle Aas <gisle at ActiveState.com>
+
+   Release 2.11
+   
+   The fallback code introduced in 2.10 did only work for
+   perl-5.6.0.  It should now for for perl5.004 and 5.005
+   as well.  Patch by Ville Skyttä <ville at office.popsystems.com>.
+
+
+
+2000-08-18   Gisle Aas <gisle at ActiveState.com>
+
+   Release 2.10
+
+   Digest::MD5 will now try to fallback to the pure perl
+   implementation of Digest::Perl::MD5 if bootstrap fails.
+
+   Added a bit internal paranoia about casting the IV
+   in the Digest::MD5 object to the MD5_CTX* pointer.
+
+
+
 1999-08-06   Gisle Aas <gisle at aas.no>
 
    Release 2.09

Modified: trunk/orca/packages/Digest-MD5-2.13/README
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.13/README	(original)
+++ trunk/orca/packages/Digest-MD5-2.13/README	Sat Jul 13 21:25:48 2002
@@ -1,25 +1,12 @@
-Digest::*
----------
+The Digest::MD5 module allows you to use the RSA Data Security
+Inc. MD5 Message Digest algorithm from within Perl programs.  The
+algorithm takes as input a message of arbitrary length and produces as
+output a 128-bit "fingerprint" or "message digest" of the input.
+MD5 is described in RFC 1321.
 
-This package contains Perl extension interfaces for the following
-message digest algorithms:
+You will need perl version 5.004 or better to install this module.
 
-  - RSA Data Security Inc. MD5   (RFC 1321)
-  - RSA Data Security Inc. MD2   (RFC 1319)
-  - NIST SHA-1                   (FIPS PUB 180-1)
-
-Modules to calculate HMAC (RFC 2104) digests are also provided.
-
-To build the extensions, unpack this distribution somewhere, create
-the Makefile by running 'perl Makefile.PL' and do a 'make', 'make
-test', and if successful 'make install'.
-
-You will need perl version 5.004 or better to install these modules.
-Further documentation is embedded in the individual modules.
-
-Copyright 1998-1999 Gisle Aas.
-Copyright 1998 Graham Barr.
-Copyright 1997 Uwe Hollerbach.
+Copyright 1998-2001 Gisle Aas.
 Copyright 1995-1996 Neil Winton.
 Copyright 1990-1992 RSA Data Security, Inc.
 

Modified: trunk/orca/packages/Digest-MD5-2.13/MD5.xs
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.13/MD5.xs	(original)
+++ trunk/orca/packages/Digest-MD5-2.13/MD5.xs	Sat Jul 13 21:25:48 2002
@@ -1,10 +1,10 @@
-/* $Id: MD5.xs,v 1.24 1999/07/28 10:38:50 gisle Exp $ */
+/* $Id: MD5.xs,v 1.26 2000/09/18 14:27:44 gisle Exp $ */
 
 /* 
  * This library is free software; you can redistribute it and/or
  * modify it under the same terms as Perl itself.
  * 
- *  Copyright 1998 Gisle Aas.
+ *  Copyright 1998-2000 Gisle Aas.
  *  Copyright 1995-1996 Neil Winton.
  *  Copyright 1991-1992 RSA Data Security, Inc.
  *
@@ -92,10 +92,12 @@
                         ((U32)(*(s+3)) << 24))
 #endif
 
+#define MD5_CTX_SIGNATURE 200003165
 
 /* This stucture keeps the current state of algorithm.
  */
 typedef struct {
+  U32 signature;   /* safer cast in get_md5_ctx() */
   U32 A, B, C, D;  /* current digest */
   U32 bytes_low;   /* counts bytes in message */
   U32 bytes_high;  /* turn it into a 64-bit counter */
@@ -415,11 +417,21 @@
 #endif
 }
 
+#ifndef INT2PTR
+#define INT2PTR(any,d)	(any)(d)
+#endif
 
 static MD5_CTX* get_md5_ctx(SV* sv)
 {
-    if (sv_derived_from(sv, "Digest::MD5"))
-	return (MD5_CTX*)SvIV(SvRV(sv));
+    if (SvROK(sv)) {
+	sv = SvRV(sv);
+	if (SvIOK(sv)) {
+	    MD5_CTX* ctx = INT2PTR(MD5_CTX*, SvIV(sv));
+	    if (ctx && ctx->signature == MD5_CTX_SIGNATURE) {
+		return ctx;
+            }
+        }
+    }
     croak("Not a reference to a Digest::MD5 object");
     return (MD5_CTX*)0; /* some compilers insist on a return value */
 }
@@ -515,6 +527,7 @@
 	    STRLEN my_na;
 	    char *sclass = SvPV(xclass, my_na);
 	    New(55, context, 1, MD5_CTX);
+	    context->signature = MD5_CTX_SIGNATURE;
 	    ST(0) = sv_newmortal();
 	    sv_setref_pv(ST(0), sclass, (void*)context);
 	    SvREADONLY_on(SvRV(ST(0)));

Deleted: trunk/orca/packages/Digest-MD5-2.13/rfc2104.txt

Added: trunk/orca/packages/Time-HiRes-01.20/HiRes.xs
==============================================================================
--- trunk/orca/packages/Time-HiRes-01.20/HiRes.xs	(original)
+++ trunk/orca/packages/Time-HiRes-01.20/HiRes.xs	Sat Jul 13 21:25:49 2002
@@ -0,0 +1,297 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#ifdef WIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#if !defined(HAS_GETTIMEOFDAY) && defined(WIN32)
+#define HAS_GETTIMEOFDAY
+
+/* shows up in winsock.h?
+struct timeval {
+ long tv_sec;
+ long tv_usec;
+}
+*/
+
+int
+gettimeofday (struct timeval *tp, int nothing)
+{
+ SYSTEMTIME st;
+ time_t tt;
+ struct tm tmtm;
+ /* mktime converts local to UTC */
+ GetLocalTime (&st);
+ tmtm.tm_sec = st.wSecond;
+ tmtm.tm_min = st.wMinute;
+ tmtm.tm_hour = st.wHour;
+ tmtm.tm_mday = st.wDay;
+ tmtm.tm_mon = st.wMonth - 1;
+ tmtm.tm_year = st.wYear - 1900;
+ tmtm.tm_isdst = -1;
+ tt = mktime (&tmtm);
+ tp->tv_sec = tt;
+ tp->tv_usec = st.wMilliseconds * 1000;
+ return 0;
+}
+#endif
+
+#if !defined(HAS_GETTIMEOFDAY) && defined(VMS)
+#define HAS_GETTIMEOFDAY
+
+#include <time.h> /* gettimeofday */
+#include <stdlib.h> /* qdiv */
+#include <starlet.h> /* sys$gettim */
+#include <descrip.h>
+
+/*
+        VMS binary time is expressed in 100 nano-seconds since
+        system base time which is 17-NOV-1858 00:00:00.00
+*/
+
+#define DIV_100NS_TO_SECS  10000000L
+#define DIV_100NS_TO_USECS 10L
+
+/* 
+        gettimeofday is supposed to return times since the epoch
+        so need to determine this in terms of VMS base time
+*/
+static $DESCRIPTOR(dscepoch,"01-JAN-1970 00:00:00.00");
+
+static __int64 base_adjust=0;
+
+int
+gettimeofday (struct timeval *tp, void *tpz)
+{
+ long ret;
+ __int64 quad;
+ __qdiv_t ans1,ans2;
+
+/*
+        In case of error, tv_usec = 0 and tv_sec = VMS condition code.
+        The return from function is also set to -1.
+        This is not exactly as per the manual page.
+*/
+
+ tp->tv_usec = 0;
+
+ if (base_adjust==0) { /* Need to determine epoch adjustment */
+        ret=sys$bintim(&dscepoch,&base_adjust);
+        if (1 != (ret &&1)) {
+                tp->tv_sec = ret;
+                return -1;
+        }
+ }
+
+ ret=sys$gettim(&quad); /* Get VMS system time */
+ if ((1 && ret) == 1) {
+        quad -= base_adjust; /* convert to epoch offset */
+        ans1=qdiv(quad,DIV_100NS_TO_SECS);
+        ans2=qdiv(ans1.rem,DIV_100NS_TO_USECS);
+        tp->tv_sec = ans1.quot; /* Whole seconds */
+        tp->tv_usec = ans2.quot; /* Micro-seconds */
+ } else {
+        tp->tv_sec = ret;
+        return -1;
+ }
+ return 0;
+}
+#endif
+
+#if !defined(HAS_USLEEP) && defined(HAS_SELECT)
+#ifndef SELECT_IS_BROKEN
+#define HAS_USLEEP
+#define usleep hrt_usleep  /* could conflict with ncurses for static build */
+
+void
+hrt_usleep(unsigned long usec)
+{
+    struct timeval tv;
+    tv.tv_sec = 0;
+    tv.tv_usec = usec;
+    select(0, (Select_fd_set_t)NULL, (Select_fd_set_t)NULL,
+		(Select_fd_set_t)NULL, &tv);
+}
+#endif
+#endif
+
+#if !defined(HAS_USLEEP) && defined(WIN32)
+#define HAS_USLEEP
+#define usleep hrt_usleep  /* could conflict with ncurses for static build */
+
+void
+hrt_usleep(unsigned long usec)
+{
+    long msec;
+    msec = usec / 1000;
+    Sleep (msec);
+}
+#endif
+
+
+#if !defined(HAS_UALARM) && defined(HAS_SETITIMER)
+#define HAS_UALARM
+#define ualarm hrt_ualarm  /* could conflict with ncurses for static build */
+
+int
+hrt_ualarm(int usec, int interval)
+{
+   struct itimerval itv;
+   itv.it_value.tv_sec = usec / 1000000;
+   itv.it_value.tv_usec = usec % 1000000;
+   itv.it_interval.tv_sec = interval / 1000000;
+   itv.it_interval.tv_usec = interval % 1000000;
+   return setitimer(ITIMER_REAL, &itv, 0);
+}
+#endif
+
+#ifdef ATLEASTFIVEOHOHFIVE
+#ifdef HAS_GETTIMEOFDAY
+
+static void
+myU2time(UV *ret)
+{
+  struct timeval Tp;
+  int status;
+  status = gettimeofday (&Tp, NULL);
+  ret[0] = Tp.tv_sec;
+  ret[1] = Tp.tv_usec;
+}
+
+static double
+myNVtime()
+{
+  struct timeval Tp;
+  int status;
+  status = gettimeofday (&Tp, NULL);
+  return Tp.tv_sec + (Tp.tv_usec / 1000000.);
+}
+
+#endif
+#endif
+
+MODULE = Time::HiRes            PACKAGE = Time::HiRes
+
+PROTOTYPES: ENABLE
+
+BOOT:
+#ifdef ATLEASTFIVEOHOHFIVE
+#ifdef HAS_GETTIMEOFDAY
+  hv_store(PL_modglobal, "Time::NVtime", 12, newSViv((IV) myNVtime), 0);
+  hv_store(PL_modglobal, "Time::U2time", 12, newSViv((IV) myU2time), 0);
+#endif
+#endif
+
+#ifdef HAS_USLEEP
+
+void
+usleep(useconds)
+        int useconds 
+
+void
+sleep(fseconds)
+        double fseconds 
+	CODE:
+	int useconds = fseconds * 1000000;
+	usleep (useconds);
+
+#endif
+
+#ifdef HAS_UALARM
+
+int
+ualarm(useconds,interval=0)
+	int useconds
+	int interval
+
+int
+alarm(fseconds,finterval=0)
+	double fseconds
+	double finterval
+	PREINIT:
+	int useconds, uinterval;
+	CODE:
+	useconds = fseconds * 1000000;
+	uinterval = finterval * 1000000;
+	RETVAL = ualarm (useconds, uinterval);
+
+#endif
+
+#ifdef HAS_GETTIMEOFDAY
+
+void
+gettimeofday()
+        PREINIT:
+        struct timeval Tp;
+        PPCODE:
+	int status;
+        status = gettimeofday (&Tp, NULL);
+        if (GIMME == G_ARRAY) {
+	     EXTEND(sp, 2);
+             PUSHs(sv_2mortal(newSViv(Tp.tv_sec)));
+             PUSHs(sv_2mortal(newSViv(Tp.tv_usec)));
+        } else {
+             EXTEND(sp, 1);
+             PUSHs(sv_2mortal(newSVnv(Tp.tv_sec + (Tp.tv_usec / 1000000.0))));
+        }
+
+double
+time()
+        PREINIT:
+        struct timeval Tp;
+        CODE:
+	int status;
+        status = gettimeofday (&Tp, NULL);
+        RETVAL = Tp.tv_sec + (Tp.tv_usec / 1000000.);
+	OUTPUT:
+	RETVAL
+
+#endif
+
+# $Id: HiRes.xs,v 1.11 1999/03/16 02:27:38 wegscd Exp wegscd $
+
+# $Log: HiRes.xs,v $
+# Revision 1.11  1999/03/16 02:27:38  wegscd
+# Add U2time, NVtime. Fix symbols for static link.
+#
+# Revision 1.10  1998/09/30 02:36:25  wegscd
+# Add VMS changes.
+#
+# Revision 1.9  1998/07/07 02:42:06  wegscd
+# Win32 usleep()
+#
+# Revision 1.8  1998/07/02 01:47:26  wegscd
+# Add Win32 code for gettimeofday.
+#
+# Revision 1.7  1997/11/13 02:08:12  wegscd
+# Add missing EXTEND in gettimeofday() scalar code.
+#
+# Revision 1.6  1997/11/11 02:32:35  wegscd
+# Do something useful when calling gettimeofday() in a scalar context.
+# The patch is courtesy of Gisle Aas.
+#
+# Revision 1.5  1997/11/06 03:10:47  wegscd
+# Fake ualarm() if we have setitimer.
+#
+# Revision 1.4  1997/11/05 05:41:23  wegscd
+# Turn prototypes ON (suggested by Gisle Aas)
+#
+# Revision 1.3  1997/10/13 20:56:15  wegscd
+# Add PROTOTYPES: DISABLE
+#
+# Revision 1.2  1997/05/23 01:01:38  wegscd
+# Conditional compilation, depending on what the OS gives us.
+#
+# Revision 1.1  1996/09/03 18:26:35  wegscd
+# Initial revision
+#
+#

Added: trunk/orca/packages/Time-HiRes-01.20/t/01test.t
==============================================================================
--- trunk/orca/packages/Time-HiRes-01.20/t/01test.t	(original)
+++ trunk/orca/packages/Time-HiRes-01.20/t/01test.t	Sat Jul 13 21:25:49 2002
@@ -0,0 +1,140 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1; print "1..14\n"; }
+END {print "not ok 1\n" unless $loaded;}
+use Time::HiRes qw(tv_interval);
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+
+use strict;
+
+my $have_gettimeofday	= defined &Time::HiRes::gettimeofday;
+my $have_usleep		= defined &Time::HiRes::usleep;
+my $have_ualarm		= defined &Time::HiRes::ualarm;
+
+import Time::HiRes 'gettimeofday'	if $have_gettimeofday;
+import Time::HiRes 'usleep'		if $have_usleep;
+import Time::HiRes 'ualarm'		if $have_ualarm;
+
+sub skip {
+    map { print "ok $_ (skipped)\n" } @_;
+}
+
+sub ok {
+    my ($n, $result, @info) = @_;
+    if ($result) {
+    	print "ok $n\n";
+    }
+    else {
+	print "not ok $n\n";
+    	print "# @info\n" if @info;
+    }
+}
+
+if (!$have_gettimeofday) {
+    skip 2..6;
+}
+else {
+    my @one = gettimeofday();
+    ok 2, @one == 2, 'gettimeofday returned ', 0+ at one, ' args';
+    ok 3, $one[0] > 850_000_000, "@one too small";
+
+    sleep 1;
+
+    my @two = gettimeofday();
+    ok 4, ($two[0] > $one[0] || ($two[0] == $one[0] && $two[1] > $one[1])),
+    	    "@two is not greater than @one";
+
+    my $f = Time::HiRes::time;
+    ok 5, $f > 850_000_000, "$f too small";
+    ok 6, $f - $two[0] < 2, "$f - @two >= 2";
+}
+
+if (!$have_usleep) {
+    skip 7..8;
+}
+else {
+    my $one = time;
+    usleep(10_000);
+    my $two = time;
+    usleep(10_000);
+    my $three = time;
+    ok 7, $one == $two || $two == $three, "slept too long, $one $two $three";
+
+    if (!$have_gettimeofday) {
+    	skip 8;
+    }
+    else {
+    	my $f = Time::HiRes::time;
+	usleep(500_000);
+        my $f2 = Time::HiRes::time;
+	my $d = $f2 - $f;
+	ok 8, $d > 0.4 && $d < 0.8, "slept $d secs $f to $f2";
+    }
+}
+
+# Two-arg tv_interval() is always available.
+{
+    my $f = tv_interval [5, 100_000], [10, 500_000];
+    ok 9, $f == 5.4, $f;
+}
+
+if (!$have_gettimeofday) {
+    skip 10;
+}
+else {
+    my $r = [gettimeofday()];
+    my $f = tv_interval $r;
+    ok 10, $f < 2, $f;
+}
+
+if (!$have_usleep) {
+    skip 11;
+}
+else {
+    my $r = [gettimeofday()];
+    #jTime::HiRes::sleep 0.5;
+    Time::HiRes::sleep( 0.5 );
+    my $f = tv_interval $r;
+    ok 11, $f > 0.4 && $f < 0.8, "slept $f secs";
+}
+
+if (!$have_ualarm) {
+    skip 12..13;
+}
+else {
+    my $tick = 0;
+    local $SIG{ALRM} = sub { $tick++ };
+
+    my $one = time; $tick = 0; ualarm(10_000); sleep until $tick;
+    my $two = time; $tick = 0; ualarm(10_000); sleep until $tick;
+    my $three = time;
+    ok 12, $one == $two || $two == $three, "slept too long, $one $two $three";
+
+    $tick = 0;
+    ualarm(10_000, 10_000);
+    sleep until $tick >= 3;
+    ok 13, 1;
+    ualarm(0);
+}
+
+# new test: did we even get close?
+
+{
+ my $t = time();
+ my $tf = Time::HiRes::time();
+ ok 14, ($tf >= $t) && (($tf - $t) <= 1),
+  "time $t differs from Time::HiRes::time $tf";
+}

Added: trunk/orca/packages/Time-HiRes-01.20/t/02export.t
==============================================================================
--- trunk/orca/packages/Time-HiRes-01.20/t/02export.t	(original)
+++ trunk/orca/packages/Time-HiRes-01.20/t/02export.t	Sat Jul 13 21:25:49 2002
@@ -0,0 +1,58 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+BEGIN {
+    require Time::HiRes;
+    unless (defined &Time::HiRes::gettimeofday
+	    && defined &Time::HiRes::ualarm
+	    && defined &Time::HiRes::usleep) {
+    	print "1..0\n";
+	exit;
+    }
+}
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1; print "1..4\n"; }
+END {print "not ok 1\n" unless $loaded;}
+
+$Exporter::Verbose=1;
+use Time::HiRes qw (time alarm sleep);
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+
+print "time...";
+$f = time; 
+print "$f\nok 2\n";
+
+print "sleep...";
+$r = [Time::HiRes::gettimeofday];
+sleep (0.5);
+print Time::HiRes::tv_interval($r), "\nok 3\n";
+
+$r = [Time::HiRes::gettimeofday];
+$i = 5;
+$SIG{ALRM} = "tick";
+while ($i)
+ {
+  alarm(2.5);
+  select (undef, undef, undef, 10);
+  print "Select returned! ", Time::HiRes::tv_interval ($r), "\n";
+ }
+
+sub tick
+ {
+  print "Tick! ", Time::HiRes::tv_interval ($r), "\n";
+  $i--;
+ }
+$SIG{ALRM} = 'DEFAULT';
+print "ok 4\n";

Added: trunk/orca/packages/Time-HiRes-01.20/TODO
==============================================================================
--- trunk/orca/packages/Time-HiRes-01.20/TODO	(original)
+++ trunk/orca/packages/Time-HiRes-01.20/TODO	Sat Jul 13 21:25:49 2002
@@ -0,0 +1,3 @@
+Version 1.16
+
+... nothing right now ...

Added: trunk/orca/packages/Time-HiRes-01.20/HiRes.pm
==============================================================================
--- trunk/orca/packages/Time-HiRes-01.20/HiRes.pm	(original)
+++ trunk/orca/packages/Time-HiRes-01.20/HiRes.pm	Sat Jul 13 21:25:49 2002
@@ -0,0 +1,255 @@
+package Time::HiRes;
+
+use strict;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK @EXPORT_FAIL);
+
+require Exporter;
+require DynaLoader;
+
+ at ISA = qw(Exporter DynaLoader);
+
+ at EXPORT = qw( );
+ at EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval);
+
+$VERSION = do{my at r=q$Revision: 1.20 $=~/\d+/g;sprintf '%02d.'.'%02d'x$#r, at r};
+
+bootstrap Time::HiRes $VERSION;
+
+ at EXPORT_FAIL = grep { ! defined &$_ } @EXPORT_OK;
+
+# Preloaded methods go here.
+
+sub tv_interval {
+    # probably could have been done in C
+    my ($a, $b) = @_;
+    $b = [gettimeofday()] unless defined($b);
+    (${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000);
+}
+
+# I'm only supplying this because the version of it in 5.003's Export.pm
+# is buggy (it doesn't shift off the class name).
+
+sub export_fail {
+    my $self = shift;
+    @_;
+}
+
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+1;
+__END__
+
+=head1 NAME
+
+Time::HiRes - High resolution ualarm, usleep, and gettimeofday
+
+=head1 SYNOPSIS
+
+  use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
+
+  usleep ($microseconds);
+
+  ualarm ($microseconds);
+  ualarm ($microseconds, $interval_microseconds);
+
+  $t0 = [gettimeofday];
+  ($seconds, $microseconds) = gettimeofday;
+
+  $elapsed = tv_interval ( $t0, [$seconds, $microseconds]);
+  $elapsed = tv_interval ( $t0, [gettimeofday]);
+  $elapsed = tv_interval ( $t0 );
+
+  use Time::HiRes qw ( time alarm sleep );
+  $now_fractions = time;
+  sleep ($floating_seconds);
+  alarm ($floating_seconds);
+  alarm ($floating_seconds, $floating_interval);
+
+=head1 DESCRIPTION
+
+The C<Time::HiRes> module implements a Perl interface to the usleep, ualarm,
+and gettimeofday system calls. See the EXAMPLES section below and the test
+scripts for usage; see your system documentation for the description of
+the underlying gettimeofday, usleep, and ualarm calls.
+
+If your system lacks gettimeofday(2) you don't get gettimeofday() or the
+one-arg form of tv_interval().  If you don't have usleep(3) or select(2)
+you don't get usleep() or sleep().  If your system don't have ualarm(3)
+or setitimer(2) you don't
+get ualarm() or alarm().  If you try to import an unimplemented function
+in the C<use> statement it will fail at compile time.
+
+The following functions can be imported from this module.  No
+functions are exported by default.
+
+=over 4
+
+=item gettimeofday ()
+
+In array context it returns a 2 element array with the seconds and
+microseconds since the epoch.  In scalar context it returns floating
+seconds like Time::HiRes::time() (see below).
+
+=item usleep ( $useconds )
+
+Issues a usleep for the number of microseconds specified. See also 
+Time::HiRes::sleep() below.
+
+=item ualarm ( $useconds [, $interval_useconds ] )
+
+Issues a ualarm call; interval_useconds is optional and will be 0 if 
+unspecified, resulting in alarm-like behaviour.
+
+=item tv_interval ( $ref_to_gettimeofday [, $ref_to_later_gettimeofday] )
+
+Returns the floating seconds between the two times, which should have been 
+returned by gettimeofday(). If the second argument is omitted, then the
+current time is used.
+
+=item time ()
+
+Returns a floating seconds since the epoch. This function can be imported,
+resulting in a nice drop-in replacement for the C<time> provided with perl,
+see the EXAMPLES below.
+
+=item sleep ( $floating_seconds )
+
+Converts $floating_seconds to microseconds and issues a usleep for the 
+result.  This function can be imported, resulting in a nice drop-in 
+replacement for the C<sleep> provided with perl, see the EXAMPLES below.
+
+=item alarm ( $floating_seconds [, $interval_floating_seconds ] )
+
+Converts $floating_seconds and $interval_floating_seconds and issues a
+ualarm for the results.  The $interval_floating_seconds argument is optional and will 
+be 0 if unspecified, resulting in alarm-like behaviour.  This function can 
+be imported, resulting in a nice drop-in 
+replacement for the C<alarm> provided with perl, see the EXAMPLES below.
+
+=back
+
+=head1 EXAMPLES
+
+  use Time::HiRes qw(usleep ualarm gettimeofday tv_interval);
+
+  $microseconds = 750_000;
+  usleep $microseconds;
+
+  # signal alarm in 2.5s & every .1s thereafter
+  ualarm 2_500_000, 100_000;	
+
+  # get seconds and microseconds since the epoch
+  ($s, $usec) = gettimeofday;
+
+  # measure elapsed time 
+  # (could also do by subtracting 2 gettimeofday return values)
+  $t0 = [gettimeofday];
+  # do bunch of stuff here
+  $t1 = [gettimeofday];
+  # do more stuff here
+  $t0_t1 = tv_interval $t0, $t1;
+  
+  $elapsed = tv_interval ($t0, [gettimeofday]);
+  $elapsed = tv_interval ($t0);	# equivalent code
+
+  #
+  # replacements for time, alarm and sleep that know about
+  # floating seconds
+  #
+  use Time::HiRes;
+  $now_fractions = Time::HiRes::time;
+  Time::HiRes::sleep (2.5);
+  Time::HiRes::alarm (10.6666666);
+ 
+  use Time::HiRes qw ( time alarm sleep );
+  $now_fractions = time;
+  sleep (2.5);
+  alarm (10.6666666);
+
+=head1 C API
+
+In addition to the perl API described above, a C API is available for
+extension writers.  The following C functions are available in the
+modglobal hash:
+
+  name             C prototype
+  ---------------  ----------------------
+  Time::NVtime     double (*)()
+  Time::U2time     void (*)(UV ret[2])
+
+Both functions return equivalent information (like C<gettimeofday>)
+but with different representations.  The names C<NVtime> and C<U2time>
+were selected mainly because they are operating system independent.
+(C<gettimeofday> is Un*x-centric.)
+
+Here is an example of using NVtime from C:
+
+  double (*myNVtime)();
+  SV **svp = hv_fetch(PL_modglobal, "Time::NVtime", 12, 0);
+  if (!svp)         croak("Time::HiRes is required");
+  if (!SvIOK(*svp)) croak("Time::NVtime isn't a function pointer");
+  myNVtime = (double(*)()) SvIV(*svp);
+  printf("The current time is: %f\n", (*myNVtime)());
+
+=head1 AUTHORS
+
+D. Wegscheid <wegscd at whirlpool.com>
+R. Schertler <roderick at argon.org>
+J. Hietaniemi <jhi at iki.fi>
+G. Aas <gisle at aas.no>
+
+=head1 REVISION
+
+$Id: HiRes.pm,v 1.20 1999/03/16 02:26:13 wegscd Exp $
+
+$Log: HiRes.pm,v $
+Revision 1.20  1999/03/16 02:26:13  wegscd
+Add documentation for NVTime and U2Time.
+
+Revision 1.19  1998/09/30 02:34:42  wegscd
+No changes, bump version.
+
+Revision 1.18  1998/07/07 02:41:35  wegscd
+No changes, bump version.
+
+Revision 1.17  1998/07/02 01:45:13  wegscd
+Bump version to 1.17
+
+Revision 1.16  1997/11/13 02:06:36  wegscd
+version bump to accomodate HiRes.xs fix.
+
+Revision 1.15  1997/11/11 02:17:59  wegscd
+POD editing, courtesy of Gisle Aas.
+
+Revision 1.14  1997/11/06 03:14:35  wegscd
+Update version # for Makefile.PL and HiRes.xs changes.
+
+Revision 1.13  1997/11/05 05:36:25  wegscd
+change version # for Makefile.pl and HiRes.xs changes.
+
+Revision 1.12  1997/10/13 20:55:33  wegscd
+Force a new version for Makefile.PL changes.
+
+Revision 1.11  1997/09/05 19:59:33  wegscd
+New version to bump version for README and Makefile.PL fixes.
+Fix bad RCS log.
+
+Revision 1.10  1997/05/23 01:11:38  wegscd
+Conditional compilation; EXPORT_FAIL fixes.
+
+Revision 1.2  1996/12/30 13:28:40  wegscd
+Update documentation for what to do when missing ualarm() and friends.
+
+Revision 1.1  1996/10/17 20:53:31  wegscd
+Fix =head1 being next to __END__ so pod2man works
+
+Revision 1.0  1996/09/03 18:25:15  wegscd
+Initial revision
+
+=head1 COPYRIGHT
+
+Copyright (c) 1996-1997 Douglas E. Wegscheid.
+All rights reserved. This program is free software; you can
+redistribute it and/or modify it under the same terms as Perl itself.
+
+=cut

Added: trunk/orca/packages/Time-HiRes-01.20/MANIFEST
==============================================================================
--- trunk/orca/packages/Time-HiRes-01.20/MANIFEST	(original)
+++ trunk/orca/packages/Time-HiRes-01.20/MANIFEST	Sat Jul 13 21:25:49 2002
@@ -0,0 +1,9 @@
+Changes
+MANIFEST
+Makefile.PL
+README
+TODO
+HiRes.pm
+HiRes.xs
+t/01test.t
+t/02export.t

Added: trunk/orca/packages/Time-HiRes-01.20/Makefile.PL
==============================================================================
--- trunk/orca/packages/Time-HiRes-01.20/Makefile.PL	(original)
+++ trunk/orca/packages/Time-HiRes-01.20/Makefile.PL	Sat Jul 13 21:25:49 2002
@@ -0,0 +1,251 @@
+
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+#
+
+require 5.002;
+
+use Config;
+use ExtUtils::MakeMaker;
+
+# comment the following if xsubpp complains about bad usage.
+$XSOPT = '-nolinenumbers'; 
+
+# if you have 5.004_03 (and some slightly older versions?), xsubpp
+# tries to generate line numbers in the C code generated from the .xs.
+# unfortunately, it is a little buggy around #ifdef'd code.
+# my choice is leave it in and have people with old perls complain 
+# about the "Usage" bug, or leave it out and be unable to compile myself
+# without changing it, and then I'd always forget to change it before a 
+# release. Sorry, Edward :)
+
+sub TMPDIR {
+    my $TMPDIR =
+	(grep(defined $_ && -d $_ && -w _,
+	      ((defined $ENV{'TMPDIR'} ? $ENV{'TMPDIR'} : undef),
+	       qw(/var/tmp /usr/tmp /tmp))))[0]
+		   unless defined $TMPDIR;
+    $TMPDIR || die "Cannot find writable temporary directory.\n";
+}
+
+sub try_compile_and_link {
+    my ($c, $cccmd) = @_;
+
+    my ($ok) = 0;
+    my ($tmp) = ($^O eq 'VMS') ? "tmp$$" : TMPDIR . '/' . "tmp$$";
+    local(*TMPC);
+
+    my $obj_ext = $Config{obj_ext} || ".o";
+    unlink("$tmp.c", "$tmp$obj_ext");
+
+    if (open(TMPC, ">$tmp.c")) {
+	print TMPC $c;
+	close(TMPC);
+	my $COREincdir = $Config{'archlibexp'} . '/' . 'CORE';
+	my $ccflags = $Config{'ccflags'} . ' ' . "-I$COREincdir";
+	if ($^O eq 'VMS') {
+            my $perl_core = $Config{'installarchlib'};
+            $perl_core =~ s/\]$/.CORE]/;
+            $cccmd = "$Config{'cc'} /include=(perl_root:[000000],$perl_core) $tmp.c"; 
+        }
+	$cccmd = "$Config{'cc'} -o $tmp $ccflags $tmp.c @$LIBS"
+	 unless (defined $cccmd);
+	system($cccmd);
+	if ($^O eq 'VMS') {
+	    $ok = -s "$tmp$obj_ext" && -x _;
+	    unlink("$tmp.c", "$tmp$obj_ext");
+        }
+        else
+        {
+	    $ok = -s $tmp && -x _;
+	    unlink("$tmp.c", $tmp);
+        }
+    }
+    
+    $ok;
+}
+
+sub has_gettimeofday {
+    # confusing but true (if condition true ==> -DHAS_GETTIMEOFDAY already)
+    return 0 if $Config{'d_gettimeod'} eq 'define';
+    return 1 if try_compile_and_link(<<EOM); 
+#include "EXTERN.h" 
+#include "perl.h" 
+#include "XSUB.h" 
+#ifdef I_SYS_TYPES 
+#   include <sys/types.h>
+#endif
+
+#ifdef I_SYS_TIME
+#   include <sys/time.h>
+#endif
+
+#ifdef I_SYS_SELECT
+#   include <sys/select.h>	/* struct timeval might be hidden in here */
+#endif
+static int foo()
+{
+    struct timeval tv;
+    gettimeofday(&tv, 0);
+}
+int main _((int argc, char** argv, char** env))
+{
+    foo();
+}
+EOM
+    return 0;
+}
+
+sub has_x {
+    my ($x) = @_; 
+
+    return 1 if
+    try_compile_and_link(<<EOM);
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#ifdef I_UNISTD
+#   include <unistd.h>
+#endif
+
+#ifdef I_SYS_TYPES
+#   include <sys/types.h>
+#endif
+
+#ifdef I_SYS_TIME
+#   include <sys/time.h>
+#endif
+
+int main _((int argc, char** argv, char** env))
+{
+	$x;
+}
+EOM
+    return 0;
+}
+
+sub unixinit {
+    $DEFINE = '';
+
+    $LIBS = [''];
+
+    # this might break the link, try it if it can't find some things you 
+    # honestly think should be in there...
+    # $LIBS = ['-lucb -lbsd'];
+
+    # ... but ucb is poison for Solaris, and probably Linux. honest.
+    $LIBS = [''] if $Config{'osname'} eq 'solaris';
+    $LIBS = [''] if $Config{'osname'} eq 'linux';
+    $LIBS = ['-lm'] if $Config{'osname'} =~ /sco/i;
+
+    if ($Config{'d_gettimeod'} eq 'define') {
+	# do nothing special, everything should be fine
+    } elsif (has_gettimeofday) {
+	$DEFINE .= ' -DHAS_GETTIMEOFDAY';
+    } else {
+	die <<EOD
+Your operating system does not seem to have the gettimeofday() function.
+(or, at least, I cannot find it)
+
+There is no way Time::HiRes is going to work.
+
+I am awfully sorry but I cannot go further.
+
+Aborting configuration
+
+EOD
+    }
+
+    print "Looking for usleep()...\n";
+    if (has_x ("usleep (0)")) {
+	$DEFINE .= ' -DHAS_USLEEP';
+	print "You have usleep()\n\n";
+    } else {
+	print "Whoops! No usleep()! Let's see if you have select().\n";
+        if ($Config{'d_select'} eq 'define') {
+	    print "You have select(); we can make a Time::HiRes::usleep()\n\n";
+	} else {
+	    print "No select(); you won't have a Time::HiRes::usleep()\n\n";
+	}
+    }
+
+    print "Looking for ualarm()...\n";
+    if (has_x ("ualarm (0, 0)")) {
+	$DEFINE .= ' -DHAS_UALARM';
+	print "You have ualarm()\n\n";
+    } else {
+	print "Whoops! No ualarm()!\n";
+	if (has_x("setitimer(ITIMER_REAL, 0, 0)")) {
+	    print "You have setitimer(); we can make a Time::HiRes::ualarm()\n\n";
+	    $DEFINE .= ' -DHAS_SETITIMER';
+	} else {
+	     print "We'll manage.\n\n";
+	}
+    }
+    $DEFINE =~ s/^\s+//;
+}
+
+sub doMakefile {
+    print <<EOM if ($$LIBS[0] ne '');
+Looking for libraries...
+Note: it is ok if none of the libraries '@$LIBS' is found.
+
+EOM
+
+    @makefileopts = ();
+
+    if ($] >= 5.005) {
+	push (@makefileopts,
+	    'AUTHOR'    => 'Doug Wegscheid (wegscd at whirlpool.com)',
+	    'ABSTRACT_FROM' => 'HiRes.pm',
+	);
+	$DEFINE .= " -DATLEASTFIVEOHOHFIVE";
+    }
+
+    push (@makefileopts,
+	'NAME'	=> 'Time::HiRes',
+	'VERSION_FROM' => 'HiRes.pm', # finds $VERSION
+	'LIBS'	=> $LIBS,   # e.g., '-lm' 
+	'DEFINE'	=> $DEFINE,     # e.g., '-DHAS_SOMETHING' 
+	'XSOPT'	=> $XSOPT,
+    # do not even think about 'INC' => '-I/usr/ucbinclude', Solaris will avenge.
+	'INC'	=> '',     # e.g., '-I/usr/include/other' 
+	'dist'      => {
+	    'CI'=>'ci -l',
+	    'COMPRESS'=>'gzip -9f', 
+	    'SUFFIX' => 'gz',
+	},
+    );
+
+    WriteMakefile(@makefileopts);
+}
+
+sub main {
+    print <<EOM;
+
+Configuring...
+
+EOM
+
+    if ($^O =~ /Win32/i) {
+      $DEFINE = '-DSELECT_IS_BROKEN';
+      $LIBS = [''];
+    } else {
+      unixinit();
+    }
+    configure;
+    doMakefile;
+    my $make = $Config{'make'} || "make";
+print  <<EOM;
+
+Done configuring
+
+Now you may issue '$make'. Do not forget also '$make test'.
+
+EOM
+}
+
+&main;
+
+# EOF

Added: trunk/orca/packages/Time-HiRes-01.20/Changes
==============================================================================
--- trunk/orca/packages/Time-HiRes-01.20/Changes	(original)
+++ trunk/orca/packages/Time-HiRes-01.20/Changes	Sat Jul 13 21:25:49 2002
@@ -0,0 +1,99 @@
+Revision history for Perl extension Time::HiRes.
+
+1.20  Wed Feb 24 21:30 1999
+	- make our usleep and ualarm substitutes into hrt_usleep 
+	  and hrt_ualarm. This helps static links of Perl with other
+	  packages that also have usleep, etc. From
+	  Ilya Zakharevich <ilya at math.ohio-state.edu>
+	- add C API stuff. From Joshua Pritikin
+	  <joshua.pritikin at db.com>
+	- VMS Makefile.PL fun.  From pvhp at forte.com (Peter Prymmer)
+	- hopefully correct "-lc" fix for SCO.
+	- add PPD stuff
+
+1.19  Tue Sep 29 22:30 1998
+	- put VMS gettimeofday() in. Patch is from Sebastian Bazley
+	  <seb at stian.demon.co.uk>
+	- change GIMME_V to GIMME to help people with older versions of
+	  Perl.
+	- fix Win32 version of gettimeofday(). It didn't affect anything,
+	  but it confuses people reading the code when the return value
+	  is backwards (0 is success).
+	- fix Makefile.PL (more) so that detection of gettimeofday is
+	  more correct.
+
+1.18  Mon Jul 6 22:40 1998
+	- add usleep() for Win32.
+	- fix Makefile.PL to fix reported HP/UX feature where unresolved
+	  externals still cause an executable to be generated (though no
+	  x bit set). Thanks to David Kozinn for report and explanation.
+	  Problems with the fix are mine :)
+
+1.17  Wed Jul 1 20:10 1998
+	- fix setitimer calls so microseconds is not more than 1000000.
+	  Hp/UX 9 doesn't like that. Provided by Roland B Robert, PhD.
+        - make Win32. We only get gettimeofday (the select hack doesn't
+	  seem to work on my Win95 system).
+        - fix test 4 on 01test.t. add test to see if time() and 
+	  Time::HiRes::time() are close.
+
+1.16  Wed Nov 12 21:05 1997
+	- add missing EXTEND in new gettimeofday scalar code.
+
+1.15  Mon Nov 10 21:30 1997
+	- HiRes.pm: update pod. Provided by Gisle Aas.
+	- HiRes.xs: if gettimeofday() called in scalar context, do
+	  something more useful than before. Provided by Gisle Aas.
+	- README: tell of xsubpp '-nolinenumber' woes. thanks to
+	  Edward Henigin <ed at texas.net> for pointing out the problem.
+
+1.14  Wed Nov 5 9:40 1997
+	- Makefile.PL: look for setitimer
+	- HiRes.xs: if missing ualarm, but we have setitimer, make up
+	  our own setitimer. These were provided by Gisle Aas.
+
+1.13  Tue Nov 4 23:30 1997
+	- Makefile.PL: fix autodetect mechanism to do try linking in addition
+	  to just compiling; should fix Linux build problem. Fix was provided
+	  by Gisle Aas.
+
+1.12  Sun Oct 12 12:00:00 1997
+	- Makefile.PL: set XSOPT to '-nolinenumbers' to work around xsubpp bug;
+	  you may need to comment this back out if you have an older xsubpp.
+	- HiRes.xs: set PROTOTYPES: DISABLE
+
+1.11  Fri Sep 05 16:00:00 1997
+	- Makefile.PL:
+	  Had some line commented out that shouldn't have been (testing
+	  remnants)
+	- README:
+	  Previous version was corrupted.
+
+1.10  Thu May 22 20:20:00 1997
+	- HiRes.xs, HiRes.pm, t/*:
+	      -	only compile what we have OS support for (or can 
+		fake with select())
+	      - only test what we compiled 
+	      - gross improvement to the test suite
+	      - fix EXPORT_FAIL. 
+	  This work was all done by Roderick Schertler
+	  <roderick at argon.org>. If you run Linux or
+	  one of the other ualarm-less platoforms, and you like this 
+	  module, let Roderick know; without him, it still wouldn't 
+	  be working on those boxes...
+	- Makefile.PL: figure out what routines the OS has and
+	  only build what we need. These bits were written by Jarkko 
+	  Hietaniemi <jhi at iki.fi>. Again, gratitude is due...
+
+1.02  Mon Dec 30 08:00:00 1996
+	- HiRes.pm: update documentation to say what to do when missing
+	  ualarm() and friends.
+	- README: update to warn that ualarm() and friends need to exist
+
+1.01  Fri Oct 17 08:00:00 1996
+	- Makefile.PL: make XSPROTOARGS => '-noprototyopes'
+	- HiRes.pm: put blank line between __END__ and =head1 so that 
+	  pod2man works.
+
+1.00  Tue Sep 03 13:00:00 1996
+	- original version; created by h2xs 1.16

Added: trunk/orca/packages/Time-HiRes-01.20/README
==============================================================================
--- trunk/orca/packages/Time-HiRes-01.20/README	(original)
+++ trunk/orca/packages/Time-HiRes-01.20/README	Sat Jul 13 21:25:50 2002
@@ -0,0 +1,41 @@
+Time::HiRes module: High resolution time, sleep, and alarm.
+
+Implement usleep, ualarm, and gettimeofday for Perl, as well as wrappers
+to implement time, sleep, and alarm that know about non-integral seconds.
+
+1.20 adds a platform neutral set of C accessible routines if you are running
+5.005+.  All other changes are packaging changes and build fixes(?) for
+statically linked Perl, SCO, and VMS.
+
+1.19 has better VMS support.
+
+1.18 has limited Win32 support (no ualarm). Added usleep for Win32.
+Probably buggy. I'm sure I'll hear.
+
+1.16+ should be closer to building out of the box on Linux. Thanks
+to Gisle Aas for patches, and the ualarm equivalent using setitimer.
+
+If your underlying operating system doesn't implement ualarm(), then a fake
+using setitimer() will be made.  If the OS is missing usleep(), a fake one
+using select() will be made. If a fake can't be made for either ualarm() or
+usleep(), then the corresponding Perl function will not be available.  If the
+OS is missing gettimeofday(), you will get unresolved externals, either at
+link- or run-time.
+
+This is an improvement; the package used to not even build if you were
+missing any of these bits. Roderick Schertler <roderick at argon.org> did all 
+the conditional compilation stuff, look at HiRes.pm and the test suites; 
+it's good educational reading.
+
+Also, older versions of Perl do not support '-nolinenumbers' on the XSUBPP
+command, however, 5.004_03 requires it (on my box, anyway) since the #line
+generating code in XSUBPP appears to have problems with #ifdef'd .xs code. If
+xsubpp complains about usage when you do a make, look at the top of the
+Makefile.PL and comment out the "$XSOPT=" line. Or upgrade to a newer version
+of Perl.
+
+POD documentation is embedded.
+
+Copyright (c) 1996, 1997, 1998 Douglas E. Wegscheid.
+All rights reserved. This program is free software; you can 
+redistribute it and/or modify it under the same terms as Perl itself.

Modified: trunk/orca/packages/rrdtool-1.0.33/configure
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/configure	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/configure	Sat Jul 13 21:25:50 2002
@@ -11,7 +11,12 @@
 ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
-ac_default_prefix=/usr/local/rrdtool-1.0.13 
+ac_default_prefix=/usr/local/rrdtool-1.0.33 
+ac_help="$ac_help
+  --with-tcllib=DIR       location of the tclConfig.sh"
+ac_help="$ac_help
+  --with-perl-options=[OPTIONS]  options to pass on command-line when
+                          generating Makefile from Makefile.PL"
 ac_help="$ac_help
   --enable-shared[=PKGS]  build shared libraries [default=no]"
 ac_help="$ac_help
@@ -581,7 +586,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:585: checking host system type" >&5
+echo "configure:590: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -602,7 +607,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:606: checking target system type" >&5
+echo "configure:611: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -620,7 +625,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:624: checking build system type" >&5
+echo "configure:629: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -655,7 +660,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:659: checking for a BSD compatible install" >&5
+echo "configure:664: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -708,7 +713,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:712: checking whether build environment is sane" >&5
+echo "configure:717: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -765,7 +770,7 @@
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:769: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:774: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -794,7 +799,7 @@
 
 PACKAGE=rrdtool
 
-VERSION=1.0.13
+VERSION=1.0.33
 
 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; }
@@ -811,7 +816,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:815: checking for working aclocal" >&5
+echo "configure:820: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -824,7 +829,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:828: checking for working autoconf" >&5
+echo "configure:833: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -837,7 +842,7 @@
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:841: checking for working automake" >&5
+echo "configure:846: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -850,7 +855,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:854: checking for working autoheader" >&5
+echo "configure:859: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -863,7 +868,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:867: checking for working makeinfo" >&5
+echo "configure:872: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -885,9 +890,10 @@
 
 
 
+
 CGI_LIB_DIR=cgilib-0.4
 GD_LIB_DIR=gd1.3
-PNG_LIB_DIR=libpng-1.0.3
+PNG_LIB_DIR=libpng-1.0.9
 ZLIB_LIB_DIR=zlib-1.1.3
 
 
@@ -899,7 +905,7 @@
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:903: checking for $ac_word" >&5
+echo "configure:909: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -932,18 +938,73 @@
   echo "$ac_t""no" 1>&6
 fi
 
-if test "x$PERL" = "nox"; then
+if test "x$PERL" = "xno"; then
 	COMP_PERL=
 else
 	COMP_PERL="perl_piped perl_shared"
+	echo $ac_n "checking for shared library extension""... $ac_c" 1>&6
+echo "configure:947: checking for shared library extension" >&5
+	SO_EXT=`$PERL -e 'use Config; if (defined $Config{so} and $Config{so} ne 'a') {print "$Config{so}\n"} else {print "so\n"};'`
+	echo "$ac_t""$SO_EXT" 1>&6
+fi
+
+
+
+withval=""
+# Check whether --with-tcllib or --without-tcllib was given.
+if test "${with_tcllib+set}" = set; then
+  withval="$with_tcllib"
+  :
+fi
+
+found=0
+echo $ac_n "checking for tclConfig.sh in $withval""... $ac_c" 1>&6
+echo "configure:963: checking for tclConfig.sh in $withval" >&5
+if test -f "$withval/tclConfig.sh" ; then
+    	tcl_config=$withval/tclConfig.sh
+        found=1
+        echo "$ac_t""yes" 1>&6
+        break
+else
+        echo "$ac_t""no" 1>&6
+fi
+
+if test $found -eq 0 ; then
+        echo "configure: warning: tclConfig.sh not found - Tcl interface won't be built" 1>&2
+else
+	. $tcl_config
+fi
+
+# Options to pass when configuring perl module
+# Check whether --with-perl-options or --without-perl-options was given.
+if test "${with_perl_options+set}" = set; then
+  withval="$with_perl_options"
+  PERL_MAKE_OPTIONS=$withval
 fi
 
 
 
+
+
+if test x$found = x1 ; then
+  COMP_TCL_TRUE=
+  COMP_TCL_FALSE='#'
+else
+  COMP_TCL_TRUE='#'
+  COMP_TCL_FALSE=
+fi
+
+
+
+
+
+
+
+
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:947: checking for $ac_word" >&5
+echo "configure:1008: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -973,7 +1034,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:977: checking for $ac_word" >&5
+echo "configure:1038: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1024,7 +1085,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1028: checking for $ac_word" >&5
+echo "configure:1089: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1056,7 +1117,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1060: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1121: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1067,12 +1128,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1071 "configure"
+#line 1132 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1098,12 +1159,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1102: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1163: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1107: checking whether we are using GNU C" >&5
+echo "configure:1168: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1112,7 +1173,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1131,7 +1192,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1135: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1196: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1163,7 +1224,7 @@
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1167: checking how to run the C preprocessor" >&5
+echo "configure:1228: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1178,13 +1239,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1182 "configure"
+#line 1243 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1195,13 +1256,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1199 "configure"
+#line 1260 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1266: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1212,13 +1273,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1216 "configure"
+#line 1277 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1316,7 +1377,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1320: checking for $ac_word" >&5
+echo "configure:1381: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1355,7 +1416,7 @@
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1359: checking for ld used by GCC" >&5
+echo "configure:1420: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
     # Accept absolute paths.
@@ -1379,10 +1440,10 @@
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1383: checking for GNU ld" >&5
+echo "configure:1444: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1386: checking for non-GNU ld" >&5
+echo "configure:1447: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1416,9 +1477,8 @@
   echo "$ac_t""no" 1>&6
 fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
-
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1422: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1482: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1434,7 +1494,7 @@
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1438: checking for BSD-compatible nm" >&5
+echo "configure:1498: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1469,9 +1529,8 @@
 NM="$ac_cv_path_NM"
 echo "$ac_t""$NM" 1>&6
 
-
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1475: checking whether ln -s works" >&5
+echo "configure:1534: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1492,6 +1551,11 @@
 fi
 
 
+case "$target" in
+NONE) lt_target="$host" ;;
+*) lt_target="$target" ;;
+esac
+
 # Check for any special flags to pass to ltconfig.
 libtool_flags="--cache-file=$cache_file"
 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
@@ -1512,11 +1576,11 @@
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
-case "$host" in
+case "$lt_target" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1519 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1583 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1537,19 +1601,19 @@
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:1541: checking whether the C compiler needs -belf" >&5
+echo "configure:1605: checking whether the C compiler needs -belf" >&5
 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1546 "configure"
+#line 1610 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_needs_belf=yes
 else
@@ -1627,7 +1691,7 @@
 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
 
 # Reload cache, that may have been modified by ltconfig
@@ -1652,12 +1716,12 @@
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1656: checking for ANSI C header files" >&5
+echo "configure:1720: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1661 "configure"
+#line 1725 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1665,7 +1729,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1682,7 +1746,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1686 "configure"
+#line 1750 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1700,7 +1764,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1704 "configure"
+#line 1768 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1721,7 +1785,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1725 "configure"
+#line 1789 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1732,7 +1796,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:1736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1755,21 +1819,21 @@
 
 fi
 
-for ac_hdr in fcntl.h fp_class.h malloc.h unistd.h math.h sys/time.h sys/times.h sys/param.h sys/resource.h float.h
+for ac_hdr in fcntl.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/time.h sys/times.h sys/param.h sys/resource.h float.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1763: checking for $ac_hdr" >&5
+echo "configure:1827: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1768 "configure"
+#line 1832 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1797,12 +1861,12 @@
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1801: checking for working const" >&5
+echo "configure:1865: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1806 "configure"
+#line 1870 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1851,7 +1915,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1872,12 +1936,12 @@
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1876: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1940: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1881 "configure"
+#line 1945 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -1886,7 +1950,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:1890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -1907,12 +1971,12 @@
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1911: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:1975: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1916 "configure"
+#line 1980 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -1920,7 +1984,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:1924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -1941,8 +2005,54 @@
 fi
 
 
+echo $ac_n "checking for acos""... $ac_c" 1>&6
+echo "configure:2010: checking for acos" >&5
+if eval "test \"`echo '$''{'ac_cv_func_acos'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2015 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char acos(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char acos();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_acos) || defined (__stub___acos)
+choke me
+#else
+acos();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_acos=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_acos=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'acos`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
 echo $ac_n "checking for acos in -lm""... $ac_c" 1>&6
-echo "configure:1946: checking for acos in -lm" >&5
+echo "configure:2056: checking for acos in -lm" >&5
 ac_lib_var=`echo m'_'acos | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1950,7 +2060,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1954 "configure"
+#line 2064 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1961,7 +2071,7 @@
 acos()
 ; return 0; }
 EOF
-if { (eval echo configure:1965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1976,7 +2086,7 @@
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
@@ -1988,23 +2098,107 @@
   echo "$ac_t""no" 1>&6
 fi
 
+fi
+
+
+for ac_prog in gnroff nroff
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2110: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_NROFF'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$NROFF" in
+  /*)
+  ac_cv_path_NROFF="$NROFF" # Let the user override the test with a path.
+  ;;
+  ?:/*)			 
+  ac_cv_path_NROFF="$NROFF" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_NROFF="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+NROFF="$ac_cv_path_NROFF"
+if test -n "$NROFF"; then
+  echo "$ac_t""$NROFF" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$NROFF" && break
+done
+
+for ac_prog in groff troff
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2150: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_TROFF'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$TROFF" in
+  /*)
+  ac_cv_path_TROFF="$TROFF" # Let the user override the test with a path.
+  ;;
+  ?:/*)			 
+  ac_cv_path_TROFF="$TROFF" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_TROFF="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+TROFF="$ac_cv_path_TROFF"
+if test -n "$TROFF"; then
+  echo "$ac_t""$TROFF" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$TROFF" && break
+done
+
 
-oCFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -Wall -pedantic"
-echo $ac_n "checking if we can use GCC-specific compiler options""... $ac_c" 1>&6
-echo "configure:1996: checking if we can use GCC-specific compiler options" >&5
+if test "x$GCC" = "xyes"; then
+  oCFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline"
+  echo $ac_n "checking if we can use GCC-specific compiler options""... $ac_c" 1>&6
+echo "configure:2190: checking if we can use GCC-specific compiler options" >&5
 if eval "test \"`echo '$''{'rd_cv_gcc_opt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2001 "configure"
+#line 2195 "configure"
 #include "confdefs.h"
 
 int main() {
 return 0 
 ; return 0; }
 EOF
-if { (eval echo configure:2008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rd_cv_gcc_opt=yes
 else
@@ -2014,60 +2208,31 @@
   rd_cv_gcc_opt=no 
 fi
 rm -f conftest*
-	       
-       
+               
+        
 fi
 
 echo "$ac_t""$rd_cv_gcc_opt" 1>&6
-if test $rd_cv_gcc_opt = no; then
-	CFLAGS=$oCFLAGS
-fi
-
-
-oCFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -fPIC"
-echo $ac_n "checking if we can use -fPIC as this may help building the perl module""... $ac_c" 1>&6
-echo "configure:2031: checking if we can use -fPIC as this may help building the perl module" >&5
-if eval "test \"`echo '$''{'rd_cv_pic'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test "$cross_compiling" = yes; then
-  :
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2039 "configure"
-#include "confdefs.h"
-int main(void){return 0;}
-EOF
-if { (eval echo configure:2043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  rd_cv_pic=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  rd_cv_pic=no
-fi
-rm -fr conftest*
-fi
-
-	       
-       
+  if test $rd_cv_gcc_opt = no; then
+         CFLAGS=$oCFLAGS
+  fi
 fi
 
-echo "$ac_t""$rd_cv_pic" 1>&6
-if test $rd_cv_pic = no; then
-	CFLAGS=$oCFLAGS
-fi
+CFLAGS="$CFLAGS "`grep pic_flag= libtool | sed -e 's/.*pic_flag=//' -e 's/"//g'`
 
+case $target_os in
+*hpux*)
+	CLFAGS=`echo $CFLAGS|sed -e 's/-fPIC/-fpic/g'`
+;;
+esac
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:2066: checking for strftime" >&5
+echo "configure:2231: checking for strftime" >&5
 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2071 "configure"
+#line 2236 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -2090,7 +2255,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -2112,7 +2277,7 @@
   echo "$ac_t""no" 1>&6
 # strftime is in -lintl on SCO UNIX.
 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
-echo "configure:2116: checking for strftime in -lintl" >&5
+echo "configure:2281: checking for strftime in -lintl" >&5
 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2120,7 +2285,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2124 "configure"
+#line 2289 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2131,7 +2296,7 @@
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:2135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2158,12 +2323,12 @@
 fi
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:2162: checking for vprintf" >&5
+echo "configure:2327: checking for vprintf" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2167 "configure"
+#line 2332 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -2186,7 +2351,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
@@ -2210,12 +2375,12 @@
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:2214: checking for _doprnt" >&5
+echo "configure:2379: checking for _doprnt" >&5
 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2219 "configure"
+#line 2384 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -2238,7 +2403,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -2263,15 +2428,16 @@
 fi
 
 
-for ac_func in snprintf vsnprintf fpclass class fpclassify fp_class isnan finite isinf memmove strchr mktime getrusage gettimeofday
+
+for ac_func in strerror snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2270: checking for $ac_func" >&5
+echo "configure:2436: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2275 "configure"
+#line 2441 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2294,7 +2460,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2319,126 +2485,424 @@
 done
 
 
-
-echo $ac_n "checking if realloc can deal with NULL""... $ac_c" 1>&6
-echo "configure:2325: checking if realloc can deal with NULL" >&5
-if eval "test \"`echo '$''{'rd_cv_null_realloc'+set}'`\" = set"; then
+for ac_func in fpclassify
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2492: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test "$cross_compiling" = yes; then
-  :
-else
   cat > conftest.$ac_ext <<EOF
-#line 2333 "configure"
+#line 2497 "configure"
 #include "confdefs.h"
-#include <stdlib.h>
-	      int main(void){
-              char *x = NULL;
-	      x = realloc (x,10);
-	      if (x==NULL) return 1;
-	      return 0;
-             }
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
 EOF
-if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  rd_cv_null_realloc=yes
+if { (eval echo configure:2520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  rd_cv_null_realloc=nope
-fi
-rm -fr conftest*
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
 fi
-
+rm -f conftest*
 fi
 
-echo "$ac_t""$rd_cv_null_realloc" 1>&6
-
-if test x"$rd_cv_null_realloc" = xnope; then
-cat >> confdefs.h <<\EOF
-#define NO_NULL_REALLOC 1
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ 
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for fpclassify with <math.h>""... $ac_c" 1>&6
+echo "configure:2542: checking for fpclassify with <math.h>" >&5
+    cat > conftest.$ac_ext <<EOF
+#line 2544 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+float f = 0.0; fpclassify(f)
+; return 0; }
+EOF
+if { (eval echo configure:2551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+      cat >> confdefs.h <<\EOF
+#define HAVE_FPCLASSIFY 1
 EOF
 
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
 fi
+rm -f conftest*
+fi
+done
 
-
-
-
-oCFLAGS=$CFLAGS
-unset CFLAGS
-
-echo $ac_n "checking if IEEE math works out of the box""... $ac_c" 1>&6
-echo "configure:2373: checking if IEEE math works out of the box" >&5
-if eval "test \"`echo '$''{'rd_cv_ieee_works'+set}'`\" = set"; then
+for ac_func in finite
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2571: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test "$cross_compiling" = yes; then
-  :
-else
   cat > conftest.$ac_ext <<EOF
-#line 2381 "configure"
+#line 2576 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
 
+int main() {
 
-#if HAVE_MATH_H
-#  include <math.h>                                                                                                                                        
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ 
+else
+  echo "$ac_t""no" 1>&6
+for ac_func in isfinite
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2623: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2628 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ 
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for isfinite with <math.h>""... $ac_c" 1>&6
+echo "configure:2673: checking for isfinite with <math.h>" >&5
+    cat > conftest.$ac_ext <<EOF
+#line 2675 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+float f = 0.0; isfinite(f)
+; return 0; }
+EOF
+if { (eval echo configure:2682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+      cat >> confdefs.h <<\EOF
+#define HAVE_ISFINITE 1
+EOF
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+fi
+done
+
+fi
+done
+
+for ac_func in isinf
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2705: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2710 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ 
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for isinf with <math.h>""... $ac_c" 1>&6
+echo "configure:2755: checking for isinf with <math.h>" >&5
+    cat > conftest.$ac_ext <<EOF
+#line 2757 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+float f = 0.0; isinf(f)
+; return 0; }
+EOF
+if { (eval echo configure:2764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+      cat >> confdefs.h <<\EOF
+#define HAVE_ISINF 1
+EOF
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+fi
+done
+
+
+
+echo $ac_n "checking if realloc can deal with NULL""... $ac_c" 1>&6
+echo "configure:2784: checking if realloc can deal with NULL" >&5
+if eval "test \"`echo '$''{'rd_cv_null_realloc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2792 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+	      int main(void){
+              char *x = NULL;
+	      x = realloc (x,10);
+	      if (x==NULL) return 1;
+	      return 0;
+             }
+EOF
+if { (eval echo configure:2802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  rd_cv_null_realloc=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  rd_cv_null_realloc=nope
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$rd_cv_null_realloc" 1>&6
+
+if test x"$rd_cv_null_realloc" = xnope; then
+cat >> confdefs.h <<\EOF
+#define NO_NULL_REALLOC 1
+EOF
+
+fi
+
+
+
+
+_cflags=${CFLAGS}
+echo $ac_n "checking if IEEE math works out of the box""... $ac_c" 1>&6
+echo "configure:2830: checking if IEEE math works out of the box" >&5
+if eval "test \"`echo '$''{'rd_cv_ieee_works'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2838 "configure"
+#include "confdefs.h"
+
+
+#if HAVE_MATH_H
+#  include <math.h>
 #endif
 
 #if HAVE_FLOAT_H
 #  include <float.h>  
 #endif
 
-/* for solaris */
+#if HAVE_IEEEFP_H
+#  include <ieeefp.h>
+#endif
+
+#if HAVE_FP_CLASS_H
+#  include <fp_class.h>
+#endif
+
+/* Solaris */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
 #  define HAVE_ISINF 1
-#  include <ieeefp.h>
 #  define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
 #endif
-/* for dec unix */
+
+/* Digital UNIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
 #  define HAVE_ISINF 1
-#  include <fp_class.h>
 #  define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
-#endif
-/* for HP-UX 10.20 */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY))
-#  define HAVE_ISINF 1
-#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
-#endif
-/* for AIX */
+#endif 
+
+/* AIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
 #  define HAVE_ISINF 1
 #  define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
 #endif
 
-#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF))
-#  define HAVE_FINITE 1
-#  define finite(a) (! isnan(a) && ! isinf(a))
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
 #endif
 
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_INFINITE)
+#endif
 
 #include <stdio.h>
 int main(void){
-    double nan,inf,c,d;
-     ;
-     /* some math to see if we get a segfault; */
-     nan=0.0/0.0;
-     inf=1.0/0.0;
-     c = 1.0;
-     c = c / 0.0; /* try getting fpe */
-     c = inf + nan;
-     c = inf / nan;
-     if (! isnan(nan)) {printf ("isnan(NaN) ... "); return 1;}
-     if (nan == nan) {printf ("nan != nan ..."); return 1;}
-     if (! isinf(inf)) {printf ("isinf(oo) ... "); return 1;}
-     if (! isinf(-inf)) {printf ("isinf(-oo) ... "); return 1;}
-     if (! inf > 0) {printf ("inf > 0 ... "); return 1;}
-     if (! -inf < 0) {printf ("inf < 0 ... "); return 1;}
-     return 0;
-}
+    double nan,inf,c,zero;
+    ;
+    /* some math to see if we get a floating point exception */
+    zero=sin(0.0); /* don't let the compiler optimize us away */
+    nan=0.0/zero; /* especially here */
+    inf=1.0/zero; /* and here. I want to know if it can do the magic */
+		  /* at run time without sig fpe */
+    c = inf + nan;
+    c = inf / nan;
+    if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;}
+    if (nan == nan) {printf ("nan == nan ... "); return 1;}
+    if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;}
+    if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;}
+    if (! inf > 0) {printf ("not inf > 0 ... "); return 1;}
+    if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;}
+    return 0;
+ }
 EOF
-if { (eval echo configure:2442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   rd_cv_ieee_works=yes
 else
@@ -2452,12 +2916,14 @@
 
 fi
 
-echo "$ac_t""$rd_cv_ieee_works" 1>&6
-if test "$rd_cv_ieee_works" != yes ; then
-
-CFLAGS=-ieee
-echo $ac_n "checking if IEEE math works with the -ieee switch""... $ac_c" 1>&6
-echo "configure:2461: checking if IEEE math works with the -ieee switch" >&5
+if test x${rd_cv_ieee_works} = "xyes"; then
+ echo "$ac_t""yes" 1>&6
+ 
+else
+ echo "$ac_t""no" 1>&6
+ CFLAGS="$_cflags -ieee"
+  echo $ac_n "checking if IEEE math works with the -ieee switch""... $ac_c" 1>&6
+echo "configure:2927: checking if IEEE math works with the -ieee switch" >&5
 if eval "test \"`echo '$''{'rd_cv_ieee_switch'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2465,68 +2931,75 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2469 "configure"
+#line 2935 "configure"
 #include "confdefs.h"
 
 
 #if HAVE_MATH_H
-#  include <math.h>                                                                                                                                        
+#  include <math.h>
 #endif
 
 #if HAVE_FLOAT_H
 #  include <float.h>  
 #endif
 
-/* for solaris */
+#if HAVE_IEEEFP_H
+#  include <ieeefp.h>
+#endif
+
+#if HAVE_FP_CLASS_H
+#  include <fp_class.h>
+#endif
+
+/* Solaris */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
 #  define HAVE_ISINF 1
-#  include <ieeefp.h>
 #  define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
 #endif
-/* for dec unix */
+
+/* Digital UNIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
 #  define HAVE_ISINF 1
-#  include <fp_class.h>
 #  define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
-#endif
-/* for HP-UX 10.20 */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY))
-#  define HAVE_ISINF 1
-#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
-#endif
-/* for AIX */
+#endif 
+
+/* AIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
 #  define HAVE_ISINF 1
 #  define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
 #endif
 
-#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF))
-#  define HAVE_FINITE 1
-#  define finite(a) (! isnan(a) && ! isinf(a))
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
 #endif
 
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_INFINITE)
+#endif
 
 #include <stdio.h>
 int main(void){
-    double nan,inf,c,d;
-     ;
-     /* some math to see if we get a segfault; */
-     nan=0.0/0.0;
-     inf=1.0/0.0;
-     c = 1.0;
-     c = c / 0.0; /* try getting fpe */
-     c = inf + nan;
-     c = inf / nan;
-     if (! isnan(nan)) {printf ("isnan(NaN) ... "); return 1;}
-     if (nan == nan) {printf ("nan != nan ..."); return 1;}
-     if (! isinf(inf)) {printf ("isinf(oo) ... "); return 1;}
-     if (! isinf(-inf)) {printf ("isinf(-oo) ... "); return 1;}
-     if (! inf > 0) {printf ("inf > 0 ... "); return 1;}
-     if (! -inf < 0) {printf ("inf < 0 ... "); return 1;}
-     return 0;
-}
+    double nan,inf,c,zero;
+    ;
+    /* some math to see if we get a floating point exception */
+    zero=sin(0.0); /* don't let the compiler optimize us away */
+    nan=0.0/zero; /* especially here */
+    inf=1.0/zero; /* and here. I want to know if it can do the magic */
+		  /* at run time without sig fpe */
+    c = inf + nan;
+    c = inf / nan;
+    if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;}
+    if (nan == nan) {printf ("nan == nan ... "); return 1;}
+    if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;}
+    if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;}
+    if (! inf > 0) {printf ("not inf > 0 ... "); return 1;}
+    if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;}
+    return 0;
+ }
 EOF
-if { (eval echo configure:2530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   rd_cv_ieee_switch=yes
 else
@@ -2540,12 +3013,14 @@
 
 fi
 
-echo "$ac_t""$rd_cv_ieee_switch" 1>&6
-if test "$rd_cv_ieee_switch" != yes ; then
-
-CFLAGS=-qfloat=nofold
-echo $ac_n "checking if IEEE math works with the -qfloat=nofold switch""... $ac_c" 1>&6
-echo "configure:2549: checking if IEEE math works with the -qfloat=nofold switch" >&5
+if test x${rd_cv_ieee_switch} = "xyes"; then
+ echo "$ac_t""yes" 1>&6
+ 
+else
+ echo "$ac_t""no" 1>&6
+ CFLAGS="$_cflags -qfloat=nofold"
+    echo $ac_n "checking if IEEE math works with the -qfloat=nofold switch""... $ac_c" 1>&6
+echo "configure:3024: checking if IEEE math works with the -qfloat=nofold switch" >&5
 if eval "test \"`echo '$''{'rd_cv_ieee_nofold'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2553,68 +3028,75 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2557 "configure"
+#line 3032 "configure"
 #include "confdefs.h"
 
 
 #if HAVE_MATH_H
-#  include <math.h>                                                                                                                                        
+#  include <math.h>
 #endif
 
 #if HAVE_FLOAT_H
 #  include <float.h>  
 #endif
 
-/* for solaris */
+#if HAVE_IEEEFP_H
+#  include <ieeefp.h>
+#endif
+
+#if HAVE_FP_CLASS_H
+#  include <fp_class.h>
+#endif
+
+/* Solaris */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
 #  define HAVE_ISINF 1
-#  include <ieeefp.h>
 #  define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
 #endif
-/* for dec unix */
+
+/* Digital UNIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
 #  define HAVE_ISINF 1
-#  include <fp_class.h>
 #  define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
-#endif
-/* for HP-UX 10.20 */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY))
-#  define HAVE_ISINF 1
-#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
-#endif
-/* for AIX */
+#endif 
+
+/* AIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
 #  define HAVE_ISINF 1
 #  define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
 #endif
 
-#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF))
-#  define HAVE_FINITE 1
-#  define finite(a) (! isnan(a) && ! isinf(a))
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
 #endif
 
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_INFINITE)
+#endif
 
 #include <stdio.h>
 int main(void){
-    double nan,inf,c,d;
-     ;
-     /* some math to see if we get a segfault; */
-     nan=0.0/0.0;
-     inf=1.0/0.0;
-     c = 1.0;
-     c = c / 0.0; /* try getting fpe */
-     c = inf + nan;
-     c = inf / nan;
-     if (! isnan(nan)) {printf ("isnan(NaN) ... "); return 1;}
-     if (nan == nan) {printf ("nan != nan ..."); return 1;}
-     if (! isinf(inf)) {printf ("isinf(oo) ... "); return 1;}
-     if (! isinf(-inf)) {printf ("isinf(-oo) ... "); return 1;}
-     if (! inf > 0) {printf ("inf > 0 ... "); return 1;}
-     if (! -inf < 0) {printf ("inf < 0 ... "); return 1;}
-     return 0;
-}
+    double nan,inf,c,zero;
+    ;
+    /* some math to see if we get a floating point exception */
+    zero=sin(0.0); /* don't let the compiler optimize us away */
+    nan=0.0/zero; /* especially here */
+    inf=1.0/zero; /* and here. I want to know if it can do the magic */
+		  /* at run time without sig fpe */
+    c = inf + nan;
+    c = inf / nan;
+    if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;}
+    if (nan == nan) {printf ("nan == nan ... "); return 1;}
+    if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;}
+    if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;}
+    if (! inf > 0) {printf ("not inf > 0 ... "); return 1;}
+    if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;}
+    return 0;
+ }
 EOF
-if { (eval echo configure:2618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   rd_cv_ieee_nofold=yes
 else
@@ -2628,12 +3110,14 @@
 
 fi
 
-echo "$ac_t""$rd_cv_ieee_nofold" 1>&6
-if test "$rd_cv_ieee_nofold" != yes ; then
-
-CFLAGS="-w -qflttrap=enable:zerodivide"
-echo $ac_n "checking if IEEE math works with the -w -qflttrap=enable:zerodivide""... $ac_c" 1>&6
-echo "configure:2637: checking if IEEE math works with the -w -qflttrap=enable:zerodivide" >&5
+if test x${rd_cv_ieee_nofold} = "xyes"; then
+ echo "$ac_t""yes" 1>&6
+ 
+else
+ echo "$ac_t""no" 1>&6
+ CFLAGS="$_cflags -w -qflttrap=enable:zerodivide"
+      echo $ac_n "checking if IEEE math works with the -w -qflttrap=enable:zerodivide""... $ac_c" 1>&6
+echo "configure:3121: checking if IEEE math works with the -w -qflttrap=enable:zerodivide" >&5
 if eval "test \"`echo '$''{'rd_cv_ieee_flttrap'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2641,68 +3125,75 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2645 "configure"
+#line 3129 "configure"
 #include "confdefs.h"
 
 
 #if HAVE_MATH_H
-#  include <math.h>                                                                                                                                        
+#  include <math.h>
 #endif
 
 #if HAVE_FLOAT_H
 #  include <float.h>  
 #endif
 
-/* for solaris */
+#if HAVE_IEEEFP_H
+#  include <ieeefp.h>
+#endif
+
+#if HAVE_FP_CLASS_H
+#  include <fp_class.h>
+#endif
+
+/* Solaris */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
 #  define HAVE_ISINF 1
-#  include <ieeefp.h>
 #  define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
 #endif
-/* for dec unix */
+
+/* Digital UNIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
 #  define HAVE_ISINF 1
-#  include <fp_class.h>
 #  define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
-#endif
-/* for HP-UX 10.20 */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY))
-#  define HAVE_ISINF 1
-#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
-#endif
-/* for AIX */
+#endif 
+
+/* AIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
 #  define HAVE_ISINF 1
 #  define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
 #endif
 
-#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF))
-#  define HAVE_FINITE 1
-#  define finite(a) (! isnan(a) && ! isinf(a))
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
 #endif
 
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_INFINITE)
+#endif
 
 #include <stdio.h>
 int main(void){
-    double nan,inf,c,d;
-     ;
-     /* some math to see if we get a segfault; */
-     nan=0.0/0.0;
-     inf=1.0/0.0;
-     c = 1.0;
-     c = c / 0.0; /* try getting fpe */
-     c = inf + nan;
-     c = inf / nan;
-     if (! isnan(nan)) {printf ("isnan(NaN) ... "); return 1;}
-     if (nan == nan) {printf ("nan != nan ..."); return 1;}
-     if (! isinf(inf)) {printf ("isinf(oo) ... "); return 1;}
-     if (! isinf(-inf)) {printf ("isinf(-oo) ... "); return 1;}
-     if (! inf > 0) {printf ("inf > 0 ... "); return 1;}
-     if (! -inf < 0) {printf ("inf < 0 ... "); return 1;}
-     return 0;
-}
+    double nan,inf,c,zero;
+    ;
+    /* some math to see if we get a floating point exception */
+    zero=sin(0.0); /* don't let the compiler optimize us away */
+    nan=0.0/zero; /* especially here */
+    inf=1.0/zero; /* and here. I want to know if it can do the magic */
+		  /* at run time without sig fpe */
+    c = inf + nan;
+    c = inf / nan;
+    if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;}
+    if (nan == nan) {printf ("nan == nan ... "); return 1;}
+    if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;}
+    if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;}
+    if (! inf > 0) {printf ("not inf > 0 ... "); return 1;}
+    if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;}
+    return 0;
+ }
 EOF
-if { (eval echo configure:2706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   rd_cv_ieee_flttrap=yes
 else
@@ -2716,12 +3207,14 @@
 
 fi
 
-echo "$ac_t""$rd_cv_ieee_flttrap" 1>&6
-if test "$rd_cv_ieee_flttrap" != yes ; then
-
-CFLAGS=-mieee
-echo $ac_n "checking if IEEE math works with the -mieee switch""... $ac_c" 1>&6
-echo "configure:2725: checking if IEEE math works with the -mieee switch" >&5
+if test x${rd_cv_ieee_flttrap} = "xyes"; then
+ echo "$ac_t""yes" 1>&6
+ 
+else
+ echo "$ac_t""no" 1>&6
+ CFLAGS="$_cflags -mieee"
+       echo $ac_n "checking if IEEE math works with the -mieee switch""... $ac_c" 1>&6
+echo "configure:3218: checking if IEEE math works with the -mieee switch" >&5
 if eval "test \"`echo '$''{'rd_cv_ieee_mswitch'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2729,68 +3222,75 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2733 "configure"
+#line 3226 "configure"
 #include "confdefs.h"
 
 
 #if HAVE_MATH_H
-#  include <math.h>                                                                                                                                        
+#  include <math.h>
 #endif
 
 #if HAVE_FLOAT_H
 #  include <float.h>  
 #endif
 
-/* for solaris */
+#if HAVE_IEEEFP_H
+#  include <ieeefp.h>
+#endif
+
+#if HAVE_FP_CLASS_H
+#  include <fp_class.h>
+#endif
+
+/* Solaris */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
 #  define HAVE_ISINF 1
-#  include <ieeefp.h>
 #  define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
 #endif
-/* for dec unix */
+
+/* Digital UNIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
 #  define HAVE_ISINF 1
-#  include <fp_class.h>
 #  define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
-#endif
-/* for HP-UX 10.20 */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY))
-#  define HAVE_ISINF 1
-#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
-#endif
-/* for AIX */
+#endif 
+
+/* AIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
 #  define HAVE_ISINF 1
 #  define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
 #endif
 
-#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF))
-#  define HAVE_FINITE 1
-#  define finite(a) (! isnan(a) && ! isinf(a))
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
 #endif
 
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_INFINITE)
+#endif
 
 #include <stdio.h>
 int main(void){
-    double nan,inf,c,d;
-     ;
-     /* some math to see if we get a segfault; */
-     nan=0.0/0.0;
-     inf=1.0/0.0;
-     c = 1.0;
-     c = c / 0.0; /* try getting fpe */
-     c = inf + nan;
-     c = inf / nan;
-     if (! isnan(nan)) {printf ("isnan(NaN) ... "); return 1;}
-     if (nan == nan) {printf ("nan != nan ..."); return 1;}
-     if (! isinf(inf)) {printf ("isinf(oo) ... "); return 1;}
-     if (! isinf(-inf)) {printf ("isinf(-oo) ... "); return 1;}
-     if (! inf > 0) {printf ("inf > 0 ... "); return 1;}
-     if (! -inf < 0) {printf ("inf < 0 ... "); return 1;}
-     return 0;
-}
+    double nan,inf,c,zero;
+    ;
+    /* some math to see if we get a floating point exception */
+    zero=sin(0.0); /* don't let the compiler optimize us away */
+    nan=0.0/zero; /* especially here */
+    inf=1.0/zero; /* and here. I want to know if it can do the magic */
+		  /* at run time without sig fpe */
+    c = inf + nan;
+    c = inf / nan;
+    if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;}
+    if (nan == nan) {printf ("nan == nan ... "); return 1;}
+    if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;}
+    if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;}
+    if (! inf > 0) {printf ("not inf > 0 ... "); return 1;}
+    if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;}
+    return 0;
+ }
 EOF
-if { (eval echo configure:2794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   rd_cv_ieee_mswitch=yes
 else
@@ -2804,12 +3304,14 @@
 
 fi
 
-echo "$ac_t""$rd_cv_ieee_mswitch" 1>&6
-if test "$rd_cv_ieee_mswitch" != yes ; then
-
-CFLAGS="-q float=rndsngl"
-echo $ac_n "checking if IEEE math works with the -q float=rndsngl switch""... $ac_c" 1>&6
-echo "configure:2813: checking if IEEE math works with the -q float=rndsngl switch" >&5
+if test x${rd_cv_ieee_mswitch} = "xyes"; then
+ echo "$ac_t""yes" 1>&6
+ 
+else
+ echo "$ac_t""no" 1>&6
+ CFLAGS="$_cflags -q float=rndsngl"
+         echo $ac_n "checking if IEEE math works with the -q float=rndsngl switch""... $ac_c" 1>&6
+echo "configure:3315: checking if IEEE math works with the -q float=rndsngl switch" >&5
 if eval "test \"`echo '$''{'rd_cv_ieee_qswitch'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2817,68 +3319,75 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2821 "configure"
+#line 3323 "configure"
 #include "confdefs.h"
 
 
 #if HAVE_MATH_H
-#  include <math.h>                                                                                                                                        
+#  include <math.h>
 #endif
 
 #if HAVE_FLOAT_H
 #  include <float.h>  
 #endif
 
-/* for solaris */
+#if HAVE_IEEEFP_H
+#  include <ieeefp.h>
+#endif
+
+#if HAVE_FP_CLASS_H
+#  include <fp_class.h>
+#endif
+
+/* Solaris */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
 #  define HAVE_ISINF 1
-#  include <ieeefp.h>
 #  define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
 #endif
-/* for dec unix */
+
+/* Digital UNIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
 #  define HAVE_ISINF 1
-#  include <fp_class.h>
 #  define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
-#endif
-/* for HP-UX 10.20 */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY))
-#  define HAVE_ISINF 1
-#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
-#endif
-/* for AIX */
+#endif 
+
+/* AIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
 #  define HAVE_ISINF 1
 #  define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
 #endif
 
-#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF))
-#  define HAVE_FINITE 1
-#  define finite(a) (! isnan(a) && ! isinf(a))
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
 #endif
 
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_INFINITE)
+#endif
 
 #include <stdio.h>
 int main(void){
-    double nan,inf,c,d;
-     ;
-     /* some math to see if we get a segfault; */
-     nan=0.0/0.0;
-     inf=1.0/0.0;
-     c = 1.0;
-     c = c / 0.0; /* try getting fpe */
-     c = inf + nan;
-     c = inf / nan;
-     if (! isnan(nan)) {printf ("isnan(NaN) ... "); return 1;}
-     if (nan == nan) {printf ("nan != nan ..."); return 1;}
-     if (! isinf(inf)) {printf ("isinf(oo) ... "); return 1;}
-     if (! isinf(-inf)) {printf ("isinf(-oo) ... "); return 1;}
-     if (! inf > 0) {printf ("inf > 0 ... "); return 1;}
-     if (! -inf < 0) {printf ("inf < 0 ... "); return 1;}
-     return 0;
-}
+    double nan,inf,c,zero;
+    ;
+    /* some math to see if we get a floating point exception */
+    zero=sin(0.0); /* don't let the compiler optimize us away */
+    nan=0.0/zero; /* especially here */
+    inf=1.0/zero; /* and here. I want to know if it can do the magic */
+		  /* at run time without sig fpe */
+    c = inf + nan;
+    c = inf / nan;
+    if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;}
+    if (nan == nan) {printf ("nan == nan ... "); return 1;}
+    if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;}
+    if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;}
+    if (! inf > 0) {printf ("not inf > 0 ... "); return 1;}
+    if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;}
+    return 0;
+ }
 EOF
-if { (eval echo configure:2882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   rd_cv_ieee_qswitch=yes
 else
@@ -2892,81 +3401,187 @@
 
 fi
 
-echo "$ac_t""$rd_cv_ieee_qswitch" 1>&6
-if test "$rd_cv_ieee_qswitch" != yes ; then
-
-unset CFLAGS
-echo $ac_n "checking if IEEE math works with fpsetmask(0)""... $ac_c" 1>&6
-echo "configure:2901: checking if IEEE math works with fpsetmask(0)" >&5
-if eval "test \"`echo '$''{'rd_cv_ieee_mask'+set}'`\" = set"; then
+if test x${rd_cv_ieee_qswitch} = "xyes"; then
+ echo "$ac_t""yes" 1>&6
+ 
+else
+ echo "$ac_t""no" 1>&6
+ CFLAGS="$_cflags -OPT:IEEE_comparisons=ON"
+           echo $ac_n "checking if IEEE math works with the -OPT:IEEE_comparisons=ON switch""... $ac_c" 1>&6
+echo "configure:3412: checking if IEEE math works with the -OPT:IEEE_comparisons=ON switch" >&5
+if eval "test \"`echo '$''{'rd_cv_ieee_ieeecmpswitch'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2909 "configure"
+#line 3420 "configure"
 #include "confdefs.h"
-#include <floatingpoint.h>
+
 
 #if HAVE_MATH_H
-#  include <math.h>                                                                                                                                        
+#  include <math.h>
 #endif
 
 #if HAVE_FLOAT_H
 #  include <float.h>  
 #endif
 
-/* for solaris */
+#if HAVE_IEEEFP_H
+#  include <ieeefp.h>
+#endif
+
+#if HAVE_FP_CLASS_H
+#  include <fp_class.h>
+#endif
+
+/* Solaris */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
 #  define HAVE_ISINF 1
-#  include <ieeefp.h>
 #  define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
 #endif
-/* for dec unix */
+
+/* Digital UNIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
 #  define HAVE_ISINF 1
-#  include <fp_class.h>
 #  define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
+#endif 
+
+/* AIX */
+#if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
+#  define HAVE_ISINF 1
+#  define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
 #endif
-/* for HP-UX 10.20 */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY))
+
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
 #  define HAVE_ISINF 1
 #  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
 #endif
-/* for AIX */
+
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_INFINITE)
+#endif
+
+#include <stdio.h>
+int main(void){
+    double nan,inf,c,zero;
+    ;
+    /* some math to see if we get a floating point exception */
+    zero=sin(0.0); /* don't let the compiler optimize us away */
+    nan=0.0/zero; /* especially here */
+    inf=1.0/zero; /* and here. I want to know if it can do the magic */
+		  /* at run time without sig fpe */
+    c = inf + nan;
+    c = inf / nan;
+    if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;}
+    if (nan == nan) {printf ("nan == nan ... "); return 1;}
+    if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;}
+    if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;}
+    if (! inf > 0) {printf ("not inf > 0 ... "); return 1;}
+    if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;}
+    return 0;
+ }
+EOF
+if { (eval echo configure:3488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  rd_cv_ieee_ieeecmpswitch=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  rd_cv_ieee_ieeecmpswitch=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+if test x${rd_cv_ieee_ieeecmpswitch} = "xyes"; then
+ echo "$ac_t""yes" 1>&6
+ 
+else
+ echo "$ac_t""no" 1>&6
+ CFLAGS=$_cflags
+             echo $ac_n "checking if IEEE math works with fpsetmask(0)""... $ac_c" 1>&6
+echo "configure:3509: checking if IEEE math works with fpsetmask(0)" >&5
+if eval "test \"`echo '$''{'rd_cv_ieee_mask'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3517 "configure"
+#include "confdefs.h"
+#include <floatingpoint.h>
+
+#if HAVE_MATH_H
+#  include <math.h>
+#endif
+
+#if HAVE_FLOAT_H
+#  include <float.h>  
+#endif
+
+#if HAVE_IEEEFP_H
+#  include <ieeefp.h>
+#endif
+
+#if HAVE_FP_CLASS_H
+#  include <fp_class.h>
+#endif
+
+/* Solaris */
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
+#endif
+
+/* Digital UNIX */
+#if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
+#endif 
+
+/* AIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
 #  define HAVE_ISINF 1
 #  define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
 #endif
 
-#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF))
-#  define HAVE_FINITE 1
-#  define finite(a) (! isnan(a) && ! isinf(a))
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
 #endif
 
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_INFINITE)
+#endif
 
 #include <stdio.h>
 int main(void){
-    double nan,inf,c,d;
-     fpsetmask(0);
-     /* some math to see if we get a segfault; */
-     nan=0.0/0.0;
-     inf=1.0/0.0;
-     c = 1.0;
-     c = c / 0.0; /* try getting fpe */
-     c = inf + nan;
-     c = inf / nan;
-     if (! isnan(nan)) {printf ("isnan(NaN) ... "); return 1;}
-     if (nan == nan) {printf ("nan != nan ..."); return 1;}
-     if (! isinf(inf)) {printf ("isinf(oo) ... "); return 1;}
-     if (! isinf(-inf)) {printf ("isinf(-oo) ... "); return 1;}
-     if (! inf > 0) {printf ("inf > 0 ... "); return 1;}
-     if (! -inf < 0) {printf ("inf < 0 ... "); return 1;}
-     return 0;
-}
+    double nan,inf,c,zero;
+    fpsetmask(0);
+    /* some math to see if we get a floating point exception */
+    zero=sin(0.0); /* don't let the compiler optimize us away */
+    nan=0.0/zero; /* especially here */
+    inf=1.0/zero; /* and here. I want to know if it can do the magic */
+		  /* at run time without sig fpe */
+    c = inf + nan;
+    c = inf / nan;
+    if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;}
+    if (nan == nan) {printf ("nan == nan ... "); return 1;}
+    if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;}
+    if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;}
+    if (! inf > 0) {printf ("not inf > 0 ... "); return 1;}
+    if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;}
+    return 0;
+ }
 EOF
-if { (eval echo configure:2970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   rd_cv_ieee_mask=yes
 else
@@ -2980,11 +3595,17 @@
 
 fi
 
-echo "$ac_t""$rd_cv_ieee_mask" 1>&6
-if test "$rd_cv_ieee_mask" != yes ; then
+if test x${rd_cv_ieee_mask} = "xyes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define MUST_DISABLE_FPMASK 1
+EOF
 
-echo $ac_n "checking if IEEE math works with signal(SIGFPE,SIG_IGN)""... $ac_c" 1>&6
-echo "configure:2988: checking if IEEE math works with signal(SIGFPE,SIG_IGN)" >&5
+	       PERLFLAGS="CCFLAGS=-DMUST_DISABLE_FPMASK"
+else
+ echo "$ac_t""no" 1>&6
+ echo $ac_n "checking if IEEE math works with signal(SIGFPE,SIG_IGN)""... $ac_c" 1>&6
+echo "configure:3609: checking if IEEE math works with signal(SIGFPE,SIG_IGN)" >&5
 if eval "test \"`echo '$''{'rd_cv_ieee_sigfpe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2992,68 +3613,75 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2996 "configure"
+#line 3617 "configure"
 #include "confdefs.h"
 #include <signal.h>
 
 #if HAVE_MATH_H
-#  include <math.h>                                                                                                                                        
+#  include <math.h>
 #endif
 
 #if HAVE_FLOAT_H
 #  include <float.h>  
 #endif
 
-/* for solaris */
+#if HAVE_IEEEFP_H
+#  include <ieeefp.h>
+#endif
+
+#if HAVE_FP_CLASS_H
+#  include <fp_class.h>
+#endif
+
+/* Solaris */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
 #  define HAVE_ISINF 1
-#  include <ieeefp.h>
 #  define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
 #endif
-/* for dec unix */
+
+/* Digital UNIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
 #  define HAVE_ISINF 1
-#  include <fp_class.h>
 #  define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
-#endif
-/* for HP-UX 10.20 */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY))
-#  define HAVE_ISINF 1
-#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
-#endif
-/* for AIX */
+#endif 
+
+/* AIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
 #  define HAVE_ISINF 1
 #  define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
 #endif
 
-#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF))
-#  define HAVE_FINITE 1
-#  define finite(a) (! isnan(a) && ! isinf(a))
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
 #endif
 
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_INFINITE)
+#endif
 
 #include <stdio.h>
 int main(void){
-    double nan,inf,c,d;
-     signal(SIGFPE,SIG_IGN);
-     /* some math to see if we get a segfault; */
-     nan=0.0/0.0;
-     inf=1.0/0.0;
-     c = 1.0;
-     c = c / 0.0; /* try getting fpe */
-     c = inf + nan;
-     c = inf / nan;
-     if (! isnan(nan)) {printf ("isnan(NaN) ... "); return 1;}
-     if (nan == nan) {printf ("nan != nan ..."); return 1;}
-     if (! isinf(inf)) {printf ("isinf(oo) ... "); return 1;}
-     if (! isinf(-inf)) {printf ("isinf(-oo) ... "); return 1;}
-     if (! inf > 0) {printf ("inf > 0 ... "); return 1;}
-     if (! -inf < 0) {printf ("inf < 0 ... "); return 1;}
-     return 0;
-}
+    double nan,inf,c,zero;
+    signal(SIGFPE,SIG_IGN);
+    /* some math to see if we get a floating point exception */
+    zero=sin(0.0); /* don't let the compiler optimize us away */
+    nan=0.0/zero; /* especially here */
+    inf=1.0/zero; /* and here. I want to know if it can do the magic */
+		  /* at run time without sig fpe */
+    c = inf + nan;
+    c = inf / nan;
+    if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;}
+    if (nan == nan) {printf ("nan == nan ... "); return 1;}
+    if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;}
+    if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;}
+    if (! inf > 0) {printf ("not inf > 0 ... "); return 1;}
+    if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;}
+    return 0;
+ }
 EOF
-if { (eval echo configure:3057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   rd_cv_ieee_sigfpe=yes
 else
@@ -3067,65 +3695,49 @@
 
 fi
 
-echo "$ac_t""$rd_cv_ieee_sigfpe" 1>&6
-if test "$rd_cv_ieee_sigfpe" != yes ; then
-
+if test x${rd_cv_ieee_sigfpe} = "xyes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define MUST_DISABLE_SIGFPE 1
+EOF
 
-echo "--------------------------------------------------------------"
-echo "Your Compiler does not do propper IEEE math ... "
-echo "Please find out how to make IEEE math work with your Compiler"
-echo "and let me know (oetiker at ee.ethz.ch)"
-echo "Check config.log to see what went wrong ..."
-echo ""
-exit 1
-       fi
-      fi
-     fi
-    fi
-   fi
-  fi
- fi
+                 PERLFLAGS="CCFLAGS=-DMUST_DISABLE_SIGFPE"
+else
+ echo "$ac_t""no" 1>&6
+ { echo "configure: error: 
+Your Compiler does not do propper IEEE math ... Please find out how to
+make IEEE math work with your compiler and let me know (oetiker at ee.ethz.ch).
+Check config.log to see what went wrong ...
+" 1>&2; exit 1; }
 fi
 
-CFLAGS=$oCFLAGS
 
-if test x$rd_cv_ieee_sigfpe = xyes; then
-   cat >> confdefs.h <<\EOF
-#define MUST_DISABLE_SIGFPE 1
-EOF
+fi
+
 
 fi
 
-if test x$rd_cv_ieee_mask = xyes; then
-   cat >> confdefs.h <<\EOF
-#define MUST_DISABLE_FPMASK 1
-EOF
 
-   CFLAGS="$CFLAGS -DMUST_DISABLE_FPMASK"
 fi
 
-if test x$rd_cv_ieee_switch = xyes; then
-   CFLAGS="$CFLAGS -ieee"
+
 fi
 
-if test x$rd_cv_ieee_nofold = xyes; then
-   CFLAGS="$CFLAGS -qfloat=nofold"
+
 fi
 
-if test x$rd_cv_ieee_flttrap = xyes; then
-   CFLAGS="$CFLAGS -w -qflttrap=enable:zerodivide"
+
 fi
 
-if test x$rd_cv_ieee_mswitch = xyes; then
-   CFLAGS="$CFLAGS -mieee"
+
 fi
 
-if test x$rd_cv_ieee_qswitch = xyes; then
-   CFLAGS="$CFLAGS -q float=rndsngl"
+
 fi
 
 
 
+
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -3238,24 +3850,18 @@
           examples/Makefile				\
           contrib/Makefile				\
           contrib/trytime/Makefile			\
-          contrib/log2rrd/Makefile			\
           contrib/log2rrd/log2rrd.pl			\
-          contrib/killspike/Makefile			\
           contrib/killspike/killspike.pl		\
-          contrib/rrdlastds/Makefile			\
           contrib/rrdlastds/rrdlastds.pl		\
-          contrib/rrdfetchnames/Makefile		\
           contrib/rrdfetchnames/rrdfetchnames.pl	\
-          contrib/add_ds/Makefile			\
           contrib/add_ds/add_ds.pl			\
 	  contrib/add_ds/batch.pl			\
-          contrib/rrd-file-icon/Makefile		\
-          contrib/rrdproc/Makefile			\
           doc/Makefile					\
           gd1.3/Makefile				\
-          libpng-1.0.3/Makefile				\
+          libpng-1.0.9/Makefile				\
           zlib-1.1.3/Makefile				\
           src/Makefile					\
+          tcl/Makefile					\
           Makefile config/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
@@ -3318,15 +3924,26 @@
 s%@GD_LIB_DIR@%$GD_LIB_DIR%g
 s%@PNG_LIB_DIR@%$PNG_LIB_DIR%g
 s%@ZLIB_LIB_DIR@%$ZLIB_LIB_DIR%g
+s%@PERLFLAGS@%$PERLFLAGS%g
 s%@PERL@%$PERL%g
 s%@COMP_PERL@%$COMP_PERL%g
+s%@SO_EXT@%$SO_EXT%g
+s%@PERL_MAKE_OPTIONS@%$PERL_MAKE_OPTIONS%g
+s%@COMP_TCL_TRUE@%$COMP_TCL_TRUE%g
+s%@COMP_TCL_FALSE@%$COMP_TCL_FALSE%g
+s%@TCL_PREFIX@%$TCL_PREFIX%g
+s%@TCL_SHLIB_CFLAGS@%$TCL_SHLIB_CFLAGS%g
+s%@TCL_SHLIB_LD@%$TCL_SHLIB_LD%g
+s%@TCL_SHLIB_SUFFIX@%$TCL_SHLIB_SUFFIX%g
+s%@TCL_PACKAGE_PATH@%$TCL_PACKAGE_PATH%g
+s%@TCL_LD_SEARCH_FLAGS@%$TCL_LD_SEARCH_FLAGS%g
 s%@CC@%$CC%g
 s%@CPP@%$CPP%g
 s%@RANLIB@%$RANLIB%g
-s%@LD@%$LD%g
-s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
 s%@LIBTOOL@%$LIBTOOL%g
+s%@NROFF@%$NROFF%g
+s%@TROFF@%$TROFF%g
 
 CEOF
 EOF
@@ -3379,24 +3996,18 @@
           examples/Makefile				\
           contrib/Makefile				\
           contrib/trytime/Makefile			\
-          contrib/log2rrd/Makefile			\
           contrib/log2rrd/log2rrd.pl			\
-          contrib/killspike/Makefile			\
           contrib/killspike/killspike.pl		\
-          contrib/rrdlastds/Makefile			\
           contrib/rrdlastds/rrdlastds.pl		\
-          contrib/rrdfetchnames/Makefile		\
           contrib/rrdfetchnames/rrdfetchnames.pl	\
-          contrib/add_ds/Makefile			\
           contrib/add_ds/add_ds.pl			\
 	  contrib/add_ds/batch.pl			\
-          contrib/rrd-file-icon/Makefile		\
-          contrib/rrdproc/Makefile			\
           doc/Makefile					\
           gd1.3/Makefile				\
-          libpng-1.0.3/Makefile				\
+          libpng-1.0.9/Makefile				\
           zlib-1.1.3/Makefile				\
           src/Makefile					\
+          tcl/Makefile					\
           Makefile"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
@@ -3580,10 +4191,10 @@
 
 
 echo $ac_n "checking in""... $ac_c" 1>&6
-echo "configure:3584: checking in" >&5
+echo "configure:4195: checking in" >&5
 echo "$ac_t""and out again" 1>&6
 
-echo $ac_n "ordering CD from http://ee-staff.ethz-ch/~oetiker/wish $ac_c" 1>&6
+echo $ac_n "ordering CD from http://ee-staff.ethz.ch/~oetiker/wish $ac_c" 1>&6
 sleep 1
 echo $ac_n ".$ac_c" 1>&6
 sleep 1
@@ -3599,13 +4210,14 @@
 echo "Config is DONE!"
 echo
 echo "Type 'make' to compile the software and use 'make install' to "
-echo "install everything to $prefix. If you want to install the perl"
+echo "install everything to: $prefix."
+echo
+echo "If you want to install the perl"
 echo "modules in site-perl, try 'make site-perl-install'."
 echo 
-echo "       ... that wishlist mentioned above does really exist. So if"
-echo "you feel like showing your appreciation for rrdtool this is the"
-echo "place to go. :-)"
+echo "       ... that wishlist is NO JOKE. If you find RRDtool useful"
+echo "make me happy. Go to http://ee-staff.ethz.ch/~oetiker/wish and"
+echo "place an order."
 echo 
-echo "                            -- Tobi Oetiker <oetiker at ee.ethz.ch>"
+echo "                               -- Tobi Oetiker <tobi at oetiker.ch>"
 echo "----------------------------------------------------------------"
-

Modified: trunk/orca/packages/rrdtool-1.0.33/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/Makefile.in	Sat Jul 13 21:25:50 2002
@@ -62,31 +62,42 @@
 target_alias = @target_alias@
 target_triplet = @target@
 CC = @CC@
-CFLAGS = @CFLAGS@
 CGI_LIB_DIR = @CGI_LIB_DIR@
 COMP_PERL = @COMP_PERL@
 CPP = @CPP@
 GD_LIB_DIR = @GD_LIB_DIR@
 LIBTOOL = @LIBTOOL@
+NROFF = @NROFF@
 PERL = @PERL@
+PERLFLAGS = @PERLFLAGS@
+PERL_MAKE_OPTIONS = @PERL_MAKE_OPTIONS@
 PNG_LIB_DIR = @PNG_LIB_DIR@
 RANLIB = @RANLIB@
+SO_EXT = @SO_EXT@
+TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
+TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
+TCL_PREFIX = @TCL_PREFIX@
+TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
+TCL_SHLIB_LD = @TCL_SHLIB_LD@
+TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
+TROFF = @TROFF@
+VERSION = @VERSION@
 ZLIB_LIB_DIR = @ZLIB_LIB_DIR@
 
 RSYNC = rsync --rsh=ssh
+
 # build the following subdirectories
-SUBDIRS = cgilib-0.4 config gd1.3 zlib-1.1.3 libpng-1.0.3 src doc examples contrib
+SUBDIRS = cgilib-0.4 config gd1.3 zlib-1.1.3 libpng-1.0.9           src doc examples contrib tcl
 
-# the following files are not mentioned in any other Makefile
-EXTRA_DIST = COPYRIGHT CHANGES NT-BUILD-TIPS.txt TODO CONTRIBUTORS   perl-piped/MANIFEST perl-piped/README perl-piped/rrdpl.ds?  perl-piped/RRDp.pm perl-piped/Makefile.PL  perl-piped/t/base.t  perl-shared/MANIFEST perl-shared/README perl-shared/RRDs.xs  perl-shared/ntmake.pl perl-shared/Makefile.PL perl-shared/t/base.t  perl-shared/rrdpl.ds? perl-shared/RRDs.pm
 
+# the following files are not mentioned in any other Makefile
+EXTRA_DIST = COPYRIGHT CHANGES NT-BUILD-TIPS.txt TODO CONTRIBUTORS rrdtool.spec  perl-piped/MANIFEST perl-piped/README perl-piped/rrdpl.ds?  perl-piped/RRDp.pm perl-piped/Makefile.PL  perl-piped/t/base.t  perl-shared/MANIFEST perl-shared/README perl-shared/RRDs.xs  perl-shared/ntmake.pl perl-shared/Makefile.PL perl-shared/t/base.t  perl-shared/rrdpl.ds? perl-shared/RRDs.pm
 
-#
 
 CLEANFILES = config.cache
 
 # use relaxed rules when building dists
-AUTOMAKE_OPTIONS = foreign
+AUTOMAKE_OPTIONS = foreign no-dependencies
 
 # where we keep local rules for automake
 ACLOCAL_M4 = $(top_srcdir)/config/aclocal.m4
@@ -100,7 +111,6 @@
 
 
 PACKAGE = @PACKAGE@
-VERSION = @VERSION@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
@@ -109,7 +119,7 @@
 all: all-redirect
 .SUFFIXES:
 $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile
+	cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
 
 Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
@@ -281,7 +291,7 @@
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
-	    cp -pr $$/$$file $(distdir)/$$file; \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
 	  else \
 	    test -f $(distdir)/$$file \
 	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -373,42 +383,34 @@
 
 
 # lets schedule the perl stuff for installation
+# the special call to install-sh is because the -d switch is not portable
 install-data-local:
-	$(INSTALL) -d -m 755 $(prefix)/lib/perl/auto/RRDs
-	$(INSTALL) -m 644 perl-piped/RRDp.pm $(prefix)/lib/perl
-	$(INSTALL) -m 644 perl-shared/RRDs.pm $(prefix)/lib/perl
-	$(INSTALL) -m 644 perl-shared/blib/arch/auto/RRDs/RRDs.bs $(prefix)/lib/perl/auto/RRDs
-	$(INSTALL) -m 755 perl-shared/blib/arch/auto/RRDs/RRDs.so $(prefix)/lib/perl/auto/RRDs
+	./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
 
 # rules for building the perl module
 perl_piped: perl-piped/Makefile
-	cd perl-piped && $(MAKE)  OPTIMIZE="$(CFLAGS)" CC="$(CC)"
+	cd perl-piped && $(MAKE)
 
 perl-piped/Makefile: perl-piped/Makefile.PL
-	cd perl-piped && $(PERL) Makefile.PL
+	cd perl-piped && $(PERL) Makefile.PL $(PERL_MAKE_OPTIONS)
 
 perl_shared: perl-shared/Makefile
-	cd perl-shared && $(MAKE) OPTIMIZE="$(CFLAGS)" CC="$(CC)"
+	cd perl-shared && $(MAKE)
 
 perl-shared/Makefile: perl-shared/Makefile.PL
-	cd perl-shared && $(PERL) Makefile.PL
+	cd perl-shared && $(PERL) Makefile.PL $(PERLFLAGS) $(PERL_MAKE_OPTIONS)
 
 # add the following to the all target
 all-local:	@COMP_PERL@
 
-# add to install
-
-#to-autoconf:
-#	aclocal -I config -I config/libtool --output=config/aclocal.m4
-#	automake --foreign
-#	autoconf --localdir=config
-#	autoheader --localdir=config
-#	./configure
-
 to-docs: to-versync
-	(cd doc && $(MAKE) clean && $(MAKE))
+	(cd doc && $(MAKE) clean && $(MAKE) && $(MAKE) pdf)
+	(cd website && wmk-1.7.4 -f manual tutorial contributors.wml && ./site-sync )
 
-#to-autoconf
 to-versync: 
 	perl -i -p -e '"$(VERSION)" =~ /(\d+)\.(\d+)\.(\d+)/; $$v=sprintf("%1d.%02d0%02d1" ,$${1},$${2},$${3}); s|VERSION\s*=\s*[\d.]+|VERSION = $$v|' perl-*/RRD?.pm
 	perl -i -p -e 's|RRDtool\s+\d+\.\d+\.\d+ |RRDtool $(VERSION) |' src/*.[ch]
@@ -417,8 +419,10 @@
 	mv $(PACKAGE)-$(VERSION).tar.gz archive
 
 to-scp: to-dist
-	$(RSYNC) CHANGES  archive/$(PACKAGE)-$(VERSION).tar.gz oetiker at tardis.ee.ethz.ch:/home/oetiker/public_html/webtools/rrdtool/pub/
-	$(RSYNC) CHANGES archive/$(PACKAGE)-$(VERSION).tar.gz tobi at ipn.caida.org:/ipn/web/Tools/RRDtool/pub/
+	cp CHANGES  archive/$(PACKAGE)-$(VERSION).tar.gz /home/oetiker/public_html/webtools/rrdtool/pub/
+	(cd /home/oetiker/public_html/webtools/rrdtool/pub; rm $(PACKAGE).tar.gz; ln -s $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE).tar.gz)
+
+#	$(RSYNC) CHANGES archive/$(PACKAGE)-$(VERSION).tar.gz tobi at ipn.caida.org:/ipn/web/Tools/RRDtool/pub/
 
 site-perl-inst: site-perl-install
 
@@ -426,6 +430,9 @@
 	cd perl-piped && $(MAKE) install
 	cd perl-shared && $(MAKE) install
 
+site-tcl-install:
+	cd tcl && $(MAKE) tcl-install
+
 clean-local:
 	cd perl-piped && test -f Makefile && $(MAKE) clean || true
 	cd perl-shared && test -f Makefile && $(MAKE) clean || true

Added: trunk/orca/packages/rrdtool-1.0.33/tcl/ifOctets.tcl
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/tcl/ifOctets.tcl	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/tcl/ifOctets.tcl	Sat Jul 13 21:25:50 2002
@@ -0,0 +1,45 @@
+#!/bin/sh
+# the next line restarts using tclsh -*- tcl -*- \
+exec tclsh8.2 "$0" "$@"
+
+#package require Tnm 3.0
+package require Rrd 1.0.13
+
+set rrdfile "[lindex $argv 0]-[lindex $argv 1].rrd"
+
+# create rrdfile if not yet existent
+if {[file exists $rrdfile] == 0} {
+    Rrd::create $rrdfile --step 5 \
+	    DS:inOctets:COUNTER:10:U:U DS:outOctets:COUNTER:10:U:U \
+	    RRA:AVERAGE:0.5:1:12
+}
+
+# get an snmp session context
+set session [Tnm::snmp generator -address [lindex $argv 0]]
+
+# walk through the ifDescr column to find the right interface
+$session walk descr IF-MIB!ifDescr {
+
+    # is this the right interface?
+    if {"[Tnm::snmp value $descr 0]" == "[lindex $argv 1]"} {
+
+	# get the instance part of this table row
+	set inst [lindex [Tnm::mib split [Tnm::snmp oid $descr 0]] 1]
+
+	# get the two interface's octet counter values
+	set in [lindex [lindex [$session get IF-MIB!ifInOctets.$inst] 0] 2]
+	set out [lindex [lindex [$session get IF-MIB!ifOutOctets.$inst] 0] 2]
+
+	# write the values to the rrd
+	puts "$in $out"
+	Rrd::update $rrdfile --template inOctets:outOctets N:$in:$out
+
+	Rrd::graph gaga.png --title "gaga" \
+		DEF:in=$rrdfile:inOctets:AVERAGE \
+		DEF:out=$rrdfile:outOctets:AVERAGE \
+		AREA:in#0000FF:inOctets \
+		LINE2:out#00C000:outOctets
+
+	#puts [Rrd::fetch $rrdfile AVERAGE]
+    }
+}

Added: trunk/orca/packages/rrdtool-1.0.33/tcl/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/tcl/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/tcl/Makefile.in	Sat Jul 13 21:25:50 2002
@@ -0,0 +1,224 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+CC = @CC@
+CGI_LIB_DIR = @CGI_LIB_DIR@
+COMP_PERL = @COMP_PERL@
+CPP = @CPP@
+LIBTOOL = @LIBTOOL@
+NROFF = @NROFF@
+PERL = @PERL@
+PERLFLAGS = @PERLFLAGS@
+PERL_MAKE_OPTIONS = @PERL_MAKE_OPTIONS@
+PNG_LIB_DIR = @PNG_LIB_DIR@
+RANLIB = @RANLIB@
+SO_EXT = @SO_EXT@
+TROFF = @TROFF@
+ZLIB_LIB_DIR = @ZLIB_LIB_DIR@
+
+EXTRA_DIST = README ifOctets.tcl tclrrd.c
+CLEANFILES = tclrrd.o tclrrd.so
+
+VERSION = @VERSION@
+
+CFLAGS = @CFLAGS@
+TCL_PREFIX = @TCL_PREFIX@
+TCL_SHLIB_LD = @TCL_SHLIB_LD@
+TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
+TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
+TCL_PACKAGE_PATH = $(DESTDIR)@TCL_PACKAGE_PATH@
+TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
+GD_LIB_DIR = $(top_srcdir)/@GD_LIB_DIR@
+
+SRC_DIR = $(top_srcdir)/src
+INCLUDES = -I$(TCL_PREFIX)/include -I$(SRC_DIR)  -I$(GD_LIB_DIR)
+LIBDIRS = -L$(libdir) -L$(SRC_DIR)  -L../src/.libs
+LIB_RUNTIME_DIR = $(libdir)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = ../config/config.h
+CONFIG_CLEAN_FILES = 
+DIST_COMMON =  README Makefile.am Makefile.in
+
+
+PACKAGE = @PACKAGE@
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps tcl/Makefile
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = tcl
+
+distdir: $(DISTFILES)
+	@for file in $(DISTFILES); do \
+	  d=$(srcdir); \
+	  if test -d $$d/$$file; then \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+	  fi; \
+	done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile all-local
+all-redirect: all-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+
+
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am:  mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am:  clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am:  distclean-generic clean-am
+	-rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am:  maintainer-clean-generic distclean-am
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-local all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+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@tclrrd.o: tclrrd.c
+ at 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@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@	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_FALSE@all-local:
+
+diff:
+	cd .. ; diff -c -u -r -N --exclude Makefile --exclude html --exclude doc --exclude Makefile.in --exclude Makefile.old --exclude perl --exclude aclocal.m4 --exclude configure rrdtool-1.0.13 rrdtool-1.0.13-ibr > rrdtool-1.0.13-ibr.patch
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: trunk/orca/packages/rrdtool-1.0.33/tcl/Makefile.am
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/tcl/Makefile.am	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/tcl/Makefile.am	Sat Jul 13 21:25:50 2002
@@ -0,0 +1,47 @@
+
+EXTRA_DIST = README ifOctets.tcl tclrrd.c
+CLEANFILES = tclrrd.o tclrrd.so
+
+VERSION = @VERSION@
+
+CFLAGS = @CFLAGS@
+TCL_PREFIX = @TCL_PREFIX@
+TCL_SHLIB_LD = @TCL_SHLIB_LD@
+TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
+TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
+TCL_PACKAGE_PATH = $(DESTDIR)@TCL_PACKAGE_PATH@
+TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
+GD_LIB_DIR       = $(top_srcdir)/@GD_LIB_DIR@
+
+SRC_DIR            = $(top_srcdir)/src
+INCLUDES           = -I$(TCL_PREFIX)/include -I$(SRC_DIR)  -I$(GD_LIB_DIR)
+LIBDIRS            = -L$(libdir) -L$(SRC_DIR)  -L../src/.libs
+LIB_RUNTIME_DIR    = $(libdir)
+
+if COMP_TCL
+
+tclrrd$(TCL_SHLIB_SUFFIX): tclrrd.o
+	$(TCL_SHLIB_LD) $(LIBDIRS) $< -o $@ -lrrd_private -lm
+
+tclrrd.o: tclrrd.c
+	$(CC) $(CFLAGS) $(TCL_SHLIB_CFLAGS) $(INCLUDES) -c $< -DVERSION=\"$(VERSION)\"
+
+all-local: tclrrd$(TCL_SHLIB_SUFFIX)
+
+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) ; \
+	fi
+	echo "package ifneeded Rrd $(VERSION) [list load [file join \$$dir .. tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)]]" > $(TCL_PACKAGE_PATH)/tclrrd$(VERSION)/pkgIndex.tcl
+
+else
+
+all-local:
+
+endif
+
+diff:
+	cd .. ; diff -c -u -r -N --exclude Makefile --exclude html --exclude doc --exclude Makefile.in --exclude Makefile.old --exclude perl --exclude aclocal.m4 --exclude configure rrdtool-1.0.13 rrdtool-1.0.13-ibr > rrdtool-1.0.13-ibr.patch
+	
+

Added: trunk/orca/packages/rrdtool-1.0.33/tcl/tclrrd.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/tcl/tclrrd.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/tcl/tclrrd.c	Sat Jul 13 21:25:51 2002
@@ -0,0 +1,389 @@
+/*
+ * tclrrd.c -- A TCL interpreter extension to access the RRD library.
+ *
+ * Copyright (c) 1999,2000 Frank Strauss, Technical University of Braunschweig.
+ *
+ * See the file "COPYING" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * $Id$
+ */
+
+
+
+#include <time.h>
+#include <tcl.h>
+#include <rrd_tool.h>
+#include <rrd_format.h>
+
+
+
+extern int __getopt_initialized;
+
+
+/*
+ * some rrd_XXX() functions might modify the argv strings passed to it.
+ * Furthermore, they use getopt() without initializing getopt's optind
+ * variable themselves. Hence, we need to do some preparation before
+ * calling the rrd library functions.
+ */
+static char ** getopt_init(argc, argv)
+    int argc;
+    char *argv[];
+{
+    char **argv2;
+    int i;
+    
+    optind = 0;
+
+    argv2 = calloc(argc, sizeof(char *));
+    for (i = 0; i < argc; i++) {
+	argv2[i] = strdup(argv[i]);
+    }
+    return argv2;
+}
+
+static void getopt_cleanup(argc, argv2)
+    int argc;
+    char *argv2[];
+{
+    int i;
+    
+    for (i = 0; i < argc; i++) {
+	free(argv2[i]);
+    }
+    free(argv2);
+}
+
+
+
+static int
+Rrd_Create(clientData, interp, argc, argv)
+    ClientData clientData;
+    Tcl_Interp *interp;
+    int argc;
+    char *argv[];
+{
+    char **argv2;
+
+    argv2 = getopt_init(argc, argv);
+    rrd_create(argc, argv2);
+    getopt_cleanup(argc, argv2);
+    
+    if (rrd_test_error()) {
+	Tcl_AppendResult(interp, "RRD Error: ",
+			 rrd_get_error(), (char *) NULL);
+        rrd_clear_error();
+	return TCL_ERROR;
+    }
+
+    return TCL_OK;
+}
+
+
+
+static int
+Rrd_Dump(clientData, interp, argc, argv)
+    ClientData clientData;
+    Tcl_Interp *interp;
+    int argc;
+    char *argv[];
+{
+    char **argv2;
+    
+    argv2 = getopt_init(argc, argv);
+    rrd_dump(argc, argv2);
+    getopt_cleanup(argv, argv2);
+
+    /* NOTE: rrd_dump() writes to stdout. No interaction with TCL. */
+
+    if (rrd_test_error()) {
+	Tcl_AppendResult(interp, "RRD Error: ",
+			 rrd_get_error(), (char *) NULL);
+        rrd_clear_error();
+	return TCL_ERROR;
+    }
+
+    return TCL_OK;
+}
+
+
+
+static int
+Rrd_Last(clientData, interp, argc, argv)
+    ClientData clientData;
+    Tcl_Interp *interp;
+    int argc;
+    char *argv[];
+{
+    time_t t;
+    char **argv2;
+    
+    argv2 = getopt_init(argc, argv);
+    t = rrd_last(argc, argv2);
+    getopt_cleanup(argv, argv2);
+
+
+    if (rrd_test_error()) {
+	Tcl_AppendResult(interp, "RRD Error: ",
+			 rrd_get_error(), (char *) NULL);
+        rrd_clear_error();
+	return TCL_ERROR;
+    }
+
+    Tcl_SetIntObj(Tcl_GetObjResult(interp), t);
+
+    return TCL_OK;
+}
+
+
+
+static int
+Rrd_Update(clientData, interp, argc, argv)
+    ClientData clientData;
+    Tcl_Interp *interp;
+    int argc;
+    char *argv[];
+{
+    char **argv2;
+    
+    argv2 = getopt_init(argc, argv);
+    rrd_update(argc, argv2);
+    getopt_cleanup(argv, argv2);
+
+    if (rrd_test_error()) {
+	Tcl_AppendResult(interp, "RRD Error: ",
+			 rrd_get_error(), (char *) NULL);
+        rrd_clear_error();
+	return TCL_ERROR;
+    }
+
+    return TCL_OK;
+}
+
+
+
+static int
+Rrd_Fetch(clientData, interp, argc, argv)
+    ClientData clientData;
+    Tcl_Interp *interp;
+    int argc;
+    char *argv[];
+{
+    time_t start, end;
+    unsigned long step, ds_cnt, i, ii;
+    rrd_value_t *data, *datai;
+    char **ds_namv;
+    Tcl_Obj *listPtr;
+    char s[30];
+    char **argv2;
+    
+    argv2 = getopt_init(argc, argv);
+    if (rrd_fetch(argc, argv2, &start, &end, &step,
+		  &ds_cnt, &ds_namv, &data) != -1) {
+        datai = data;
+        listPtr = Tcl_GetObjResult(interp);
+        for (i = start; i <= end; i += step) {
+            for (ii = 0; ii < ds_cnt; ii++) {
+		sprintf(s, "%.2f", *(datai++));
+                Tcl_ListObjAppendElement(interp, listPtr,
+					 Tcl_NewStringObj(s, -1));
+            }
+        }
+        for (i=0; i<ds_cnt; i++) free(ds_namv[i]);
+        free(ds_namv);
+        free(data);
+    }
+    getopt_cleanup(argv, argv2);
+
+    if (rrd_test_error()) {
+	Tcl_AppendResult(interp, "RRD Error: ",
+			 rrd_get_error(), (char *) NULL);
+        rrd_clear_error();
+	return TCL_ERROR;
+    }
+
+    return TCL_OK;
+}
+
+
+
+static int
+Rrd_Graph(clientData, interp, argc, argv)
+    ClientData clientData;
+    Tcl_Interp *interp;
+    int argc;
+    char *argv[];
+{
+    char **calcpr;
+    int xsize, ysize;
+    Tcl_Obj *listPtr;
+    char **argv2;
+    
+    calcpr = NULL;
+
+    argv2 = getopt_init(argc, argv);
+    if (rrd_graph(argc, argv2, &calcpr, &xsize, &ysize) != -1 ) {
+        listPtr = Tcl_GetObjResult(interp);
+        Tcl_ListObjAppendElement(interp, listPtr, Tcl_NewIntObj(xsize));
+        Tcl_ListObjAppendElement(interp, listPtr, Tcl_NewIntObj(ysize));
+        if (calcpr) {
+#if 0
+	    int i;
+	    
+            for(i = 0; calcpr[i]; i++){
+                printf("%s\n", calcpr[i]);
+                free(calcpr[i]);
+            } 
+#endif
+            free(calcpr);
+        }
+    }
+    getopt_cleanup(argv, argv2);
+
+    if (rrd_test_error()) {
+	Tcl_AppendResult(interp, "RRD Error: ",
+			 rrd_get_error(), (char *) NULL);
+        rrd_clear_error();
+	return TCL_ERROR;
+    }
+
+    return TCL_OK;
+}
+
+
+
+static int
+Rrd_Tune(clientData, interp, argc, argv)
+    ClientData clientData;
+    Tcl_Interp *interp;
+    int argc;
+    char *argv[];
+{
+    char **argv2;
+    
+    argv2 = getopt_init(argc, argv);
+    rrd_tune(argc, argv2);
+    getopt_cleanup(argv, argv2);
+
+    if (rrd_test_error()) {
+	Tcl_AppendResult(interp, "RRD Error: ",
+			 rrd_get_error(), (char *) NULL);
+        rrd_clear_error();
+	return TCL_ERROR;
+    }
+
+    return TCL_OK;
+}
+
+
+
+static int
+Rrd_Resize(clientData, interp, argc, argv)
+    ClientData clientData;
+    Tcl_Interp *interp;
+    int argc;
+    char *argv[];
+{
+    char **argv2;
+    
+    argv2 = getopt_init(argc, argv);
+    rrd_resize(argc, argv2);
+    getopt_cleanup(argv, argv2);
+
+    if (rrd_test_error()) {
+	Tcl_AppendResult(interp, "RRD Error: ",
+			 rrd_get_error(), (char *) NULL);
+        rrd_clear_error();
+	return TCL_ERROR;
+    }
+
+    return TCL_OK;
+}
+
+
+
+static int
+Rrd_Restore(clientData, interp, argc, argv)
+    ClientData clientData;
+    Tcl_Interp *interp;
+    int argc;
+    char *argv[];
+{
+    char **argv2;
+    
+    argv2 = getopt_init(argc, argv);
+    rrd_restore(argc, argv2);
+    getopt_cleanup(argv, argv2);
+
+    if (rrd_test_error()) {
+	Tcl_AppendResult(interp, "RRD Error: ",
+			 rrd_get_error(), (char *) NULL);
+        rrd_clear_error();
+	return TCL_ERROR;
+    }
+
+    return TCL_OK;
+}
+
+
+
+/*
+ * The following structure defines the commands in the Rrd extension.
+ */
+
+typedef struct {
+    char *name;			/* Name of the command. */
+    Tcl_CmdProc *proc;		/* Procedure for command. */
+} CmdInfo;
+
+static CmdInfo rrdCmds[] = {
+    { "Rrd::create",	Rrd_Create		},
+    { "Rrd::dump",	Rrd_Dump		},
+    { "Rrd::last",	Rrd_Last		},
+    { "Rrd::update",	Rrd_Update		},
+    { "Rrd::fetch",	Rrd_Fetch		},
+    { "Rrd::graph",	Rrd_Graph		},
+    { "Rrd::tune",	Rrd_Tune		},
+    { "Rrd::resize",	Rrd_Resize		},
+    { "Rrd::restore",	Rrd_Restore		},
+    { (char *) NULL,	(Tcl_CmdProc *) NULL	}
+};
+
+
+
+int
+Tclrrd_Init(interp, safe)
+    Tcl_Interp *interp;
+    int safe;
+{ 
+    CmdInfo *cmdInfoPtr;
+    Tcl_CmdInfo info;
+
+    if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 1) == NULL) {
+        return TCL_ERROR;
+    }
+
+    Tcl_SetVar2(interp, "rrd", "version", VERSION, TCL_GLOBAL_ONLY);
+
+    for (cmdInfoPtr = rrdCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) {
+	/*
+	 * Check if the command already exists and return an error
+	 * to ensure we detect name clashes while loading the Rrd
+	 * extension.
+	 */
+	if (Tcl_GetCommandInfo(interp, cmdInfoPtr->name, &info)) {
+	    Tcl_AppendResult(interp, "command \"", cmdInfoPtr->name,
+			     "\" already exists", (char *) NULL);
+	    return TCL_ERROR;
+	}
+	Tcl_CreateCommand(interp, cmdInfoPtr->name, cmdInfoPtr->proc,
+		          (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+    }
+
+    if (Tcl_PkgProvide(interp, "Rrd", VERSION) != TCL_OK) {
+	return TCL_ERROR;
+    }
+
+    return TCL_OK;
+}

Added: trunk/orca/packages/rrdtool-1.0.33/tcl/README
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/tcl/README	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/tcl/README	Sat Jul 13 21:25:51 2002
@@ -0,0 +1,31 @@
+TCLRRD -- A TCL interpreter extension to access the RRD library,
+	  contributed to Tobias Oetiker's RRD tools.
+
+Copyright (c) 1999,2000 Frank Strauss, Technical University of Braunschweig.
+
+See the file "COPYING" for information on usage and redistribution
+of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+TCLRRD adds a dynamically loadable package to the Tcl 8.x interpreter
+to access all RRD functions as of RRDtool 1.0.13. All command names
+and arguments are equal to those of RRDtool. They are assigned to the
+namespace `Rrd', e.g.  `Rrd::create'. Return values are a bit
+different from plain rrdtool behavior to enable more native Tcl
+usage. Errors are mapped to the TCL_ERROR return code together with
+the RRD error strings.
+
+TCLRRD makes it easy to combine RRD use with advanced SNMP functionality
+of scotty (http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/). E.g., it's easy
+to use some scotty code to get the counters of some interfaces by their
+interface name and then use Rrd::update to store the values. Furthermore,
+data source types (see RRD::create documentation) and integer value ranges
+could be easily retrieved from MIB information.
+
+TCLRRD has been written on a Linux system for use with Tcl 8.x. It should
+work on many other platforms, although it has not been tested. There are
+no fool proof installation procedures. Take a look at Makefile.am and
+adapt it, if required.
+
+TCLRRD has been written for RRD 1.0.13.
+
+	Frank Strauss <strauss at ibr.cs.tu-bs.de>, 09-Mar-2000

Modified: trunk/orca/packages/rrdtool-1.0.33/configure.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/configure.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/configure.in	Sat Jul 13 21:25:51 2002
@@ -16,10 +16,11 @@
 AC_CANONICAL_SYSTEM
 
 dnl tell automake the this script is for rrdtool
-AM_INIT_AUTOMAKE(rrdtool, 1.0.13)
+AM_INIT_AUTOMAKE(rrdtool, 1.0.33)
+AC_SUBST(VERSION)
 
 dnl where we install our stuff ...
-AC_PREFIX_DEFAULT( /usr/local/rrdtool-1.0.13 )
+AC_PREFIX_DEFAULT( /usr/local/rrdtool-1.0.33 )
 
 dnl tell automake which file to use as config header
 AM_CONFIG_HEADER(config/config.h)
@@ -30,7 +31,7 @@
 dnl Define library subdirectory names here.
 CGI_LIB_DIR=cgilib-0.4
 GD_LIB_DIR=gd1.3
-PNG_LIB_DIR=libpng-1.0.3
+PNG_LIB_DIR=libpng-1.0.9
 ZLIB_LIB_DIR=zlib-1.1.3
 
 dnl substitute them in all the files listed in AC_OUTPUT
@@ -38,24 +39,64 @@
 AC_SUBST(GD_LIB_DIR)
 AC_SUBST(PNG_LIB_DIR)
 AC_SUBST(ZLIB_LIB_DIR)
-
+AC_SUBST(PERLFLAGS)
 
 dnl Check for Perl.
 AC_PATH_PROG(PERL, perl, no)
-if test "x$PERL" = "nox"; then
+if test "x$PERL" = "xno"; then
 	COMP_PERL=
 else
 	COMP_PERL="perl_piped perl_shared"
+	AC_MSG_CHECKING(for shared library extension)
+	SO_EXT=`$PERL -e 'use Config; if (defined $Config{so} and $Config{so} ne 'a') {print "$Config{so}\n"} else {print "so\n"};'`
+	AC_MSG_RESULT($SO_EXT)
 fi
 AC_SUBST(COMP_PERL)
+AC_SUBST(SO_EXT)
+
+dnl Check for Tcl.
+withval=""
+AC_ARG_WITH(tcllib,[  --with-tcllib=DIR       location of the tclConfig.sh])
+found=0
+AC_MSG_CHECKING(for tclConfig.sh in $withval)
+if test -f "$withval/tclConfig.sh" ; then
+    	tcl_config=$withval/tclConfig.sh
+        found=1
+        AC_MSG_RESULT(yes)
+        break
+else
+        AC_MSG_RESULT(no)
+fi
+
+if test $found -eq 0 ; then
+        AC_MSG_WARN([tclConfig.sh not found - Tcl interface won't be built])
+else
+	. $tcl_config
+fi
 
+dnl Pass additional perl options when generating Makefile from Makefile.PL
+# Options to pass when configuring perl module
+AC_ARG_WITH(perl-options,
+[  --with-perl-options=[OPTIONS]  options to pass on command-line when
+                          generating Makefile from Makefile.PL],
+[PERL_MAKE_OPTIONS=$withval])
+AC_SUBST(PERL_MAKE_OPTIONS)
+
+AM_CONDITIONAL(COMP_TCL, test x$found = x1 )
+
+AC_SUBST(TCL_PREFIX)
+AC_SUBST(TCL_SHLIB_CFLAGS)
+AC_SUBST(TCL_SHLIB_LD)
+AC_SUBST(TCL_SHLIB_SUFFIX)
+AC_SUBST(TCL_PACKAGE_PATH)
+AC_SUBST(TCL_LD_SEARCH_FLAGS)
 
 dnl Check for the compiler and static/shared library creation.
 AC_PROG_CC
 AC_PROG_CPP
 dnl RRD_ACLOCAL_FIND_LIBTOOL
 
-dnl don't build a shared library ... perl will do it's own magic. 
+dnl don't build a shared library ...
 dnl this can be changed when running configure
 AC_DISABLE_SHARED
 
@@ -63,7 +104,7 @@
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h fp_class.h malloc.h unistd.h math.h sys/time.h sys/times.h sys/param.h sys/resource.h float.h)
+AC_CHECK_HEADERS(fcntl.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/time.h sys/times.h sys/param.h sys/resource.h float.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -71,35 +112,36 @@
 AC_STRUCT_TM
 
 dnl Checks for libraries.
-AC_CHECK_LIB(m, acos)
+AC_CHECK_FUNC(acos, , AC_CHECK_LIB(m, acos))
 
-dnl Does the compiler like -Wall and -pedantic ?
-oCFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -Wall -pedantic"
-AC_CACHE_CHECK(if we can use GCC-specific compiler options, rd_cv_gcc_opt,
-               [AC_TRY_COMPILE( , return 0 ,
-             	    rd_cv_gcc_opt=yes,
-		    rd_cv_gcc_opt=no )
-	       ]
-       )
-if test $rd_cv_gcc_opt = no; then
-	CFLAGS=$oCFLAGS
+dnl Check for nroff
+AC_PATH_PROGS(NROFF, gnroff nroff)
+AC_PATH_PROGS(TROFF, groff troff)
+
+dnl Does the compiler like -Wall and -pedantic?
+if test "x$GCC" = "xyes"; then
+  oCFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline"
+  AC_CACHE_CHECK(if we can use GCC-specific compiler options, rd_cv_gcc_opt,
+                [AC_TRY_COMPILE( , return 0 ,
+                    rd_cv_gcc_opt=yes,
+                    rd_cv_gcc_opt=no )
+               ]
+        )
+  if test $rd_cv_gcc_opt = no; then
+         CFLAGS=$oCFLAGS
+  fi
 fi
 
-dnl Can the compiler take -fPIC
-
-oCFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -fPIC"
-AC_CACHE_CHECK(if we can use -fPIC as this may help building the perl module, rd_cv_pic,
-               [AC_TRY_RUN([int main(void){return 0;}],
-             	    rd_cv_pic=yes,
-		    rd_cv_pic=no,:)
-	       ]
-       )
-if test $rd_cv_pic = no; then
-	CFLAGS=$oCFLAGS
-fi
+dnl add pic flag in any case this makes sure all our code is relocatable
+CFLAGS="$CFLAGS "`grep pic_flag= libtool | sed -e 's/.*pic_flag=//' -e 's/"//g'`
 
+dnl it seems that hpux chockes on -fPIC for some reason
+case $target_os in
+*hpux*)
+	CLFAGS=`echo $CFLAGS|sed -e 's/-fPIC/-fpic/g'`
+;;
+esac
 
 dnl Checks for library functions.
 AC_FUNC_STRFTIME
@@ -107,7 +149,26 @@
 
 dnl for each function found we get a definition in config.h 
 dnl of the form HAVE_FUNCTION
-AC_CHECK_FUNCS(snprintf vsnprintf fpclass class fpclassify fp_class isnan finite isinf memmove strchr mktime getrusage gettimeofday)
+
+AC_CHECK_FUNCS(strerror snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday)
+
+dnl HP-UX 11.00 does not have finite but does have isfinite as a macro
+AC_CHECK_FUNCS(fpclassify, ,
+  [AC_MSG_CHECKING(for fpclassify with <math.h>)
+    AC_TRY_LINK([#include <math.h>], [float f = 0.0; fpclassify(f)],
+      AC_MSG_RESULT(yes)
+      AC_DEFINE(HAVE_FPCLASSIFY), AC_MSG_RESULT(no))])
+AC_CHECK_FUNCS(finite, ,
+  [AC_CHECK_FUNCS(isfinite, ,
+    [AC_MSG_CHECKING(for isfinite with <math.h>)
+    AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
+      AC_MSG_RESULT(yes)
+      AC_DEFINE(HAVE_ISFINITE), AC_MSG_RESULT(no))])])
+AC_CHECK_FUNCS(isinf, ,
+  [AC_MSG_CHECKING(for isinf with <math.h>)
+    AC_TRY_LINK([#include <math.h>], [float f = 0.0; isinf(f)],
+      AC_MSG_RESULT(yes)
+      AC_DEFINE(HAVE_ISINF), AC_MSG_RESULT(no))])
 
 dnl what does realloc do if it gets called with a NULL pointer
 
@@ -125,152 +186,122 @@
 AC_DEFINE(NO_NULL_REALLOC)
 fi
 
-dnl determine how to get IEEE math to work on this box.
+dnl determine how to get IEEE math working
+dnl AC_IEEE(MESSAGE, set rd_cv_ieee_[var] variable, INCLUDES,
+dnl   FUNCTION-BODY, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
 
 AC_DEFUN(AC_IEEE, 
-AC_CACHE_CHECK([if IEEE math works $1], [rd_cv_ieee_$2],
+AC_MSG_CHECKING([if IEEE math works $1])
+AC_CACHE_VAL([rd_cv_ieee_$2],
 [AC_TRY_RUN([$3
 
 #if HAVE_MATH_H
-#  include <math.h>                                                                                                                                        
+#  include <math.h>
 #endif
 
 #if HAVE_FLOAT_H
 #  include <float.h>  
 #endif
 
-/* for solaris */
+#if HAVE_IEEEFP_H
+#  include <ieeefp.h>
+#endif
+
+#if HAVE_FP_CLASS_H
+#  include <fp_class.h>
+#endif
+
+/* Solaris */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
 #  define HAVE_ISINF 1
-#  include <ieeefp.h>
 #  define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
 #endif
-/* for dec unix */
+
+/* Digital UNIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
 #  define HAVE_ISINF 1
-#  include <fp_class.h>
 #  define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
-#endif
-/* for HP-UX 10.20 */
-#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY))
-#  define HAVE_ISINF 1
-#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
-#endif
-/* for AIX */
+#endif 
+
+/* AIX */
 #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
 #  define HAVE_ISINF 1
 #  define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
 #endif
 
-#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF))
-#  define HAVE_FINITE 1
-#  define finite(a) (! isnan(a) && ! isinf(a))
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
 #endif
 
+#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
+#  define HAVE_ISINF 1
+#  define isinf(a) (fpclassify(a) == FP_INFINITE)
+#endif
 
 #include <stdio.h>
 int main(void){
-    double nan,inf,c,d;
-     $4;
-     /* some math to see if we get a segfault; */
-     nan=0.0/0.0;
-     inf=1.0/0.0;
-     c = 1.0;
-     c = c / 0.0; /* try getting fpe */
-     c = inf + nan;
-     c = inf / nan;
-     if (! isnan(nan)) {printf ("isnan(NaN) ... "); return 1;}
-     if (nan == nan) {printf ("nan != nan ..."); return 1;}
-     if (! isinf(inf)) {printf ("isinf(oo) ... "); return 1;}
-     if (! isinf(-inf)) {printf ("isinf(-oo) ... "); return 1;}
-     if (! inf > 0) {printf ("inf > 0 ... "); return 1;}
-     if (! -inf < 0) {printf ("inf < 0 ... "); return 1;}
-     return 0;
-}],
-           [rd_cv_ieee_$2=yes],[rd_cv_ieee_$2=no],:)]))
-
-oCFLAGS=$CFLAGS
-unset CFLAGS
-
-AC_IEEE([out of the box],works)
-if test "$rd_cv_ieee_works" != yes ; then
-
-CFLAGS=-ieee
-AC_IEEE([with the -ieee switch],switch)
-if test "$rd_cv_ieee_switch" != yes ; then
-
-CFLAGS=-qfloat=nofold
-AC_IEEE([with the -qfloat=nofold switch],nofold)
-if test "$rd_cv_ieee_nofold" != yes ; then
-
-CFLAGS="-w -qflttrap=enable:zerodivide"
-AC_IEEE([with the -w -qflttrap=enable:zerodivide],flttrap)
-if test "$rd_cv_ieee_flttrap" != yes ; then
-
-CFLAGS=-mieee
-AC_IEEE([with the -mieee switch],mswitch)
-if test "$rd_cv_ieee_mswitch" != yes ; then
-
-CFLAGS="-q float=rndsngl"
-AC_IEEE([with the -q float=rndsngl switch],qswitch)
-if test "$rd_cv_ieee_qswitch" != yes ; then
-
-unset CFLAGS
-AC_IEEE([with fpsetmask(0)],mask,[#include <floatingpoint.h>],[fpsetmask(0)])
-if test "$rd_cv_ieee_mask" != yes ; then
-
-AC_IEEE([with signal(SIGFPE,SIG_IGN)],sigfpe,[#include <signal.h>],[signal(SIGFPE,SIG_IGN)])
-if test "$rd_cv_ieee_sigfpe" != yes ; then
-
-
-echo "--------------------------------------------------------------"
-echo "Your Compiler does not do propper IEEE math ... "
-echo "Please find out how to make IEEE math work with your Compiler"
-echo "and let me know (oetiker at ee.ethz.ch)"
-echo "Check config.log to see what went wrong ..."
-echo ""
-exit 1
-       fi
-      fi
-     fi
-    fi
-   fi
-  fi
- fi
-fi
-
-CFLAGS=$oCFLAGS
-
-if test x$rd_cv_ieee_sigfpe = xyes; then
-   AC_DEFINE(MUST_DISABLE_SIGFPE)
-fi
-
-if test x$rd_cv_ieee_mask = xyes; then
-   AC_DEFINE(MUST_DISABLE_FPMASK)
-   CFLAGS="$CFLAGS -DMUST_DISABLE_FPMASK"
-fi
-
-if test x$rd_cv_ieee_switch = xyes; then
-   CFLAGS="$CFLAGS -ieee"
-fi
-
-if test x$rd_cv_ieee_nofold = xyes; then
-   CFLAGS="$CFLAGS -qfloat=nofold"
-fi
-
-if test x$rd_cv_ieee_flttrap = xyes; then
-   CFLAGS="$CFLAGS -w -qflttrap=enable:zerodivide"
+    double nan,inf,c,zero;
+    $4;
+    /* some math to see if we get a floating point exception */
+    zero=sin(0.0); /* don't let the compiler optimize us away */
+    nan=0.0/zero; /* especially here */
+    inf=1.0/zero; /* and here. I want to know if it can do the magic */
+		  /* at run time without sig fpe */
+    c = inf + nan;
+    c = inf / nan;
+    if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;}
+    if (nan == nan) {printf ("nan == nan ... "); return 1;}
+    if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;}
+    if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;}
+    if (! inf > 0) {printf ("not inf > 0 ... "); return 1;}
+    if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;}
+    return 0;
+ }],
+
+rd_cv_ieee_$2=yes,
+rd_cv_ieee_$2=no,
+:)])
+dnl these we run regardles is cached or not
+if test x${rd_cv_ieee_$2} = "xyes"; then
+ AC_MSG_RESULT(yes)
+ $5
+else
+ AC_MSG_RESULT(no)
+ $6
 fi
 
-if test x$rd_cv_ieee_mswitch = xyes; then
-   CFLAGS="$CFLAGS -mieee"
-fi
+)
 
-if test x$rd_cv_ieee_qswitch = xyes; then
-   CFLAGS="$CFLAGS -q float=rndsngl"
-fi
+_cflags=${CFLAGS}
+AC_IEEE([out of the box], works, , , ,
+  [CFLAGS="$_cflags -ieee"
+  AC_IEEE([with the -ieee switch], switch, , , ,
+    [CFLAGS="$_cflags -qfloat=nofold"
+    AC_IEEE([with the -qfloat=nofold switch], nofold, , , ,
+      [CFLAGS="$_cflags -w -qflttrap=enable:zerodivide"
+      AC_IEEE([with the -w -qflttrap=enable:zerodivide], flttrap, , , ,
+       [CFLAGS="$_cflags -mieee"
+       AC_IEEE([with the -mieee switch], mswitch, , , ,
+         [CFLAGS="$_cflags -q float=rndsngl"
+         AC_IEEE([with the -q float=rndsngl switch], qswitch, , , ,
+           [CFLAGS="$_cflags -OPT:IEEE_comparisons=ON"
+           AC_IEEE([with the -OPT:IEEE_comparisons=ON switch], ieeecmpswitch, , , ,
+             [CFLAGS=$_cflags
+             AC_IEEE([with fpsetmask(0)], mask,
+               [#include <floatingpoint.h>], [fpsetmask(0)],
+               [AC_DEFINE(MUST_DISABLE_FPMASK)
+	       PERLFLAGS="CCFLAGS=-DMUST_DISABLE_FPMASK"],
+               [AC_IEEE([with signal(SIGFPE,SIG_IGN)], sigfpe,
+                 [#include <signal.h>], [signal(SIGFPE,SIG_IGN)],
+                 [AC_DEFINE(MUST_DISABLE_SIGFPE)
+                 PERLFLAGS="CCFLAGS=-DMUST_DISABLE_SIGFPE"],		
+                 AC_MSG_ERROR([
+Your Compiler does not do propper IEEE math ... Please find out how to
+make IEEE math work with your compiler and let me know (oetiker at ee.ethz.ch).
+Check config.log to see what went wrong ...
+]))])])])])])])])])
 
-AC_SUBST(CFLAGS)
 
 AC_OUTPUT(cgilib-0.4/Makefile				\
           config/Makefile				\
@@ -283,31 +314,25 @@
           examples/Makefile				\
           contrib/Makefile				\
           contrib/trytime/Makefile			\
-          contrib/log2rrd/Makefile			\
           contrib/log2rrd/log2rrd.pl			\
-          contrib/killspike/Makefile			\
           contrib/killspike/killspike.pl		\
-          contrib/rrdlastds/Makefile			\
           contrib/rrdlastds/rrdlastds.pl		\
-          contrib/rrdfetchnames/Makefile		\
           contrib/rrdfetchnames/rrdfetchnames.pl	\
-          contrib/add_ds/Makefile			\
           contrib/add_ds/add_ds.pl			\
 	  contrib/add_ds/batch.pl			\
-          contrib/rrd-file-icon/Makefile		\
-          contrib/rrdproc/Makefile			\
           doc/Makefile					\
           gd1.3/Makefile				\
-          libpng-1.0.3/Makefile				\
+          libpng-1.0.9/Makefile				\
           zlib-1.1.3/Makefile				\
           src/Makefile					\
+          tcl/Makefile					\
           Makefile,					\
           [chmod +x examples/*.cgi examples/*.pl contrib/*/*.pl])
 
 AC_MSG_CHECKING(in)
 AC_MSG_RESULT(and out again)
 
-echo $ac_n "ordering CD from http://ee-staff.ethz-ch/~oetiker/wish $ac_c" 1>&6
+echo $ac_n "ordering CD from http://ee-staff.ethz.ch/~oetiker/wish $ac_c" 1>&6
 sleep 1
 echo $ac_n ".$ac_c" 1>&6
 sleep 1
@@ -323,13 +348,14 @@
 echo "Config is DONE!"
 echo
 echo "Type 'make' to compile the software and use 'make install' to "
-echo "install everything to $prefix. If you want to install the perl"
+echo "install everything to: $prefix."
+echo
+echo "If you want to install the perl"
 echo "modules in site-perl, try 'make site-perl-install'."
 echo 
-echo "       ... that wishlist mentioned above does really exist. So if"
-echo "you feel like showing your appreciation for rrdtool this is the"
-echo "place to go. :-)"
+echo "       ... that wishlist is NO JOKE. If you find RRDtool useful"
+echo "make me happy. Go to http://ee-staff.ethz.ch/~oetiker/wish and"
+echo "place an order."
 echo 
-echo "                            -- Tobi Oetiker <oetiker at ee.ethz.ch>"
+echo "                               -- Tobi Oetiker <tobi at oetiker.ch>"
 echo "----------------------------------------------------------------"
-

Modified: trunk/orca/packages/rrdtool-1.0.33/src/parsetime.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/parsetime.h	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/parsetime.h	Sat Jul 13 21:25:51 2002
@@ -1,23 +1,8 @@
 #ifndef __PARSETIME_H__
 #define __PARSETIME_H__
 
-#include <time.h>
 #include <stdio.h>
 
-typedef enum {
-	ABSOLUTE_TIME,
-	RELATIVE_TO_START_TIME, 
-	RELATIVE_TO_END_TIME
-} timetype;
-
-#define TIME_OK NULL
-
-struct time_value {
-  timetype type;
-  long offset;
-  struct tm tm;
-};
-
-char *parsetime(char *spec, struct time_value *ptv);
+#include "rrd.h"
 
 #endif

Modified: trunk/orca/packages/rrdtool-1.0.33/src/gifsize.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/gifsize.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/gifsize.c	Sat Jul 13 21:25:51 2002
@@ -1,5 +1,5 @@
 /****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997,1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  ****************************************************************************
  * gifsize.c  provides the function gifsize which determines the size of a gif
  ****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.33/src/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/Makefile.in	Sat Jul 13 21:25:51 2002
@@ -69,12 +69,23 @@
 target_alias = @target_alias@
 target_triplet = @target@
 CC = @CC@
-CFLAGS = @CFLAGS@
 COMP_PERL = @COMP_PERL@
 CPP = @CPP@
 LIBTOOL = @LIBTOOL@
+NROFF = @NROFF@
 PERL = @PERL@
+PERLFLAGS = @PERLFLAGS@
+PERL_MAKE_OPTIONS = @PERL_MAKE_OPTIONS@
 RANLIB = @RANLIB@
+SO_EXT = @SO_EXT@
+TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
+TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
+TCL_PREFIX = @TCL_PREFIX@
+TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
+TCL_SHLIB_LD = @TCL_SHLIB_LD@
+TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
+TROFF = @TROFF@
+VERSION = @VERSION@
 
 CGI_LIB_DIR = $(top_srcdir)/@CGI_LIB_DIR@
 GD_LIB_DIR = $(top_srcdir)/@GD_LIB_DIR@
@@ -87,7 +98,7 @@
 #LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CFLAGS_EXTRA)
 #LINK      = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(CFLAGS_EXTRA) $(LDFLAGS) -o $@
 
-RRD_C_FILES =  	gdpng.c			getopt.c		getopt1.c		gifsize.c		parsetime.c		pngsize.c		rrd_create.c		rrd_diff.c		rrd_dump.c		rrd_error.c		rrd_fetch.c		rrd_format.c		rrd_graph.c		rrd_last.c		rrd_open.c		rrd_resize.c		rrd_restore.c		rrd_tune.c		rrd_update.c		getopt.h      ntconfig.h    parsetime.h   rrd_format.h  rrd_tool.h
+RRD_C_FILES =  	gdpng.c			getopt.c		getopt1.c		gifsize.c		parsetime.c		pngsize.c		rrd_create.c		rrd_diff.c		rrd_dump.c		rrd_info.c		rrd_error.c		rrd_fetch.c		rrd_format.c		rrd_graph.c		rrd_last.c		rrd_open.c		rrd_resize.c		rrd_restore.c		rrd_tune.c		rrd_update.c		getopt.h ntconfig.h parsetime.h rrd_format.h rrd_tool.h rrd.h
 
 
 # Build two libraries.  One is a public one that gets installed in
@@ -107,14 +118,21 @@
 librrd_private_la_SOURCES = $(RRD_C_FILES)
 
 librrd_la_LIBADD = $(RRD_LIBS)
-librrd_private_la_LIBADD = $(RRD_LIBS)
 librrd_la_LDFLAGS = -version-info 0:0:0
 
-bin_PROGRAMS = rrdcgi rrdtool
+include_HEADERS = rrd.h
+
+librrd_private_la_LIBADD = $(RRD_LIBS)
+librrd_private_la_LDFLAGS = -static
+
+bin_PROGRAMS = rrdcgi rrdtool rrdupdate
 
 rrdcgi_SOURCES = rrd_cgi.c
 rrdcgi_LDADD = librrd.la
 
+rrdupdate_SOURCES = 
+rrdupdate_LDADD = rrdupdate.o librrd.la
+
 rrdtool_SOURCES = rrd_tool.c
 rrdtool_LDADD = librrd.la
 
@@ -134,16 +152,17 @@
 $(ZLIB_LIB_DIR)/librrd_z.la
 librrd_la_OBJECTS =  gdpng.lo getopt.lo getopt1.lo gifsize.lo \
 parsetime.lo pngsize.lo rrd_create.lo rrd_diff.lo rrd_dump.lo \
-rrd_error.lo rrd_fetch.lo rrd_format.lo rrd_graph.lo rrd_last.lo \
-rrd_open.lo rrd_resize.lo rrd_restore.lo rrd_tune.lo rrd_update.lo
-librrd_private_la_LDFLAGS = 
+rrd_info.lo rrd_error.lo rrd_fetch.lo rrd_format.lo rrd_graph.lo \
+rrd_last.lo rrd_open.lo rrd_resize.lo rrd_restore.lo rrd_tune.lo \
+rrd_update.lo
 librrd_private_la_DEPENDENCIES =  $(CGI_LIB_DIR)/librrd_cgi.la \
 $(GD_LIB_DIR)/librrd_gd.la $(PNG_LIB_DIR)/librrd_png.la \
 $(ZLIB_LIB_DIR)/librrd_z.la
 librrd_private_la_OBJECTS =  gdpng.lo getopt.lo getopt1.lo gifsize.lo \
 parsetime.lo pngsize.lo rrd_create.lo rrd_diff.lo rrd_dump.lo \
-rrd_error.lo rrd_fetch.lo rrd_format.lo rrd_graph.lo rrd_last.lo \
-rrd_open.lo rrd_resize.lo rrd_restore.lo rrd_tune.lo rrd_update.lo
+rrd_info.lo rrd_error.lo rrd_fetch.lo rrd_format.lo rrd_graph.lo \
+rrd_last.lo rrd_open.lo rrd_resize.lo rrd_restore.lo rrd_tune.lo \
+rrd_update.lo
 PROGRAMS =  $(bin_PROGRAMS)
 
 rrdcgi_OBJECTS =  rrd_cgi.o
@@ -152,22 +171,27 @@
 rrdtool_OBJECTS =  rrd_tool.o
 rrdtool_DEPENDENCIES =  librrd.la
 rrdtool_LDFLAGS = 
+rrdupdate_OBJECTS = 
+rrdupdate_DEPENDENCIES =  rrdupdate.o librrd.la
+rrdupdate_LDFLAGS = 
+CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
 LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+HEADERS =  $(include_HEADERS)
+
 DIST_COMMON =  Makefile.am Makefile.in
 
 
 PACKAGE = @PACKAGE@
-VERSION = @VERSION@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
 TAR = gtar
 GZIP_ENV = --best
-SOURCES = $(librrd_la_SOURCES) $(librrd_private_la_SOURCES) $(rrdcgi_SOURCES) $(rrdtool_SOURCES)
-OBJECTS = $(librrd_la_OBJECTS) $(librrd_private_la_OBJECTS) $(rrdcgi_OBJECTS) $(rrdtool_OBJECTS)
+SOURCES = $(librrd_la_SOURCES) $(librrd_private_la_SOURCES) $(rrdcgi_SOURCES) $(rrdtool_SOURCES) $(rrdupdate_SOURCES)
+OBJECTS = $(librrd_la_OBJECTS) $(librrd_private_la_OBJECTS) $(rrdcgi_OBJECTS) $(rrdtool_OBJECTS) $(rrdupdate_OBJECTS)
 
 all: all-redirect
 .SUFFIXES:
@@ -291,6 +315,25 @@
 	@rm -f rrdtool
 	$(LINK) $(rrdtool_LDFLAGS) $(rrdtool_OBJECTS) $(rrdtool_LDADD) $(LIBS)
 
+rrdupdate: $(rrdupdate_OBJECTS) $(rrdupdate_DEPENDENCIES)
+	@rm -f rrdupdate
+	$(LINK) $(rrdupdate_LDFLAGS) $(rrdupdate_OBJECTS) $(rrdupdate_LDADD) $(LIBS)
+
+install-includeHEADERS: $(include_HEADERS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(includedir)
+	@list='$(include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \
+	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \
+	done
+
+uninstall-includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	list='$(include_HEADERS)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(includedir)/$$p; \
+	done
+
 tags: TAGS
 
 ID: $(HEADERS) $(SOURCES) $(LISP)
@@ -328,55 +371,56 @@
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
-	    cp -pr $$/$$file $(distdir)/$$file; \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
 	  else \
 	    test -f $(distdir)/$$file \
 	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
 	    || cp -p $$d/$$file $(distdir)/$$file || :; \
 	  fi; \
 	done
-gdpng.lo gdpng.o : gdpng.c ../libpng-1.0.3/png.h ../zlib-1.1.3/zlib.h \
-	../zlib-1.1.3/zconf.h ../libpng-1.0.3/pngconf.h ../gd1.3/gd.h
+gdpng.lo gdpng.o : gdpng.c ../libpng-1.0.9/png.h ../zlib-1.1.3/zlib.h \
+	../zlib-1.1.3/zconf.h ../libpng-1.0.9/pngconf.h ../gd1.3/gd.h
 getopt.lo getopt.o : getopt.c ../config/config.h getopt.h
 getopt1.lo getopt1.o : getopt1.c ../config/config.h getopt.h
 gifsize.lo gifsize.o : gifsize.c
 parsetime.lo parsetime.o : parsetime.c rrd_tool.h ../config/config.h \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.h
-pngsize.lo pngsize.o : pngsize.c ../libpng-1.0.3/png.h \
+	rrd.h getopt.h rrd_format.h ../gd1.3/gd.h
+pngsize.lo pngsize.o : pngsize.c ../libpng-1.0.9/png.h \
 	../zlib-1.1.3/zlib.h ../zlib-1.1.3/zconf.h \
-	../libpng-1.0.3/pngconf.h
-rrd_cgi.o: rrd_cgi.c rrd_tool.h ../config/config.h parsetime.h getopt.h \
+	../libpng-1.0.9/pngconf.h
+rrd_cgi.o: rrd_cgi.c rrd_tool.h ../config/config.h rrd.h getopt.h \
 	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 \
-	parsetime.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 \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.h
-rrd_dump.lo rrd_dump.o : rrd_dump.c rrd_tool.h ../config/config.h \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.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_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 \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.h
+	rrd.h getopt.h rrd_format.h ../gd1.3/gd.h
 rrd_fetch.lo rrd_fetch.o : rrd_fetch.c rrd_tool.h ../config/config.h \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.h
+	rrd.h getopt.h rrd_format.h ../gd1.3/gd.h
 rrd_format.lo rrd_format.o : rrd_format.c rrd_tool.h ../config/config.h \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.h
+	rrd.h getopt.h rrd_format.h ../gd1.3/gd.h
 rrd_graph.lo rrd_graph.o : rrd_graph.c rrd_tool.h ../config/config.h \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.h \
+	rrd.h getopt.h rrd_format.h ../gd1.3/gd.h \
 	../gd1.3/gdlucidan10.h ../gd1.3/gdlucidab12.h
-rrd_last.lo rrd_last.o : rrd_last.c rrd_tool.h ../config/config.h \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.h
-rrd_open.lo rrd_open.o : rrd_open.c rrd_tool.h ../config/config.h \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.h
+rrd_info.lo rrd_info.o : rrd_info.c rrd_tool.h ../config/config.h rrd.h \
+	getopt.h rrd_format.h ../gd1.3/gd.h
+rrd_last.lo rrd_last.o : rrd_last.c rrd_tool.h ../config/config.h rrd.h \
+	getopt.h rrd_format.h ../gd1.3/gd.h
+rrd_open.lo rrd_open.o : rrd_open.c rrd_tool.h ../config/config.h rrd.h \
+	getopt.h rrd_format.h ../gd1.3/gd.h
 rrd_resize.lo rrd_resize.o : rrd_resize.c rrd_tool.h ../config/config.h \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.h
+	rrd.h getopt.h rrd_format.h ../gd1.3/gd.h
 rrd_restore.lo rrd_restore.o : rrd_restore.c rrd_tool.h \
-	../config/config.h parsetime.h getopt.h rrd_format.h \
-	../gd1.3/gd.h
-rrd_tool.o: rrd_tool.c rrd_tool.h ../config/config.h parsetime.h \
+	../config/config.h rrd.h getopt.h rrd_format.h ../gd1.3/gd.h
+rrd_tool.o: rrd_tool.c rrd_tool.h ../config/config.h rrd.h getopt.h \
+	rrd_format.h ../gd1.3/gd.h
+rrd_tune.lo rrd_tune.o : rrd_tune.c rrd_tool.h ../config/config.h rrd.h \
 	getopt.h rrd_format.h ../gd1.3/gd.h
-rrd_tune.lo rrd_tune.o : rrd_tune.c rrd_tool.h ../config/config.h \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.h
 rrd_update.lo rrd_update.o : rrd_update.c rrd_tool.h ../config/config.h \
-	parsetime.h getopt.h rrd_format.h ../gd1.3/gd.h
+	rrd.h getopt.h rrd_format.h ../gd1.3/gd.h
 
 info-am:
 info: info-am
@@ -389,20 +433,22 @@
 install-exec-am: install-libLTLIBRARIES install-binPROGRAMS
 install-exec: install-exec-am
 
-install-data-am:
+install-data-am: install-includeHEADERS
 install-data: install-data-am
 
 install-am: all-am
 	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 install: install-am
-uninstall-am: uninstall-libLTLIBRARIES uninstall-binPROGRAMS
+uninstall-am: uninstall-libLTLIBRARIES uninstall-binPROGRAMS \
+		uninstall-includeHEADERS
 uninstall: uninstall-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
 all-redirect: all-am
 install-strip:
 	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
 installdirs:
-	$(mkinstalldirs)  $(DESTDIR)$(libdir) $(DESTDIR)$(bindir)
+	$(mkinstalldirs)  $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) \
+		$(DESTDIR)$(includedir)
 
 
 mostlyclean-generic:
@@ -454,14 +500,21 @@
 maintainer-clean-compile mostlyclean-libtool distclean-libtool \
 clean-libtool maintainer-clean-libtool mostlyclean-binPROGRAMS \
 distclean-binPROGRAMS clean-binPROGRAMS maintainer-clean-binPROGRAMS \
-uninstall-binPROGRAMS install-binPROGRAMS tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
-install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+uninstall-binPROGRAMS install-binPROGRAMS uninstall-includeHEADERS \
+install-includeHEADERS tags mostlyclean-tags distclean-tags clean-tags \
+maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+rrdupdate.c: rrd_update.c
+	-ln -s rrd_update.c rrdupdate.c
 
+rrdupdate.o: rrdupdate.c
+	$(COMPILE) -DSTANDALONE -c rrdupdate.c
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.

Added: trunk/orca/packages/rrdtool-1.0.33/src/rrd_info.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_info.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_info.c	Sat Jul 13 21:25:51 2002
@@ -0,0 +1,142 @@
+/*****************************************************************************
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
+ *****************************************************************************
+ * rrd_info  Get Information about the configuration of an RRD
+ *****************************************************************************/
+
+#include "rrd_tool.h"
+#include <stdarg.h>
+
+/* proto */
+static char * sprintf_alloc(char *, ...);
+static info_t *push(info_t *, char *, enum info_type, infoval);
+info_t *rrd_info(int, char **);
+
+/* allocate memory for string */
+static char *
+sprintf_alloc(char *fmt, ...) {
+#ifdef HAVE_VSNPRINTF    
+    int maxlen = 50;
+#else
+    int maxlen = 1000;
+#endif
+    char *str = NULL;
+    va_list argp;
+    str = malloc(sizeof(char)*(strlen(fmt)+maxlen));
+    if (str != NULL) {
+	va_start(argp, fmt);
+#ifdef HAVE_VSNPRINTF
+	vsnprintf(str, maxlen-1, fmt, argp);
+#else
+	vsprintf(str, fmt, argp);
+#endif
+    }
+    va_end(argp);
+    return str;
+}
+
+static info_t 
+*push(info_t *info, char *key, enum info_type type, infoval value){
+    info_t *next;
+    next = malloc(sizeof(*next));
+    next->next = (info_t *) 0;
+    if( info )
+	info->next = next;
+    next->type = type;
+    next->key  = key;
+    switch (type) {
+    case RD_I_VAL:
+	next->value.u_val = value.u_val;
+	break;
+    case RD_I_CNT:
+	next->value.u_cnt = value.u_cnt;
+	break;
+    case RD_I_STR:
+	next->value.u_str = malloc(sizeof(char)*(strlen(value.u_str)+1));
+	strcpy(next->value.u_str,value.u_str);
+	break;
+    }
+    return(next);
+}
+
+  
+info_t *
+rrd_info(int argc, char **argv) {   
+    int          i,ii=0;
+    FILE         *in_file;
+    rrd_t        rrd;
+    info_t       *data,*cd;
+    infoval      info;
+
+    if(rrd_open(argv[1],&in_file,&rrd, RRD_READONLY)==-1){
+	return(NULL);
+    }
+    fclose(in_file);
+
+    info.u_str=argv[1];
+    cd=push(NULL,sprintf_alloc("filename"),    RD_I_STR, info);
+    data=cd;
+
+    info.u_str=rrd.stat_head->version;
+    cd=push(cd,sprintf_alloc("rrd_version"),    RD_I_STR, info);
+
+    info.u_cnt=rrd.stat_head->pdp_step;
+    cd=push(cd,sprintf_alloc("step"),       RD_I_CNT, info);
+
+    info.u_cnt=rrd.live_head->last_up;
+    cd=push(cd,sprintf_alloc("last_update"), RD_I_CNT, info);
+
+    for(i=0;i<rrd.stat_head->ds_cnt;i++){
+
+	info.u_str=rrd.ds_def[i].dst;
+	cd=push(cd,sprintf_alloc("ds[%s].type",             rrd.ds_def[i].ds_nam), RD_I_STR, info);
+
+	info.u_cnt=rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt;
+	cd=push(cd,sprintf_alloc("ds[%s].minimal_heartbeat",rrd.ds_def[i].ds_nam), RD_I_CNT, info);
+
+	info.u_val=rrd.ds_def[i].par[DS_min_val].u_val;
+	cd=push(cd,sprintf_alloc("ds[%s].min",              rrd.ds_def[i].ds_nam), RD_I_VAL, info);
+	
+	info.u_val=rrd.ds_def[i].par[DS_max_val].u_val;
+	cd=push(cd,sprintf_alloc("ds[%s].max",              rrd.ds_def[i].ds_nam), RD_I_VAL, info);
+	
+	info.u_str=rrd.pdp_prep[i].last_ds;
+	cd=push(cd,sprintf_alloc("ds[%s].last_ds",          rrd.ds_def[i].ds_nam), RD_I_STR, info);
+
+	info.u_val=rrd.pdp_prep[i].scratch[PDP_val].u_val;
+        cd=push(cd,sprintf_alloc("ds[%s].value",            rrd.ds_def[i].ds_nam), RD_I_VAL, info);
+
+	info.u_cnt=rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt;
+	cd=push(cd,sprintf_alloc("ds[%s].unknown_sec",      rrd.ds_def[i].ds_nam), RD_I_CNT, info);
+    }
+
+    for(i=0;i<rrd.stat_head->rra_cnt;i++){
+	info.u_str=rrd.rra_def[i].cf_nam;
+	cd=push(cd,sprintf_alloc("rra[%d].cf",         i),  RD_I_STR,   info);
+
+	info.u_cnt=rrd.rra_def[i].row_cnt;
+	cd=push(cd,sprintf_alloc("rra[%d].rows",i),  RD_I_CNT,   info);
+
+	info.u_cnt=rrd.rra_def[i].pdp_cnt;
+	cd=push(cd,sprintf_alloc("rra[%d].pdp_per_row",i),  RD_I_CNT,   info);
+
+        info.u_val=rrd.rra_def[i].par[RRA_cdp_xff_val].u_val;
+        cd=push(cd,sprintf_alloc("rra[%d].xff",i),  RD_I_VAL,   info);
+        
+	for(ii=0;ii<rrd.stat_head->ds_cnt;ii++){
+	    info.u_val=rrd.cdp_prep[i*rrd.stat_head->ds_cnt+ii].scratch[CDP_val].u_val;
+	    cd=push(cd,sprintf_alloc("rra[%d].cdp_prep[%d].value",i,ii), RD_I_VAL, info);
+
+	    info.u_cnt=rrd.cdp_prep[i*rrd.stat_head->ds_cnt+ii].scratch[CDP_unkn_pdp_cnt].u_cnt;
+	    cd=push(cd,sprintf_alloc("rra[%d].cdp_prep[%d].unknown_datapoints",i,ii), RD_I_CNT, info);
+        }
+    }
+    rrd_free(&rrd);
+    return(data);
+
+}
+
+
+
+
+

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_last.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_last.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_last.c	Sat Jul 13 21:25:52 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_last.c
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_dump.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_dump.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_dump.c	Sat Jul 13 21:25:52 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_dump  Display a RRD
  *****************************************************************************
@@ -80,9 +80,10 @@
                       * sizeof(rrd_value_t));
 	printf("\t<rra>\n");
 	printf("\t\t<cf> %s </cf>\n",rrd.rra_def[i].cf_nam);
-	printf("\t\t<pdp_per_row> %lu </pdp_per_row> <!-- %lu seconds -->\n\n",
+	printf("\t\t<pdp_per_row> %lu </pdp_per_row> <!-- %lu seconds -->\n",
 	       rrd.rra_def[i].pdp_cnt, rrd.rra_def[i].pdp_cnt
 	       *rrd.stat_head->pdp_step);
+	printf("\t\t<xff> %0.10e </xff>\n\n",rrd.rra_def[i].par[RRA_cdp_xff_val].u_val);
 	printf("\t\t<cdp_prep>\n");
 	for(ii=0;ii<rrd.stat_head->ds_cnt;ii++){
 	    double value = rrd.cdp_prep[i*rrd.stat_head->ds_cnt+ii].scratch[CDP_val].u_val;
@@ -122,7 +123,7 @@
 #else
 # error "Need strftime"
 #endif
-	    printf("\t\t\t<!-- %s --> <row>",somestring);
+	    printf("\t\t\t<!-- %s / %d --> <row>",somestring,(int)now);
 	    for(iii=0;iii<rrd.stat_head->ds_cnt;iii++){			 
 		fread(&my_cdp,sizeof(rrd_value_t),1,in_file);		
 		if (isnan(my_cdp)){

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_diff.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_diff.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_diff.c	Sat Jul 13 21:25:52 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1999
  * This code is stolen from rateup (mrtg-2.x) by Dave Rand
  *****************************************************************************
  * diff calculate the difference between two very long integers available as

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_tool.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_tool.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_tool.c	Sat Jul 13 21:25:52 2002
@@ -1,15 +1,12 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2001
  *****************************************************************************
  * rrd_tool.c  Startup wrapper
- *****************************************************************************
- * $Id: rrd_tool.c,v 1.8 1998/03/08 12:35:11 oetiker Exp oetiker $
- * $Log: rrd_tool.c,v $
  *****************************************************************************/
 
 #include "rrd_tool.h"
 
-void PrintUsage(void);
+void PrintUsage(char *cmd);
 int CountArgs(char *aLine);
 int CreateArgs(char *, char *, int, char **);
 int HandleInputLine(int, char **, FILE*);
@@ -18,38 +15,53 @@
 #define MAX_LENGTH	10000
 
 
-void PrintUsage(void)
+void PrintUsage(char *cmd)
 {
-    printf("\n"
-	   "RRDtool 1.0.13  Copyright (C) 1999 by Tobias Oetiker <tobi at oetiker.ch>\n\n"
-	   "Usage: rrdtool [options] command command_options\n\n"
-	   "Valid commands and command_options are listed below.\n\n"
 
+    char help_main[] =
+	   "RRDtool 1.0.33  Copyright 1997-2001 by Tobias Oetiker <tobi at oetiker.ch>\n\n"
+	   "Usage: rrdtool [options] command command_options\n\n";
+
+    char help_list[] =
+	   "Valid commands: create, update, graph, dump, restore,\n"
+	   "\t\tlast, info, fetch, tune, resize\n\n";
+
+    char help_create[] =
 	   "* create - create a new RRD\n\n"
 	   "\trrdtool create filename [--start|-b start time]\n"
 	   "\t\t[--step|-s step]\n"
-	   "\t\t[DS:ds-name:DST:heartbeat:min:max] [RRA:CF:xff:steps:rows]\n\n"
+	   "\t\t[DS:ds-name:DST:heartbeat:min:max] [RRA:CF:xff:steps:rows]\n\n";
 
+    char help_dump[] =
 	   "* dump - dump an RRD to XML\n\n"
-	   "\trrdtool dump filename.rrd >filename.xml\n\n"
+	   "\trrdtool dump filename.rrd >filename.xml\n\n";
 
+    char help_info[] =
+	   "* info - returns the configuration and status of the\n\n"
+	   "\trrdtool info filename.rrd\n\n";
+
+    char help_restore[] =
 	   "* restore - restore an RRD file from its XML form\n\n"
-	   "\trrdtool restore [--range-check|-r] filename.xml filename.rrd\n\n"
+	   "\trrdtool restore [--range-check|-r] filename.xml filename.rrd\n\n";
 
+    char help_last[] =
            "* last - show last update time for RRD\n\n"
-           "\trrdtool last filename.rrd\n\n"
+           "\trrdtool last filename.rrd\n\n";
 
+    char help_update[] =
 	   "* update - update an RRD\n\n"
 	   "\trrdtool update filename\n"
 	   "\t\t--template|-t ds-name:ds-name:...\n"
 	   "\t\ttime|N:value[:value...]\n\n"
-	   "\t\t[ time:value[:value...] ..]\n\n"
+	   "\t\t[ time:value[:value...] ..]\n\n";
 
+    char help_fetch[] =
 	   "* fetch - fetch data out of an RRD\n\n"
 	   "\trrdtool fetch filename.rrd CF\n"
 	   "\t\t[--resolution|-r resolution]\n"
-	   "\t\t[--start|-s start] [--end|-e end]\n\n"
-	   	   
+	   "\t\t[--start|-s start] [--end|-e end]\n\n";
+
+    char help_graph[] =
 	   "* graph - generate a graph from one or several RRD\n\n"
 	   "\trrdtool graph filename [-s|--start seconds] [-e|--end seconds]\n"
 	   "\t\t[-x|--x-grid x-axis grid and label]\n"
@@ -60,6 +72,9 @@
 	   "\t\t[-u|--upper-limit value] [-z|--lazy]\n"
 	   "\t\t[-l|--lower-limit value] [-r|--rigid]\n"
 	   "\t\t[--alt-autoscale]\n"
+	   "\t\t[--alt-autoscale-max]\n"
+	   "\t\t[--units-exponent value]\n"	   
+	   "\t\t[--step seconds]\n"	   
 	   "\t\t[-f|--imginfo printfstr]\n"
 	   "\t\t[-a|--imgformat GIF|PNG]\n"
 	   "\t\t[-c|--color COLORTAG#rrggbb] [-t|--title string]\n"
@@ -71,23 +86,92 @@
 	   "\t\t[VRULE:value#rrggbb[:legend]]\n"
 	   "\t\t[LINE{1|2|3}:vname[#rrggbb[:legend]]]\n"
 	   "\t\t[AREA:vname[#rrggbb[:legend]]]\n"
-	   "\t\t[STACK:vname[#rrggbb[:legend]]]\n\n"
+	   "\t\t[STACK:vname[#rrggbb[:legend]]]\n\n";
 
-	   
+    char help_tune[] =
 	   " * tune -  Modify some basic properties of an RRD\n\n"
 	   "\trrdtool tune filename\n"
 	   "\t\t[--heartbeat|-h ds-name:heartbeat]\n"
 	   "\t\t[--data-source-type|-d ds-name:DST\n"
 	   "\t\t[--data-source-rename|-r old-name:new-name\n"
-	   "\t\t[--minimum|-i ds-name:min] [--maximum|-a ds-name:max]\n\n"
+	   "\t\t[--minimum|-i ds-name:min] [--maximum|-a ds-name:max]\n\n";
 
+    char help_resize[] =
 	   " * resize - alter the lenght of one of the RRAs in an RRD\n\n"
-	   "\trrdtool resize filename rranum GROW|SHRINK rows\n\n"
+	   "\trrdtool resize filename rranum GROW|SHRINK rows\n\n";
 
+    char help_lic[] =
 	   "RRDtool is distributed under the Terms of the GNU General\n"
 	   "Public License Version 2. (www.gnu.org/copyleft/gpl.html)\n\n"
 
-	   "For more information read the RRD manpages\n\n");
+	   "For more information read the RRD manpages\n\n";
+
+    enum { C_NONE, C_CREATE, C_DUMP, C_INFO, C_RESTORE, C_LAST,
+	   C_UPDATE, C_FETCH, C_GRAPH, C_TUNE, C_RESIZE };
+
+    int help_cmd = C_NONE;
+
+    if (cmd)
+	{
+	    if (!strcmp(cmd,"create"))
+		help_cmd = C_CREATE;
+    	    else if (!strcmp(cmd,"dump"))
+		help_cmd = C_DUMP;
+    	    else if (!strcmp(cmd,"info"))
+		help_cmd = C_INFO;
+    	    else if (!strcmp(cmd,"restore"))
+		help_cmd = C_RESTORE;
+    	    else if (!strcmp(cmd,"last"))
+		help_cmd = C_LAST;
+    	    else if (!strcmp(cmd,"update"))
+		help_cmd = C_UPDATE;
+    	    else if (!strcmp(cmd,"fetch"))
+		help_cmd = C_FETCH;
+    	    else if (!strcmp(cmd,"graph"))
+		help_cmd = C_GRAPH;
+    	    else if (!strcmp(cmd,"tune"))
+		help_cmd = C_TUNE;
+    	    else if (!strcmp(cmd,"resize"))
+		help_cmd = C_RESIZE;
+	}
+    fputs(help_main, stdout);
+    switch (help_cmd)
+	{
+	    case C_NONE:
+		fputs(help_list, stdout);
+		break;
+	    case C_CREATE:
+		fputs(help_create, stdout);
+		break;
+	    case C_DUMP:
+		fputs(help_dump, stdout);
+		break;
+	    case C_INFO:
+		fputs(help_info, stdout);
+		break;
+	    case C_RESTORE:
+		fputs(help_restore, stdout);
+		break;
+	    case C_LAST:
+		fputs(help_last, stdout);
+		break;
+	    case C_UPDATE:
+		fputs(help_update, stdout);
+		break;
+	    case C_FETCH:
+		fputs(help_fetch, stdout);
+		break;
+	    case C_GRAPH:
+		fputs(help_graph, stdout);
+		break;
+	    case C_TUNE:
+		fputs(help_tune, stdout);
+		break;
+	    case C_RESIZE:
+		fputs(help_resize, stdout);
+		break;
+	}
+    fputs(help_lic, stdout);
 }
 
 
@@ -103,11 +187,11 @@
 #endif
     if (argc == 1)
 	{
-	    PrintUsage();
+	    PrintUsage("");
 	    return 0;
 	}
     
-    if ((argc == 2) && (*argv[1] == '-'))
+    if ((argc == 2) && !strcmp("-",argv[1]))
 	{
 #if HAVE_GETRUSAGE
 	  struct rusage  myusage;
@@ -155,6 +239,11 @@
 		fflush(stdout); /* this is important for pipes to work */
 	    }
 	}
+    else if (argc == 2)
+	{
+		PrintUsage(argv[1]);
+		exit(0);
+	}
     else
 	HandleInputLine(argc, argv, stderr);    
     return 0;
@@ -171,7 +260,7 @@
 	|| strcmp("-help", argv[1]) == 0
 	|| strcmp("-?", argv[1]) == 0
 	|| strcmp("-h", argv[1]) == 0 ) {
-	PrintUsage();
+	PrintUsage("");
 	return 0;
     }
     
@@ -179,12 +268,42 @@
 	rrd_create(argc-1, &argv[1]);
     else if (strcmp("dump", argv[1]) == 0)
 	rrd_dump(argc-1, &argv[1]);
+    else if (strcmp("info", argv[1]) == 0){
+	info_t *data,*save;
+	data=rrd_info(argc-1, &argv[1]);
+	while (data) {
+	    save=data;
+	    printf ("%s = ", data->key);
+	    free(data->key);
+	    
+	    switch (data->type) {
+	    case RD_I_VAL:
+		if (isnan (data->value.u_val))
+		    printf("NaN");
+		else
+		    printf ("%0.10e", data->value.u_val);
+		break;
+	    case RD_I_CNT:
+		printf ("%lu", data->value.u_cnt);
+		break;
+	    case RD_I_STR:
+		printf ("\"%s\"", data->value.u_str);
+		free(data->value.u_str);
+		break;
+	    }
+	    data = data->next;
+	    free(save);
+	    printf ("\n");
+	}
+	free(data);
+    }
+	
     else if (strcmp("--version", argv[1]) == 0 ||
 	     strcmp("version", argv[1]) == 0 || 
 	     strcmp("v", argv[1]) == 0 ||
 	     strcmp("-v", argv[1]) == 0  ||
 	     strcmp("-version", argv[1]) == 0  )
-        printf("RRDtool   Copyright (C) 1999 by Tobias Oetiker <tobi at oetiker.ch>\n");
+        printf("RRDtool 1.0.33  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)
@@ -207,7 +326,7 @@
 	    for (i = start; i <= end; i += step){
 	        printf("%10lu:", i);
 	        for (ii = 0; ii < ds_cnt; ii++)
-		    printf(" %13.2f", *(datai++));
+		    printf(" %0.10e", *(datai++));
 	        printf("\n");
 	    }
 	    for (i=0;i<ds_cnt;i++)

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_update.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_update.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_update.c	Sat Jul 13 21:25:52 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_update.c  RRD Update Function
  *****************************************************************************
@@ -23,7 +23,27 @@
 
 /*#define DEBUG */
 
+
+#ifdef STANDALONE
 int 
+main(int argc, char **argv){
+        rrd_update(argc,argv);
+        if (rrd_test_error()) {
+                printf("RRDtool 1.0.33  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"
+                        "\t\t\t[ time:value[:value...] ..]\n\n");
+                                   
+                printf("ERROR: %s\n",rrd_get_error());
+                rrd_clear_error();                                                            
+                return 1;
+        }
+        return 0;
+}
+#endif
+
+int
 rrd_update(int argc, char **argv)
 {
 
@@ -73,6 +93,7 @@
     int              wrote_to_file = 0;
     char             *template = NULL;          
 
+
     while (1) {
 	static struct option long_options[] =
 	{
@@ -101,7 +122,7 @@
 
     /* need at least 2 arguments: filename, data. */
     if (argc-optind < 2) {
-	rrd_set_error("not enough arguments");
+	rrd_set_error("Not enough arguments");
 	return -1;
     }
 
@@ -190,6 +211,11 @@
 		  tmpl_idx[tmpl_cnt-1]++; 
 		  /* go to the next entry on the template */
 		  dsname = &template[i+1];
+                  /* fix the damage we did before */
+                  if (i<tmpl_len) {
+                     template[i]=':';
+                  } 
+
 		}
 	    }	    
 	}
@@ -207,12 +233,22 @@
 
     /* loop through the arguments. */
     for(arg_i=optind+1; arg_i<argc;arg_i++) {
-	char *stepper;
+	char *stepper = malloc((strlen(argv[arg_i])+1)*sizeof(char));
+        char *step_start = stepper;
+        if (stepper == NULL){
+                rrd_set_error("faild duplication argv entry");
+                free(updvals);
+                free(pdp_temp);  
+                free(tmpl_idx);
+                rrd_free(&rrd);
+                fclose(rrd_file);
+                return(-1);
+         }
 	/* initialize all ds input to unknown except the first one
            which has always got to be set */
 	for(ii=1;ii<=rrd.stat_head->ds_cnt;ii++) updvals[ii] = "U";
 	ii=0;
-	stepper = argv[arg_i];
+	strcpy(stepper,argv[arg_i]);
 	updvals[0]=stepper;
 	while (*stepper) {
 	    if (*stepper == ':') {
@@ -228,6 +264,7 @@
 	if (ii != tmpl_cnt-1) {
 	    rrd_set_error("expected %lu data source readings (got %lu) from %s:...",
 			  tmpl_cnt-1, ii, argv[arg_i]);
+	    free(step_start);
 	    break;
 	}
 	
@@ -242,6 +279,7 @@
 	    rrd_set_error("illegal attempt to update using time %ld when "
 			  "last update time is %ld (minimum one second step)",
 			  current_time, rrd.live_head->last_up);
+	    free(step_start);
 	    break;
 	}
 	
@@ -250,6 +288,7 @@
 	if (rra_current != rra_begin) {
 	    if(fseek(rrd_file, rra_begin, SEEK_SET) != 0) {
 		rrd_set_error("seek error in rrd");
+		free(step_start);
 		break;
 	    }
 	    rra_current = rra_begin;
@@ -332,7 +371,7 @@
 		    rate = pdp_new[i] / interval;		   
 		    break;
 		default:
-		    rrd_set_error("rrd contains and DS type : '%s'",
+		    rrd_set_error("rrd contains unknown DS type : '%s'",
 				  rrd.ds_def[i].dst);
 		    break;
 		}
@@ -373,9 +412,10 @@
 	    }
 	}
 	/* break out of the argument parsing loop if the error_string is set */
-	if (rrd_test_error())
+	if (rrd_test_error()){
+	    free(step_start);
 	    break;
-
+	}
 	/* has a pdp_st moment occurred since the last run ? */
 
 	if (proc_pdp_st == occu_pdp_st){
@@ -615,12 +655,16 @@
 
 	    }
 	    /* break out of the argument parsing loop if error_string is set */
-	    if (rrd_test_error())
+	    if (rrd_test_error()){
+		free(step_start);
 		break;
+	    }
 	}
 	rrd.live_head->last_up = current_time;
+	free(step_start);
     }
 
+
     /* if we got here and if there is an error and if the file has not been
      * written to, then close things up and return. */
     if (rrd_test_error()) {

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_tool.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_tool.h	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_tool.h	Sat Jul 13 21:25:52 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997,1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_tool.h   Common Header File
  *****************************************************************************
@@ -66,8 +66,7 @@
 #endif /* __svr4__ && __sun__ */
 #endif
 
-#include "parsetime.h"
-int proc_start_end (struct time_value *,  struct time_value *, time_t *, time_t *);
+#include "rrd.h"
 
 #ifndef WIN32
 
@@ -100,30 +99,35 @@
 
 #define DIM(x) (sizeof(x)/sizeof(x[0]))
 
-/* main function blocks */
-int    rrd_create(int argc, char **argv);
-int    rrd_update(int argc, char **argv);
-int    rrd_graph(int argc, char **argv, char ***prdata, int *xsize, int *ysize);
-int    rrd_fetch(int argc, char **argv, 
-		 time_t *start, time_t *end, unsigned long *step, 
-		 unsigned long *ds_cnt, char ***ds_namv, rrd_value_t **data);
-int    rrd_restore(int argc, char **argv);
-int    rrd_dump(int argc, char **argv);
-int    rrd_tune(int argc, char **argv);
-time_t rrd_last(int argc, char **argv);
-int    rrd_resize(int argc, char **argv);
+/* rrd info interface */
+enum info_type   { RD_I_VAL=0,
+	       RD_I_CNT,
+	       RD_I_STR  };
+
+typedef union infoval { 
+    unsigned long u_cnt; 
+    rrd_value_t   u_val;
+    char         *u_str;
+} infoval;
+
+typedef struct info_t {
+    char            *key;
+    enum info_type  type;
+    union infoval   value;
+    struct info_t   *next;
+} info_t;
+
+
+info_t *rrd_info(int, char **);
 
 /* HELPER FUNCTIONS */
-void rrd_set_error(char *fmt,...);
-void rrd_clear_error(void);
-int  rrd_test_error(void);
-char *rrd_get_error(void);
-int  LockRRD(FILE *);
 int GifSize(FILE *, long *, long *);
 int PngSize(FILE *, long *, long *);
 int PngSize(FILE *, long *, long *);
+
 #include <gd.h>
 void gdImagePng(gdImagePtr im, FILE *out);
+
 int rrd_create_fn(char *file_name, rrd_t *rrd);
 int rrd_fetch_fn(char *filename, enum cf_en cf_idx,
 		 time_t *start,time_t *end,
@@ -131,13 +135,13 @@
 		 unsigned long *ds_cnt,
 		 char        ***ds_namv,
 		 rrd_value_t **data);
+
 void rrd_free(rrd_t *rrd);
 void rrd_init(rrd_t *rrd);
 
-int  rrd_open(char *file_name, FILE **in_file, rrd_t *rrd, int rdwr);
+int rrd_open(char *file_name, FILE **in_file, rrd_t *rrd, int rdwr);
 int readfile(char *file, char **buffer, int skipfirst);
 
-
 #define RRD_READONLY    0
 #define RRD_READWRITE   1
 
@@ -149,7 +153,6 @@
 #endif
 
 
-
 #ifdef  __cplusplus
 }
 #endif

Added: trunk/orca/packages/rrdtool-1.0.33/src/rrd.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd.h	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd.h	Sat Jul 13 21:25:53 2002
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997,1998, 1999
+ *****************************************************************************
+ * rrdlib.h   Public header file for librrd
+ *****************************************************************************
+ * $Id: rrd_tool.h,v 1.5 1998/03/08 12:35:11 oetiker Exp oetiker $
+ * $Log: rrd_tool.h,v $
+ *****************************************************************************/
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#ifndef _RRDLIB_H
+#define _RRDLIB_H
+
+#include <time.h>
+
+/* Transplanted from rrd_format.h */
+typedef double       rrd_value_t;         /* the data storage type is
+                                           * double */
+/* END rrd_format.h */
+
+/* main function blocks */
+int    rrd_create(int, char **);
+int    rrd_update(int, char **);
+int    rrd_graph(int, char **, char ***, int *, int *);
+int    rrd_fetch(int, char **, time_t *, time_t *, unsigned long *,
+		 unsigned long *, char ***, rrd_value_t **);
+int    rrd_restore(int, char **);
+int    rrd_dump(int, char **);
+int    rrd_tune(int, char **);
+time_t rrd_last(int, char **);
+int    rrd_resize(int, char **);
+
+/* Transplanted from parsetime.h */
+typedef enum {
+        ABSOLUTE_TIME,
+        RELATIVE_TO_START_TIME, 
+        RELATIVE_TO_END_TIME
+} timetype;
+
+#define TIME_OK NULL
+
+struct time_value {
+  timetype type;
+  long offset;
+  struct tm tm;
+};
+
+char *parsetime(char *spec, struct time_value *ptv);
+/* END parsetime.h */
+
+int proc_start_end (struct time_value *,  struct time_value *, time_t *, time_t *);
+
+/* HELPER FUNCTIONS */
+void rrd_set_error(char *,...);
+void rrd_clear_error(void);
+int  rrd_test_error(void);
+char *rrd_get_error(void);
+int  LockRRD(FILE *);
+
+#endif /* _RRDLIB_H */
+
+#ifdef  __cplusplus
+}
+#endif

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_format.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_format.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_format.c	Sat Jul 13 21:25:53 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1999
  *****************************************************************************
  * rrd_format.c  RRD Database Format helper functions
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.33/src/gdpng.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/gdpng.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/gdpng.c	Sat Jul 13 21:25:53 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * gdpng.c  add PNG output routine to gd library
  *****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_error.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_error.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_error.c	Sat Jul 13 21:25:53 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_error.c   Common Header File
  *****************************************************************************
@@ -8,7 +8,8 @@
  *************************************************************************** */
 
 #include "rrd_tool.h"
-static char* rrd_error = NULL;
+#define MAXLEN 4096
+static char rrd_error[MAXLEN] = "\0";
 #include <stdarg.h>
 
 
@@ -16,33 +17,30 @@
 void
 rrd_set_error(char *fmt, ...)
 {
-    int maxlen = 4096;
     va_list argp;
     rrd_clear_error();
-    rrd_error = malloc(sizeof(char)*maxlen);
     va_start(argp, fmt);
 #ifdef HAVE_VSNPRINTF
-    vsnprintf(rrd_error, maxlen-1, fmt, argp);
+    vsnprintf((char *)rrd_error, MAXLEN-1, fmt, argp);
 #else
-    vsprintf(rrd_error, fmt, argp);
+    vsprintf((char *)rrd_error, fmt, argp);
 #endif
     va_end(argp);
 }
 
 int
 rrd_test_error(void) {
-    return rrd_error != NULL;
+    return rrd_error[0] != '\0';
 }
 
 void
 rrd_clear_error(void){
-    free(rrd_error);
-    rrd_error = NULL;
+    rrd_error[0] = '\0';
 }
 
 char *
 rrd_get_error(void){
-    return rrd_error;
+    return (char *)rrd_error;
 }
 
 

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_fetch.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_fetch.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_fetch.c	Sat Jul 13 21:25:53 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_fetch.c  read date from an rrd to use for further processing
  *****************************************************************************
@@ -231,7 +231,6 @@
 
     *ds_cnt =   rrd.stat_head->ds_cnt; 
     if (((*data) = malloc(*ds_cnt * rows * sizeof(rrd_value_t)))==NULL){
-	long i;
 	rrd_set_error("malloc fetch data area");
 	for (i=0;i<*ds_cnt;i++)
 	      free((*ds_namv)[i]);
@@ -273,7 +272,6 @@
 		   + (rra_pointer
 		      * *ds_cnt
 		      * sizeof(rrd_value_t))),SEEK_SET) != 0){
-	long i;
 	rrd_set_error("seek error in RRA");
 	for (i=0;i<*ds_cnt;i++)
 	      free((*ds_namv)[i]);
@@ -325,10 +323,9 @@
 		if(fseek(in_file,(rra_base+rra_pointer
 			       * *ds_cnt
 			       * sizeof(rrd_value_t)),SEEK_SET) != 0){
-		    long i;
 		    rrd_set_error("wrap seek in RRA did fail");
-		    for (i=0;i<*ds_cnt;i++)
-			free((*ds_namv)[i]);
+		    for (ii=0;ii<*ds_cnt;ii++)
+			free((*ds_namv)[ii]);
 		    free(*ds_namv);
 		    rrd_free(&rrd);
 		    free(*data);
@@ -344,10 +341,9 @@
 	    if(fread(data_ptr,
 		     sizeof(rrd_value_t),
 		     *ds_cnt,in_file) != rrd.stat_head->ds_cnt){
-		long i;
 		rrd_set_error("fetching cdp from rra");
-		for (i=0;i<*ds_cnt;i++)
-		    free((*ds_namv)[i]);
+		for (ii=0;ii<*ds_cnt;ii++)
+		    free((*ds_namv)[ii]);
 		free(*ds_namv);
 		rrd_free(&rrd);
 		free(*data);

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_format.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_format.h	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_format.h	Sat Jul 13 21:25:53 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997, 1998, 1999
  *****************************************************************************
  * rrd_format.h  RRD Database Format header
  *****************************************************************************/
@@ -7,6 +7,8 @@
 #ifndef _RRD_FORMAT_H
 #define _RRD_FORMAT_H
 
+#include "rrd.h"
+
 /*****************************************************************************
  * put this in your /usr/lib/magic file (/etc/magic on HPUX)
  *
@@ -34,10 +36,6 @@
 					       * */
 #endif
 
-
-typedef double       rrd_value_t;         /* the data storage type is
-					   * double */
-
 typedef union unival { 
     unsigned long u_cnt; 
     rrd_value_t   u_val;
@@ -150,7 +148,9 @@
 					   * both can be set to UNKNOWN if you
 					   * do not care. Data outside the limits
  					   * set to UNKNOWN */
-#define DS_NAM_FMT    "%19[a-zA-Z0-9_]"
+
+/* The magic number here is one less than DS_NAM_SIZE */
+#define DS_NAM_FMT    "%19[a-zA-Z0-9_-]"
 #define DS_NAM_SIZE   20
 
 #define DST_FMT    "%19[A-Z]"
@@ -171,8 +171,8 @@
                        CF_LAST};
 
 enum rra_par_en {   RRA_cdp_xff_val=0};   /* what part of the consolidated 
-					    datapoint must be known, to produce a
-					    valid entry in the rra */
+					    datapoint may be unknown, while 
+					    still a valid entry in goes into the rra */
 		   	
 #define CF_NAM_FMT    "%19[A-Z]"
 #define CF_NAM_SIZE   20

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_resize.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_resize.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_resize.c	Sat Jul 13 21:25:53 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_resize.c Alters size of an RRA
  *****************************************************************************

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_graph.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_graph.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_graph.c	Sat Jul 13 21:25:54 2002
@@ -1,5 +1,5 @@
 /****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997,1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  ****************************************************************************
  * rrd__graph.c  make creates ne rrds
  ****************************************************************************/
@@ -9,6 +9,10 @@
 #include <gdlucidan10.h>
 #include <gdlucidab12.h>
 #include <sys/stat.h>
+#ifdef WIN32
+#include <io.h>
+#include <fcntl.h>
+#endif
 
 #define SmallFont gdLucidaNormal10
 #define LargeFont gdLucidaBold12
@@ -21,20 +25,24 @@
 # define DPRINT(x)
 #endif
 
+#define DEF_NAM_FMT "%29[_A-Za-z0-9]"
+
 enum tmt_en {TMT_SECOND=0,TMT_MINUTE,TMT_HOUR,TMT_DAY,
 	     TMT_WEEK,TMT_MONTH,TMT_YEAR};
 
 enum grc_en {GRC_CANVAS=0,GRC_BACK,GRC_SHADEA,GRC_SHADEB,
 	     GRC_GRID,GRC_MGRID,GRC_FONT,GRC_FRAME,GRC_ARROW,__GRC_END__};
 
+
 enum gf_en {GF_PRINT=0,GF_GPRINT,GF_COMMENT,GF_HRULE,GF_VRULE,GF_LINE1,
 	    GF_LINE2,GF_LINE3,GF_AREA,GF_STACK, GF_DEF, GF_CDEF };
 
 enum op_en {OP_NUMBER=0,OP_VARIABLE,OP_INF,OP_PREV,OP_NEGINF,
-	    OP_UNKN,OP_NOW,OP_TIME,OP_ADD,OP_MOD,
+	    OP_UNKN,OP_NOW,OP_TIME,OP_LTIME,OP_ADD,OP_MOD,
             OP_SUB,OP_MUL,
 	    OP_DIV,OP_SIN, OP_DUP, OP_EXC, OP_POP,
 	    OP_COS,OP_LOG,OP_EXP,OP_LT,OP_LE,OP_GT,OP_GE,OP_EQ,OP_IF,
+	    OP_MIN,OP_MAX,OP_LIMIT, OP_FLOOR, OP_CEIL,
 	    OP_UN,OP_END};
 
 enum if_en {IF_GIF=0,IF_PNG=1};
@@ -173,8 +181,10 @@
 
 } graph_desc_t;
 
-#define ALTYGRID      0x01  /* use alternative y grid algorithm */
-#define ALTAUTOSCALE  0x02  /* use alternative algorithm to find lower and upper bounds */
+#define ALTYGRID          0x01  /* use alternative y grid algorithm */
+#define ALTAUTOSCALE      0x02  /* use alternative algorithm to find lower and upper bounds */
+#define ALTAUTOSCALE_MAX  0x04  /* use alternative algorithm to find upper bounds */
+#define NOLEGEND          0x08  /* use no legend */
 
 typedef struct image_desc_t {
 
@@ -185,6 +195,8 @@
     col_trip_t     graph_col[__GRC_END__]; /* real colors for the graph */   
     char           ylegend[200];   /* legend along the yaxis */
     char           title[200];     /* title for graph */
+    int            draw_x_grid;      /* no x-grid at all */
+    int            draw_y_grid;      /* no x-grid at all */
     xlab_t         xlab_user;      /* user defined labeling for xaxis */
     char           xlab_form[200]; /* format for the label on the xaxis */
 
@@ -192,6 +204,7 @@
     int            ylabfact;       /* every how many y grid shall a label be written ? */
 
     time_t         start,end;      /* what time does the graph cover */
+    unsigned long           step;           /* any preference for the default step ? */
     rrd_value_t    minval,maxval;  /* extreme values in the data */
     int            rigid;          /* do not expand range even with 
 				      values outside */
@@ -210,6 +223,7 @@
     double         magfact;        /* numerical magnitude*/
     long         base;            /* 1000 or 1024 depending on what we graph */
     char           symbol;         /* magnitude symbol for y-axis */
+    int            unitsexponent;    /* 10*exponent for units on y-asis */
     int            extra_flags;    /* flags for boolean options */
     /* data elements */
 
@@ -219,8 +233,42 @@
 
 } image_desc_t;
 
+/* Prototypes */
+int xtr(image_desc_t *,time_t);
+int ytr(image_desc_t *, double);
+enum gf_en gf_conv(char *);
+enum if_en if_conv(char *);
+enum tmt_en tmt_conv(char *);
+enum grc_en grc_conv(char *);
+int im_free(image_desc_t *);
+void auto_scale( image_desc_t *,  double *, char **, double *);
+void si_unit( image_desc_t *);
+void expand_range(image_desc_t *);
+void reduce_data( enum cf_en,  unsigned long,  time_t *, time_t *,  unsigned long *,  unsigned long *,  rrd_value_t **);
+int data_fetch( image_desc_t *);
+long find_var(image_desc_t *, char *);
+long lcd(long *);
+int data_calc( image_desc_t *);
+int data_proc( image_desc_t *);
+time_t find_first_time( time_t,  enum tmt_en,  long);
+time_t find_next_time( time_t,  enum tmt_en,  long);
+void gator( gdImagePtr, int, int);
+int tzoffset(time_t);
+int print_calc(image_desc_t *, char ***);
+int leg_place(image_desc_t *);
+int horizontal_grid(gdImagePtr, image_desc_t *);
+int horizontal_log_grid(gdImagePtr, image_desc_t *);
+void vertical_grid( gdImagePtr, image_desc_t *);
+void axis_paint( image_desc_t *, gdImagePtr);
+void grid_paint( image_desc_t *, gdImagePtr);
+gdImagePtr MkLineBrush(image_desc_t *,long, enum gf_en);
+int lazy_check(image_desc_t *);
+int graph_paint(image_desc_t *, char ***);
+int gdes_alloc(image_desc_t *);
+int scan_for_col(char *, int, char *);
+int rrd_graph(int, char **, char ***, int *, int *);
 int bad_format(char *);
-
+rpnp_t * str2rpn(image_desc_t *,char *);
 
 /* translate time values into x coordinates */   
 /*#define xtr(x) (int)((double)im->xorigin \
@@ -228,14 +276,14 @@
 		* ((double)(x) - im->start)+0.5) */
 /* initialize with xtr(im,0); */
 int
-xtr(image_desc_t *im,time_t time){
+xtr(image_desc_t *im,time_t mytime){
     static double pixie;
-    if (time==0){
+    if (mytime==0){
 	pixie = (double) im->xsize / (double)(im->end - im->start);
 	return im->xorigin;
     }
     return (int)((double)im->xorigin 
-		 + pixie * ( time - im->start ) );
+		 + pixie * ( mytime - im->start ) );
 }
 
 /* translate data values into y coordinates */
@@ -282,6 +330,7 @@
 
 /* conversion function for symbolic entry names */
 
+
 #define conv_if(VV,VVV) \
    if (strcmp(#VV, string) == 0) return VVV ;
 
@@ -389,18 +438,18 @@
 		      "E"};/* 10e18  Exa */
 
     int symbcenter = 6;
-    int index;  
+    int sindex;  
 
     if (*value == 0.0 || isnan(*value) ) {
-	index = 0;
+	sindex = 0;
 	*magfact = 1.0;
     } else {
-	index = floor(log(fabs(*value))/log(im->base)); 
-	*magfact = pow(im->base, index);
+	sindex = floor(log(fabs(*value))/log((double)im->base)); 
+	*magfact = pow((double)im->base, (double)sindex);
 	(*value) /= (*magfact);
     }
-    if ( index <= symbcenter && index >= -symbcenter) {
-	(*symb_ptr) = symbol[index+symbcenter];
+    if ( sindex <= symbcenter && sindex >= -symbcenter) {
+	(*symb_ptr) = symbol[sindex+symbcenter];
     }
     else {
 	(*symb_ptr) = "?";
@@ -432,11 +481,18 @@
     int   symbcenter = 6;
     double digits;  
     
-    digits = floor( log( max( fabs(im->minval),fabs(im->maxval)))/log(im->base)); 
-    im->magfact = pow(im->base , digits);
+    if (im->unitsexponent != 9999) {
+	/* unitsexponent = 9, 6, 3, 0, -3, -6, -9, etc */
+        digits = floor(im->unitsexponent / 3);
+    } else {
+        digits = floor( log( max( fabs(im->minval),fabs(im->maxval)))/log((double)im->base)); 
+    }
+    im->magfact = pow((double)im->base , digits);
+
 #ifdef DEBUG
     printf("digits %6.3f  im->magfact %6.3f\n",digits,im->magfact);
 #endif
+
     if ( ((digits+symbcenter) < sizeof(symbol)) &&
 		    ((digits+symbcenter) >= 0) )
         im->symbol = symbol[(int)digits+symbcenter];
@@ -464,20 +520,38 @@
     
 
     
-    #ifdef DEBUG
+#ifdef DEBUG
     printf("Min: %6.2f Max: %6.2f MagFactor: %6.2f\n",
 	   im->minval,im->maxval,im->magfact);
-    #endif
+#endif
 
     if (isnan(im->ygridstep)){
 	if(im->extra_flags & ALTAUTOSCALE) {
 	    /* measure the amplitude of the function. Make sure that
 	       graph boundaries are slightly higher then max/min vals
 	       so we can see amplitude on the graph */
-	      adj = (im->maxval - im->minval) * 0.1;
+	      double delt, fact;
+
+	      delt = im->maxval - im->minval;
+	      adj = delt * 0.1;
+	      fact = 2.0 * pow(10.0,
+		    floor(log10(max(fabs(im->minval), fabs(im->maxval)))) - 2);
+	      if (delt < fact) {
+		adj = (fact - delt) * 0.55;
+#ifdef DEBUG
+	      printf("Min: %6.2f Max: %6.2f delt: %6.2f fact: %6.2f adj: %6.2f\n", im->minval, im->maxval, delt, fact, adj);
+#endif
+	      }
 	      im->minval -= adj;
 	      im->maxval += adj;
 	}
+	else if(im->extra_flags & ALTAUTOSCALE_MAX) {
+	    /* measure the amplitude of the function. Make sure that
+	       graph boundaries are slightly higher than max vals
+	       so we can see amplitude on the graph */
+	      adj = (im->maxval - im->minval) * 0.1;
+	      im->maxval += adj;
+	}
 	else {
 	    scaled_min = im->minval / im->magfact;
 	    scaled_max = im->maxval / im->magfact;
@@ -515,96 +589,140 @@
 }
 
     
+/* reduce data reimplementation by Alex */
 
 void
 reduce_data(
     enum cf_en     cf,         /* which consolidation function ?*/
     unsigned long  cur_step,   /* step the data currently is in */
-    time_t         *start,
-    time_t         *end,       /* which time frame do you want ?
-				* will be changed to represent reality */
-    unsigned long  *step,      /* desired step size. Will be adjusted to new increassed step size */
+    time_t         *start,     /* start, end and step as requested ... */
+    time_t         *end,       /* ... by the application will be   ... */
+    unsigned long  *step,      /* ... adjusted to represent reality    */
     unsigned long  *ds_cnt,    /* number of data sources in file */
     rrd_value_t    **data)     /* two dimensional array containing the data */
 {
     int i,reduce_factor = ceil((double)(*step) / (double)cur_step);
-    unsigned long src_row,trg_row,col,row_cnt,start_offset,skiprows=0;
+    unsigned long col,dst_row,row_cnt,start_offset,end_offset,skiprows=0;
+    rrd_value_t    *srcptr,*dstptr;
 
     (*step) = cur_step*reduce_factor; /* set new step size for reduced data */
-    /* adjust the start time so that it is a multiple of the new steptime */
+    dstptr = *data;
+    srcptr = *data;
 
-    row_cnt = ((*end)-(*start))/cur_step+1; /* +1 because start and end are pointers to first and last entry */
-    
+    /* We were given one extra row at the beginning of the interval.
+    ** We also need to return one extra row.  The extra interval is
+    ** the one defined by the start time in both cases.  It is not
+    ** used when graphing but maybe we can use it while reducing the
+    ** data.
+    */
+    row_cnt = ((*end)-(*start))/cur_step +1;
+
+    /* alter start and end so that they are multiples of the new steptime.
+    ** End will be shifted towards the future and start will be shifted
+    ** towards the past in order to include the requested interval
+    */ 
+    end_offset = (*end) % (*step);
+    if (end_offset) end_offset = (*step)-end_offset;
     start_offset = (*start) % (*step);
-    /* move the start pointer into the past so that the reduced data set
-       fully covers the timespan of the new dataset */
-    (*start) -= start_offset;
-
-    trg_row=0;
-    /* skip the first <skiprows> of original data because we already covered
-       by the row of *unknown* data added to the reduced dataset */
-    
-    skiprows = ((*step) - start_offset) / cur_step;
-
-    if (start_offset > 0) {
-      /* we don't have full data for the first row, so we'll ditch 
-         what is there and fill it with *UNKNOWN* */
-      for (col=0;col<(*ds_cnt);col++) {
-	(*data)[col] = DNAN;
-      }
-      trg_row++; /* one row of target filled already */
+    (*end) = (*end)+end_offset;
+    (*start) = (*start)-start_offset;
 
-    };
- 
-        
-    for (src_row = skiprows; src_row < row_cnt; src_row+=reduce_factor) {
-	for (col=0;col<(*ds_cnt);col++){
-	    double newval=DNAN;
+    /* The first destination row is unknown yet it still needs
+    ** to be present in the returned data.  Skip it.
+    ** Don't make it NaN or we might overwrite the source.
+    */
+    dstptr += (*ds_cnt);
+
+    /* Depending on the amount of extra data needed at the
+    ** start of the destination, three things can happen:
+    ** -1- start_offset == 0:  skip the extra source row
+    ** -2- start_offset == cur_step: do nothing
+    ** -3- start_offset > cur_step: skip some source rows and 
+    **                      fill one destination row with NaN
+    */
+    if (start_offset==0) {
+	srcptr+=(*ds_cnt);
+	row_cnt--;
+    } else if (start_offset!=cur_step) {
+	skiprows=((*step)-start_offset)/cur_step+1;
+	srcptr += ((*ds_cnt)*skiprows);
+	row_cnt-=skiprows;
+	for (col=0;col<(*ds_cnt);col++) *dstptr++=DNAN;
+    }
+
+    /* If we had to alter the endtime, there won't be
+    ** enough data to fill the last row.  This means
+    ** we have to skip some rows at the end
+    */
+    if (end_offset) {
+	skiprows = ((*step)-end_offset)/cur_step;
+	row_cnt-=skiprows;
+    }
+
+
+/* Sanity check: row_cnt should be multiple of reduce_factor */
+/* if this gets triggered, something is REALY WRONG ... we die immediately */
+
+    if (row_cnt%reduce_factor) {
+	printf("SANITY CHECK: %lu rows cannot be reduced by %i \n",
+				row_cnt,reduce_factor);
+	printf("BUG in reduce_data()\n");
+	exit(1);
+    }
+
+    /* Now combine reduce_factor intervals at a time
+    ** into one interval for the destination.
+    */
+
+    for (dst_row=0;row_cnt>=reduce_factor;dst_row++) {
+	for (col=0;col<(*ds_cnt);col++) {
+	    rrd_value_t newval=DNAN;
 	    unsigned long validval=0;
-	    for (i=0;i<reduce_factor && src_row+i<row_cnt;i++) {		
-		unsigned long ptr = (src_row+i)* (*ds_cnt)+col;
-		if (isnan((*data)[ptr])) continue; /* we can't help with NAN */
+
+	    for (i=0;i<reduce_factor;i++) {
+		if (isnan(srcptr[i*(*ds_cnt)+col])) {
+		    continue;
+		}
 		validval++;
-		if (isnan(newval)) {
-		    newval = (*data)[ptr];
-		} else {
-		   
-  		  switch (cf) {
-		  case CF_AVERAGE:
-		      newval += (*data)[ptr];
-		      break;
-		  case CF_MINIMUM:
-		      newval = min (newval,(*data)[ptr]);
-		      break;
-		  case CF_MAXIMUM:
-		      newval = max (newval,(*data)[ptr]);
-		      break;
-		  case CF_LAST:
-		      newval = (*data)[ptr];
-		      break;
-		  }
+		if (isnan(newval)) newval = srcptr[i*(*ds_cnt)+col];
+		else {
+		    switch (cf) {
+			case CF_AVERAGE:
+			    newval += srcptr[i*(*ds_cnt)+col];
+			    break;
+			case CF_MINIMUM:
+			    newval = min (newval,srcptr[i*(*ds_cnt)+col]);
+			    break;
+			case CF_MAXIMUM:
+			    newval = max (newval,srcptr[i*(*ds_cnt)+col]);
+			    break;
+			case CF_LAST:
+			    newval = srcptr[i*(*ds_cnt)+col];
+			    break;
+		    }
 		}
 	    }
 	    if (validval == 0){newval = DNAN;} else{
 		switch (cf) {
-		case CF_AVERAGE:		
-		    newval /= validval;
-		    break;
-		case CF_MINIMUM:
-		case CF_MAXIMUM:
-		case CF_LAST:
-		    break;
+		    case CF_AVERAGE:		
+			newval /= validval;
+			break;
+		    case CF_MINIMUM:
+		    case CF_MAXIMUM:
+		    case CF_LAST:
+			break;
 		}
 	    }
-	    (*data)[(trg_row)* (*ds_cnt)+col] = newval;
+	    *dstptr++=newval;
 	}
-	trg_row++;
-    }
-    *end = (*start) + (*step) * (trg_row);
-    /* make sure there is some NAN at the end of the graph */
-    for (col=0;col<(*ds_cnt);col++){
-      (*data)[(trg_row)* *ds_cnt+col] = DNAN;
+	srcptr+=(*ds_cnt)*reduce_factor;
+	row_cnt-=reduce_factor;
     }
+
+    /* If we had to alter the endtime, we didn't have enough
+    ** source rows to fill the last row. Fill it with NaN.
+    */
+    if (end_offset!=0) for (col=0;col<(*ds_cnt);col++) *dstptr++ = DNAN;
 }
 
 
@@ -740,13 +858,15 @@
 	    return NULL;
 	}
 
-	else if((sscanf(expr,"%lf%n",&rpnp[steps].val,&pos) == 1) && (expr[pos] == ',')){
+	else if((sscanf(expr,"%lf%n",&rpnp[steps].val,&pos) == 1) 
+	        && (expr[pos] == ',')){
  	    rpnp[steps].op = OP_NUMBER;
 	    expr+=pos;
 	} 
 	
 #define match_op(VV,VVV) \
-        else if (strncmp(expr, #VVV, strlen(#VVV))==0){ \
+        else if (strncmp(expr, #VVV, strlen(#VVV))==0 && \
+                (expr[strlen(#VVV)] == ',' || expr[strlen(#VVV)] == '\0') ){ \
 	    rpnp[steps].op = VV; \
 	    expr+=strlen(#VVV); \
 	}
@@ -759,6 +879,8 @@
 	match_op(OP_SIN,SIN)
 	match_op(OP_COS,COS)
 	match_op(OP_LOG,LOG)
+	match_op(OP_FLOOR,FLOOR)
+	match_op(OP_CEIL,CEIL)
 	match_op(OP_EXP,EXP)
 	match_op(OP_DUP,DUP)
 	match_op(OP_EXC,EXC)
@@ -769,6 +891,9 @@
 	match_op(OP_GE,GE)
 	match_op(OP_EQ,EQ)
 	match_op(OP_IF,IF)
+	match_op(OP_MIN,MIN)
+	match_op(OP_MAX,MAX)
+	match_op(OP_LIMIT,LIMIT)
 	  /* order is important here ! .. match longest first */
 	match_op(OP_UNKN,UNKN)
 	match_op(OP_UN,UN)
@@ -776,12 +901,14 @@
 	match_op(OP_PREV,PREV)
 	match_op(OP_INF,INF)
 	match_op(OP_NOW,NOW)
+	match_op(OP_LTIME,LTIME)
 	match_op(OP_TIME,TIME)
 
+
 #undef match_op
 
 
-	else if ((sscanf(expr,"%29[_A-Za-z0-9]%n",
+	else if ((sscanf(expr,DEF_NAM_FMT "%n",
 			 vname,&pos) == 1) 
 		 && ((rpnp[steps].ptr = find_var(im,vname)) != -1)){
 	    rpnp[steps].op = OP_VARIABLE;
@@ -805,6 +932,38 @@
     return rpnp;
 }
 
+/* figure out what the local timezone offset for any point in
+   time was. Return it in seconds */
+
+int
+tzoffset( time_t now ){
+  int gm_sec, gm_min, gm_hour, gm_yday, gm_year,
+    l_sec, l_min, l_hour, l_yday, l_year;
+  struct tm *t;
+  int off;
+  t = gmtime(&now);
+  gm_sec = t->tm_sec;
+  gm_min = t->tm_min;
+  gm_hour = t->tm_hour;
+  gm_yday = t->tm_yday;
+  gm_year = t->tm_year;
+  t = localtime(&now);
+  l_sec = t->tm_sec;
+  l_min = t->tm_min;
+  l_hour = t->tm_hour;
+  l_yday = t->tm_yday;
+  l_year = t->tm_year;
+  off = (l_sec-gm_sec)+(l_min-gm_min)*60+(l_hour-gm_hour)*3600; 
+  if ( l_yday > gm_yday || l_year > gm_year){
+        off += 24*3600;
+  } else if ( l_yday < gm_yday || l_year < gm_year){
+        off -= 24*3600;
+  }
+
+  return off;
+}
+
+    
 
 #define dc_stackblock 100
 
@@ -841,7 +1000,7 @@
 	for(rpi=0;im->gdes[gdi].rpnp[rpi].op != OP_END;rpi++){
 	    if(im->gdes[gdi].rpnp[rpi].op == OP_VARIABLE){
 		long ptr = im->gdes[gdi].rpnp[rpi].ptr;
-		if ((steparray = rrd_realloc(steparray, (++stepcnt+1)*sizeof(double)))==NULL){
+		if ((steparray = rrd_realloc(steparray, (++stepcnt+1)*sizeof(*steparray)))==NULL){
 		  rrd_set_error("realloc steparray");
 		  free(stack);
 		  return -1;
@@ -903,7 +1062,7 @@
 	    for (rpi=0;im->gdes[gdi].rpnp[rpi].op != OP_END;rpi++){
 		if (stptr +5 > dc_stacksize){
 		    dc_stacksize += dc_stackblock;		
-		    stack = rrd_realloc(stack,dc_stacksize*sizeof(long));
+		    stack = rrd_realloc(stack,dc_stacksize*sizeof(*stack));
 		    if (stack==NULL){
 			rrd_set_error("RPN stack overflow");
 			return -1;
@@ -924,7 +1083,7 @@
 		    stack[++stptr] =  *im->gdes[gdi].rpnp[rpi].data;
 		    break;
 		case OP_PREV:
-		    if (dataidx == 0) {
+		    if (dataidx <= 0) {
                        stack[++stptr] = DNAN;
                     } else {
                        stack[++stptr] = im->gdes[gdi].data[dataidx];
@@ -945,6 +1104,9 @@
 		case OP_TIME:
 		    stack[++stptr] = (double)now;
 		    break;
+		case OP_LTIME:
+		    stack[++stptr] = (double)tzoffset(now)+(double)now;
+		    break;
 		case OP_ADD:
 		    if(stptr<1){
 			rrd_set_error("RPN stack underflow");
@@ -1006,6 +1168,22 @@
 		    }
 		    stack[stptr] = cos(stack[stptr]);
 		    break;
+		case OP_CEIL:
+		    if(stptr<0){
+			rrd_set_error("RPN stack underflow");
+			free(stack);
+			return -1;
+		    }
+		    stack[stptr] = ceil(stack[stptr]);
+		    break;
+		case OP_FLOOR:
+		    if(stptr<0){
+			rrd_set_error("RPN stack underflow");
+			free(stack);
+			return -1;
+		    }
+		    stack[stptr] = floor(stack[stptr]);
+		    break;
 		case OP_LOG:
 		    if(stptr<0){
 			rrd_set_error("RPN stack underflow");
@@ -1057,7 +1235,10 @@
 			free(stack);
 			return -1;
 		    }
-		    stack[stptr-1] = stack[stptr-1] < stack[stptr] ? 1.0 : 0.0;
+		    if (isnan(stack[stptr-1]) || isnan(stack[stptr]))
+		        stack[stptr-1] = 0.0;
+		    else
+			stack[stptr-1] = stack[stptr-1] < stack[stptr] ? 1.0 : 0.0;
 		    stptr--;
 		    break;
 		case OP_LE:
@@ -1066,7 +1247,10 @@
 			free(stack);
 			return -1;
 		    }
-		    stack[stptr-1] = stack[stptr-1] <= stack[stptr] ? 1.0 : 0.0;
+		    if (isnan(stack[stptr-1]) || isnan(stack[stptr]))
+		        stack[stptr-1] = 0.0;
+		    else
+		        stack[stptr-1] = stack[stptr-1] <= stack[stptr] ? 1.0 : 0.0;
 		    stptr--;
 		    break;
 		case OP_GT:
@@ -1075,7 +1259,10 @@
 			free(stack);
 			return -1;
 		    }
-		    stack[stptr-1] = stack[stptr-1] > stack[stptr] ? 1.0 : 0.0;
+		    if (isnan(stack[stptr-1]) || isnan(stack[stptr]))
+		        stack[stptr-1] = 0.0;
+		    else
+		        stack[stptr-1] = stack[stptr-1] > stack[stptr] ? 1.0 : 0.0;
 		    stptr--;
 		    break;
 		case OP_GE:
@@ -1084,7 +1271,10 @@
 			free(stack);
 			return -1;
 		    }
-		    stack[stptr-1] = stack[stptr-1] >= stack[stptr] ? 1.0 : 0.0;
+		    if (isnan(stack[stptr-1]) || isnan(stack[stptr]))
+		        stack[stptr-1] = 0.0;
+		    else
+		        stack[stptr-1] = stack[stptr-1] >= stack[stptr] ? 1.0 : 0.0;
 		    stptr--;
 		    break;
 		case OP_EQ:
@@ -1093,7 +1283,10 @@
 			free(stack);
 			return -1;
 		    }
-		    stack[stptr-1] = stack[stptr-1] == stack[stptr] ? 1.0 : 0.0;
+		    if (isnan(stack[stptr-1]) || isnan(stack[stptr]))
+		        stack[stptr-1] = 0.0;
+		    else
+		        stack[stptr-1] = stack[stptr-1] == stack[stptr] ? 1.0 : 0.0;
 		    stptr--;
 		    break;
 		case OP_IF:
@@ -1106,6 +1299,52 @@
 		    stptr--;
 		    stptr--;
 		    break;
+		case OP_MIN:
+		    if(stptr<1){
+			rrd_set_error("RPN stack underflow");
+			free(stack);
+			return -1;
+		    }
+		    if (isnan(stack[stptr-1])) 
+			;
+		    else if (isnan(stack[stptr]))
+		        stack[stptr-1] = stack[stptr];
+		    else if (stack[stptr-1] > stack[stptr])
+		        stack[stptr-1] = stack[stptr];
+		    stptr--;
+		    break;
+		case OP_MAX:
+		    if(stptr<1){
+			rrd_set_error("RPN stack underflow");
+			free(stack);
+			return -1;
+		    }
+		    if (isnan(stack[stptr-1])) 
+			;
+		    else if (isnan(stack[stptr]))
+		        stack[stptr-1] = stack[stptr];
+		    else if (stack[stptr-1] < stack[stptr])
+		        stack[stptr-1] = stack[stptr];
+		    stptr--;
+		    break;
+		case OP_LIMIT:
+		    if(stptr<2){
+			rrd_set_error("RPN stack underflow");
+			free(stack);
+			return -1;
+		    }
+		    if (isnan(stack[stptr-2])) 
+			;
+		    else if (isnan(stack[stptr-1]))
+		        stack[stptr-2] = stack[stptr-1];
+		    else if (isnan(stack[stptr]))
+		        stack[stptr-2] = stack[stptr];
+		    else if (stack[stptr-2] < stack[stptr-1])
+		        stack[stptr-2] = DNAN;
+		    else if (stack[stptr-2] > stack[stptr])
+		        stack[stptr-2] = DNAN;
+		    stptr-=2;
+		    break;
 		case OP_UN:
 		    if(stptr<0){
 			rrd_set_error("RPN stack underflow");
@@ -1283,8 +1522,9 @@
 	tm.tm_sec=0;
 	tm.tm_min = 0;
 	tm.tm_hour = 0;
-	tm.tm_mday -= tm.tm_wday -1 ; break;	/* -1 because we want the monday */
+	tm.tm_mday -= tm.tm_wday -1;	/* -1 because we want the monday */
 	if (tm.tm_wday==0) tm.tm_mday -= 7; /* we want the *previous* monday */
+	break;
     case TMT_MONTH:
 	tm.tm_sec=0;
 	tm.tm_min = 0;
@@ -1338,14 +1578,25 @@
 	  
 }
 
-/* create a grid on the graph. it determines what to do
-   from the values of xsize, start and end */
-/* the xaxis labels are determined from the number of seconds per pixel
-   in the requested graph */
-
-
 void gator( gdImagePtr gif, int x, int y){ 
 
+/* this function puts the name of the author and the tool into the
+   graph. Remove if you must, but please note, that it is here,
+   because I would like people who look at rrdtool generated graphs to
+   see what was used to do it. No obviously you can also add a credit
+   line to your webpage or printed document, this is fine with me. But
+   as I have no control over this, I added the little tag in here. 
+*/
+
+/* the fact that the text of what gets put into the graph is not
+   visible in the function, has lead some to think this is for
+   obfuscation reasons. While this is a nice side effect (I addmit),
+   it is not the prime reason. The prime reason is, that the font
+   used, is so small, that I had to hand edit the characters to ensure
+   readability. I could thus not use the normal gd functions to write,
+   but had to embed a slightly compressed bitmap version into the code. 
+*/
+
     int li[]={0,0,1, 0,4,5, 0,8,9, 0,12,14, 0,17,17, 0,21,21, 
 	      0,24,24, 0,34,34, 0,40,42, 0,45,45, 0,48,49, 0,52,54, 
 	      0,61,61, 0,64,66, 0,68,70, 0,72,74, 0,76,76, 0,78,78, 
@@ -1374,6 +1625,7 @@
 	  gdImageSetPixel(gif,x-li[i],ii,graph_col[GRC_GRID].i); 
 }
 
+
 /* calculate values required for PRINT and GPRINT functions */
 
 int
@@ -1405,8 +1657,8 @@
 		     *im->gdes[vidx].ds_cnt);
 	    printval = DNAN;
 	    validsteps = 0;
-	    for(ii=im->gdes[vidx].ds;
-		ii < max_ii;
+	    for(ii=im->gdes[vidx].ds+im->gdes[vidx].ds_cnt;
+		ii < max_ii+im->gdes[vidx].ds_cnt;
 		ii+=im->gdes[vidx].ds_cnt){
 		 if (! finite(im->gdes[vidx].data[ii]))
 		     continue;
@@ -1504,7 +1756,6 @@
 int
 leg_place(image_desc_t *im)
 {
-    
     /* graph labels */
     int   interleg = SmallFont->w*2;
     int   box = SmallFont->h*1.2;
@@ -1518,6 +1769,7 @@
     char  prt_fctn; /*special printfunctions */
     int  *legspace;
 
+  if( !(im->extra_flags & NOLEGEND) ) {
     if ((legspace = malloc(im->gdes_c*sizeof(int)))==NULL){
        rrd_set_error("malloc for legspace");
        return -1;
@@ -1615,9 +1867,16 @@
     }
     im->ygif = leg_y+6;
     free(legspace);
-    return 0;
+  }
+  return 0;
 }
 
+/* create a grid on the graph. it determines what to do
+   from the values of xsize, start and end */
+
+/* the xaxis labels are determined from the number of seconds per pixel
+   in the requested graph */
+
 
 
 int
@@ -1667,7 +1926,7 @@
 		sprintf(labfmt, "%%%d.%df", decimals - fractionals + 1, -fractionals + 1);
 	    else
 		sprintf(labfmt, "%%%d.1f", decimals + 1);
-	    gridstep = pow(10, fractionals);
+	    gridstep = pow((double)10, (double)fractionals);
 	    if(gridstep == 0) /* range is one -> 0.1 is reasonable scale */
 		gridstep = 0.1;
 	    /* should have at least 5 lines but no more then 15 */
@@ -1810,7 +2069,7 @@
     polyPoints[0].x=im->xorigin;
     polyPoints[1].x=im->xorigin+im->xsize;
     /* paint minor grid */
-    for (value = pow(10, log10(im->minval) 
+    for (value = pow((double)10, log10(im->minval) 
 			  - fmod(log10(im->minval),log10(yloglab[minoridx][0])));
 	 value  <= im->maxval;
 	 value *= yloglab[minoridx][0]){
@@ -1831,7 +2090,7 @@
     }
 
     /* paint major grid and labels*/
-    for (value = pow(10, log10(im->minval) 
+    for (value = pow((double)10, log10(im->minval) 
 			  - fmod(log10(im->minval),log10(yloglab[majoridx][0])));
 	 value <= im->maxval;
 	 value *= yloglab[majoridx][0]){
@@ -2017,7 +2276,7 @@
 {   
     long i;
     int boxH=8, boxV=8;
-	int res;
+    int res=0;
     gdPoint polyPoints[4];	 /* points for filled graph and more*/
 
     /* draw 3d border */
@@ -2031,23 +2290,26 @@
     gdImageLine(gif,1,im->ygif-2,im->xgif-2,im->ygif-2,graph_col[GRC_SHADEB].i);
 
 
-    vertical_grid(gif, im);
+    if (im->draw_x_grid == 1 )
+      vertical_grid(gif, im);
     
-    /* dont draw horizontal grid if there is no min and max val */
+    if (im->draw_y_grid == 1){
 	if(im->logarithmic){
 		res = horizontal_log_grid(gif,im);
 	} else {
 		res = horizontal_grid(gif,im);
 	}
-    if (! res) {
-       char *nodata = "No Data found";
-       gdImageString(gif, LargeFont,
-		     im->xgif/2 
-		     - (strlen(nodata)*LargeFont->w)/2,
-		     (2*im->yorigin-im->ysize) / 2,
-		     (unsigned char *)nodata, graph_col[GRC_FONT].i);
-    }
 
+	/* dont draw horizontal grid if there is no min and max val */
+	if (! res ) {
+	  char *nodata = "No Data found";
+	  gdImageString(gif, LargeFont,
+			im->xgif/2 
+			- (strlen(nodata)*LargeFont->w)/2,
+			(2*im->yorigin-im->ysize) / 2,
+			(unsigned char *)nodata, graph_col[GRC_FONT].i);
+	}
+    }
 
     /* yaxis description */
     gdImageStringUp(gif, SmallFont,
@@ -2065,8 +2327,8 @@
 		    (unsigned char *)im->title, graph_col[GRC_FONT].i);
     
     /* graph labels */
-
-    for(i=0;i<im->gdes_c;i++){
+    if( !(im->extra_flags & NOLEGEND) ) {
+      for(i=0;i<im->gdes_c;i++){
 	if(im->gdes[i].legend[0] =='\0')
 	    continue;
 	
@@ -2098,6 +2360,7 @@
 			  (unsigned char *)im->gdes[i].legend,
 			  graph_col[GRC_FONT].i);
 	}
+      }
     }
     
     
@@ -2160,6 +2423,7 @@
 
 int lazy_check(image_desc_t *im){
     FILE *fd = NULL;
+    int size = 1;
     struct stat  gifstat;
     
     if (im->lazy == 0) return 0; /* no lazy option */
@@ -2174,12 +2438,14 @@
       return 0; /* the file does not exist */
     switch (im->imgformat) {
     case IF_GIF:
-	return GifSize(fd,&(im->xgif),&(im->ygif));
+	size = GifSize(fd,&(im->xgif),&(im->ygif));
+	break;
     case IF_PNG:
-	return PngSize(fd,&(im->xgif),&(im->ygif));
+	size = PngSize(fd,&(im->xgif),&(im->ygif));
+	break;
     }
     fclose(fd);
-    return 1;
+    return size;
 }
 
 /* draw that picture thing ... */
@@ -2215,8 +2481,9 @@
      * if there are no graph elements we stop here ... 
      * if we are lazy, try to quit ... 
      */
-    if(print_calc(im,calcpr)==0 || lazy)
-	return 0;
+    i=print_calc(im,calcpr);
+    if(i<0) return -1;
+    if(i==0 || lazy) return 0;
 
     /* get actual drawing data and find min and max values*/
     if(data_proc(im)==-1)
@@ -2424,10 +2691,14 @@
     }
 
     if (strcmp(im->graphfile,"-")==0) {
-	fo = stdout;
+#ifdef WIN32
+        /* Change translation mode for stdout to BINARY */
+        _setmode( _fileno( stdout ), O_BINARY );
+#endif
+        fo = stdout;
     } else {
 	if ((fo = fopen(im->graphfile,"wb")) == NULL) {
-	    rrd_set_error("cannot open %s for write",im->graphfile);
+	    rrd_set_error("Opening '%s' for write: %s",im->graphfile, strerror(errno));
 	    return (-1);
 	}
     }
@@ -2455,6 +2726,9 @@
 gdes_alloc(image_desc_t *im){
 
     long def_step = (im->end-im->start)/im->xsize;
+    
+    if (im->step > def_step) /* step can be increassed ... no decreassed */
+      def_step = im->step;
 
     im->gdes_c++;
     
@@ -2523,6 +2797,7 @@
     int linepass = 0; /* stack can only follow directly after LINE* AREA or STACK */    
     struct time_value start_tv, end_tv;
     char *parsetime_error = NULL;
+    int stroff;    
 
     (*prdata)=NULL;
 
@@ -2534,17 +2809,21 @@
     im.ygif=0;
     im.xsize = 400;
     im.ysize = 100;
+    im.step = 0;
     im.ylegend[0] = '\0';
     im.title[0] = '\0';
     im.minval = DNAN;
     im.maxval = DNAN;    
     im.interlaced = 0;
+    im.unitsexponent= 9999;
     im.extra_flags= 0;
     im.rigid = 0;
     im.imginfo = NULL;
     im.lazy = 0;
     im.logarithmic = 0;
     im.ygridstep = DNAN;
+    im.draw_x_grid = 1;
+    im.draw_y_grid = 1;
     im.base = 1000;
     im.prt_c = 0;
     im.gdes_c = 0;
@@ -2576,15 +2855,19 @@
 	    {"imginfo",    required_argument, 0,  'f'},
 	    {"imgformat",  required_argument, 0,  'a'},
 	    {"lazy",       no_argument,       0,  'z'},
+	    {"no-legend",  no_argument,       0,  'g'},
 	    {"alt-y-grid", no_argument,       0,   257 },
 	    {"alt-autoscale", no_argument,    0,   258 },
+	    {"alt-autoscale-max", no_argument,    0,   259 },
+	    {"units-exponent",required_argument, 0,  260},
+	    {"step",       required_argument, 0,   261},
 	    {0,0,0,0}};
 	int option_index = 0;
 	int opt;
 
 	
 	opt = getopt_long(argc, argv, 
-			  "s:e:x:y:v:w:h:iu:l:rb:oc:t:f:a:z",
+			  "s:e:x:y:v:w:h:iu:l:rb:oc:t:f:a:z:g",
 			  long_options, &option_index);
 
 	if (opt == EOF)
@@ -2597,6 +2880,18 @@
 	case 258:
 	    im.extra_flags |= ALTAUTOSCALE;
 	    break;
+	case 259:
+	    im.extra_flags |= ALTAUTOSCALE_MAX;
+	    break;
+	case 'g':
+	    im.extra_flags |= NOLEGEND;
+	    break;
+	case 260:
+	    im.unitsexponent = atoi(optarg);
+	    break;
+	case 261:
+	    im.step =  atoi(optarg);
+	    break;
 	case 's':
 	    if ((parsetime_error = parsetime(optarg, &start_tv))) {
 	        rrd_set_error( "start time: %s", parsetime_error );
@@ -2610,8 +2905,13 @@
 	    }
 	    break;
 	case 'x':
+	    if(strcmp(optarg,"none") == 0){
+	      im.draw_x_grid=0;
+	      break;
+	    };
+	        
 	    if(sscanf(optarg,
-		      "%10[A-Z]:%lu:%10[A-Z]:%lu:%10[A-Z]:%lu:%lu:%100s",
+		      "%10[A-Z]:%ld:%10[A-Z]:%ld:%10[A-Z]:%ld:%ld:%n",
 		      scan_gtm,
 		      &im.xlab_user.gridst,
 		      scan_mtm,
@@ -2619,7 +2919,8 @@
 		      scan_ltm,
 		      &im.xlab_user.labst,
 		      &im.xlab_user.precis,
-		      im.xlab_form) == 8){
+		      &stroff) == 7 && stroff != 0){
+                strncpy(im.xlab_form, optarg+stroff, sizeof(im.xlab_form) - 1);
 		if((im.xlab_user.gridtm = tmt_conv(scan_gtm)) == -1){
 		    rrd_set_error("unknown keyword %s",scan_gtm);
 		    return -1;
@@ -2633,11 +2934,17 @@
 		im.xlab_user.minsec = 1;
 		im.xlab_user.stst = im.xlab_form;
 	    } else {
-		rrd_set_error("invalid xgrid format");
+		rrd_set_error("invalid x-grid format");
 		return -1;
 	    }
 	    break;
 	case 'y':
+
+	    if(strcmp(optarg,"none") == 0){
+	      im.draw_y_grid=0;
+	      break;
+	    };
+
 	    if(sscanf(optarg,
 		      "%lf:%d",
 		      &im.ygridstep,
@@ -2650,7 +2957,7 @@
 		    return -1;
 		} 
 	    } else {
-		rrd_set_error("invalid ygrid format");
+		rrd_set_error("invalid y-grid format");
 		return -1;
 	    }
 	    break;
@@ -2922,7 +3229,7 @@
 	    }
 	    if(sscanf(
 		    &argv[i][argstart],
-		    "%29[_A-Za-z0-9]=%[^: ]",
+		    DEF_NAM_FMT "=%[^: ]",
 		    im.gdes[im.gdes_c-1].vname,
 		    rpnex) != 2){
 		im_free(&im);
@@ -2947,9 +3254,9 @@
 	case GF_DEF:
 	    if (sscanf(
 		&argv[i][argstart],
-		"%29[_A-Za-z0-9]=%n",
+		DEF_NAM_FMT "=%n",
 		im.gdes[im.gdes_c-1].vname,
-		&strstart)== 1){
+		&strstart)== 1 && strstart){ /* is the = did not match %n returns 0 */ 
 		if(sscanf(&argv[i][argstart
 				  +strstart
 				  +scan_for_col(&argv[i][argstart+strstart],

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_open.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_open.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_open.c	Sat Jul 13 21:25:54 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_open.c  Open an RRD File
  *****************************************************************************
@@ -35,7 +35,7 @@
     }
     
     if (((*in_file) = fopen(file_name,mode)) == NULL ){
-	rrd_set_error("rrdopen can't open '%s'",file_name);
+	rrd_set_error("opening '%s': %s",file_name, strerror(errno));
 	return (-1);
     }
     
@@ -50,7 +50,7 @@
     
 	/* lets do some test if we are on track ... */
 	if (strncmp(rrd->stat_head->cookie,RRD_COOKIE,4) != 0){
-	    rrd_set_error("not an RRD file");
+	    rrd_set_error("'%s' is not an RRD file",file_name);
 	    free(rrd->stat_head);
 	    return(-1);}
 
@@ -61,7 +61,7 @@
 	    return(-1);}
 
 	if (rrd->stat_head->float_cookie != FLOAT_COOKIE){
-	    rrd_set_error("This RRD created on other architecture");
+	    rrd_set_error("This RRD was created on other architecture");
 	    free(rrd->stat_head);
 	    return(-1);}
 
@@ -108,7 +108,7 @@
     if ((strcmp("-",file_name) == 0)) { input = stdin; }
     else {
       if ((input = fopen(file_name,"rb")) == NULL ){
-	rrd_set_error("readfile can't open '%s'",file_name);
+	rrd_set_error("opening '%s': %s",file_name,strerror(errno));
 	return (-1);
       }
     }

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_cgi.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_cgi.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_cgi.c	Sat Jul 13 21:25:54 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_cgi.c  RRD Web Page Generator
  *****************************************************************************/
@@ -47,6 +47,9 @@
 /* set an evironment variable */
 char* rrdsetenv(long, char **);
 
+/* get an evironment variable */
+char* rrdgetenv(long, char **);
+
 /* include the named file at this point */
 char* includefile(long, char **);
 
@@ -56,6 +59,8 @@
 /** http protocol needs special format, and GMT time **/
 char *http_time(time_t *);
 
+/* return a pointer to newly alocated copy of this string */
+char *stralloc(char *);
 
 static long goodfor=0;
 static char **calcpr=NULL;
@@ -63,9 +68,13 @@
   if (calcpr) {
     long i;
     for(i=0;calcpr[i];i++){
-      free(calcpr[i]);
+      if (calcpr[i]){
+	      free(calcpr[i]);
+      }
     } 
-    free(calcpr);
+    if (calcpr) {
+	    free(calcpr);
+    }
   }
 }
 
@@ -135,25 +144,26 @@
   if(filter==0) {
   /* pass 1 makes only sense in cgi mode */
       for (i=0;buffer[i] != '\0'; i++){    
-	  i +=parse(&buffer,i,"<RRD::CV ",cgiget);
-	  i +=parse(&buffer,i,"<RRD::CV::QUOTE ",cgigetq);
-	  i +=parse(&buffer,i,"<RRD::CV::PATH ",cgigetqp);
+	  i +=parse(&buffer,i,"<RRD::CV",cgiget);
+	  i +=parse(&buffer,i,"<RRD::CV::QUOTE",cgigetq);
+	  i +=parse(&buffer,i,"<RRD::CV::PATH",cgigetqp);
+	  i +=parse(&buffer,i,"<RRD::GETENV",rrdgetenv);	 
       }
   }
 
   /* pass 2 */
   for (i=0;buffer[i] != '\0'; i++){    
-      i +=parse(&buffer,i,"<RRD::GOODFOR ",rrdgoodfor);
-      i += parse(&buffer,i,"<RRD::SETENV ",rrdsetenv);
-      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::GOODFOR",rrdgoodfor);
+      i += parse(&buffer,i,"<RRD::SETENV",rrdsetenv);
+      i += parse(&buffer,i,"<RRD::INCLUDE",includefile);
+      i += parse(&buffer,i,"<RRD::TIME::LAST",printtimelast);
+      i += parse(&buffer,i,"<RRD::TIME::NOW",printtimenow);
   }
 
   /* pass 3 */
   for (i=0;buffer[i] != '\0'; i++){    
-    i += parse(&buffer,i,"<RRD::GRAPH ",drawgraph);
-    i += parse(&buffer,i,"<RRD::PRINT ",drawprint);
+    i += parse(&buffer,i,"<RRD::GRAPH",drawgraph);
+    i += parse(&buffer,i,"<RRD::PRINT",drawprint);
   }
 
   if (filter==0){
@@ -173,7 +183,9 @@
   }
   printf ("%s", buffer);
   calfree();
-  free(buffer);
+  if (buffer){
+     free(buffer);
+  }
   exit(0);
 }
 
@@ -196,6 +208,13 @@
   return stralloc("");
 }
 
+char* rrdgetenv(long argc, char **args){
+  if (argc != 1) {
+    return stralloc("[ERROR: getenv faild because it did not get 1 argument only]");
+  };
+  return stralloc(getenv(args[0]));
+}
+
 char* rrdgoodfor(long argc, char **args){
   if (argc == 1) {
       goodfor = atol(args[0]);
@@ -215,7 +234,7 @@
   if (argc >= 1) {
       readfile(args[0], &buffer, 0);
       if (rrd_test_error()) {
-	  char *err = malloc((strlen(rrd_get_error())+20)*sizeof(char));
+	  char *err = malloc((strlen(rrd_get_error())+DS_NAM_SIZE)*sizeof(char));
 	  sprintf(err, "[ERROR: %s]",rrd_get_error());
 	  rrd_clear_error();
 	  return err;
@@ -232,13 +251,15 @@
 char* rrdstrip(char *buf){
   char *start;
   if (buf == NULL) return NULL;
+  buf = stralloc(buf); /* make a copy of the buffer */
+  if (buf == NULL) return NULL;
   while ((start = strstr(buf,"<"))){
     *start = '_';
   }
   while ((start = strstr(buf,">"))){
     *start = '_';
   }
-  return stralloc(buf);
+  return buf;
 }
 
 char* cgigetq(long argc, char **args){
@@ -251,7 +272,7 @@
 
     for(c=buf;*c != '\0';c++)
       if (*c == '"') qc++;
-    if((buf2=malloc((strlen(buf) + qc*4 +2) * sizeof(char)))==NULL){
+    if((buf2=malloc((strlen(buf) + qc*4 +4) * sizeof(char)))==NULL){
 	perror("Malloc Buffer");
 	exit(1);
     };
@@ -289,7 +310,7 @@
 
     for(c=buf;*c != '\0';c++)
       if (*c == '"') qc++;
-    if((buf2=malloc((strlen(buf) + qc*4 +2) * sizeof(char)))==NULL){
+    if((buf2=malloc((strlen(buf) + qc*4 +4) * sizeof(char)))==NULL){
 	perror("Malloc Buffer");
 	exit(1);
     };
@@ -350,7 +371,7 @@
     return stralloc(calcpr[0]);
   } else {
     if (rrd_test_error()) {
-      char *err = malloc((strlen(rrd_get_error())+20)*sizeof(char));
+      char *err = malloc((strlen(rrd_get_error())+DS_NAM_SIZE)*sizeof(char));
       sprintf(err, "[ERROR: %s]",rrd_get_error());
       rrd_clear_error();
       calfree();
@@ -381,7 +402,7 @@
     };
     last = rrd_last(argc+1, args-1); 
     if (rrd_test_error()) {
-      char *err = malloc((strlen(rrd_get_error())+20)*sizeof(char));
+      char *err = malloc((strlen(rrd_get_error())+DS_NAM_SIZE)*sizeof(char));
       sprintf(err, "[ERROR: %s]",rrd_get_error());
       rrd_clear_error();
       return err;
@@ -506,6 +527,7 @@
   long argc;
   /* do we like it ? */
   if (strncmp((*buf)+i, tag, strlen(tag))!=0) return 0;      
+  if (! isspace(*( (*buf) + i + strlen(tag) )) ) return 0;
   /* scanargs puts \0 into *buf ... so after scanargs it is probably
      not a good time to use strlen on buf */
   end = scanargs((*buf)+i+strlen(tag),&argc,&args);
@@ -543,7 +565,7 @@
   /* splice the variable */
   memmove ((*buf)+i+valln,end,strlen(end)+1);
   if (val != NULL ) memmove ((*buf)+i,val, valln);
-  free(val);
+  if (val){ free(val);}
   return valln > 0 ? valln-1: valln;
 }
 

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_create.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_create.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_create.c	Sat Jul 13 21:25:54 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_create.c  creates new rrds
  *****************************************************************************/
@@ -105,7 +105,7 @@
     rrd.live_head->last_up = last_up;
 
     for(i=optind+1;i<argc;i++){
-	char minstr[20], maxstr[20];	
+	char minstr[DS_NAM_SIZE], maxstr[DS_NAM_SIZE];	
 	int ii;
 	if (strncmp(argv[i],"DS:",3)==0){
 	    size_t old_size = sizeof(ds_def_t)*(rrd.stat_head->ds_cnt);
@@ -224,7 +224,7 @@
     rrd_value_t       unknown = DNAN ;
 
     if ((rrd_file = fopen(file_name,"wb")) == NULL ) {
-	rrd_set_error("can't create '%s'",file_name);
+	rrd_set_error("creating '%s': %s",file_name,strerror(errno));
 	free(rrd->stat_head);
 	free(rrd->ds_def);
 	free(rrd->rra_def);

Modified: trunk/orca/packages/rrdtool-1.0.33/src/pngsize.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/pngsize.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/pngsize.c	Sat Jul 13 21:25:55 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * pngsize.c  determine the size of a PNG image
  *****************************************************************************/

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_tune.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_tune.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_tune.c	Sat Jul 13 21:25:55 2002
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * change header parameters of an rrd
  *****************************************************************************
@@ -53,10 +53,12 @@
 	    if ((matches = sscanf(optarg, DS_NAM_FMT ":%ld",ds_nam,&heartbeat)) != 2){
 		rrd_set_error("invalid arguments for heartbeat");
 		rrd_free(&rrd);
+	        fclose(rrd_file);
 		return -1;
 	    }
 	    if ((ds=ds_match(&rrd,ds_nam))==-1){
 		rrd_free(&rrd);
+                fclose(rrd_file);
 		return -1;
 	    }
 	    rrd.ds_def[ds].par[DS_mrhb_cnt].u_cnt = heartbeat;
@@ -66,10 +68,12 @@
 	    if ((matches = sscanf(optarg,DS_NAM_FMT ":%lf",ds_nam,&min)) <1){
 		rrd_set_error("invalid arguments for minimum ds value");
 		rrd_free(&rrd);
+                fclose(rrd_file);
 		return -1;
 	    }
 	    if ((ds=ds_match(&rrd,ds_nam))==-1){
 		rrd_free(&rrd);
+                fclose(rrd_file);
 		return -1;
 	    }
 
@@ -82,10 +86,12 @@
 	    if ((matches = sscanf(optarg, DS_NAM_FMT ":%lf",ds_nam,&max)) <1){
 		rrd_set_error("invalid arguments for maximum ds value");
 		rrd_free(&rrd);
+	        fclose(rrd_file);
 		return -1;
 	    }
 	    if ((ds=ds_match(&rrd,ds_nam))==-1){
 		rrd_free(&rrd);
+	        fclose(rrd_file);
 		return -1;
 	    }
 	    if(matches == 1) 
@@ -97,14 +103,17 @@
 	    if ((matches = sscanf(optarg, DS_NAM_FMT ":" DST_FMT ,ds_nam,dst)) != 2){
 		rrd_set_error("invalid arguments for data source type");
 		rrd_free(&rrd);
+	        fclose(rrd_file);
 		return -1;
 	    }
 	    if ((ds=ds_match(&rrd,ds_nam))==-1){
 		rrd_free(&rrd);
+	        fclose(rrd_file);
 		return -1;
 	    }
 	    if (dst_conv(dst) == -1){
 		rrd_free(&rrd);
+	        fclose(rrd_file);
 		return -1;
 	    }
 	    strncpy(rrd.ds_def[ds].dst,dst,DST_SIZE-1);
@@ -122,10 +131,12 @@
 		 sscanf(optarg,DS_NAM_FMT ":" DS_NAM_FMT , ds_nam,ds_new)) != 2){
 		rrd_set_error("invalid arguments for data source type");
 		rrd_free(&rrd);
+	        fclose(rrd_file);
 		return -1;
 	    }
 	    if ((ds=ds_match(&rrd,ds_nam))==-1){
 		rrd_free(&rrd);
+	        fclose(rrd_file);
 		return -1;
 	    }
 	    strncpy(rrd.ds_def[ds].ds_nam,ds_new,DS_NAM_SIZE-1);
@@ -137,6 +148,7 @@
             else
                 rrd_set_error("unknown option '%s'",argv[optind-1]);
 	    rrd_free(&rrd);	    
+            fclose(rrd_file);
             return -1;
         }
     }

Modified: trunk/orca/packages/rrdtool-1.0.33/src/Makefile.am
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/Makefile.am	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/Makefile.am	Sat Jul 13 21:25:55 2002
@@ -26,6 +26,7 @@
 	rrd_create.c	\
 	rrd_diff.c	\
 	rrd_dump.c	\
+	rrd_info.c	\
 	rrd_error.c	\
 	rrd_fetch.c	\
 	rrd_format.c	\
@@ -36,7 +37,7 @@
 	rrd_restore.c	\
 	rrd_tune.c	\
 	rrd_update.c	\
-	getopt.h      ntconfig.h    parsetime.h   rrd_format.h  rrd_tool.h
+	getopt.h ntconfig.h parsetime.h rrd_format.h rrd_tool.h rrd.h
 
 # Build two libraries.  One is a public one that gets installed in
 # $prefix/lib.  Libtool does not create an archive of the PIC compiled
@@ -58,14 +59,28 @@
 librrd_private_la_SOURCES = $(RRD_C_FILES)
 
 librrd_la_LIBADD          = $(RRD_LIBS)
-librrd_private_la_LIBADD  = $(RRD_LIBS)
 librrd_la_LDFLAGS         = -version-info 0:0:0
 
-bin_PROGRAMS	= rrdcgi rrdtool
+include_HEADERS	= rrd.h
+
+librrd_private_la_LIBADD  = $(RRD_LIBS)
+librrd_private_la_LDFLAGS = -static
+
+bin_PROGRAMS	= rrdcgi rrdtool rrdupdate
 
 rrdcgi_SOURCES	= rrd_cgi.c
 rrdcgi_LDADD	= librrd.la
 
+rrdupdate_SOURCES = 
+rrdupdate_LDADD	= rrdupdate.o librrd.la
+
+
+rrdupdate.c: rrd_update.c
+	-ln -s rrd_update.c rrdupdate.c
+
+rrdupdate.o: rrdupdate.c
+	$(COMPILE) -DSTANDALONE -c rrdupdate.c
+
 rrdtool_SOURCES	= rrd_tool.c
 rrdtool_LDADD	= librrd.la
 

Modified: trunk/orca/packages/rrdtool-1.0.33/src/parsetime.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/parsetime.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/parsetime.c	Sat Jul 13 21:25:55 2002
@@ -630,8 +630,8 @@
 static char *
 assign_date(struct time_value *ptv, long mday, long mon, long year)
 {
-    if (year > 99) {
-	if (year > 1899)
+    if (year > 138) {
+	if (year > 1970)
 	    year -= 1900;
 	else {
 	    panic(e("invalid year %d (should be either 00-99 or >1900)",
@@ -641,9 +641,6 @@
 	year += 100;	     /* Allow year 2000-2037 to be specified as   */
     }			     /* 00-37 until the problem of 2038 year will */
 			     /* arise for unices with 32-bit time_t :)    */
-    if (year < 0) {
-      panic(e("don't know what's the use of the year %d (negative!)?", year));
-    }
     if (year < 70) {
       panic(e("won't handle dates before epoch (01/01/1970), sorry"));
     }
@@ -838,11 +835,11 @@
     /* Only absolute time specifications below */
     case NUMBER:
 	    try(tod(ptv))
-	    if (sc_tokid != NUMBER) break;
+	    if (sc_tokid != NUMBER) break; 
     /* fix month parsing */
     case JAN: case FEB: case MAR: case APR: case MAY: case JUN:
     case JUL: case AUG: case SEP: case OCT: case NOV: case DEC:
-    	    try(day(ptv));
+            try(day(ptv));
 	    if (sc_tokid != NUMBER) break;
 	    try(tod(ptv))
 	    break;
@@ -861,14 +858,15 @@
 	    hr += 12;
 	    /* FALLTHRU */
     case MIDNIGHT:
-	    if (ptv->tm.tm_hour >= hr) {
+            /* if (ptv->tm.tm_hour >= hr) {
 		ptv->tm.tm_mday++;
 		ptv->tm.tm_wday++;
-	    }
+	    } */ /* shifting does not makes sense here ... noon is noon */ 
 	    ptv->tm.tm_hour = hr;
 	    ptv->tm.tm_min = 0;
 	    ptv->tm.tm_sec = 0;
 	    token();
+	    try(day(ptv));
 	    break;
     default:
     	    panic(e("unparsable time: %s%s",sc_token,sct));

Modified: trunk/orca/packages/rrdtool-1.0.33/src/rrd_restore.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/src/rrd_restore.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/src/rrd_restore.c	Sat Jul 13 21:25:55 2002
@@ -1,11 +1,20 @@
 /*****************************************************************************
- * RRDtool 1.0.13  Copyright Tobias Oetiker, 1997, 1998, 1999, 2000
+ * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
  *****************************************************************************
  * rrd_restore.c  creates new rrd from data dumped by rrd_dump.c
  *****************************************************************************/
 
 #include "rrd_tool.h"
 
+/* Prototypes */
+
+void xml_lc(char*);
+int skip(char **);
+int eat_tag(char **, char *);
+int read_tag(char **, char *, char *, void *);
+int xml2rrd(char*, rrd_t*, char);
+int rrd_write(char *, rrd_t *);
+
 /* convert all ocurances of <BlaBlaBla> to <blablabla> */
 
 void xml_lc(char* buf){
@@ -156,7 +165,6 @@
   
   ptr2 = ptr;
   while (eat_tag(&ptr2,"rra") == 1){
-      long i;
       rrd->stat_head->rra_cnt++;
 
       /* alocate and reset rra definition areas */
@@ -179,6 +187,10 @@
       if(cf_conv(rrd->rra_def[rrd->stat_head->rra_cnt-1].cf_nam) == -1) return -1;
 
       read_tag(&ptr2,"pdp_per_row","%lu",&(rrd->rra_def[rrd->stat_head->rra_cnt-1].pdp_cnt));
+      read_tag(&ptr2,"xff","%lf",&(rrd->rra_def[rrd->stat_head->rra_cnt-1].par[RRA_cdp_xff_val].u_val));
+      if(rrd->rra_def[rrd->stat_head->rra_cnt-1].par[RRA_cdp_xff_val].u_val > 1 ||
+         rrd->rra_def[rrd->stat_head->rra_cnt-1].par[RRA_cdp_xff_val].u_val < 0)
+          return -1;
       
       eat_tag(&ptr2,"cdp_prep");
       for(i=0;i<rrd->stat_head->ds_cnt;i++){
@@ -268,7 +280,7 @@
       *rrd_file= *stdout;
     } else {
       if ((rrd_file = fopen(file_name,"wb")) == NULL ) {
-	rrd_set_error("can't create '%s'",file_name);
+	rrd_set_error("creating '%s': %s",file_name,strerror(errno));
 	rrd_free(rrd);
 	return(-1);
       }

Modified: trunk/orca/packages/rrdtool-1.0.33/cgilib-0.4/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/cgilib-0.4/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/cgilib-0.4/Makefile.in	Sat Jul 13 21:25:56 2002
@@ -10,12 +10,6 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-#AUTOMAKE_OPTIONS        = foreign
-
-# our local rules for autoconf (automake and libtool)
-#ACLOCAL_M4 = $(top_srcdir)/config/aclocal.m4
-#AUTOHEADER = @AUTOHEADER@ --localdir=config
-
 
 SHELL = @SHELL@
 
@@ -70,15 +64,26 @@
 target_alias = @target_alias@
 target_triplet = @target@
 CC = @CC@
-CFLAGS = @CFLAGS@
 CGI_LIB_DIR = @CGI_LIB_DIR@
 COMP_PERL = @COMP_PERL@
 CPP = @CPP@
 GD_LIB_DIR = @GD_LIB_DIR@
 LIBTOOL = @LIBTOOL@
+NROFF = @NROFF@
 PERL = @PERL@
+PERLFLAGS = @PERLFLAGS@
+PERL_MAKE_OPTIONS = @PERL_MAKE_OPTIONS@
 PNG_LIB_DIR = @PNG_LIB_DIR@
 RANLIB = @RANLIB@
+SO_EXT = @SO_EXT@
+TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
+TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
+TCL_PREFIX = @TCL_PREFIX@
+TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
+TCL_SHLIB_LD = @TCL_SHLIB_LD@
+TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
+TROFF = @TROFF@
+VERSION = @VERSION@
 ZLIB_LIB_DIR = @ZLIB_LIB_DIR@
 
 noinst_LTLIBRARIES = librrd_cgi.la
@@ -99,6 +104,7 @@
 librrd_cgi_la_LDFLAGS = 
 librrd_cgi_la_LIBADD = 
 librrd_cgi_la_OBJECTS =  cgi.lo
+CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
@@ -107,7 +113,6 @@
 
 
 PACKAGE = @PACKAGE@
-VERSION = @VERSION@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
@@ -214,7 +219,7 @@
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
-	    cp -pr $$/$$file $(distdir)/$$file; \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
 	  else \
 	    test -f $(distdir)/$$file \
 	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \

Modified: trunk/orca/packages/rrdtool-1.0.33/cgilib-0.4/Makefile.am
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/cgilib-0.4/Makefile.am	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/cgilib-0.4/Makefile.am	Sat Jul 13 21:25:56 2002
@@ -1,11 +1,3 @@
-## Process this file with automake to produce Makefile.in
-
-#AUTOMAKE_OPTIONS        = foreign
-
-# our local rules for autoconf (automake and libtool)
-#ACLOCAL_M4 = $(top_srcdir)/config/aclocal.m4
-#AUTOHEADER = @AUTOHEADER@ --localdir=config
-
 noinst_LTLIBRARIES    = librrd_cgi.la
 
 librrd_cgi_la_SOURCES = cgi.c cgi.h

Modified: trunk/orca/packages/rrdtool-1.0.33/README
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/README	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/README	Sat Jul 13 21:25:56 2002
@@ -18,29 +18,48 @@
   make             <------ GNU make
   make install     <------ GNU make
 
-This will configure, compile and install RRDtool in /usr/local/rrdtool-VERSION.
-If you prefer to install RRDtool in some other place, use 
+This will configure, compile and install RRDtool in
+/usr/local/rrdtool-VERSION. If you prefer to install RRDtool in some other
+place, use
 
   sh configure --prefix=/some/other/RRDtool-dir
 
-If you prefer to live with shared libraries, make sure you add the --enable-shared
-option to your configure call.
+If you prefer to live with shared libraries, make sure you add the
+--enable-shared option to your configure call.
 
   sh configure --enable-shared
 
-The configure script will try to find your perl installation (5.004 preferred).
-If it does not find it, you can still build RRDtool but no perl modules will be
-generated.
-
-By default the perl modules will be installed under the RRDtool install directory.
-This will require you to use a 'use lib' statement in your RRDtool perl programs.
-If you do not care what happens to your site-perl directory, you can also use
+The configure script will try to find your perl installation (5.004
+preferred). If it does not find it, you can still build RRDtool but no perl
+modules will be generated.
+
+By default the perl modules will be installed under the RRDtool install
+directory. This will require you to use a 'use lib' statement in your
+RRDtool perl programs. If you do not care what happens to your site-perl
+directory, you can also use
 
   make site-perl-install
 
 will install the perl modules whereever you keep your local perl modules.
 Doing this reliefs you from using 'use lib' in your scripts.
 
+Configure will also look for an TCL installation on your system. If it finds
+one it will build a TCL interface for rrdtool. If you keep tcl in a non
+standard location you can use
+
+  sh configure --with-tcllib=/sw/tcl-8.3/lib
+
+to indicte the right version (note, this must point to the directory where
+tclConfig.sh is located). Note that install will integrate the tcl bindings
+into your tcl installation. It will use a separate directory for each
+version though, so this is not much of a problem. Never the less the TCL
+module will not get intalled by default as TCL wants its module in the base
+tcl installation where you might not be able to write to. So if you want the
+tcl stuff installed, type
+
+  make site-tcl-install
+
+
 Getting Started:
 ----------------
 

Modified: trunk/orca/packages/rrdtool-1.0.33/CONTRIBUTORS
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/CONTRIBUTORS	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/CONTRIBUTORS	Sat Jul 13 21:25:56 2002
@@ -11,33 +11,50 @@
 
 	Andreas Kroomaa <andre at ml.ee>
 	Andrew Turner <turner at mint.net> (LAST consolidator)
+	Bernard Fischer <bfischer at syslog.ch> 64bit stuff and --alt-autoscale-max
 	Bill Fenner <fenner at research.att.com>
 	Blair Zajac <bzajac at geostaff.com>
 	Dan Dunn <dandunn at computer.org>
 	Hermann Hueni <hueni at glue.ch> (SunOS porting)
 	Jeff R. Allen <jeff.allen at acm.org> (autoconfigure, portability)  
+	Joel Becker <jlbec at raleigh.ibm.com> AIX
+	Joey Miller <joeym at inficad.com>	php3 and php4 bindings
 	Jost.Krieger <Jost.Krieger at ruhr-uni-bochum.de>
 	Larry Leszczynski <larryl at furph.com>
 	Otmar Lendl <O.Lendl at Austria.EU.net> (lots of bugfixes)
 	Paul Joslin <Paul.Joslin at sdrc.com>
 	Philippe.Simonet <Philippe.Simonet at swisscom.com> (NT porting)
+	Poul-Henning Kamp <phk at freebsd.org> CDEF enhancements
+	REIBENSCHUH Alfred <alfred.reibenschuh at it-austria.com> AIX
+        Roman Hoogant <rhoogant at ee.ethz.ch>
 	Russ Wright <rwwright at home.com>
 	Simon Leinen <simon at switch.ch>
+	Stefan Mueller <s.mueller at computer.org> HPUX 11
+	Steve Rader <rader at teak.wiscnet.net> (rrd_cgi debugging and LAST)
+        Terminator rAT <karl_schilke at eli.net>
+        Christophe VG <Christophe.VanGinneken at ubizen.com>
+        Shane O'Donnell <shaneo at opennms.org>
+        Tuc <ttsg at ttsg.com>
+        Mike Mitchell <mcm at unx.sas.com>
+	Ulrich Schilling <schilling at netz.uni-essen.de> AIX
 	Wrolf Courtney <wrolf at wrolf.net> (HP-UX)
         Alan Lichty <alan_lichty at eli.net>
         Alex van den Bogaerdt <alex at ergens.op.het.net> (rrd_resize.c and more)
+        Frank Strauss <strauss at escape.de> TCL bindings
+        Jakob Ilves <jilves at se.oracle.com> HPUX 11
         Jeremy Fischer <jeremy at pobox.com> (Makefile changes & RPM builds)
         Oleg Cherevko <olwi at icyb.kiev.ua>
+        Rainer Bawidamann <Rainer.Bawidamann at informatik.uni-ulm.de>
+        Selena M Brewington <smbrewin at ichips.intel.com> add_ds
         Steen Linden <Steen.Linden at ebone.net>
-        Tom Crawley <Tom.Crawley at hi.riotinto.com.au> (GCC&HP configuration)
-	Steve Rader <rader at teak.wiscnet.net> (rrd_cgi debugging and LAST)
         Steve Harris <steveh at wesley.com.au> AIX portability
-	Stefan Mueller <s.mueller at computer.org> HPUX 11
-	Ulrich Schilling <schilling at netz.uni-essen.de> AIX
-	Joel Becker <jlbec at raleigh.ibm.com> AIX
-	REIBENSCHUH Alfred <alfred.reibenschuh at it-austria.com> AIX
-        Selena M Brewington <smbrewin at ichips.intel.com> add_ds
-	Larry Leszczynski <larryl at furph.com>
+        Tom Crawley <Tom.Crawley at hi.riotinto.com.au> (GCC&HP configuration)
+	Albert Chin-A-Young <china at thewrittenword.com>
+	Sean McCreary mccreary at xoanon.colorado.edu
+	Bruce Campbell <bruce.campbell at apnic.net>
+	Sean Summers <sean at Fenstermaker.com> (RPM .spec)
+	Christophe Van Ginneken <Christophe.VanGinneken at ubizen.com> (--no-legend)
+
 
 Documentation
 
@@ -51,13 +68,20 @@
 	Tobias Weingartner <weingart at cs.ualberta.ca>
 	hendrik visage <hvisage at is.co.za>
 	Steve Rader <rader at teak.wiscnet.net>
+        Jesús Couto Fandiño
 
 Packaging
         Henri GOMEZ -- Redhat RPMs
         Philippe Simonet -- NT Binaries
 
+
 Internet Resources
-        LAN Services AG (www.lan.ch) for the http://rrdtool.eu.org domain reflector
+        LAN Services AG (www.lan.ch) 
+           for the http://rrdtool.eu.org domain reflector
+
+        Alexander Lucke (lucke at dns-net.de) 
+           and DNS:NET Internet Services (www.dns-net.de)
+              for http://rrdtool.org
 
 Further I would like to note, that rrdtool would not exist without
 the following free software products:

Modified: trunk/orca/packages/rrdtool-1.0.33/zlib-1.1.3/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/zlib-1.1.3/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/zlib-1.1.3/Makefile.in	Sat Jul 13 21:25:56 2002
@@ -70,15 +70,26 @@
 target_alias = @target_alias@
 target_triplet = @target@
 CC = @CC@
-CFLAGS = @CFLAGS@
 CGI_LIB_DIR = @CGI_LIB_DIR@
 COMP_PERL = @COMP_PERL@
 CPP = @CPP@
 GD_LIB_DIR = @GD_LIB_DIR@
 LIBTOOL = @LIBTOOL@
+NROFF = @NROFF@
 PERL = @PERL@
+PERLFLAGS = @PERLFLAGS@
+PERL_MAKE_OPTIONS = @PERL_MAKE_OPTIONS@
 PNG_LIB_DIR = @PNG_LIB_DIR@
 RANLIB = @RANLIB@
+SO_EXT = @SO_EXT@
+TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
+TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
+TCL_PREFIX = @TCL_PREFIX@
+TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
+TCL_SHLIB_LD = @TCL_SHLIB_LD@
+TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
+TROFF = @TROFF@
+VERSION = @VERSION@
 ZLIB_LIB_DIR = @ZLIB_LIB_DIR@
 
 EXTRA_DIST = ChangeLog FAQ INDEX README README.rrdtool algorithm.txt zlib.dsp zlib.dsw zlib.3 
@@ -102,6 +113,7 @@
 librrd_z_la_OBJECTS =  adler32.lo compress.lo crc32.lo deflate.lo \
 gzio.lo infblock.lo infcodes.lo inffast.lo inflate.lo inftrees.lo \
 infutil.lo trees.lo uncompr.lo zutil.lo
+CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
@@ -110,7 +122,6 @@
 
 
 PACKAGE = @PACKAGE@
-VERSION = @VERSION@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
@@ -217,7 +228,7 @@
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
-	    cp -pr $$/$$file $(distdir)/$$file; \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
 	  else \
 	    test -f $(distdir)/$$file \
 	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdview/rrdview.cgi
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/rrdview/rrdview.cgi	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/rrdview/rrdview.cgi	Sat Jul 13 21:25:57 2002
@@ -0,0 +1,412 @@
+#!/usr/bin/perl -T -w
+
+use CGI::Carp qw(fatalsToBrowser carpout);
+use Time::Local;
+use File::Basename;
+use FileHandle;
+use POSIX;
+use RRDs;
+
+BEGIN {
+	carpout(\*STDOUT);
+};
+
+use strict;
+
+use vars qw($VERSION);
+my $rcs = ' $Id: rrdview.cgi,v 1.16 2000/09/22 23:20:40 gilles Exp $ ' ;
+$rcs =~ m/,v (\d+\.\d+)/;
+$VERSION = ($1) ? $1 : "UNKNOWN";
+
+my $mod_perl = (exists $ENV{MOD_PERL}) ? 1 : 0;
+my $self  = basename($0);
+my $imgErr; # global is good in that huge case.
+
+doit();
+
+sub doit {
+	
+	my $debug = 0;
+	my $cgi   = myCGI->new();
+	my $q     = $cgi->r();
+	my $now   = time();
+	
+	my $strftime = '%A %d %B %Y %H:%M:%S %Z';
+	
+	my ($minD,$hourD,$mdayD,$monD,$yearD) = (myLocaltime($now));
+	$cgi->paramDefault(
+			   'minE'  => $minD,
+			   'hourE' => $hourD,
+			   'mdayE' => $mdayD,
+			   'monE'  => $monD,
+			   'yearE' => $yearD,
+			  );
+	
+	($minD,$hourD,$mdayD,$monD,$yearD) = (myLocaltime($now - 86400));
+	
+	$cgi->paramDefault(
+			   'minS'  => $minD,
+			   'hourS' => $hourD,
+			   'mdayS' => $mdayD,
+			   'monS'  => $monD,
+			   'yearS' => $yearD,
+			  );
+	
+	
+	my ($minS,$hourS,$mdayS,$monS,$yearS) = 
+	  (
+	   $q->param(-Name => 'minS'),
+	   $q->param('hourS'),
+	   $q->param('mdayS'),
+	   $q->param('monS'),
+	   $q->param('yearS'),
+	  );
+	
+	my ($minE,$hourE,$mdayE,$monE,$yearE) = 
+	  (
+	   $q->param('minE'),
+	   $q->param('hourE'),
+	   $q->param('mdayE'),
+	   $q->param('monE'),
+	   $q->param('yearE'),
+	  );
+	
+	my $start = myTimelocal($minS,$hourS,$mdayS,$monS,$yearS);
+	my $end   = myTimelocal($minE,$hourE,$mdayE,$monE,$yearE);
+	
+	my $startString = strftime($strftime, localtime($start));
+	my $endString   = strftime($strftime, localtime($end));
+	
+	$q->param('start', $start);
+	$q->param('end', $end);
+	
+	$cgi->paramDefault(
+			   'hight'   => 150,
+			   'width'   => 600,
+			   'rrdfile' => 'foo.rrd',
+			  );
+	
+	my $width = $q->param(-Name=>'width');
+	my $hight = $q->param(-Name=>'hight');
+	my $owner = $q->param(-Name=>'owner') || "No Owner";
+	my $title = $q->param(-Name=>'title') || "No Title";
+	
+	my $rrdfile = $q->param("rrdfile");
+	
+	$debug and $cgi->saveparam("/tmp/rrdmon.out");
+	my $error = "";
+	my $rrdinfo;
+	my @dsname;
+	unless (-f $rrdfile) {
+		$error = "<big>File '$rrdfile' does not exist!</big><BR>\n";
+	}else{
+		$rrdinfo = RRDs::info $rrdfile;
+		if (my $ERR=RRDs::error) {
+			$error = "<big>" . $ERR . "</big><BR>\n";
+			@dsname = ('RRD ERROR');
+		}else{
+			foreach my $key (keys %$rrdinfo) {
+				if ($key =~ m/ds\[(\w+)\]\.value/) {
+					push(@dsname, $1);
+				}
+			}
+		}
+	};
+	
+	my $dsname  = $q->param("dsname") || $dsname[0] || "unknown";
+	
+	if (defined $q->param(-Name=>'child')) {
+		# cgi child
+		imagepage($q, 
+			  $cgi, 
+			  $debug, 
+			  $rrdfile, 
+			  $dsname,
+			  $owner,
+			  $hight,
+			  $width,
+			  $start,
+			  $end,
+			  $title,
+			 );
+	}else{
+		# cgi parent
+		mainpage($q, 
+			 $cgi, 
+			 $debug, 
+		 $dsname, 
+		 \@dsname, 
+		 $hight, 
+		 $width, 
+		 $error,
+		 $startString,
+		 $endString,
+		);
+	}
+}
+
+sub mainpage {
+	
+	my $q = shift;
+	my $cgi = shift;
+	my $debug = shift;
+	my $dsname = shift;
+	my $ldsname = shift;
+	my $hight = shift;
+	my $width =  shift;
+	my $error = shift;
+	my $startString = shift;
+	my $endString = shift;
+
+	my $queryChild = "child=yes&".$q->query_string();
+	my $cgiChild = myCGI->new($queryChild);
+	# CGI fork ! 
+	print 
+	  $q->header(),
+	  #$q->start_html($q->param('owner'). " " . $q->param('title') ),
+	  $q->start_html(
+			 -Title=>"RRDVIEW $VERSION",
+			 -Author=>'lamiral at mail.dotcom.fr',
+			 -Meta=>{'keywords'=>'monitoring rrdtool rrdmon rrdview',
+				 'copyright'=>'Copyleft GPL'},
+			 -BGCOLOR=>'lightblue',
+			),
+	    ($debug) ?                   "<tt>\n" : "",
+	    ($debug and $mod_perl) ?     "mod_perl PID $$<BR>\n" : "",
+	    ($debug and not $mod_perl) ? "PID=$$<BR>\n" : "",
+	    ($debug) ?                   "$cgi<BR>\n" : "",
+	    ($debug) ?                   "$q<BR>\n" : "",
+	    ($debug) ?                   "img=".\$imgErr."<BR>\n" : "",
+	    ($debug) ?                   "</tt>\n" : "",
+	    $q->startform(-Method=>'GET',
+			  #-Enctype=>'multipart/form-data',
+			 ),
+	    $q->textfield(-Name=>'rrdfile', 
+			-Default=>'Give me a file like foo.rrd',
+			-Size=>76),
+	  $q->br(),"\n",
+	  $q->popup_menu(-Name=>'dsname',
+			 -Values=>[@$ldsname],
+			 -Default=>$dsname,
+		    ),
+	  $q->textfield(-Name=>'hight', -Size=>length($hight)), "x",
+	  $q->textfield(-Name=>'width', -Size=>length($width)), " ",
+	  $q->br(),"\n",
+	  $q->image_button(-Name=>'Beautiful Image!',
+			   -Src=>"$self?$queryChild",
+			  ),
+	  $q->br(),"\n",
+	  $error,
+	  $q->tt(" From "),
+	  $q->textfield(-Name=>'yearS', -Size=>4),
+	  $q->textfield(-Name=>'monS',  -Size=>2),
+	  $q->textfield(-Name=>'mdayS', -Size=>2),
+	  " ",
+	  $q->textfield(-Name=>'hourS', -Size=>2),
+	  $q->textfield(-Name=>'minS',  -Size=>2),
+	  " $startString",
+	  $q->br(),"\n",
+	  $q->tt(" To", "&nbsp;" x 2),
+	  $q->textfield(-Name=>'yearE', -Size=>4),
+	  $q->textfield(-Name=>'monE',  -Size=>2),
+	  $q->textfield(-Name=>'mdayE', -Size=>2),
+	  " ",
+	  $q->textfield(-Name=>'hourE', -Size=>2),
+	  $q->textfield(-Name=>'minE',  -Size=>2),
+	  " $endString",
+	  $q->br(),"\n",
+	  $cgi->paramHidden(
+			    'title',
+			    'owner',
+			   ),
+  	    $q->endform(),
+	    ($debug) ? $q->dump(): "",
+	    $q->end_html(),
+	    "\n",
+	    ;
+}
+
+
+sub imagepage {
+
+	my $q = shift;
+	my $cgi = shift;
+	my $debug = shift;
+	my $rrdfile = shift;
+	my $dsname = shift;
+	my $owner  = shift;
+	my $hight = shift;
+	my $width = shift;
+	my $start = shift;
+	my $end = shift;
+	my $title = shift;
+	    
+	$debug and $cgi->saveparam("/tmp/png.out");
+	
+	my $output;
+	RRDs::last($rrdfile);
+	
+	print $q->header(
+			 -Type=>'image/png',
+			 -Expires=>'now'
+			);
+	
+	if($mod_perl) {
+                #carp("we're running under mod_perl");
+		$output = "/tmp/rrdmon.img.$$.png";
+		
+	}
+	else {
+                #we're NOT running under mod_perl
+		$output = "-";
+		
+	}
+
+	RRDs::graph($output,"--title", "$owner",
+		    "--imgformat", "PNG",
+		    "--height","$hight", "--width","$width",
+		    "--start",$start,"--end",$end,
+		    "DEF:value=$rrdfile:$dsname:AVERAGE",
+		    "AREA:value#00FF00:$title",
+		   );
+	
+	
+	if (my $ERROR = RRDs::error()) {
+		carp "ERROR: $ERROR\n";
+		my $rimgErr = loadImageErrorFromVar();
+		print $$rimgErr;
+		return();
+	}
+	if($mod_perl) {
+		my $fh = FileHandle->new($output, "r");
+		unless (defined($fh)){
+			carp("Could not open ",$output,"$!");
+			return undef;
+		}
+		local $/ = undef;
+		my $file = <$fh>;
+		$fh->close();
+		print $file;
+	}
+}
+
+
+sub myLocaltime {
+	my $time = shift;
+
+	my ($min,$hour,$mday,$mon,$year) 
+	  = (localtime($time))[1,2,3,4,5];
+
+	$min  = sprintf("%02s", $min);
+	$hour = sprintf("%02s", $hour);
+	$mday = sprintf("% 2s", $mday);
+	$mon  = sprintf("% 2s", $mon + 1);
+	
+	return($min,$hour,$mday,$mon,$year + 1900);	
+}
+
+sub myTimelocal {
+	my ($min,$hours,$mday,$mon,$year) = @_;
+	
+	my $time = timelocal(0,$min,$hours,$mday,
+			     $mon - 1,$year - 1900);
+	return($time);
+}
+
+sub loadImageErrorFromVar {
+	unless (defined ($main::imgErr)){
+		$main::imgErr = pack "h*", '9805e474d0a0a1a0000000d09484442500000069000000b480000000100cdc1195000000407614d4140010680a138e69f5000080769444144587adde959607357d51e37fdb7291b42b469cb0e51f283c26028d4ce2484034020129430947b0d24c01a30482e4a30c47b480cc00d2d47adcc47843186a094999423818201a10a9408c0d670360a50c18016316b3605cb8c6958d2b4a7fee7df1290b63bcb45818c8fef1947ed5d9bfd937fbb769bf818246801c204819525793f2746a31d92001110e2070a618aa8300032040c2f590000dbc54000d600b06c22b44ca728f88a7c3f2cbc6168a019d9d08910000ee9f02cbf08a1a381ba164f880211ead6a43a63aad41bb5f6df73074502c8d6db0b3a7866400af76c7844999afc9968ea68ecb6810a74481e1b65022af90888e8debf8e2e7abb57fd7a64d8e88e93776d2bd110b830bdb3ae4602edbb24c18fa08ad9e3d662024c322b4d5852152784fa4b901595259e1dca25483ac40f8f7addbb10fb9473d4aaaea475e5d31119444515711654de759be1c5bebe321380e54f3a2f37e92222eb7c37e9d73870de8f320005cad67eadf871f15c8c1a781dadabd237da20006ba4f1bc2b1006ad520e68e08fcea34f8a979b2db63a76690444467b219e378821ebd44ab61a262ad95c12eb7651752e972232aae9a44f0c68c91b46addeb7eaf2a8ede6f49e776e4f6665f0fc7443f015f78e25e70742a6ab4c7261bc7be7873ec0c96dbe7efaa56d4a6f659d4cfada9cefcb74b72cc8d971b5c5c93a7d3a95f72e6d771888826757decebfc0a26caf0ef69014efa9ff5f1379bd527f1c16c246f1d052faee9d3b7e428888b39fa3d5a728dfade7e8fbd4d50662227f9b7bf02cb9fe9c6b566e4c5aa404150418981736182e53af64c7ed25e008fadce2823ec93c1543af88be7a3ad904d8eccf24cfaf6d00fa6ba9a2f6d77faea2fc179f423753d100007524117008d191e404e2a5304d4c9ef3806fdbdcf47979f5d46d9a981768905ea015be025111115bbdf12644443ba068759bff5f5e3a44cbde7e3724c1617941c632750008f1b73414b7397445f9f57ed5f4eacd959a00082199f1ff7e9d65ce1f7b7ec6f73436ecd63d530efae75d5052a7abefbfc8b3a6abc8f9993a6ab2d4f712a6ab4596e7ab42f5ce8a73f7179e1850db55d24a45709eab2f2f5233f8d4e4397e7fa185a852847d7cbff75352f2e4d205fe31462d930b00d5f80a433af8e03d403fb235b76bfc465a0acbda91b70bfeccf02c5c62d177abddeee358f1fb224c34282c353c78d0bcf39e59957fe15758628fe442c34b990f3e75ebae79622968311193555b3dadcebef5cd5397073dacb13b7988486c39797ea988804c88f9eda7648f3d86f385c2827da5d07adb9f2dd397b!
f8f7cc653dcec292e6d786479d37e40f7b5d989df8ab00cb7fe1eaec1dd4953b1c2d99f57dd38a405d31d69c74cbfb9f2fc5df53000bc0e71d87d0c18ddab23b99d8f1208973fe47ac4c31189cb7dd44e14abc934678f4055aafe97e9eb41b56c108c3ee76c1cf9f728303febb9b3fb3282febf3e2f8fe9987bc3892cb8c3e18247e246444cda36811b2da0b111d923cb11311a8931c7e4377db5c14444a0cb5bcad8560111949d74412238ca019257faae24a0a04037287bdb93a686e5ed29a322e4ed5afa88134444c6deec55de6f57363e98a95d3d34802afcf0ed74741c4df375d5ef06c76991d0aa30e1be7a81db7b607825253533fb000b97e5861ade67228be24583004bd68a60fa39d32a7565af6e4dfebd7d0d954a5f5aef2edbe89bd5fc71a72aaa52a793d4e7af464fa6396983170aec910d57fe5d1d779a98300bee0d09ee4e2e8b975097a3677b97b8f995c33e7fdc77dd62a836663e0c97e77d17b4b7f72c5fbceee117b04a822bce4ea3dcde78c26656e9cb0de131906926f6d63b89babea1cad4dae454693ff5f70557bb16133429273adc8110657cbfbaa15538c46a4fcc173831d46885ead4de7835aad1c0b8d2d957d0b45959ce85a569426f5e696bfe34d625bdbd1cab6acb83a729bf87db424fb2a22620361eab1fe4a572ccccafcf8a3afb30a21744e8b5251c407c7a5bdfc505036c2c2b6cf86d90f0fef35b5a054260292d2f3e28663758488efe030c800619065c4e7ae99dc1f2011194326571aff934e53bbe3aa681a86151aa41798a264407438d44db14b267ed8c9ca8a4516073fe0b53b38b06c4b8903f091182c17bcf6176953ef259cb697c880c898ed9b86aa4efd26bd635341f2b147aa1d22bcf7f5dad2d9394d2b7fda3fc81f4bf5f391b4448693478cc536552f69dc2db71b8da52ed0201c175f0f1c37dc42231febfdd8fe54814f7f986784c43ad5a0c8decfaef6fcec25dee4dd8f4be8188816a77cf175d1f54b77b5acb6f4a6c6c60f022243deadc7e4c2c9f9779edd79a275e0164444695bbdf9d5d94f9ff5f085435cfb82ec0d03625c801692fc882cc62affba5ee8772d78de3938abc57eea11a5de0f2fecb4809ffd52ad1168bf7fafaba6e6ef1b1a07b6d9c08be0c833eb2e97d9153375b37f8e2f494a7eff1d0274ae1ab57db172e9803fe6ccfd406a159bd1a4070cb1f3aa3499df8576ed21b0eb3aeb86c55335debe36ff3785756f3a431984539616c69f11797e48905db4ff2505eb96642a81992f00ab9a028136168f713219a2b26df50a30d8c90aae43626c573d36c866a61cd834d2e95e493b7d71d699caee630480dd50802254143e9abe75aaf6a49034746e42a7e8e8bbd1a238fb9ceeabe012da3b6a496ce3efeef1a1b437442a6f3171539fa52222278bcdf4db09add60419b!
d4614ce60657c9fa77ea05bec49117eaf277a597afc9939b211113a0438a9bacdaec0f3734acab9ef6e6cda52f0b1bef39a814b2e78a1222218129e9dcdee3cc9ea47c4ec80619bf4443f9374a72be4d20328ba5e8db3519bfa71b44ea345e9bb023cfefa7179c1d16f65940c9b27e58f0f31b82252fca9d9b2973eac53d765ccd696f55eb94171ec1c27d6d46e019248bbc1d50f4eb14d55fd9c68c8f75708e1fc01ee1a6f570ea646006d00ca10857fa1caff107d7f7057eba98065000000009454e444ea240628';
+	}
+	return(\$main::imgErr);
+}
+
+
+package myCGI;
+
+use CGI;
+
+sub new {
+	my $proto = shift;
+	my $class = ref($proto) || $proto;
+	my $self  = {};
+	$self->{'CGI'} = CGI->new(shift);
+	bless ($self, $class);
+	return $self;
+}
+
+sub r {
+	my $self = shift;
+	return($self->{'CGI'});
+}
+
+sub DESTROY {
+	my $self = shift;
+
+}
+
+sub paramDefault {
+	my $self    = shift;
+	my %param   = @_;
+	
+	foreach my $param (keys(%param)) {
+		unless (defined($self->r->param(-Name=>$param))) {
+			$self->r->param(-Name=>$param, -Value=>$param{$param});
+		}
+	}
+	return values(%param);
+}
+
+sub paramHidden {
+	my $self    = shift;
+	my @hidden = @_;
+
+	my @result;
+	foreach my $param (@hidden) {
+		push(@result, $self->r->hidden(-Name=>$param));
+	}
+	return(@result);
+}
+
+sub saveparam {
+	my $self = shift;
+	my $savefile = shift;
+	my $fh = FileHandle->new($savefile, "w");
+	defined($fh) || confess("Error opening $savefile (w): $!");
+	$self->r->save($fh);
+	$fh->close();
+	chmod 0777, $savefile;
+}
+
+
+=head1 NAME
+
+rrdview.cgi - Perl CGI software to graph rrd image online
+
+=head1 SYNOPSIS
+
+Put it on any cgi-bin/ directory, use a browser, click and fill in an
+rrd file in the first textfield (replacing foo.rrd). The file belongs
+to the web server. 
+
+=head1 DESCRIPTION
+
+Just another rrd viewer. 
+
+=head1 TODO
+
+ . An upload textfield to allow graphing client rrd files.
+ . Deal with LAST, MAX, MIN RRA.
+
+=head1 AUTHOR
+
+Gilles LAMIRAL 
+lamiral at mail.dotcom.fr
+
+=head1 SEE ALSO
+
+rrdtool(1), perl(1).
+
+=cut
+
+
+

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdview/README
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/rrdview/README	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/rrdview/README	Sat Jul 13 21:25:57 2002
@@ -0,0 +1,63 @@
+User Contributed Perl Documentation                RRDVIEW.CGI(1)
+
+
+
+NNNNAAAAMMMMEEEE
+     rrdview.cgi - Perl CGI software to graph rrd image online
+
+SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
+     Put it on any cgi-bin/ directory, use a browser, click and
+     fill in an rrd file in the first textfield (replacing
+     foo.rrd). The file belongs to the web server.
+
+DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
+     Just another rrd viewer.
+
+TTTTOOOODDDDOOOO
+      . An upload textfield to allow graphing client rrd files.
+      . Deal with LAST, MAX, MIN RRA.
+
+
+AAAAUUUUTTTTHHHHOOOORRRR
+     Gilles LAMIRAL lamiral at mail.dotcom.fr
+
+SSSSEEEEEEEE AAAALLLLSSSSOOOO
+     _r_r_d_t_o_o_l(1), _p_e_r_l(1).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2000-09-23          Last change: perl v5.6.0                    1
+
+
+

Modified: trunk/orca/packages/rrdtool-1.0.33/contrib/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/Makefile.in	Sat Jul 13 21:25:57 2002
@@ -64,21 +64,32 @@
 target_alias = @target_alias@
 target_triplet = @target@
 CC = @CC@
-CFLAGS = @CFLAGS@
 CGI_LIB_DIR = @CGI_LIB_DIR@
 COMP_PERL = @COMP_PERL@
 CPP = @CPP@
 GD_LIB_DIR = @GD_LIB_DIR@
 LIBTOOL = @LIBTOOL@
+NROFF = @NROFF@
 PERL = @PERL@
+PERLFLAGS = @PERLFLAGS@
+PERL_MAKE_OPTIONS = @PERL_MAKE_OPTIONS@
 PNG_LIB_DIR = @PNG_LIB_DIR@
 RANLIB = @RANLIB@
+SO_EXT = @SO_EXT@
+TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
+TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
+TCL_PREFIX = @TCL_PREFIX@
+TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
+TCL_SHLIB_LD = @TCL_SHLIB_LD@
+TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
+TROFF = @TROFF@
+VERSION = @VERSION@
 ZLIB_LIB_DIR = @ZLIB_LIB_DIR@
 
-SUBDIRS = log2rrd rrd-file-icon trytime rrdproc rrdlastds add_ds killspike rrdfetchnames
-
+SUBDIRS = trytime
 contribdir = $(prefix)/contrib
 contrib_DATA = README
+EXTRA_DIST = rrdview log2rrd rrd-file-icon rrdproc rrdlastds add_ds killspike rrdfetchnames snmpstats rrdexplorer php3 php4
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = ../config/config.h
 CONFIG_CLEAN_FILES = 
@@ -88,7 +99,6 @@
 
 
 PACKAGE = @PACKAGE@
-VERSION = @VERSION@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
@@ -220,7 +230,7 @@
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
-	    cp -pr $$/$$file $(distdir)/$$file; \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
 	  else \
 	    test -f $(distdir)/$$file \
 	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdfetchnames/rrdfetchnames.pl
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/rrdfetchnames/rrdfetchnames.pl	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/rrdfetchnames/rrdfetchnames.pl	Sat Jul 13 21:25:57 2002
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+
+use strict;
+
+#makes things work when run without install
+use lib qw( ../../perl-shared/blib/lib ../../perl-shared/blib/arch );
+
+#makes programm work AFTER install
+use lib qw( /usr/local/rrdtool-1.0.30/lib/perl ../lib/perl );
+
+use vars qw(@ISA $loaded);
+
+use RRDs;
+
+my $NAME = $ARGV[ 0];
+my $SEPARATOR = " ";
+my $CF = "AVERAGE";
+
+my ($start,$step,$names,$data) = RRDs::fetch "$NAME", "$CF", "--start", "now","--end","start+1";
+
+if ( my $ERR = RRDs::error){
+	die "ERROR while fetching data from $NAME $ERR\n";
+}
+
+print join( $SEPARATOR, @$names), "\n";
+
+sub usage{
+	print "usage: rrdfetchnames filename";
+};
+

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdfetchnames/Makefile.in

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdfetchnames/Makefile.am

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/killspike.pl
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/killspike.pl	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/killspike.pl	Sat Jul 13 21:25:58 2002
@@ -0,0 +1,137 @@
+#! /usr/sepp/bin/perl -w
+
+# $Id: killspike.pl,v 1.3 2000/06/11 22:08:08 bertd Exp $
+# $Source: /cvs-mis/local/support/killspike/killspike.pl,v $
+
+# This script will read an XML file produced by
+#	rrdtool dump foo.rrd >in.xml
+# and look at the $maxspike highest samples per datasource. It then finds
+# the records with the most hits and ditches the data. The resulting file
+# can be read back into the RRD database with the command
+#	rrdtool restore out.xml foo.rrd
+#
+# The whole idea is to find and eradicate "spikes" caused by erroneous
+# readings affecting entire records.
+#
+# This tool is not for the faint of heart, will require tweaking per case
+# (even though that should just be picking values for cutoff and to a lesser
+# extent, maxspike). It will cause data loss, for obvious reasons.
+#
+# THIS SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT IS USEFUL, AND COMES WITH
+# NO WARRANTY. USE AT YOUR OWN RISK!
+#
+#			Bert Driehuis <driehuis at playbeing.org>
+
+use strict;
+
+my $maxspike = 25;	# How many top samples to consider per datasource
+my $cutoff = 20;	# How many records to ditch
+my $debug = 1;
+my $file = "in.xml";
+my $outfile = "out.xml";
+
+my $nds = 0;
+my @dsl = ();
+my @dsi = ();
+my @topindx = ();
+my @botindx = ();
+my @dsname = ();
+my $i;
+my $j;
+
+# Count the number of data sources
+open(IN, $file) || die;
+while(<IN>) {
+	if (/<name>\s*(\w+)\s*/) {
+		$dsname[$nds] = $1;
+		$nds++;
+	}
+}
+close IN;
+
+print "Found $nds datasources\n" if $debug;
+
+# Set up the list of lists for the datasource data
+for ($i = 0; $i < $nds; $i++) {
+	my @dsdata = ();
+	push @dsl, \@dsdata;
+	my @dsindex = ();
+	push @dsi, \@dsindex;
+	my @top = ();
+	push @topindx, \@top;
+	my @bot = ();
+	push @botindx, \@bot;
+}
+
+# Slurp all datasource fields into the @dsl Lol
+my $recno = -1;
+open(IN, $file) || die;
+while(<IN>) {
+	next if !/<row>/;
+	$recno++;
+	my @data = split(/ /);
+	die "Malformed input" if $data[5] ne "<row><v>";
+	die "Malformed record" if $data[5 + ($nds * 2)] ne "</v></row>\n";
+	for ($i = 0; $i < $nds; $i++) {
+		my $sample = $data[($i * 2) + 6];
+		#print "$sample\n";
+		push @{$dsl[$i]}, $sample;
+	}
+}
+close IN;
+
+# Set up a LoL with indexes, and ditch the values that represent NaN's
+for ($i = 0; $i < $nds; $i++) {
+	@{$dsi[$i]} = grep { ${$dsl[$i]}[$_] ne "NaN" } (0..$recno);
+	print "$dsname[$i] has $#{$dsi[$i]} valid samples\n" if $debug;
+}
+
+sub sortit {
+	${$dsl[$i]}[$a] <=> ${$dsl[$i]}[$b];
+}
+my %indexes;
+for ($i = 0; $i < $nds; $i++) {
+	next if ($#{$dsi[$i]} < $maxspike);
+	@{$dsi[$i]} = sort sortit @{$dsi[$i]};
+	@{$botindx[$i]} = @{$dsi[$i]};
+	@{$topindx[$i]} = splice(@{$botindx[$i]}, -$maxspike);
+	print "$dsname[$i] top $maxspike: ".join(' ', @{$topindx[$i]})."\n";
+	for($j = 0; $j < $maxspike; $j++) {
+		$indexes{${$topindx[$i]}[$j]} = 0 if
+				!defined($indexes{${$topindx[$i]}[$j]});
+		$indexes{${$topindx[$i]}[$j]}++;
+		printf "%1.1e ", ${$dsl[$i]}[${$topindx[$i]}[$j]];
+	}
+	print "\n";
+}
+
+# Report on the hit rate of the records to be dumped, and a few for
+# reference.
+$j = 0;
+my %ditch;
+foreach $i (sort {$indexes{$b} <=> $indexes{$a}} keys %indexes) {
+	print "Record index $i: $indexes{$i} hits\n";
+	$ditch{$i} = 1 if $j < $cutoff;
+	print "----------\n" if $j + 1 == $cutoff;
+	last if $j++ > $maxspike;
+}
+
+# Okay, so we start ditching the records. You can always re-run the script
+# if the results don't suit you after adjusting $cutoff or $maxspike.
+$recno = -1;
+open(IN, $file) || die;
+open(OUT, ">$outfile") || die;
+while(<IN>) {
+	print OUT if !/<row>/;
+	next if !/<row>/;
+	$recno++;
+	print OUT if !defined($ditch{$recno});
+	next if !defined($ditch{$recno});
+	my @data = split(/ /);
+	for ($i = 0; $i < $nds; $i++) {
+		$data[($i * 2) + 6] = "NaN";
+	}
+	print OUT join(' ', @data);
+}
+close IN;
+close OUT;

Modified: trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/killspike.pl.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/killspike.pl.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/killspike.pl.in	Sat Jul 13 21:25:58 2002
@@ -1,6 +1,6 @@
 #! @PERL@ -w
 
-# $Id: killspike.pl,v 1.2 2000/01/14 01:56:59 bertd Exp $
+# $Id: killspike.pl,v 1.3 2000/06/11 22:08:08 bertd Exp $
 # $Source: /cvs-mis/local/support/killspike/killspike.pl,v $
 
 # This script will read an XML file produced by
@@ -35,13 +35,17 @@
 my @dsi = ();
 my @topindx = ();
 my @botindx = ();
+my @dsname = ();
 my $i;
 my $j;
 
 # Count the number of data sources
 open(IN, $file) || die;
 while(<IN>) {
-	$nds++ if /<name>\s*ds/;
+	if (/<name>\s*(\w+)\s*/) {
+		$dsname[$nds] = $1;
+		$nds++;
+	}
 }
 close IN;
 
@@ -79,7 +83,7 @@
 # Set up a LoL with indexes, and ditch the values that represent NaN's
 for ($i = 0; $i < $nds; $i++) {
 	@{$dsi[$i]} = grep { ${$dsl[$i]}[$_] ne "NaN" } (0..$recno);
-	print "Ds$i has $#{$dsi[$i]} valid samples\n" if $debug;
+	print "$dsname[$i] has $#{$dsi[$i]} valid samples\n" if $debug;
 }
 
 sub sortit {
@@ -87,10 +91,11 @@
 }
 my %indexes;
 for ($i = 0; $i < $nds; $i++) {
+	next if ($#{$dsi[$i]} < $maxspike);
 	@{$dsi[$i]} = sort sortit @{$dsi[$i]};
 	@{$botindx[$i]} = @{$dsi[$i]};
 	@{$topindx[$i]} = splice(@{$botindx[$i]}, -$maxspike);
-	print "ds$i top $maxspike: ".join(' ', @{$topindx[$i]})."\n";
+	print "$dsname[$i] top $maxspike: ".join(' ', @{$topindx[$i]})."\n";
 	for($j = 0; $j < $maxspike; $j++) {
 		$indexes{${$topindx[$i]}[$j]} = 0 if
 				!defined($indexes{${$topindx[$i]}[$j]});

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/Makefile.in

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/killspike/Makefile.am

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/rrd-file-icon/Makefile.in

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/rrd-file-icon/Makefile.am

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/snmpstats/SNMPstats.pl
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/snmpstats/SNMPstats.pl	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/snmpstats/SNMPstats.pl	Sat Jul 13 21:25:59 2002
@@ -0,0 +1,363 @@
+#!/usr/bin/perl -w
+
+# Q: Who wrote this?
+# Bill Nash - billn at billn.net / billn at gblx.net
+#
+# Q: Why?
+# SNMP retrieval and storage of interface utilization, ala MRTG.
+#
+# Q: Is this a supported utility?
+# Barely. That means if there's a serious problem with it, you can email me. I'll take feature requests
+# provided they're presented in an intelligent manner. I will NOT write scripts for you. There's a plethora
+# of information available to you, stop being lazy and do it yourself. Mostly, I wrote this for myself. I
+# released it to the community at large because it's useful. Your mileage may vary. This code carries no 
+# warranty and I'm not responsible if you do something stupid with it.
+#
+# Q: Why does the author sound like a grumpy curmudgeon?
+# Because I'm releasing a utility to the public, and I detest people. I read the MRTG lists. I know what you 
+# people are and are not capable of. I could jump up on my soapbox and rant about the general laziness of people,
+# but no one will care. The user base at large is full of lazy bastards who just want someone else to create something
+# that does exactly what they want, with as little effort required on their part.
+#
+# Q: Is it safe to ask questions about this utility?
+# I will be more than happy to entertain discussions about this utility, provided:
+#	It's a discussion of perl mechanics, and the person asking the question knows something about Perl.
+#	It's a discussion of SNMP mechanics, and the person asking the question isn't asking where to find Mibs/objects.
+#	You're a Playboy Bunny and you'd like to meet me for dinner.
+#
+# Q: Your code sucks, billn, why does this do [such and such], and why didn't you do condense [this and this]?
+# This is intended to be a simple utility. No fancy obsfucation, no serious attention to efficiency. The only real creative 
+# parts are using ifDescr/ifName as an interface basis (which offsets the nasty ifIndex shift problem by using ifIndex has a 
+# value of the key, ifDescr/ifName, instead of vice versa. The ifIndex can change all it wants. Don't go saying 'Well, what if 
+# interface name changes?', because I'll just say "Then it's a new interface. Cope."
+# Also, by NOT obfuscating functions and keeping things simple, I'd hope people looking at this script that aren't fully versed
+# in the intricacies and foibles of SNMP, PERL and RRD will have an easier time grasping the concepts, and maybe learn a bit from 
+# this. Much of the code contained in here is interchangable, data sources can be substituted left and right, and I fully expect
+# someone to hack this into a shining pearl of relative usefulness on a regular basis. It's not the end all, be all of SNMP pollers,
+# but I expect it'll find widespread use.
+
+$local_dir = "/usr/local/rrdtool-1.0.28";	# Where this script lives
+$rrd_store = "$local_dir/rrd";		# Where to keep our rrd datastores
+
+$debug = 0;
+
+# This is Net::SNMP-2.00. It's not included with this script. Try CPAN.
+use Net::SNMP;
+
+# RRD Perl module. If you don't have it, why are you here?
+use RRDs;
+
+# This piece can be ripped out and subbed for any number of data storage methods. This is a simple method
+# that works for those handling only a few devices. IP addresses are important because I don't use hostname
+# matches for the SNMP calls. This eliminates DNS dependancies, but does require you to maintain your code or
+# host registries.
+
+$devices{"Hades"}{'ip_address'} = "10.0.0.254"; # my switch
+$devices{"Hades"}{'snmp_read'} = "public";
+$devices{"Bifrost"}{'ip_address'} = "10.0.0.253"; # my router
+$devices{"Bifrost"}{'snmp_read'} = "public";
+
+# Standard SNMP mib2 jazz. Feel free to edit. YMMV.
+
+# Variables from the %oids hash we'll be referencing later. It's easier to call them by a name.
+# What, you think I'm gonna memorize SNMP oids? =P
+
+ at poll_int = (
+		"ifDescr",
+		"ifOperStatus",
+		"ifAlias",
+		"ifInErrors",
+		"ifInOctets",
+		"ifOutErrors",
+		"ifOutOctets",
+		"ifSpeed"
+);
+
+%oids = (
+	sysDescr              => "1.3.6.1.2.1.1.1.0",
+	sysName               => "1.3.6.1.2.1.1.5.0",
+	sysUptime             => "1.3.6.1.2.1.1.3.0",
+	ifNumber              => "1.3.6.1.2.1.2.1.0",
+	#ifDescr               => "1.3.6.1.2.1.2.2.1.2",
+	ifType                => "1.3.6.1.2.1.2.2.1.3",
+	ifSpeed               => "1.3.6.1.2.1.2.2.1.5",
+	ifPhysAddress         => "1.3.6.1.2.1.2.2.1.6",
+	ifAdminStatus         => "1.3.6.1.2.1.2.2.1.7", 
+	ifOperStatus          => "1.3.6.1.2.1.2.2.1.8",
+	ifAlias               => "1.3.6.1.2.1.31.1.1.1.18",
+	ifInErrors            => "1.3.6.1.2.1.2.2.1.14",
+	ifInOctets            => "1.3.6.1.2.1.2.2.1.10",
+	ifInUnkProtos         => "1.3.6.1.2.1.2.2.1.15",
+	ifLastChange          => "1.3.6.1.2.1.2.2.1.19",
+	ifDescr                => "1.3.6.1.2.1.31.1.1.1.1", # was ifXName, subbed for ifDescr
+	ifOutDiscards         => "1.3.6.1.2.1.2.2.1.19",
+	ifOutErrors           => "1.3.6.1.2.1.2.2.1.20",
+	ifOutOctets           => "1.3.6.1.2.1.2.2.1.16"
+);
+
+while(1) {
+	$start = time;
+
+	foreach $device_name (keys %devices) {
+		undef(%ifAdmin);
+		# Establish an snmp session with the device
+        	my($session, $error) = Net::SNMP->session(
+                                            Hostname  => $devices{$device_name}{'ip_address'},
+                                            Community => $devices{$device_name}{'snmp_read'},
+                                            Translate => 1,
+                                            VerifyIP  => 1
+        	);
+
+	# This example may seem a bit long and drawn out, but it's better for a clear view of how the procedure works
+	# It's entirely possible (and more efficient) to restructure this into a tight bundle of reusable code.
+        	if ($session) {
+                	print "$device_name: SNMP Session established ($device_name, $devices{$device_name}{'ip_address'})\n" if ($debug);
+
+		# First step, find all the administratively active interfaces. Typically, this should be the ONLY
+		# table that takes a walk across all interfaces. If you're doing smart and clean device management,
+		# all unused/undesignated interfaces should be admin'd down and scrubbed of configs. If you don't
+		# maintain this kind of device policy, don't cry to me because things take longer than you expect.
+
+		# For the sake of efficiency, I should note here that this set of data doesn't HAVE to be generated with an SNMP poll
+		# You can have an entirely external management system here that dictates what interfaces are tracked. You can rip this
+		# chunk out and replace it with something else entirely.
+
+		#print "Retrieving ifAdminStatus table: $oids{'ifAdminStatus'}\n" if ($debug);
+                	$response = $session->get_table($oids{'ifAdminStatus'});
+                	if($error_message = $session->error) {
+                        	if($error_message eq "Requested table is empty" ||
+                           		$error_message eq "Recieved SNMP noSuchName(2) error-status at error-index 1") {}
+                        	else {
+                                	print STDERR "ifAdmin table get failed ($device_name: $oids{'ifAdminStatus'}): $error_message\n"
+                        	}	# end if
+				next; # Can't get an ifAdminStatus table? No active interfaces or a borked SNMP engine. Next!
+                	} # end if
+
+                	%array = %{$response};
+                	foreach $key (keys %array) {
+
+				$ifIndex = $key;
+				$ifIndex =~ s/^$oids{'ifAdminStatus'}.//g;
+
+			# Hash the ifAdminStatus data if the status is 1. We aren't going to bother with any 
+			# interfaces that aren't set active.
+			# For the curious, possible values here are:
+			# @OperStatus=("null", "Up", "Down", "Looped", "null", "Dormant", "Missing");
+
+                       		$ifAdmin{$ifIndex} = $array{$key};
+				#print "$device_name: ifIndex $ifIndex, ifAdmin $array{$key} $ifAdmin{$ifIndex}\n" if ($debug);
+                	} #end foreach
+
+			# Cycle through all The admin'd active interfaces, by ifIndex
+			foreach $ifIndex (keys %ifAdmin) {
+				undef(@interface_rrd);
+				next if ($ifAdmin{$ifIndex} != 1);
+			# Cycle through all the objects we want to track for each interface. This 
+			# is a highly reusable set of code, set up to perform the same task repeatedly for 
+			# (potentially long) lists of variables.
+				foreach $object (@poll_int) {
+				# get the numeric oid values from the oids table
+					$object_id = $oids{$object};
+
+				# go get the object.
+	                		$response = $session->get_request("$object_id.$ifIndex");
+      	         			if($error_message = $session->error) {
+						if($error_message eq "Recieved SNMP noSuchName(2) error-status at error-index 1") {
+						# It's a common occurence to poll an interface for an object that it
+						# doesn't support, so we'll just U the object.
+							$data{$device_name}{$ifIndex}{$object} = "U";
+						} #end if
+
+					# Whatever the object was, it didn't want to be 'gotten', so screw it.
+       	                			print STDERR "Object get failed ($device_name: $object_id.$ifIndex):$error_message\n" if ($debug);
+						next;
+                			} #end if
+
+                			%array = %{$response};
+
+				# Shucks, got data, get to work. This chunk of code is pretty generic, and you'll 
+				# recognize it from up above. I *could* use a single iteration here, but better save
+				# in case the snmp engine did something hokey, or we used a table base variable in the get.
+				# The multilayer hash prolly makes some of you twitch to see, but hey, if you don't like it,
+				# why are you reading my code to begin with? It works, take a hike.
+				# Anyway, it's an extensible memory structure that doesn't care what you're stuffing into it.
+
+                			foreach $key (keys %array) {
+		                        	$ifIndex = $key;
+               			        	$ifIndex =~ s/^$oids{$object}.//g;
+
+                        			$data{$device_name}{$ifIndex}{$object} = $array{$key};
+						#print "$device_name: ifIndex $ifIndex, $object = $data{$device_name}{$ifIndex}{$object}\n";
+                			} #end foreach
+				} #end foreach
+			} #end foreach
+
+		# Alright, so at this point, we should have a full set of data (whatever we requested) for 
+		# each active interface.
+		# This whole next section is all about what we do with any given piece of data, so if you're doing
+		# customization beyond what I've included, here's your sandbox, here's your shovel. Go build me a Buick.
+
+		# My primary goal for this utility is low overhead interface utilization tracking for my router and switch.
+		# In combination with RRDtool's graphing abilities, poof, it's a skimpy but solid (and extensible) replacement
+		# for MRTG. Don't get me wrong, I like MRTG, but RRDtool a lot easier to do flexible things with. The fact
+		# that this whole piece is in Perl provides a working template for bigger and crazier things, like using 
+		# a real SQL db for tracking port data, or real time data feeds to Linus knows what. With these things in
+		# mind, let's start tossing some data.
+
+		#        ifSpeed               => "1.3.6.1.2.1.2.2.1.5",
+		# Since we're doing traffic graphing, it's helpful to know the size of the pipe we're tracking.
+
+        	#	ifOperStatus          => "1.3.6.1.2.1.2.2.1.8",
+		# If the interface is down for some reason, it'd be good to have a way to represent that.
+
+        	#	ifAlias               => "1.3.6.1.2.1.31.1.1.1.18",
+		# ifAlias is usually a human supplied interface description. 
+
+		#       ifInErrors            => "1.3.6.1.2.1.2.2.1.14",
+		#       ifInOctets            => "1.3.6.1.2.1.2.2.1.10",
+		#       ifInUnkProtos         => "1.3.6.1.2.1.2.2.1.15",
+		#       ifOutDiscards         => "1.3.6.1.2.1.2.2.1.19",
+		#       ifOutErrors           => "1.3.6.1.2.1.2.2.1.20",
+		#       ifOutOctets           => "1.3.6.1.2.1.2.2.1.16"
+		# These should be pretty obvious. No, that's not short for Uncle Protos.
+
+		#       ifDescr               => "1.3.6.1.2.1.2.2.1.2",
+		# This is usually the name for an interface. Very important variable.
+		# Since I'm testing with a cisco catalyst, I've switched ifDescr for ifName/ifXName, up top. Less pain.
+
+		# We need a place to store this stuff, so let's check out storage structures
+
+			foreach $device_name (keys %data) {
+				#print "Generating/feeding data for $device_name\n";
+				foreach $ifIndex (keys %{$data{$device_name}}) {
+
+					$ifDescr = $data{$device_name}{$ifIndex}{'ifDescr'};
+					if ($ifDescr eq "") {
+						#print "$device_name ifIndex $ifIndex apparantly has a null ifDescr -> [$ifDescr], skipping\n";
+						next;
+					} # end if
+
+			# If you recognize where I stole these from, you may already know me as '[tHUg]Heartless'
+			# I prefer the Aug and the TMP, and I fear no AWP. =)
+			# This set of regexp's is for scrubbing potentially exciting characters from interface names before 
+			# using them as the basis for storing files. Some OS's and file systems may object to some of these 
+			# characters, so, better safe than annoyed.
+			# You'll note I don't provide facilities for reverting this. I just collect the stuff. Display is your problem.
+
+			    		$ifDescr =~ s/ /_/g;
+			    		$ifDescr =~ s/\=/\[EQUAL\]/g;
+			    		$ifDescr =~ s/\,/\[CMA\]/g;
+			    		$ifDescr =~ s/;/\[SMICLN\]/g;
+			   	 	$ifDescr =~ s/:/\[CLN\]/g;
+			  	  	$ifDescr =~ s/\"/\[DBLQT\]/g;
+			 	   	$ifDescr =~ s/\'/\[SNGLQT\]/g;
+				    	$ifDescr =~ s/\{/\[LB2\]/g;
+				    	$ifDescr =~ s/\}/\[RB2\]/g;
+				    	$ifDescr =~ s/\+/\[PLS\]/g;
+				    	$ifDescr =~ s/\-/\[DSH\]/g;
+				    	$ifDescr =~ s/\(/\[LPRN\]/g;
+				    	$ifDescr =~ s/\)/\[RPRN\]/g;
+				    	$ifDescr =~ s/\*/\[STR\]/g;
+				    	$ifDescr =~ s/\&/\[AND\]/g;
+				    	$ifDescr =~ s/\|/\[PIPE\]/g;
+				    	$ifDescr =~ s/\\/\[BSLSH\]/g;
+				    	$ifDescr =~ s/\//\[FSLSH\]/g;
+				    	$ifDescr =~ s/\?/\[QUESTN\]/g;
+				    	$ifDescr =~ s/\</\[LT\]/g;
+				    	$ifDescr =~ s/\>/\[GT\]/g;
+				    	$ifDescr =~ s/\./\[DOT\]/g;
+				    	$ifDescr =~ s/\!/\[XCLM\]/g;
+				    	$ifDescr =~ s/\@/\[AT\]/g;
+				    	$ifDescr =~ s/\#/\[PND\]/g;
+				    	$ifDescr =~ s/\$/\[DLLR\]/g;
+				    	$ifDescr =~ s/\%/\[\PRCNT\]/g;
+				    	$ifDescr =~ s/\^/\[CRT\]/g;
+		
+					if ( -e "$rrd_store/$device_name-$ifDescr.rrd") {
+					# Uh, hey, it's there. Don't worry, be happy.
+					}
+					else {  # Oh, damn, it isn't, better create it.
+				
+			# Knowing the speed of the interface, generally reported by SNMP in bits per second,
+			# we can fairly accurately determine how long it could take that counter to roll over,
+			# if it's a 32 bit counter.
+			# So, we'll use that info in creating the interface data. You may recognize these variables
+			# from the RRD tutorial docs, which were further derived from MRTG. I reuse them both because
+			# I'm lazy and so people will recognize what to hack on if they've beat up MRTG before.
+
+						if ($speed = $data{$device_name}{$ifIndex}{'ifSpeed'}) {
+							print "$device_name: Found $speed speed for $ifIndex\n";
+						}
+						else {
+							$speed = "U";
+						}
+	
+						@interface_rrd = (
+						"DS:InBits:COUNTER:600:0:$speed",
+						"DS:OutBits:COUNTER:600:0:$speed",
+						"RRA:AVERAGE:0.5:1:600",
+						"RRA:AVERAGE:0.5:6:700",
+						"RRA:AVERAGE:0.5:24:775",
+						"RRA:AVERAGE:0.5:288:797",
+						"RRA:MAX:0.5:1:600",
+						"RRA:MAX:0.5:6:700",
+						"RRA:MAX:0.5:24:775",
+						"RRA:MAX:0.5:288:797"
+						);
+	
+			# I feed the array to the create argument here, so it's easier to alter the rrd
+			# creation by just changing entries in the array above. Generic and reusable.
+
+						if(RRDs::create ("$rrd_store/$device_name-$ifDescr.rrd",
+							 "--step=300", 
+							 @interface_rrd)) {
+							print "Built RRd for $ifDescr\n";
+						}
+						else {
+							$ERR=RRDs::error;
+							print "RRd build for $ifDescr appears to have failed: $ERR\n";
+							next;
+						}
+					}
+
+
+			# Do some calculations.
+
+					$data{$device_name}{$ifIndex}{InBits} = $data{$device_name}{$ifIndex}{ifInOctets} * 8;
+					$data{$device_name}{$ifIndex}{OutBits} = $data{$device_name}{$ifIndex}{ifOutOctets} * 8;
+
+			# Feed the RRD our data.
+
+					$rrdfeed = join ":", ("N", 
+						$data{$device_name}{$ifIndex}{InBits},
+#      		                          	$data{$device_name}{$ifIndex}{IfInErrors},
+       		                         	$data{$device_name}{$ifIndex}{OutBits},
+#      		                          	$data{$device_name}{$ifIndex}{IfOutErrors},
+					);
+
+					RRDs::update ("$rrd_store/$device_name-$ifDescr.rrd",
+						"--template", "InBits:OutBits", 
+						"$rrdfeed"); 
+
+					if($ERR=RRDs::error) {
+						print STDERR "$rrd_store/$device_name-$ifDescr.rrd update failed: $ERR\n";
+					}
+					else {
+						#print "$rrd_store/$device_name-$ifDescr.rrd updated\n" if ($debug);
+					}
+				}
+			}	# yeah, it's sloppy, sue me.
+        	}
+        	else {
+		# Abort abort abort, no go no go. uNF. =)
+                	print STDERR "$device_name: SNMP Session failed: $error\n";
+        	}
+	}
+
+	$end = time;
+
+	$duration = $end - $start;
+	$sleep_period = 300 - $duration;
+	if($sleep_period > 0) { sleep($sleep_period) }
+	undef(%data);
+}

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/snmpstats/README
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/snmpstats/README	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/snmpstats/README	Sat Jul 13 21:25:59 2002
@@ -0,0 +1,43 @@
+SNMPstats.pl is a moderately simple and quick perl SNMP poller for simple
+interface traffic and other counters. It's written with flexible and easy
+hacking in mind, and is commented appropriately.
+
+It requires Net::SNMP version 2, available from CPAN.
+
+For the sake of simplicity, device names, IPs, and SNMP read strings are
+hard coded, but this can be easily substituted with something more
+dynamic. Structure for the devices hash is:
+
+$devices{<Canonical device name>}{'ip_address'} = <target ip address>
+				 {'snmp_read'}  = <SNMP read community>
+
+SNMP objects are stored in %oids. SNMP objects polled during device sweeps
+are stored in @poll_int, using named references to the object names used
+as key variables in %oids.
+
+Interface stats are only collected for interfaces that have an
+ifAdminStatus of 1. This cuts down on SNMP load quite a bit, given devices
+are properly managed. Your mileage will vary based on device policies.
+
+RRDs are only created for interfaces with ifAdminStatus of 1. This gives
+you some amount of scale control. Interfaces are checked for an existing
+RRD on each collection pass, and RRDs created as needed. They are NOT
+removed if you admin down an interface, so stale RRD cleanup is your
+problem.
+
+One caveat to note is that RRDs are created with upper limits based on
+ifSpeed. For autosensing 10/100 switches, this is a problem. In an effort
+to keep this utility simple, I formally declare it to be 'your
+problem'.
+
+This utility runs as a recurring loop, so it's meant to be run in the
+background like a daemon. You can strip the while/sleep sets and stuff it
+in cron, if you're so inclined. YMMV. 
+
+The script itself is heavily commented, explaining what I do as I go. Be a
+good user, read the code before you run it. It's simple and
+straightforward, and it's a good idea to understand how it works,
+especially if you're a novice user.
+
+Bill Nash
+billn at billn.net / billn at gblx.net

Modified: trunk/orca/packages/rrdtool-1.0.33/contrib/trytime/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/trytime/Makefile.in	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/trytime/Makefile.in	Sat Jul 13 21:25:59 2002
@@ -64,15 +64,26 @@
 target_alias = @target_alias@
 target_triplet = @target@
 CC = @CC@
-CFLAGS = @CFLAGS@
 CGI_LIB_DIR = @CGI_LIB_DIR@
 COMP_PERL = @COMP_PERL@
 CPP = @CPP@
 GD_LIB_DIR = @GD_LIB_DIR@
 LIBTOOL = @LIBTOOL@
+NROFF = @NROFF@
 PERL = @PERL@
+PERLFLAGS = @PERLFLAGS@
+PERL_MAKE_OPTIONS = @PERL_MAKE_OPTIONS@
 PNG_LIB_DIR = @PNG_LIB_DIR@
 RANLIB = @RANLIB@
+SO_EXT = @SO_EXT@
+TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
+TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
+TCL_PREFIX = @TCL_PREFIX@
+TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
+TCL_SHLIB_LD = @TCL_SHLIB_LD@
+TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
+TROFF = @TROFF@
+VERSION = @VERSION@
 ZLIB_LIB_DIR = @ZLIB_LIB_DIR@
 
 INCLUDES = -I../../src -I../../gd1.3
@@ -95,6 +106,7 @@
 trytime_OBJECTS =  trytime.o
 trytime_DEPENDENCIES =  ../../src/librrd.la
 trytime_LDFLAGS = 
+CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
@@ -105,7 +117,6 @@
 
 
 PACKAGE = @PACKAGE@
-VERSION = @VERSION@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
@@ -118,7 +129,7 @@
 .SUFFIXES:
 .SUFFIXES: .S .c .lo .o .s
 $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps contrib/trytime/Makefile
+	cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps contrib/trytime/Makefile
 
 Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
@@ -248,7 +259,7 @@
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
-	    cp -pr $$/$$file $(distdir)/$$file; \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
 	  else \
 	    test -f $(distdir)/$$file \
 	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -256,8 +267,8 @@
 	  fi; \
 	done
 trytime.o: trytime.c ../../src/getopt.h ../../src/rrd_tool.h \
-	../../config/config.h ../../src/parsetime.h \
-	../../src/rrd_format.h ../../gd1.3/gd.h
+	../../config/config.h ../../src/rrd.h ../../src/rrd_format.h \
+	../../gd1.3/gd.h
 
 info-am:
 info: info-am

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl.in.rej
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl.in.rej	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl.in.rej	Sat Jul 13 21:25:59 2002
@@ -0,0 +1,13 @@
+***************
+*** 161,166 ****
+    }
+    return $i;
+  }
+- 
+- 
+  
+--- 189,192 ----
+    }
+    return $i;
+  }
+  

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl.in.orig
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl.in.orig	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl.in.orig	Sat Jul 13 21:26:00 2002
@@ -0,0 +1,164 @@
+#! @PERL@
+#
+# rrdlastds - report the latest DS values from the RRA with
+# the shortest time resolution
+#
+# steve rader
+# <rader at wiscnet.net>
+# Jan 8th, 2000
+#
+# $Id: rrdlastds.in,v 1.12 2000/01/10 16:29:18 rader Exp $
+#
+
+#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( @prefix@/lib/perl ../lib/perl );
+
+use RRDs;
+
+%scale_symbols = qw( -18 a -15 f -12 p -9 n -6 u -3 m 
+  3 k 6 M 9 G 12 T 15 P 18 E );
+
+#----------------------------------------
+
+while ( $ARGV[0] =~ /^-/ ) {
+  switch: {
+    if ( $ARGV[0] eq '--autoscale' || $ARGV[0] =~ /^-a/ ) {
+      $scale = 1;
+      last switch;
+    }
+    if ( $ARGV[0] eq '--conversion' || $ARGV[0] =~ /^-c/ ) {
+      shift @ARGV;
+      $conversion = $ARGV[0];
+      if ( $conversion !~ /^\d+$|^\d+\.\d+$|^\.\d+$/ ) {
+        print "rrdlastds: bad conversion factor \"$conversion\"\n";
+        exit 1;
+      }
+      last switch;
+    }
+    if ( $ARGV[0] eq '--label' || $ARGV[0] =~ /^-l/ ) {
+      shift @ARGV;
+      $label = $ARGV[0];
+      last switch;
+    }
+    if ( $ARGV[0] eq '--start' || $ARGV[0] =~ /^-s/ ) {
+      shift @ARGV;
+      $start = $ARGV[0]; 
+      if ( $start =~ /^\d+$/ ) {
+        $end = $start+1;
+      } else {
+        $end = "${start}+1sec";
+      }
+      last switch;
+    }
+    if ( $ARGV[0] eq '--verbose' || $ARGV[0] =~ /^-v/ ) {
+      $verbose = 1;
+      last switch;
+    }
+    print "rrdlastds: unknown option \"$ARGV[0]\"\n";
+    exit 1;
+  }
+  shift @ARGV;
+}
+
+if ( $#ARGV != 0 ) {
+  print <<_EOT_;
+usage: rrdlastds [-v] [-a] [-c num] [-l label] [-s stamp] some.rrd
+  -v        print the start and end times (also --verbose)
+  -a        autoscale DS values (also --autoscale)
+  -c num    convert DS values by "num" (also --conversion)
+  -l label  label DS values with "label" (also --label)
+  -s time   report about DS values at the time "time" (also --start)
+
+  The -s option supports the traditional "seconds since the Unix epoch"
+  and the AT-STYLE time specification (see man rrdfetch)
+_EOT_
+  exit 1;
+}
+
+if ( ! -f "$ARGV[0]" ) {
+  print "rrdlastds: can't find \"$ARGV[0]\"\n";
+  exit 1;
+} 
+
+#----------------------------------------
+
+if ( $start ) {
+  @fetch = ( "$ARGV[0]", '-s', "$start", '-e', "$end", 'AVERAGE' );
+} else {
+  @fetch = ( "$ARGV[0]", '-s', '-1sec', 'AVERAGE' );
+}
+($start,$step,$names,$data) = RRDs::fetch @fetch;
+
+if ( $error = RRDs::error ) {
+  print "rrdlastds: rrdtool fetch failed: \"$error\"\n";
+  exit 1;
+}
+
+#----------------------------------------
+
+if ( $verbose ) {
+  print scalar localtime($start), ' through ', 
+    scalar localtime($start+$step), "\naverage";
+} else {
+  print scalar localtime($start);
+}
+
+$line = $$data[0];
+for $i (0 .. $#$names) {
+  if ( $conversion ) {
+    $$line[$i] = $$line[$i] * $conversion;
+  }
+  if ( $scale ) {
+    ($val, $units) = autoscale($$line[$i]);
+  } else {
+    $val = $$line[$i];
+  }
+  printf "  %.2f$units$label %s", $val, $$names[$i];
+}
+print "\n";
+
+exit 0;
+
+#==================================================================
+
+sub autoscale {
+  local($value) = @_;
+  local($floor, $mag, $index, $symbol, $new_value);
+
+  if ( $value =~ /^\s*[0]+\s*$/ || 
+       $value =~ /^\s*[0]+.[0]+\s*$/ || 
+       $value =~ /^\s*NaN\s*$/ ) {
+    return $value, ' ';
+  }
+
+  $floor = &floor($value);
+  $mag = int($floor/3);
+  $index = $mag * 3;
+  $symbol = $scale_symbols{$index};
+  $new_value = $value / (10 ** $index);
+  return $new_value, " $symbol";
+}
+
+#------------------------------------------------------------------
+
+sub floor {
+  local($value) = @_;
+  local($i) = 0;
+
+  if ( $value > 1.0 ) {
+    # scale downward...
+    while ( $value > 10.0 ) {
+      $i++;
+      $value /= 10.0;
+    }
+  } else {
+    while ( $value < 10.0 ) {
+      $i--;
+      $value *= 10.0;
+    }
+  }
+  return $i;
+}
+

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/rrdlastds.pl	Sat Jul 13 21:26:00 2002
@@ -0,0 +1,192 @@
+#! /usr/sepp/bin/perl
+#
+# rrdlastds - report the latest DS values from the RRA with
+# the shortest time resolution
+#
+# steve rader
+# <rader at wiscnet.net>
+# Jan 8th, 2000
+#
+# $Id: rrdlastds.in,v 1.15 2000/01/27 21:35:16 rader Exp $
+#
+
+#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.30/lib/perl ../lib/perl );
+
+use RRDs;
+
+%scale_symbols = qw( -18 a -15 f -12 p -9 n -6 u -3 m 
+  3 k 6 M 9 G 12 T 15 P 18 E );
+
+#----------------------------------------
+
+while ( $ARGV[0] =~ /^-/ ) {
+  switch: {
+    if ( $ARGV[0] eq '--autoscale' || $ARGV[0] =~ /^-a/ ) {
+      $scale = 1;
+      last switch;
+    }
+    if ( $ARGV[0] eq '--conversion' || $ARGV[0] =~ /^-c/ ) {
+      shift @ARGV;
+      $conversion = $ARGV[0];
+      if ( $conversion !~ /^\d+$|^\d+\.\d+$|^\.\d+$/ ) {
+        print "rrdlastds: bad conversion factor \"$conversion\"\n";
+        exit 1;
+      }
+      last switch;
+    }
+    if ( $ARGV[0] eq '--label' || $ARGV[0] =~ /^-l/ ) {
+      shift @ARGV;
+      $label = $ARGV[0];
+      last switch;
+    }
+    if ( $ARGV[0] eq '--start' || $ARGV[0] =~ /^-s/ ) {
+      shift @ARGV;
+      $start = $ARGV[0]; 
+      if ( $start =~ /^\d+$/ ) {
+        $end = $start+1;
+      } else {
+        $end = "${start}+1sec";
+      }
+      last switch;
+    }
+    if ( $ARGV[0] eq '--verbose' || $ARGV[0] =~ /^-v/ ) {
+      $verbose = 1;
+      last switch;
+    }
+    if ( $ARGV[0] eq '--debug' || $ARGV[0] =~ /^-d/ ) {
+      $debug = 1;
+      last switch;
+    }
+    print "rrdlastds: unknown option \"$ARGV[0]\"\n";
+    exit 1;
+  }
+  shift @ARGV;
+}
+
+if ( $#ARGV != 0 ) {
+  print <<_EOT_;
+usage: rrdlastds [-v] [-a] [-c num] [-l label] [-s stamp] some.rrd
+  -v        print the start and end times (also --verbose)
+  -a        autoscale DS values (also --autoscale)
+  -c num    convert DS values by "num" (also --conversion)
+  -l label  label DS values with "label" (also --label)
+  -s time   report about DS values at the time "time" (also --start)
+
+  The -s option supports the traditional "seconds since the Unix epoch"
+  and the AT-STYLE time specification (see man rrdfetch)
+_EOT_
+  exit 1;
+}
+
+if ( ! -f "$ARGV[0]" ) {
+  print "rrdlastds: can't find \"$ARGV[0]\"\n";
+  exit 1;
+} 
+
+#----------------------------------------
+
+if ( $start ) {
+  @fetch = ("$ARGV[0]", "-s", "$start", "-e", "$end", "AVERAGE");
+} else {
+  @fetch = ("$ARGV[0]", "-s", "-1sec", "AVERAGE");
+}
+if ( $debug ) {
+  print "rrdfetch ", join(' ', at fetch), "\n";
+}
+
+($start,$step,$names,$data) = RRDs::fetch @fetch;
+
+if ( $error = RRDs::error ) {
+  print "rrdlastds: rrdtool fetch failed: \"$error\"\n";
+  exit 1;
+}
+
+#----------------------------------------
+
+if ( $debug ) {
+  $d_start = $start;
+  print "Start:       ", scalar localtime($d_start), " ($d_start)\n";
+  print "Step size:   $step seconds\n";
+  print "DS names:    ", join (", ", @$names)."\n";
+  print "Data points: ", $#$data + 1, "\n";
+  print "Data:\n";
+  foreach $line (@$data) {
+    print "  ", scalar localtime($d_start), " ($d_start) ";
+    $d_start += $step;
+    foreach $val (@$line) {
+      printf "%12.1f ", $val;
+    }
+    print "\n";
+  }
+  print "\n";
+}
+   
+#----------------------------------------
+
+if ( $verbose ) {
+  print scalar localtime($start), ' through ', 
+    scalar localtime($start+$step), "\naverage";
+} else {
+  print scalar localtime($start);
+}
+
+$line = $$data[0];
+for $i (0 .. $#$names) {
+  if ( $conversion ) {
+    $$line[$i] = $$line[$i] * $conversion;
+  }
+  if ( $scale ) {
+    ($val, $units) = autoscale($$line[$i]);
+  } else {
+    $val = $$line[$i];
+  }
+  printf "  %.2f$units$label %s", $val, $$names[$i];
+}
+print "\n";
+
+exit 0;
+
+#==================================================================
+
+sub autoscale {
+  local($value) = @_;
+  local($floor, $mag, $index, $symbol, $new_value);
+
+  if ( $value =~ /^\s*[0]+\s*$/ || 
+       $value =~ /^\s*[0]+.[0]+\s*$/ || 
+       $value =~ /^\s*NaN\s*$/ ) {
+    return $value, ' ';
+  }
+
+  $floor = &floor($value);
+  $mag = int($floor/3);
+  $index = $mag * 3;
+  $symbol = $scale_symbols{$index};
+  $new_value = $value / (10 ** $index);
+  return $new_value, " $symbol";
+}
+
+#------------------------------------------------------------------
+
+sub floor {
+  local($value) = @_;
+  local($i) = 0;
+
+  if ( $value > 1.0 ) {
+    # scale downward...
+    while ( $value > 10.0 ) {
+      $i++;
+      $value /= 10.0;
+    }
+  } else {
+    while ( $value < 10.0 ) {
+      $i--;
+      $value *= 10.0;
+    }
+  }
+  return $i;
+}
+

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/Makefile.in

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdlastds/Makefile.am

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/png.cgi
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/png.cgi	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/png.cgi	Sat Jul 13 21:26:01 2002
@@ -0,0 +1,56 @@
+#!/usr/bin/perl
+# Create rrdtool graph ... 
+
+use CGI::Carp;
+use CGI;
+use POSIX;
+use lib qw( /usr/local/rrdtool/lib/perl );
+use RRDs;
+
+my $query = new CGI;
+
+# Get params from URL
+$rrd = $query->param("rrd"); # RRD absolute path
+$start = $query->param("start"); # start time
+$end = $query->param("end"); # end time
+$hight = $query->param("hight"); # Image sizes
+$width = $query->param("width");
+$use = $query->param("use"); # which DS shal I print
+
+# List of colors for graphs
+ at color = ("#FF0000","#00FF00","#FFFF00","#0000FF","#FF00FF","#00FFFF","#FFFFFF",
+	  "#800000","#008000","#808000","#000080","#800080","#008080","#808080");
+
+# title of graph with start / end time
+$title = $rrd.": ".scalar(localtime($start))." / ".scalar(localtime($end));
+
+# Formated date(now)
+$expiredate = strftime "%a, %e %b %Y %H:%M:%S GMT", gmtime(time);
+
+print "Content-type: image/png\n"; # Use html
+print "Cache-Control: no-cache\n"; # Ensure no cashing of page
+print "Expires: $expiredate\n\n"; # Expire now
+
+$root = $ENV{"DOCUMENT_ROOT"};
+# see rrdfetchnames
+($begin,$step,$names,$data) = RRDs::fetch "$root$rrd", "AVERAGE", "--start", "now","--end","start+1";
+if ( my $ERR = RRDs::error) {
+  die "ERROR while fetching data from $NAME $ERR\n";
+}
+ at names = @$names; # list of def's "@$name"
+$j = @names; # how many DS's
+
+# Append DEF's see examples/shared-demp.pl
+for ($i = 0; $i < $j; $i++) {
+  $val = substr($use, $i, 1);
+  if ( $val == "1" ) {
+    @options = (@options, "DEF:l$i=$root$rrd:@names[$i]:AVERAGE","LINE2:l$i at color[$i]:@names[$i]");
+  }
+}
+
+# Draw the graph to std.out ("-")
+($avg,$xsize,$ysize) = RRDs::graph "-","--title", "$title","--height","$hight","--width",
+  "$width","--start",$start,"--end",$end,"-a","PNG", at options;
+if ($ERROR = RRDs::error) {
+  print "ERROR: $ERROR\n";
+}

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/README.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/README.txt	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/README.txt	Sat Jul 13 21:26:01 2002
@@ -0,0 +1,29 @@
+From: "Claus Norrbohm" <james at type-this.com>
+
+RRD-Explorer (formally known as clickable rrd graphs) is a
+general tool for exploring RRD-files. It eliminates the need
+for creating individual RRDs cgi-scripts to show your RRD
+graphs, just plug these 4 lines into your httpd.conf (thanks
+to Alex van den Bogaerdt):
+
+   # rrd files
+   AddIcon /icons/rrd.png .rrd
+   AddDescription "Round Robin Database" .rrd
+
+   # rrdtool handler
+   AddHandler rrd-handler rrd
+   Action rrd-handler /cgi-bin/map.cgi
+
+Last line must be modified to match your system...
+
+If your placed map.cgi & png.cgi - change owner to reflect
+your cgi-bin user and make the scripts executable ex.:
+
+   chown root.root map.cgi png.cgi
+   chmod a+rx map.cgi png.cgi
+
+Now place your RRD-files in a directory below your "DocumentRoot"
+where they can be seen, i.e. "Options Indexes" must be set for
+the directory.
+
+Enjoy, Claus

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/map.cgi
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/map.cgi	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/rrdexplorer/map.cgi	Sat Jul 13 21:26:01 2002
@@ -0,0 +1,121 @@
+#!/usr/bin/perl
+# Explore rrd via clickable graphs by. james at type-this.com (Claus Norrbohm)
+
+# Basic idea: click high -> zoom out, click low -> zoom in,
+# click left -> back history, click right -> forward history
+
+use CGI::Carp;
+use CGI;
+use POSIX;
+use lib qw( /usr/local/rrdtool/lib/perl );
+use RRDs;
+
+my $query = new CGI;
+
+# modify as needed
+$hight = 300; # Image size
+$width = 600;
+$refresh = 3600;
+$expiredate = strftime "%a, %e %b %Y %H:%M:%S GMT", gmtime(time); # Format date(now)
+$root = $ENV{"DOCUMENT_ROOT"}; # Location of rrd
+
+print "Content-type: text/html\n"; # Use html
+print "Cache-Control: no-cache\n"; # Ensure no cashing of page
+print "Expires: $expiredate\n"; # Expire now
+print "Refresh: $refresh\n\n";
+
+print $query->start_html("Clickable rrd-graph"); # Title of html page
+
+if ($query->param()) { # the form has already been filled out
+
+  $rrd = $query->param("rrd"); # which rrd file are we tracking
+  $start = $query->param("start"); # Start time
+  $end = $query->param("end"); # End time
+  $x = $query->param("img.x"); # x/y cordinates of click
+  $y = $query->param("img.y");
+
+  # see contrib/rrdfetchnames
+  my ($begin,$step,$name,$data) = RRDs::fetch "$root$rrd","AVERAGE","--start","now","--end","start+1";
+  if ( my $ERR = RRDs::error) {
+    die "ERROR while fetching data from $NAME $ERR\n";
+  }
+  @names = @$name; # list of DS's "@$name"
+  $j = @names;
+  $esu = "";
+
+  for ($i = 0; $i < $j; $i++) { # here we find which DS we are curently tracking
+    if ($query->param("@names[$i]") == "1") {
+      @use[$i] = 1;
+      $esu .= "1"; # DS included
+    } else {
+      @use[$i] = 0;
+      $esu .= "0"; # DS not included
+    }
+  }
+
+  $intv = $end - $start; # Last used interval
+  $zoom = ($hight + 100 - $y) / $hight; # Find zoom factor + 100 because hight is not exact
+  $center = $start + $intv * $x / $width;  # Find time corresponding to click
+
+  $start = int($center - $intv * $zoom); # Calc new start
+  $end = int($center + $intv * $zoom); # Calc new end
+
+} else { # first time through, so present clean form
+
+  $rrd = $ENV{"REQUEST_URI"}; # Location of rrd
+
+  $end = time(); # use now for end
+  $start = $end - 86400; # and go back 24 hours
+
+  # see rrdfetchnames
+  my ($begin,$step,$name,$data) = RRDs::fetch "$root$rrd","AVERAGE","--start","now","--end","start+1";
+  if ( my $ERR = RRDs::error) {
+    die "ERROR while fetching data from $NAME $ERR\n";
+  }
+  @names = @$name; # list of DS's "@$name"
+  $j = @names;
+  $esu = "";
+
+  for ($i = 0; $i < $j; $i++) { # All DS is included first time
+    @use[$i] = 1;
+    $esu .= "1";
+  }
+
+}
+
+# Create a form with clickable image see page xxx in: Wallace, Shawn P.
+# Programming Web Graphics with Perl
+# and GNU Software
+# O'Reilly UK,1999, UK, Paperback
+
+print "<FORM ACTION=\"$rrd\">\n";
+
+print "<TABLE border=\"0\">\n";
+print "<TR><TD colspan=\"3\" align=\"center\">Click on top to zoom out</TD></TR>\n";
+print "<TR><TD align=\"right\">Click<BR>left<BR>to<BR>go<BR>back<BR>in<BR>time</TD>";
+print "<TD>\n";
+# png.cgi prints the rrd graph, by printing to std.out (browser)
+print "<INPUT TYPE=\"image\" NAME=\"img\" SRC=\"/cgi-bin/png.cgi?rrd=$rrd&start=$start&end=$end&hight=$hight&width=$width&use=$esu\">\n";
+print "<INPUT TYPE=\"hidden\" NAME=\"start\" VALUE=\"$start\">\n";
+print "<INPUT TYPE=\"hidden\" NAME=\"end\" VALUE=\"$end\">\n";
+print "<INPUT TYPE=\"hidden\" NAME=\"rrd\" VALUE=\"$rrd\">\n";
+print "</TD>";
+print "<TD align=\"left\">Click<BR>right<BR>to<BR>go<BR>forward<BR>in<BR>time</TD></TR>\n";
+print "<TR><TD colspan=\"3\" align=\"center\">Click on bottom to zoom in</TD></TR>\n";
+print "</TABLE>\n";
+
+print "<BR><HR><BR><TABLE border=\"0\"></TD><TD>Select / Deselect DS: </TD>\n";
+for ($i = 0; $i < $j; $i++) { # present user with list of DS to select / deselect
+  if (@use[$i] == 0) {
+    print "<TD><INPUT TYPE=\"checkbox\" NAME=\"@names[$i]\" VALUE=1>@names[$i] </TD>\n";
+  } else {
+    print "<TD><INPUT TYPE=\"checkbox\" NAME=\"@names[$i]\" VALUE=1 CHECKED>@names[$i] </TD>\n";
+  }
+}
+print "</TR></TABLE>\n";
+
+print "</FORM>\n";
+
+print "<P ALIGN=\"RIGHT\">Created by - Claus Norrbohm - <A HREF=\"mailto:james\@type-this.com\">james\@type-this.com</A></P>";
+
+print $query->end_html(); # lmth ....

Modified: trunk/orca/packages/rrdtool-1.0.33/contrib/Makefile.am
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/Makefile.am	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/Makefile.am	Sat Jul 13 21:26:01 2002
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = log2rrd rrd-file-icon trytime rrdproc rrdlastds add_ds killspike rrdfetchnames
-
+SUBDIRS = trytime
 contribdir = $(prefix)/contrib
 contrib_DATA = README
+EXTRA_DIST =  rrdview log2rrd rrd-file-icon rrdproc rrdlastds add_ds killspike rrdfetchnames snmpstats rrdexplorer php3 php4

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/php3_rrdtool.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/php3_rrdtool.c	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/php3_rrdtool.c	Sat Jul 13 21:26:01 2002
@@ -0,0 +1,416 @@
+/*
+ *
+ * php3_rrdtool.c
+ *
+ *	PHP interface to RRD Tool.
+ *
+ *
+ *       Joey Miller, <joeym at inficad.com> 
+ *          SkyLynx / Inficad Communications
+ *          2/12/2000
+ *
+ *
+ * See README, INSTALL, and USAGE files for more details.
+ *
+ */
+
+#include "dl/phpdl.h"
+#include "rrd_tool.h"
+#include "php3_rrdtool.h"
+
+
+/* {{{ proto string rrd_error(void)
+   Get the error message set by the last rrd tool function call */
+
+void php3_rrd_error(INTERNAL_FUNCTION_PARAMETERS)
+{
+    char *msg;
+
+    if ( rrd_test_error() )
+    {
+        msg = rrd_get_error();        
+
+        RETVAL_STRING(msg, 1);
+        rrd_clear_error();
+    }
+    else
+        return;
+}
+/* }}} */
+
+
+
+/* {{{ proto void rrd_clear_error(void)
+   Clear the error set by the last rrd tool function call */
+
+void php3_rrd_clear_error(INTERNAL_FUNCTION_PARAMETERS)
+{
+    if ( rrd_test_error() )
+        rrd_clear_error();
+
+    return;
+}
+/* }}} */
+
+
+
+/* {{{ proto int rrd_update(string file, string opt) 
+   Update an RRD file with values specified */
+
+void php3_rrd_update(INTERNAL_FUNCTION_PARAMETERS)
+{
+    pval *file, *opt;
+    char **argv;
+
+    if ( rrd_test_error() )
+        rrd_clear_error();
+
+    if ( ARG_COUNT(ht) == 2 && 
+         getParameters(ht, 2, &file, &opt) == SUCCESS )
+    {
+        convert_to_string(file);
+        convert_to_string(opt);
+
+        argv = (char **) emalloc(4 * sizeof(char *));
+
+        argv[0] = "dummy";
+        argv[1] = estrdup("update");
+        argv[2] = estrdup(file->value.str.val);
+        argv[3] = estrdup(opt->value.str.val);
+
+        optind = 0; opterr = 0;
+        if ( rrd_update(3, &argv[1]) != -1 )
+        {
+            RETVAL_TRUE;
+        }
+        else
+        {
+            RETVAL_FALSE;
+        }
+        efree(argv[1]); efree(argv[2]); efree(argv[3]);
+        efree(argv);
+    }
+    else
+    {
+        WRONG_PARAM_COUNT;
+    }
+    return;
+}
+/* }}} */
+
+
+
+/* {{{ proto int rrd_last(string file)
+   Gets last update time of an RRD file */
+
+void php3_rrd_last(INTERNAL_FUNCTION_PARAMETERS)
+{
+    pval *file;
+    unsigned long retval;
+
+    char **argv = (char **) emalloc(3 * sizeof(char *));
+    
+    if ( rrd_test_error() )
+        rrd_clear_error();
+    
+    if (getParameters(ht, 1, &file) == SUCCESS)
+    {
+        convert_to_string(file);
+
+        argv[0] = "dummy";
+        argv[1] = estrdup("last");
+        argv[2] = estrdup(file->value.str.val);
+
+        optind = 0; opterr = 0;
+        retval = rrd_last(2, &argv[1]);
+
+        efree(argv[1]);  efree(argv[2]);
+        efree(argv);
+        RETVAL_LONG(retval);
+    }
+    else
+    {
+        WRONG_PARAM_COUNT;
+    }
+    return;
+}
+/* }}} */
+
+
+/* {{{ proto int rrd_create(string file, array args_arr, int argc)
+   Create an RRD file with the options passed (passed via array) */ 
+
+void php3_rrd_create(INTERNAL_FUNCTION_PARAMETERS)
+{
+    pval *file, *args_arr, *p_argc;
+    pval *entry;
+    char **argv;
+    int argc, i;
+
+    if ( rrd_test_error() )
+        rrd_clear_error();
+
+    if ( ARG_COUNT(ht) == 3 && getParameters(ht, 3, &file, &args_arr, &p_argc) == SUCCESS )
+    {
+        if ( args_arr->type != IS_ARRAY )
+        { 
+            php3_error(E_WARNING, "2nd Variable passed to rrd_create is not an array!\n");
+            RETURN_FALSE;
+        }
+
+        convert_to_long(p_argc);
+        convert_to_string(file);
+
+        argc = p_argc->value.lval + 3;
+        argv = (char **) emalloc(argc * sizeof(char *));
+
+        argv[0] = "dummy";
+        argv[1] = estrdup("create");
+        argv[2] = estrdup(file->value.str.val);
+
+        for (i = 3; i < argc; i++) 
+        {
+            if ( _php3_hash_get_current_data(args_arr->value.ht, (void **) &entry) == FAILURE )
+                continue;
+
+            if ( entry->type != IS_STRING )
+                convert_to_string(entry);
+
+            argv[i] = estrdup(entry->value.str.val);
+
+            if ( i < argc )
+                _php3_hash_move_forward(args_arr->value.ht);
+        }
+  
+        optind = 0;  opterr = 0;
+
+        if ( rrd_create(argc-1, &argv[1]) != -1 )
+        {
+            RETVAL_TRUE;
+        }
+        else
+        {
+            RETVAL_FALSE;
+        }
+        for (i = 1; i < argc; i++)
+            efree(argv[i]);
+
+        efree(argv);
+    }
+    else
+    {
+        WRONG_PARAM_COUNT;
+    }
+    return;
+}
+/* }}} */
+
+
+
+/* {{{ proto mixed rrd_graph(string file, array args_arr, int argc)
+   Creates a graph based on options passed via an array */
+
+void php3_rrd_graph(INTERNAL_FUNCTION_PARAMETERS)
+{
+    pval *file, *args_arr, *p_argc;
+    pval *entry, p_calcpr;
+    int i, xsize, ysize, argc;
+    char **argv, **calcpr;
+    
+    if ( rrd_test_error() )
+        rrd_clear_error();
+    
+    if ( ARG_COUNT(ht) == 3 && 
+         getParameters(ht, 3, &file, &args_arr, &p_argc) == SUCCESS)
+    {
+        if ( args_arr->type != IS_ARRAY )
+        { 
+            php3_error(E_WARNING, "2nd Variable passed to rrd_graph is not an array!\n");
+            RETURN_FALSE;
+        }
+        
+        convert_to_long(p_argc);
+        convert_to_string(file);
+
+        argc = p_argc->value.lval + 3;
+        argv = (char **) emalloc(argc * sizeof(char *));
+ 
+        argv[0] = "dummy";
+        argv[1] = estrdup("graph");
+        argv[2] = estrdup(file->value.str.val);
+
+        for (i = 3; i < argc; i++) 
+        {
+            if ( _php3_hash_get_current_data(args_arr->value.ht, (void **) &entry) == FAILURE 
+                 || entry->type != IS_STRING )
+            {  
+                continue;
+            }
+            argv[i] = estrdup(entry->value.str.val);
+
+            if ( i < argc )
+                _php3_hash_move_forward(args_arr->value.ht);
+        }
+   
+        optind = 0; opterr = 0; 
+        if ( rrd_graph(argc-1, &argv[1], &calcpr, &xsize, &ysize) != -1 )
+        {
+            array_init(return_value);
+            add_assoc_long(return_value, "xsize", xsize);
+            add_assoc_long(return_value, "ysize", ysize);
+
+            array_init(&p_calcpr);
+    
+            if (calcpr)
+            {
+                for (i = 0; calcpr[i]; i++)
+                {
+                    add_next_index_string(&p_calcpr, calcpr[i], 1);
+                    free(calcpr[i]);
+                }
+                free(calcpr);
+            }
+            _php3_hash_update(return_value->value.ht, "calcpr", sizeof("calcpr"), 
+                              &p_calcpr, sizeof(pval), NULL);
+        }
+        else
+        {
+            RETVAL_FALSE;
+        }
+        for (i = 1; i < argc; i++)
+            efree(argv[i]);
+
+        efree(argv);
+    }
+    else
+    { 
+        WRONG_PARAM_COUNT;
+    }
+    return;
+}
+/* }}} */
+
+
+
+/* {{{ proto mixed rrd_fetch(string file, array args_arr, int p_argc)
+   Fetch info from an RRD file */
+
+void php3_rrd_fetch(INTERNAL_FUNCTION_PARAMETERS)
+{
+    pval *file, *args_arr, *p_argc;
+    pval *entry;
+    pval *p_start, *p_end, *p_step, *p_ds_cnt, p_ds_namv, p_data;
+    int i, argc;
+    time_t start, end;
+    unsigned long step, ds_cnt;
+    char **argv, **ds_namv; 
+    rrd_value_t *data, *datap;
+    
+    if ( rrd_test_error() )
+        rrd_clear_error();
+    
+    if ( ARG_COUNT(ht) == 3 && 
+         getParameters(ht, 3, &file, &args_arr, &p_argc) == SUCCESS)
+    {
+        if ( args_arr->type != IS_ARRAY )
+        { 
+            php3_error(E_WARNING, "2nd Variable passed to rrd_fetch is not an array!\n");
+            RETURN_FALSE;
+        }
+        
+        convert_to_long(p_argc);
+        convert_to_string(file);
+
+        argc = p_argc->value.lval + 3;
+        argv = (char **) emalloc(argc * sizeof(char *));
+ 
+        argv[0] = "dummy";
+        argv[1] = estrdup("fetch");
+        argv[2] = estrdup(file->value.str.val);
+
+        for (i = 3; i < argc; i++) 
+        {
+            if ( _php3_hash_get_current_data(args_arr->value.ht, (void **) &entry) == FAILURE 
+                 || entry->type != IS_STRING )
+            {  
+                continue;
+            }
+            argv[i] = estrdup(entry->value.str.val);
+
+            if ( i < argc )
+                _php3_hash_move_forward(args_arr->value.ht);
+        }
+  
+        optind = 0; opterr = 0; 
+
+        if ( rrd_fetch(argc-1, &argv[1], &start,&end,&step,&ds_cnt,&ds_namv,&data) != -1 )
+        {
+            array_init(return_value);
+            add_assoc_long(return_value, "start", start);
+            add_assoc_long(return_value, "end", end);
+            add_assoc_long(return_value, "step", step);
+            add_assoc_long(return_value, "ds_cnt", ds_cnt);
+
+            array_init(&p_ds_namv);
+            array_init(&p_data);
+   
+            if (ds_namv)
+            {
+                for (i = 0; i < ds_cnt; i++)
+                {
+                    add_next_index_string(&p_ds_namv, ds_namv[i], 1);
+                    free(ds_namv[i]);
+                }
+                free(ds_namv);
+            }
+
+            if (data)
+            {
+                datap = data;
+ 
+                for (i = start; i <= end; i += step)
+                    add_next_index_double(&p_data, *(datap++));
+ 
+                free(data);
+            }
+
+            _php3_hash_update(return_value->value.ht, "ds_namv", sizeof("ds_namv"), 
+                              &p_ds_namv, sizeof(pval), NULL);
+            _php3_hash_update(return_value->value.ht, "data", sizeof("data"), 
+                              &p_data, sizeof(pval), NULL);
+        }
+        else
+        {
+            RETVAL_FALSE;
+        }
+        for (i = 1; i < argc; i++)
+            efree(argv[i]);
+
+        efree(argv);
+    }
+    else
+    { 
+        WRONG_PARAM_COUNT;
+    }
+    return;
+}
+/* }}} */
+
+
+function_entry rrdtool_functions[] = {
+        {"rrd_error", php3_rrd_error, NULL},
+        {"rrd_clear_error", php3_rrd_clear_error, NULL},
+	{"rrd_graph", php3_rrd_graph, NULL},
+	{"rrd_last", php3_rrd_last, NULL},
+	{"rrd_fetch", php3_rrd_fetch, NULL},
+        {"rrd_update", php3_rrd_update, NULL},
+        {"rrd_create", php3_rrd_create, NULL},
+	{NULL, NULL, NULL}
+};
+
+
+php3_module_entry rrdtool_module_entry = {
+	"RRDTool", rrdtool_functions, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL
+};
+
+php3_module_entry *get_module(void) { return &rrdtool_module_entry; }

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/USAGE
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/USAGE	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/USAGE	Sat Jul 13 21:26:01 2002
@@ -0,0 +1,156 @@
+--------------------------------------------------
+Usage:
+
+
+  To use the 'php3_rrdtool.so' module, you need to load it in your
+PHP script before you call any of the rrd_* functions.
+
+This can be achieved with a simple command:
+
+    <?   dl("/path/to/php3_rrdtool.so");  ?>
+
+After this is loaded, you have access to all the rrd_* commands 
+contained in 'php3_rrdtool.so'.
+
+
+
+API:
+
+--------------------------------------------------------------------
+string rrd_error()
+
+	rrd_error takes no arguments.
+
+	Use this function to retrieve the error message from
+the last rrd_* function that was called and failed.
+
+	If an error was set, a string will be returned.  
+
+	If no error was set, a blank string will be returned.
+
+
+
+
+--------------------------------------------------------------------
+int rrd_last(string filename)
+
+	rrd_last takes only one argument, a filename of an RRD
+file.  
+
+	If rrd_last is successful in obtaining the last modifiation
+time of the file, a date will be returned in the form of the
+number of seconds from the unix epoch (Jan 1, 1970, 00:00:00).
+You can then use any of php's excellent time functions on this
+value.
+
+	If rrd_last is not sucessful, a value of 0 will be returned,
+and the internal rrd error will be set.  You can access this error
+message via the rrd_error() function (if one was set).
+ 
+
+--------------------------------------------------------------------
+int rrd_update(string filename, string options)
+
+	rrd_update takes 2 arguments, a filename of an RRD file
+and a string with options to fill the RRD file with.
+
+	It has been designed to work similary to the rrd_update
+call in the RRDs perl library.
+
+Example:  $result = rrd_update("/some.rrd", "N:123:9873:235");
+ 
+	If rrd_update is successful, 1 is returned. 
+
+	If rrd_update is not successful, 0 is returned, and an
+error message should be obtainable by called 'rrd_error()'.
+
+
+--------------------------------------------------------------------
+int rrd_create(string filename, array options, int num_of_elements)
+
+	rrd_create takes 3 arguments, a filename of an RRD file to
+create, an array of options (exactly like you would pass in the RRDs 
+perl library, or on the command line to 'rrdtool'), and the last 
+argument is the number of elements in the array of options.  This 
+can be obtained by simply calling " count($opt_array) ".  See the 
+example scripts for a more clear example.
+
+	If rrd_update is successful, 1 is returned. 
+
+	If rrd_update is not successful, 0 is returned, and an
+error message should be obtainable by called 'rrd_error()'.
+
+
+
+--------------------------------------------------------------------
+mixed rrd_graph(string filename, array options, int num_of_elements) 
+
+	rrd_graph takes 3 arguments, a filename of an RRD file,
+an array of options (exactly like you would pass in the RRDs perl
+library, or on the command line to 'rrdtool'), and the last argument
+is the number of elements in the array of options.  This can be 
+obtained by simply calling " count($opt_array) ".  See the example
+scripts for a more clear example.
+
+
+	If rrd_graph is successful, an array is returned.  The
+array is an associate array with 3 values:
+
+$array[xsize]  -  The size of the image along the X axis.
+$array[ysize]  -  The size of the image along the Y axis.
+$array[calcpr] -  This is actually another array, that will contain
+                  the results of any PRINT statements.
+
+
+	If rrd_graph is not successful, a 0 is returned.
+
+IMPORTANT NOTE:  In order for php not to complain about mis-using
+the return value, it is important that you check the type of the
+return value.  use the " is_array() " function to check if the 
+returned value is an array (in which case rrd_graph was successful),
+or not an array (meaning rrd_graph was NOT successful).  See the
+examples for an illustration of this.
+
+
+--------------------------------------------------------------------
+mixed rrd_fetch(string filename, array options, int num_of_elements) 
+
+	rrd_fetch takes 3 arguments, a filename of an RRD file,
+an array of options (exactly like you would pass in the RRDs perl
+library, or on the command line to 'rrdtool'), and the last argument
+is the number of elements in the array of options.  This can be 
+obtained by simply calling " count($opt_array) ".  See the example
+scripts for a more clear example.
+
+
+	If rrd_fetch is successful, an array is returned.  The
+array is an associate array with 5 values:
+
+$array[start]   -  This is the start time of the data returned 
+                   (unix epoch timestamp format)
+$array[end]     -  This is the end time of the data returned
+                   (unix epoch timestamp format)
+$array[step]    -  This is the step interval of the data returned,
+                   in number of seconds.
+$array[ds_cnt]  -  This is the number of DS's returned from the
+                   RRD file.
+$array[ds_namv] -  This is an array with the names of the DS's
+                   returned from the RRD file.
+$array[data]    -  This is an array with all the values fetch'd
+                   from the rrd file by rrd_fetch.
+
+(This is very similar to the way rrd_fetch() in the RRDs
+perl library works, as well as the C function rrd_fetch()).
+
+	If rrd_fetch is not successful, a 0 is returned.
+
+IMPORTANT NOTE:  In order for php not to complain about mis-using
+the return value, it is important that you check the type of the
+return value.  use the " is_array() " function to check if the 
+returned value is an array (in which case rrd_fetch was successful),
+or not an array (meaning rrd_fetch was NOT successful).  See the
+examples for an illustration of this.
+
+
+--------------------------------------------------------------------
+

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/VERSION
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/VERSION	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/VERSION	Sat Jul 13 21:26:02 2002
@@ -0,0 +1 @@
+0.9.0

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/php3_rrdtool.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/php3_rrdtool.h	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/php3_rrdtool.h	Sat Jul 13 21:26:02 2002
@@ -0,0 +1,31 @@
+#ifndef _PHP3_RRDTOOL_H
+#define _PHP3_RRDTOOL_H
+
+#if COMPILE_DL
+#undef HAVE_RRDTOOL
+#define HAVE_RRDTOOL 1
+#endif
+#ifndef DLEXPORT
+#define DLEXPORT
+#endif
+
+#if HAVE_RRDTOOL
+
+extern php3_module_entry rrdtool_module_entry;
+#define snmp_module_ptr &rrdtool_module_entry
+
+extern DLEXPORT void php3_rrd_error(INTERNAL_FUNCTION_PARAMETERS);
+extern DLEXPORT void php3_rrd_clear_error(INTERNAL_FUNCTION_PARAMETERS);
+extern DLEXPORT void php3_rrd_update(INTERNAL_FUNCTION_PARAMETERS);
+extern DLEXPORT void php3_rrd_last(INTERNAL_FUNCTION_PARAMETERS);
+extern DLEXPORT void php3_rrd_create(INTERNAL_FUNCTION_PARAMETERS);
+extern DLEXPORT void php3_rrd_graph(INTERNAL_FUNCTION_PARAMETERS);
+extern DLEXPORT void php3_rrd_fetch(INTERNAL_FUNCTION_PARAMETERS);
+
+#else
+
+#define rrdtool_module_ptr NULL
+
+#endif /* HAVE_RRDTOOL */
+
+#endif  /* _PHP3_RRDTOOL_H */

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/INSTALL
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/INSTALL	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/INSTALL	Sat Jul 13 21:26:02 2002
@@ -0,0 +1,16 @@
+Installation:
+
+  You'll want to have the following sources available somewhere:
+        php
+        rrdtool
+        apache (if you built php as a DSO)
+
+  Edit the *INCLUDE and *LIB variables in the Makefile to indicate
+the correct locations for your files.
+
+  After php3_rrdtool.so builds correctly, copy this file to wherever
+you'd like.  Possibly APACHE_ROOT/libexec/ .
+
+
+
+After you install, you should probably read README and API.

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/Makefile
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/Makefile	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/Makefile	Sat Jul 13 21:26:02 2002
@@ -0,0 +1,72 @@
+# code by Joey Miller <joeym at inficad.com>
+#
+#
+# BEFORE COMPILING YOU MUST SET THE VARIABLES BELOW
+# TO INDICATE THE CORRECT DIRECTORIES!!!!!!!!!!!!!!!!!!!!!
+#
+#
+# USE AT YOUR OWN RISK!
+#
+
+## begin configurable vars
+
+## PHPINCLUDE -- the directory where php is untarred
+##
+PHPINCLUDE =  -I/usr/home/joeym/apache_build/php-3.0.14
+
+## PHPLIBS -- the directory where you can find some of the PHP objects
+## and compiled libs (the directory where php is untarred, and
+## has already been compiled!
+##
+PHPLIBS    =  /usr/home/joeym/apache_build/php-3.0.14
+
+## RRDINCLUDE, GDINCLUDE -- where to find some of the header
+## files needed by rrdtool and it's libs
+##
+RRDINCLUDE =  -I/usr/home/joeym/newshit/rrdtool-1.0.10/src
+GDINCLUDE  =  -I/usr/home/joeym/newshit/rrdtool-1.0.10/gd1.3
+
+## RRDLIB -- where to find librrd.a (usually /usr/local/rrdtool-1.0.10/lib)
+RRDLIB	   =	/usr/local/rrdtool-1.0.10/lib
+
+#
+# if php is compiled as an apache module
+#
+APACHEINC = -I/var/www/include
+
+
+
+###### end primary config vars  .. change the vars below only
+###### if you need to
+######
+
+
+
+
+CFLAGS	= -O -fpic
+CC	= gcc
+
+CXX	= g++
+CXXFLAGS= $(CFLAGS)
+
+LD	= cc
+LDFLAGS	= -shared
+
+RM	= /bin/rm
+
+OBJS    =  php3_rrdtool.o
+CFLAGS	:= $(CFLAGS) -I../lib $(PHPINCLUDE) $(APACHEINC) $(RRDINCLUDE) $(GDINCLUDE)
+CXXFLAGS:= $(CXXFLAGS) -I../lib $(PHPINCLUDE) $(APACHEINC) $(RRDINCLUDE) $(GDINCLUDE)
+LIBS	:= -L$(RRDLIB) -L$(PHPLIBS) -lrrd 
+
+all: php3_rrdtool.so
+
+php3_rrdtool.so: $(OBJS)
+	$(LD) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
+
+clean:
+	$(RM) *.o
+	$(RM) *.so
+	
+veryclean: clean
+	$(RM) *~

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/README
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/README	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/README	Sat Jul 13 21:26:02 2002
@@ -0,0 +1,43 @@
+
+PHP bindings for RRD Tool.
+
+	Contained herein are bindings to allow you to interface
+php scripts with RRD tool directly via RRD tool's 'librrd' library,
+thus avoiding the need to use system() calls to the rrdtool binary.
+
+	RRD Tool is an AMAZING package of tools to faciliate
+the easy storage, retrieval, and graphing of statistics (usually
+but not limited to bit/byte counts from routers, switches, and 
+hubs).  It was written by the author of MRTG, Tobias Oetiker
+(oetiker at ee.ethz.ch).  The primary web site for RRD Tool is:
+http://www.caida.org/Tools/RRDtool
+
+
+Reason I wrote this:  Wanted to use PHP to create fairly real-time / 
+dynamic web pages w/ RRD tool, but the only way was to use system()
+and popen() with PHP, since there was no direct interface to RRD
+Tool from PHP.  The fork()ing would have been slow and tedious
+so that was pretty much out of the question.  I could have used the 
+Perl library (RRDs) to interface ePerl, or mod_perl, or even 
+'rrdcgi', but I didn't really want to.  I wanted to use PHP and
+there was nothing to change my mind.
+
+
+You are free to redistribute the source provided my name is
+kept at the top of the source files as credit for the original
+author.  I make no warranties to the usability of this software,
+nor I am responsible if your machine explodes (although it 
+shouldn't).
+
+
+BUGS:
+     There might be some.  Let me know: joeym at inficad.com.  
+Patches to fix bugs you find are more welcome than simple
+reports of bugs (I don't have a lot of time to maintain
+this code).
+
+
+http://netmon.inficad.com/php3_rrdtool/
+
+Joey Miller, <joeym at inficad.com>, SkyLynx / Inficad Communications,
+2/12/2000

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_update.php
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_update.php	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_update.php	Sat Jul 13 21:26:03 2002
@@ -0,0 +1,19 @@
+<?
+
+ dl("/tmp/php3_rrdtool.so");
+
+ ##
+ ## demonstration of the rrd_update() command
+ ##
+
+  $ret = rrd_update("/some/file.rrd", "N:1245:98344");
+
+  if ( $ret == -1 )
+  {
+      $err = rrd_error();
+      echo "ERROR occurred: $err\n";
+  }
+ /* else rrd_update() was successful */
+
+
+?>

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_last.php
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_last.php	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_last.php	Sat Jul 13 21:26:03 2002
@@ -0,0 +1,22 @@
+<?
+
+ dl("/tmp/php3_rrdtool.so");
+
+ ##
+ ## demonstration of the rrd_last() command
+ ##
+
+ $ret = rrd_last("/some/path/some-router-fe2.rrd");
+
+ if ( $ret != - 1 )
+ {
+     printf("Last update time:  %s\n", strftime("%m/%d/%Y %H:%M:%S");
+ }
+ else
+ {
+     $err_msg = rrd_error();
+     echo "Error occurred:  $err_msg\n";
+ }
+
+
+?>

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_create.php
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_create.php	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_create.php	Sat Jul 13 21:26:03 2002
@@ -0,0 +1,27 @@
+<?
+
+ dl("/tmp/php3_rrdtool.so");
+
+ ##
+ ## demonstration of the rrd_create() command
+ ##
+
+  $_opts = array( "--step", "300", "--start", 0,
+                 "DS:input:COUNTER:900:0:U",
+                 "DS:output:COUNTER:900:0:U",
+                 "RRA:AVERAGE:0.5:1:1000",
+                 "RRA:MIN:0.5:1:1000",
+                 "RRA:MAX:0.5:1:1000"
+               );
+
+  $ret = rrd_create("/tmp/test.rrd", $_opts, count($_opts));
+
+  if ( $ret == -1 )
+  {
+      $err = rrd_error();
+      echo "Create error: $err\n";
+  }
+  /*  else rrd_create was successful  */
+
+
+?>

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_fetch.php
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_fetch.php	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_fetch.php	Sat Jul 13 21:26:03 2002
@@ -0,0 +1,51 @@
+<?
+
+ dl("/tmp/php3_rrdtool.so");
+
+ ##
+ ## demonstration of the rrd_fetch() command
+ ##
+
+
+
+  $opts = array ( "AVERAGE", "--start", "-1h" );
+
+  $ret = rrd_fetch("/dir/router-port2.rrd", $opts, count($opts));
+ 
+  ##
+  ## if $ret is an array, rrd_fetch() succeeded
+  ## 
+  if ( is_array($ret) )
+  {
+      echo "Start time    (epoch): $ret[start]\n";
+      echo "End time      (epoch): $ret[end]\n";
+      echo "Step interval (epoch): $ret[step]\n";
+
+      ##
+      ## names of the DS's (data sources) will be 
+      ## contained in the array $ret[ds_namv][..]
+      ##
+      for($i = 0; $i < count($ret[ds_namv]); $i++)
+      {
+          $tmp = $ret[ds_namv][$i];
+          echo "$tmp \n";
+      }
+
+      ##
+      ## all data will be packed into the
+      ## $ret[data][..]  array
+      ##
+      for($i = 0; $i < count($ret[data]); $i++)
+      {
+          $tmp = $ret[data][$i];
+          echo "$hi\n";
+      }
+  }
+  else
+  {
+      $err = rrd_error();
+      echo "fetch() ERROR: $err\n";
+  }
+
+
+?>

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_graph.php
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_graph.php	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php3/examples/rrd_graph.php	Sat Jul 13 21:26:03 2002
@@ -0,0 +1,43 @@
+<?
+
+ dl("/tmp/php3_rrdtool.so");
+
+ ##
+ ## demonstration of the rrd_graph() command
+ ##
+
+   $opts = array( "--start", "-4d", 
+                  "DEF:in=/dir/router-port2.rrd:input:AVERAGE",
+                  "DEF:out=/dir/router-port2.rrd:output:AVERAGE",
+                  "LINE2:in#0000ff:Incoming Traffic Avg.",
+                  "PRINT:in:AVERAGE:incoming\: %1.2lf b/s",
+                  "PRINT:in:AVERAGE:incoming2\: %1.2lf b/s"
+                );
+
+
+   $ret = rrd_graph("/some-dir/router-port2.gif", $opts, count($opts));
+
+   ##
+   ## if $ret is an array, then rrd_graph was successful
+   ##
+   if ( is_array($ret) )
+   {
+       echo "Image size:  $ret[xsize] x $ret[ysize]\n";
+       
+
+       ##
+       ## all results from any PRINT commands will be
+       ## in the array $ret[calcpr][..]
+       ##
+       echo "rrd_graph1 print results: \n";
+
+       for ($i = 0; $i < count($ret[calcpr]); $i++)
+           echo $ret[calcpr][$i] . "\n";
+   }
+   else
+   {
+       $err = rrd_error();
+       echo "rrd_graph() ERROR: $err\n";
+   }
+
+?>

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/log2rrd/log2rrd.pl
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/log2rrd/log2rrd.pl	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/log2rrd/log2rrd.pl	Sat Jul 13 21:26:04 2002
@@ -0,0 +1,231 @@
+#! /usr/sepp/bin/perl
+#
+# Log 2 RRD.  This script translates a MRTG 2.x log file
+# into a RRD archive.  The original version was written by
+# Wrolf Courtney <wrolf at concentric.net> and
+# Russ Wright <wright at LBL.Gov> with an early test version
+# of RRDTOOL (mrtg-19980526.08) and has been modified to match
+# the parameters of rrdtool version 99.23 by Alan Lichty at
+# Electric Lightwave, Inc. <alichty at eli.net>.
+#
+# this script optimized for being called up by another script
+# that cycles through a list of routers and invokes this for each
+# interface.  It can be run just as easily from a command line for
+# small numbers of logfiles.
+#
+# The RRD we create looks like the following:  Note
+# that we have to use type GAUGE in order to have RRDTOOL
+# populate the new rr archive correctly.  Otherwise RRDTOOL will try 
+# to interpet the data as new octet counts instead of existing
+# data rate averages.
+#
+# DS:GAUGE:86400:U:U	        # in counter
+# DS:GAUGE:86400:U:U	        # out counter
+# RRA:AVERAGE:0.5:1:600	        # 5 minute samples
+# RRA:MAX:0.5:1:600		# 5 minute samples
+# RRA:AVERAGE:0.5:6:600	        # 30 minute samples
+# RRA:MAX:0.5:6:600		# 30 minute samples
+# RRA:AVERAGE:0.5:24:600	        # 2 hour samples
+# RRA:MAX:0.5:24:600		# 2 hour samples
+# RRA:AVERAGE:0.5:288:732	# 1 day samples
+# RRA:MAX:0.5:288:732            # 1 day samples
+#
+# 
+
+use English;
+use strict;
+
+require "ctime.pl";
+
+use RRDs;
+
+my $DEBUG=0;
+
+&main;
+
+sub main {
+
+    my($inBytes, $outBytes);
+    my($lastRunDate, $firstRunDate);
+    my($i, $dataFile, $firstRun);
+    my($oldestRun, $lastRun);
+    my($curTime, $oldestTime, $totRec);
+    my($avgIn, $avgOut, $maxIn, $maxOut);
+    my(@lines, @finalRecs);
+    my($RRD, $START, $destDir, $dsType);
+
+#
+# get the logfile name to process
+# the default is to strip out the .log extension and create
+# a new file with the extension .rrd
+#
+
+    $dataFile=$ARGV[0];
+
+    $destDir = $ARGV[1];
+
+#
+# strip off .log from file name - complain and die if no .log
+# in the filename
+#
+
+    if ($dataFile =~ /(.*)\.log$/) {
+	$RRD = "$1";
+    }
+
+    if ($RRD eq "") {
+	printf("Usage: log2rrd [log file] [destination dir]\n");
+	exit;
+    }
+
+#
+# strip out path info (if present) to get at just the filename
+#
+
+    if ($RRD =~ /(.*)\/(.*)$/){
+	$RRD = "$2";
+    }
+
+#
+# add the destination path (if present) and .rrd suffix
+#
+
+    if ($destDir){
+	$RRD = "$destDir/$RRD.rrd";
+
+    }else{
+	$RRD = "$RRD.rrd";
+    }
+
+    open(IN,"$dataFile") || die ("Couldn't open $dataFile");
+
+#
+# Get first line - has most current sample
+#
+
+    $_ = <IN>;
+    chop;
+    ($lastRun, $inBytes, $outBytes) = split;
+    $lastRunDate = &ctime($lastRun);
+    chop $lastRunDate;
+
+    $firstRun = $lastRun;
+    $i=2;
+
+#
+# start w/line 2 and read them into the lines array
+# (2nd line is in position 2)
+#
+    while (<IN>) {
+	chop;
+	$lines[$i++] = $_;
+	($curTime) = split;
+	if ($curTime < $firstRun) {
+	    $firstRun = $curTime;
+	}
+    }
+    close(IN);
+
+#
+#  Let's say source start time is 5 minutes before 1st sample
+#
+
+    $START=$firstRun - 300;
+    print STDERR "\$START = $START\n" if $DEBUG>1;
+
+    $firstRunDate = &ctime($firstRun);
+    chop $firstRunDate;
+
+    printf("Data from $firstRunDate\n       to $lastRunDate\n") if $DEBUG>0;
+
+    $oldestTime=$lastRun;
+#
+# OK- sort through the data and put it in a new array.
+# This gives us a chance to find errors in the log files and
+# handles any overlap of data (there shouldn't be any)
+#
+# NOTE: We start w/ record # 3, not #2 since #2 could be partial
+#
+
+    for ($i=3; $i <= 2533; $i++) {
+
+	($curTime, $avgIn, $avgOut, $maxIn, $maxOut) = split(/\s+/, $lines[$i]);
+
+	if ($curTime < $oldestTime) {
+
+#
+# only add data if older than anything already in array
+# this should always be true, just checking
+#
+
+	    $oldestTime = $curTime;
+	    $finalRecs[$totRec++]=$lines[$i];
+	}
+    }
+
+
+    PopulateRRD($totRec, $RRD, $START, \@finalRecs);
+
+#
+# if you know that most of your MRTG logfiles are using
+# counter data, uncomment the following lines to automatically
+# run rrdtune and change the data type.
+#
+#    my(@tuneparams) = ("$RRD", "-d", "ds0:COUNTER", "-d", "ds1:COUNTER");
+#    RRDs::tune(@tuneparams);
+
+
+}
+
+sub PopulateRRD {
+
+    my($totRec, $RRD, $START, $finalRecs) = @_;
+    my($i, $curTime, $avgIn, $avgOut, $maxIn, $maxOut);
+    my($saveReal, $line);
+    my($createret, $updret);
+
+    print "* Creating RRD $RRD\n\n" if $DEBUG>0;
+
+#
+# We'll create RRAs for both AVG and MAX. MAX isn't currently filled but 
+# may be later
+#
+
+    RRDs::create ("$RRD", "-b", $START, "-s", 300,
+    "DS:ds0:GAUGE:86400:U:U",
+    "DS:ds1:GAUGE:86400:U:U",
+    "RRA:AVERAGE:0.5:1:600",
+    "RRA:MAX:0.5:1:600",
+    "RRA:AVERAGE:0.5:6:600",
+    "RRA:MAX:0.5:6:600",
+    "RRA:AVERAGE:0.5:24:600",
+    "RRA:MAX:0.5:24:600",
+    "RRA:AVERAGE:0.5:288:600",
+    "RRA:MAX:0.5:288:600");
+
+    if (my $error = RRDs::error()) {
+	print "Cannot create $RRD: $error\n";
+    }
+
+
+    print "* Adding entries to $RRD\n\n" if $DEBUG>0;
+
+    for ($i=$totRec - 1; $i >= 0; $i--) {
+
+	($curTime, $avgIn, $avgOut, $maxIn, $maxOut) = split(/\s+/, @$finalRecs[$i]);
+
+        RRDs::update ("$RRD", "$curTime:$avgIn:$avgOut");
+
+	if (my $error = RRDs::error()) {
+	    print "Cannot update $RRD: $error\n";
+	}
+
+  
+# NOTE: Need to add checking on RRDread and include the Max values
+# print status every now and then
+#	print $i if $i % 25 && $DEBUG>0;
+#	print "$i\n";
+
+    }
+
+}

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/log2rrd/Makefile.in

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/log2rrd/Makefile.am

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdproc/Makefile.in

Deleted: trunk/orca/packages/rrdtool-1.0.33/contrib/rrdproc/Makefile.am

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php4/mkinstalldirs
==============================================================================

Added: trunk/orca/packages/rrdtool-1.0.33/contrib/php4/configure
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.33/contrib/php4/configure	(original)
+++ trunk/orca/packages/rrdtool-1.0.33/contrib/php4/configure	Sat Jul 13 21:26:05 2002
@@ -0,0 +1,2281 @@
+#! /bin/sh
+
+
+
+
+  PHP_VAR_SUBST="$PHP_VAR_SUBST EXT_STATIC"
+  
+
+
+  PHP_VAR_SUBST="$PHP_VAR_SUBST EXT_SHARED"
+  
+
+
+  PHP_VAR_SUBST="$PHP_VAR_SUBST EXT_LIBS"
+  
+
+
+  PHP_VAR_SUBST="$PHP_VAR_SUBST EXT_LTLIBS"
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# serial 40 AC_PROG_LIBTOOL
+
+
+
+
+# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+
+
+# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+
+
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+
+
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+
+
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+
+
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+
+
+# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+
+
+
+
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+
+
+# AC_CHECK_LIBM - check for math library
+
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library, adds --enable-ltdl-convenience to
+# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library, and adds --enable-ltdl-install to
+# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+
+
+
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+  --with-php-config=[PATH]"
+ac_default_prefix=
+ac_help="$ac_help
+  --with-rrdtool[=DIR]      Include RRDTool support.  DIR is the rrdtool
+                          install directory."
+ac_help="$ac_help
+  --enable-shared[=PKGS]  build shared libraries [default=yes]"
+ac_help="$ac_help
+  --enable-static[=PKGS]  build static libraries [default=yes]"
+ac_help="$ac_help
+  --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
+ac_help="$ac_help
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
+ac_help="$ac_help
+  --disable-libtool-lock  avoid locking (might break parallel builds)"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.13"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=Makefile.in
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi at caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='	'
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+
+
+abs_srcdir=`(cd $srcdir && pwd)`
+
+php_always_shared=yes
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:662: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:692: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_prog_rejected=no
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+	continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:743: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:775: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 786 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ac_cv_prog_cc_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:817: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:822: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
+else
+  ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:850: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+
+if test "x$CC" != xcc; then
+  echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
+echo "configure:883: checking whether $CC and cc understand -c and -o together" >&5
+else
+  echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
+echo "configure:886: checking whether cc understands -c and -o together" >&5
+fi
+set dummy $CC; ac_cc="`echo $2 |
+		       sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
+if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'foo(){}' > conftest.c
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
+if { (eval echo configure:898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+   test -f conftest.o && { (eval echo configure:899: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+      ac_try='cc -c conftest.c -o conftest.o 1>&5'
+      if { (eval echo configure:906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+	 test -f conftest.o && { (eval echo configure:907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+      then
+        # cc works too.
+        :
+      else
+        # cc exists but doesn't like -o.
+        eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f conftest*
+
+fi
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+  cat >> confdefs.h <<\EOF
+#define NO_MINUS_C_MINUS_O 1
+EOF
+
+fi
+
+
+
+  # Check whether --with-php-config or --without-php-config was given.
+if test "${with_php_config+set}" = set; then
+  withval="$with_php_config"
+  
+  PHP_CONFIG=$withval
+
+else
+  
+  PHP_CONFIG=php-config
+
+fi
+
+
+  prefix=`$PHP_CONFIG --prefix 2>/dev/null`
+  INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
+  EXTENSION_DIR=`$PHP_CONFIG --extension-dir`
+ 
+  if test -z "$prefix"; then
+    { echo "configure: error: Cannot find php-config. Please use --with-php-config=PATH" 1>&2; exit 1; }
+  fi
+  echo $ac_n "checking for PHP prefix""... $ac_c" 1>&6
+echo "configure:956: checking for PHP prefix" >&5
+  echo "$ac_t""$prefix" 1>&6
+  echo $ac_n "checking for PHP includes""... $ac_c" 1>&6
+echo "configure:959: checking for PHP includes" >&5
+  echo "$ac_t""$INCLUDES" 1>&6
+  echo $ac_n "checking for PHP extension directory""... $ac_c" 1>&6
+echo "configure:962: checking for PHP extension directory" >&5
+  echo "$ac_t""$EXTENSION_DIR" 1>&6
+
+
+
+
+
+
+
+echo $ac_n "checking for RRDTool support""... $ac_c" 1>&6
+echo "configure:972: checking for RRDTool support" >&5
+# Check whether --with-rrdtool or --without-rrdtool was given.
+if test "${with_rrdtool+set}" = set; then
+  withval="$with_rrdtool"
+  PHP_RRDTOOL=$withval
+else
+  PHP_RRDTOOL=no
+fi
+
+
+case "$PHP_RRDTOOL" in
+shared,*)
+  ext_output="yes, shared"
+  ext_shared=yes
+  PHP_RRDTOOL=`echo $ac_n "$PHP_RRDTOOL$ac_c"|sed s/^shared,//`
+  ;;
+shared)
+  ext_output="yes, shared"
+  ext_shared=yes
+  PHP_RRDTOOL=yes
+  ;;
+no)
+  ext_output="no"
+  ext_shared=no
+  ;;
+*)
+  ext_output="yes"
+  ext_shared=no
+  ;;
+esac
+
+if test "$php_always_shared" = "yes"; then
+  ext_output="yes, shared"
+  ext_shared=yes
+  test "$PHP_RRDTOOL" = "no" && PHP_RRDTOOL=yes
+fi
+
+echo "$ac_t""$ext_output" 1>&6
+
+
+
+
+if test "$PHP_RRDTOOL" != "no"; then
+  for i in /usr/local /usr /opt/rrdtool /usr/local/rrdtool $PHP_RRDTOOL; do
+    if test -f $i/include/rrd.h; then
+      RRDTOOL_DIR=$i
+    fi
+  done
+
+  if test -z "$RRDTOOL_DIR"; then
+    { echo "configure: error: Please reinstall rrdtool" 1>&2; exit 1; }
+  fi
+  
+  if test "$RRDTOOL_DIR/include" != "/usr/include"; then
+    
+  if test -z "$RRDTOOL_DIR/include" || echo "$RRDTOOL_DIR/include" | grep '^/' >/dev/null ; then
+    ai_p="$RRDTOOL_DIR/include"
+  else
+    
+    ep_dir="`echo $RRDTOOL_DIR/include|sed 's%/*[^/][^/]*$%%'`"
+    
+    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+    ai_p="$ep_realdir/`basename \"$RRDTOOL_DIR/include\"`"
+  fi
+
+    
+  
+  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
+  
+  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
+  if test -n "$unique" && test "`eval $cmd`" = "" ; then
+    eval "INCLUDEPATH$unique=set"
+    
+      INCLUDES="$INCLUDES -I$ai_p"
+    
+  fi
+
+  fi
+
+  
+
+  if test "$ext_shared" = "yes"; then
+    RRDTOOL_SHARED_LIBADD="-lrrd $RRDTOOL_SHARED_LIBADD"
+    if test -n "$RRDTOOL_DIR/lib"; then
+      
+  if test "$RRDTOOL_DIR/lib" != "/usr/lib"; then
+    
+  if test -z "$RRDTOOL_DIR/lib" || echo "$RRDTOOL_DIR/lib" | grep '^/' >/dev/null ; then
+    ai_p="$RRDTOOL_DIR/lib"
+  else
+    
+    ep_dir="`echo $RRDTOOL_DIR/lib|sed 's%/*[^/][^/]*$%%'`"
+    
+    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+    ai_p="$ep_realdir/`basename \"$RRDTOOL_DIR/lib\"`"
+  fi
+
+    if test "$ext_shared" = "yes" && test -n "RRDTOOL_SHARED_LIBADD"; then
+      RRDTOOL_SHARED_LIBADD="-R$RRDTOOL_DIR/lib -L$RRDTOOL_DIR/lib $RRDTOOL_SHARED_LIBADD"
+    else
+      
+  
+  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
+  
+  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
+  if test -n "$unique" && test "`eval $cmd`" = "" ; then
+    eval "LIBPATH$unique=set"
+    
+        test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+        LDFLAGS="$LDFLAGS -L$ai_p"
+        PHP_RPATHS="$PHP_RPATHS $ai_p"
+      
+  fi
+
+    fi
+  fi
+
+    fi
+  else
+    
+
+  if test -n "$RRDTOOL_DIR/lib"; then
+    
+  if test "$RRDTOOL_DIR/lib" != "/usr/lib"; then
+    
+  if test -z "$RRDTOOL_DIR/lib" || echo "$RRDTOOL_DIR/lib" | grep '^/' >/dev/null ; then
+    ai_p="$RRDTOOL_DIR/lib"
+  else
+    
+    ep_dir="`echo $RRDTOOL_DIR/lib|sed 's%/*[^/][^/]*$%%'`"
+    
+    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+    ai_p="$ep_realdir/`basename \"$RRDTOOL_DIR/lib\"`"
+  fi
+
+    if test "$ext_shared" = "yes" && test -n ""; then
+      ="-R$RRDTOOL_DIR/lib -L$RRDTOOL_DIR/lib $"
+    else
+      
+  
+  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
+  
+  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
+  if test -n "$unique" && test "`eval $cmd`" = "" ; then
+    eval "LIBPATH$unique=set"
+    
+        test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+        LDFLAGS="$LDFLAGS -L$ai_p"
+        PHP_RPATHS="$PHP_RPATHS $ai_p"
+      
+  fi
+
+    fi
+  fi
+
+  fi
+  
+ case "rrd" in
+ c|c_r|pthread*) ;;
+ *)
+
+   
+  
+  unique=`echo rrd|sed 's/[^a-zA-Z0-9]/_/g'`
+  
+  cmd="echo $ac_n \"\$LIBRARY$unique$ac_c\""
+  if test -n "$unique" && test "`eval $cmd`" = "" ; then
+    eval "LIBRARY$unique=set"
+    
+     
+  LIBS="-lrrd $LIBS"
+
+   
+  fi
+
+
+  ;;
+  esac
+
+
+
+  fi
+
+
+  
+  PHP_VAR_SUBST="$PHP_VAR_SUBST RRDTOOL_SHARED_LIBADD"
+  
+
+
+  cat >> confdefs.h <<\EOF
+#define HAVE_RRDTOOL 1
+EOF
+
+
+  
+  EXT_SUBDIRS="$EXT_SUBDIRS rrdtool"
+  
+  if test -d "$abs_srcdir/ext/rrdtool"; then
+    ext_builddir="ext/rrdtool"
+    ext_srcdir="$abs_srcdir/ext/rrdtool"
+  else
+    ext_builddir="."
+    ext_srcdir="$abs_srcdir"
+  fi
+
+  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
+    
+  lib_makefile="$ext_builddir/libs.mk"
+  lib_target=""
+  
+  $php_shtool mkdir -p $ext_builddir
+  cat >$lib_makefile<<EOF
+LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo)
+LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
+EOF
+
+  if test "" = "shared" || test "" = "yes"; then
+    lib_build_shared=yes
+    if test -n ""; then
+      
+  lib_target="\$(LTLIBRARY_NAME)"
+  cat >>$lib_makefile<<EOF
+\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
+	\$(SHARED_LIBTOOL) --mode=link \$(CCLD) \$(CFLAGS) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
+
+EOF
+
+    else
+      
+  lib_target="\$(LTLIBRARY_SHARED_NAME)"
+  cat >>$lib_makefile<<EOF
+\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
+	\$(SHARED_LIBTOOL) --mode=link \$(CCLD) \$(CFLAGS) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
+	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)
+
+EOF
+
+    fi
+  else
+    
+  lib_target="\$(LTLIBRARY_NAME)"
+  cat >>$lib_makefile<<EOF
+\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
+	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)
+
+EOF
+
+  fi
+
+  if test -n "$lib_target"; then
+    cat >>$lib_makefile<<EOF
+targets = $lib_target
+EOF
+  fi
+
+    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/librrdtool.la"
+