From: Sebastian Harl Date: Tue, 7 Apr 2009 12:39:21 +0000 (+0200) Subject: Imported upstream version 1.3.7. X-Git-Tag: debian/1.3.7-1~14^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1559397b94b4af3de73cfa23c04be31d8bee53e7;p=pkg-rrdtool.git Imported upstream version 1.3.7. --- diff --git a/CHANGES b/CHANGES index e6f80e6..3f00988 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,411 @@ +2009-04-07 07:31 oetiker + + * branches/1.3/program/bindings/perl-piped/RRDp.pm, + branches/1.3/program/bindings/perl-shared/RRDs.pm, + branches/1.3/program/configure.ac, + branches/1.3/program/doc/rrdbuild.pod, + branches/1.3/program/rrdtool.spec, + branches/1.3/program/src/pngsize.c, + branches/1.3/program/src/rrd.h, + branches/1.3/program/src/rrd_cgi.c, + branches/1.3/program/src/rrd_create.c, + branches/1.3/program/src/rrd_datalang.c, + branches/1.3/program/src/rrd_diff.c, + branches/1.3/program/src/rrd_dump.c, + branches/1.3/program/src/rrd_error.c, + branches/1.3/program/src/rrd_fetch.c, + branches/1.3/program/src/rrd_first.c, + branches/1.3/program/src/rrd_format.c, + branches/1.3/program/src/rrd_format.h, + branches/1.3/program/src/rrd_gfx.c, + branches/1.3/program/src/rrd_graph.c, + branches/1.3/program/src/rrd_graph_helper.c, + branches/1.3/program/src/rrd_hw.c, + branches/1.3/program/src/rrd_hw.h, + branches/1.3/program/src/rrd_i18n.h, + branches/1.3/program/src/rrd_info.c, + branches/1.3/program/src/rrd_is_thread_safe.h, + branches/1.3/program/src/rrd_last.c, + branches/1.3/program/src/rrd_lastupdate.c, + branches/1.3/program/src/rrd_not_thread_safe.c, + branches/1.3/program/src/rrd_open.c, + branches/1.3/program/src/rrd_resize.c, + branches/1.3/program/src/rrd_restore.c, + branches/1.3/program/src/rrd_rpncalc.c, + branches/1.3/program/src/rrd_rpncalc.h, + branches/1.3/program/src/rrd_thread_safe.c, + branches/1.3/program/src/rrd_thread_safe_nt.c, + branches/1.3/program/src/rrd_tool.c, + branches/1.3/program/src/rrd_tool.h, + branches/1.3/program/src/rrd_tune.c, + branches/1.3/program/src/rrd_update.c, + branches/1.3/program/src/rrd_version.c, + branches/1.3/program/src/rrd_xport.c, + branches/1.3/program/src/rrd_xport.h, + branches/1.3/program/src/rrdupdate.c: prepare for the release of + rrdtool-1.3.7 + +2009-04-07 07:25 oetiker + + * branches/1.3/website/.htaccess, + branches/1.3/website/gallery/index.en.html, + branches/1.3/website/gallery/miszek.xml, + branches/1.3/website/inc/template.inc, + branches/1.3/website/rrdworld/index.wml, + branches/1.3/website/rrdworld/tacLOG_RRD.png, + branches/1.3/website/rrdworld/tacLOG_RRD.xml, + branches/1.3/website/site-sync: sync up + +2009-04-07 07:23 oetiker + + * branches/1.3/program/doc/rrdbuild.pod: fix build docs + +2009-04-07 07:21 oetiker + + * branches/1.3/program/m4: provide have m4 macros go here + +2009-04-07 07:20 oetiker + + * branches/1.3/program/configure.ac: set helper directory + +2009-04-07 07:20 oetiker + + * branches/1.3/program/src/rrd_graph.c: fix lazy fix ... syntax + error + +2009-04-07 07:19 oetiker + + * branches/1.3/program/Makefile.am: update ACLOCAL flags + +2009-04-07 06:37 oetiker + + * branches/1.3/program/doc/rrdgraph.pod, + branches/1.3/program/src/rrd_graph.c, NEWS, doc/rrdgraph.pod, + src/rrd_graph.c: fix for #213 restore old behaviour of --lazy. + Even in lazy mode all the data calculation elements are run. The + main time saving comes from the fact that the graph is not being + drawn and the image does not have to be compressed. + +2009-04-07 06:03 oetiker + + * branches/1.3/program/src/rrd_dump.c, src/rrd_dump.c: make sure + rrd_dump outputs numbers with C locale so that . does not suddenly + become , this fixes #212 + +2009-04-06 14:12 oetiker + + * branches/1.3/program/src/rrd_update.c, src/rrd_update.c: printf + for time_t with %lli can easily cause a segfault since on many + platforms time_t is only 32bit ... by adding (long long) to the + time value this gets fixed. + +2009-03-21 10:44 oetiker + + * branches/1.3/program/src/rrd_hw.c: removed more rrd_flush + instances + +2009-03-21 09:55 oetiker + + * branches/1.3/program/src/rrd_hw.c: rrd_flush is not necessary here + this used to ba a call to fflush which is something different + anyway. + +2009-03-08 08:02 oetiker + + * branches/1.2/program/WIN32-BUILD-TIPS.txt, + branches/1.2/program/bindings/Makefile.am, + branches/1.2/program/bindings/perl-shared/MANIFEST, + branches/1.2/program/bindings/perl-shared/ntmake-build, + branches/1.2/program/bindings/perl-shared/ntmake.PL, + branches/1.3/program/WIN32-BUILD-TIPS.txt, + branches/1.3/program/bindings/Makefile.am, + branches/1.3/program/bindings/perl-shared/MANIFEST, + branches/1.3/program/bindings/perl-shared/ntmake-build, + branches/1.3/program/bindings/perl-shared/ntmake.PL, + WIN32-BUILD-TIPS.txt, bindings/Makefile.am, + bindings/perl-shared/MANIFEST, bindings/perl-shared/ntmake-build, + bindings/perl-shared/ntmake.PL: Renaming ntmake.pl to ntmake.PL + (r1742) had unforseen side effects. At least on freebsd ntmake.PL + gets called automatically during build. This is not desired. I + renamed the file to ntmake-build sinc it gets called explicilty on + windows anyway. Reported by Kevin modified by Tobi + +2009-03-06 05:51 oetiker + + * branches/1.3/program/src/rrd_xport.c, src/rrd_xport.c: there were + two lines of debug info printed by rrd_xport, messing up the xml + code. Fix by Alejandro Galue. + +2009-03-06 05:40 oetiker + + * branches/1.3/program/configure.ac, + branches/1.3/program/src/rrd_thread_safe.c: Even though POSIX/XSI + requires "strerror_r" to return an "int", some systems (e.g. the + GNU libc) return a "char *" _and_ ignore the second argument (user + provided buffer). The configure script now checks for that + behavior using AC_FUNC_STRERROR_R. rrd_strerror() in + rrd_thread_safe.c has been updated to (hopefully) handle all + possible cases. Previously, rrd_strerror() would have returned + "strerror_r failed. sorry!" in mostly any cases when using glibc, + since "if (strerror_r())" had been used to check for errors which + evaluates to true if a (non-NULL) pointer was returned. Now, we, + at least, return the error number in case anything else fails. + Thanks to Alessandro Iurlano for reporting this issue after + spotting it in collectd . patch by Sebastian + Harl + +2009-02-21 09:46 oetiker + + * branches/1.3/website/rrdworld/index.wml, + branches/1.3/website/rrdworld/observer.png, + branches/1.3/website/rrdworld/observer.xml, + branches/1.3/website/rrdworld/observernms.jpg, + branches/1.3/website/rrdworld/observernms.xml: update observer + entry + +2009-02-21 09:43 oetiker + + * branches/1.2/program/doc/bin_dec_hex.pod, + branches/1.2/program/doc/cdeftutorial.pod, + branches/1.2/program/doc/rrdgraph.pod, + branches/1.2/program/doc/rrdgraph_data.pod, + branches/1.2/program/doc/rrdgraph_examples.pod, + branches/1.2/program/doc/rrdgraph_graph.pod, + branches/1.2/program/doc/rrdgraph_rpn.pod, + branches/1.2/program/doc/rrdresize.pod, + branches/1.2/program/doc/rrdtutorial.es.pod, + branches/1.2/program/doc/rrdtutorial.pod, + branches/1.3/program/doc/bin_dec_hex.pod, + branches/1.3/program/doc/cdeftutorial.pod, + branches/1.3/program/doc/rrdgraph.pod, + branches/1.3/program/doc/rrdgraph_data.pod, + branches/1.3/program/doc/rrdgraph_examples.pod, + branches/1.3/program/doc/rrdgraph_graph.pod, + branches/1.3/program/doc/rrdgraph_rpn.pod, + branches/1.3/program/doc/rrdresize.pod, + branches/1.3/program/doc/rrdtutorial.es.pod, + branches/1.3/program/doc/rrdtutorial.pod, doc/bin_dec_hex.pod, + doc/cdeftutorial.pod, doc/rrdgraph.pod, doc/rrdgraph_data.pod, + doc/rrdgraph_examples.pod, doc/rrdgraph_graph.pod, + doc/rrdgraph_rpn.pod, doc/rrdresize.pod, doc/rrdtutorial.es.pod, + doc/rrdtutorial.pod: Misc documentation fixes by Alex van den + Bogaerdt + +2009-02-21 09:22 oetiker + + * branches/1.3/program/doc/rrdgraph.pod, + branches/1.3/program/doc/rrdgraph_rpn.pod: Documentation fixes by + Bernhard Reutner-Fischer + +2009-01-26 05:59 oetiker + + * branches/1.3/website/inc/design.css: fix css to not mutilate trac + layout + +2009-01-25 22:39 oetiker + + * branches/1.3/program/doc/rrdgraph.pod, doc/rrdgraph.pod: added doc + on new graphv graph_start und graph_end info variables + +2009-01-25 22:02 oetiker + + * branches/1.2/program/src/rrd_dump.c, + branches/1.2/program/src/rrd_first.c, + branches/1.3/program/src/rrd_dump.c, + branches/1.3/program/src/rrd_first.c, + branches/1.3/program/src/rrd_graph.c, src/rrd_dump.c, + src/rrd_first.c, src/rrd_graph.c: fix type conversion error (on + windows) unsigned/signed affecting timestamps on rrd_dump. + +2009-01-25 21:52 oetiker + + * branches/1.2/program/bindings/Makefile.am, + branches/1.2/program/bindings/perl-shared/ntmake.PL, + branches/1.2/program/bindings/perl-shared/ntmake.pl, + branches/1.3/program/bindings/Makefile.am, + branches/1.3/program/bindings/perl-shared/ntmake.PL, + branches/1.3/program/bindings/perl-shared/ntmake.pl, + bindings/Makefile.am, bindings/perl-shared/ntmake.PL, + bindings/perl-shared/ntmake.pl: rename ntmake.pl to ntmake.PL so + that it does not get installed + +2009-01-25 15:49 oetiker + + * branches/1.3/website/download.wml, + branches/1.3/website/gallery/index.wml, + branches/1.3/website/gallery/miszek.png, + branches/1.3/website/gallery/miszek.xml, + branches/1.3/website/index.wml, + branches/1.3/website/rrdworld/index.wml, + branches/1.3/website/rrdworld/lpar2rrd.png, + branches/1.3/website/rrdworld/lpar2rrd.xml, + branches/1.3/website/sponsor.wml: misc web updates + +2009-01-22 15:43 oetiker + + * branches/1.3/program/src/rrd_open.c: Missed to include utime.h. + #207. + +2009-01-19 14:27 oetiker + + * branches/1.3/program/bindings/perl-piped/RRDp.pm, + branches/1.3/program/bindings/perl-shared/RRDs.pm, + branches/1.3/program/configure.ac, + branches/1.3/program/doc/rrdbuild.pod, + branches/1.3/program/rrdtool-1.3-release, + branches/1.3/program/rrdtool.spec, + branches/1.3/program/src/pngsize.c, + branches/1.3/program/src/rrd.h, + branches/1.3/program/src/rrd_cgi.c, + branches/1.3/program/src/rrd_create.c, + branches/1.3/program/src/rrd_datalang.c, + branches/1.3/program/src/rrd_diff.c, + branches/1.3/program/src/rrd_dump.c, + branches/1.3/program/src/rrd_error.c, + branches/1.3/program/src/rrd_fetch.c, + branches/1.3/program/src/rrd_first.c, + branches/1.3/program/src/rrd_format.c, + branches/1.3/program/src/rrd_format.h, + branches/1.3/program/src/rrd_gfx.c, + branches/1.3/program/src/rrd_graph.c, + branches/1.3/program/src/rrd_graph_helper.c, + branches/1.3/program/src/rrd_hw.c, + branches/1.3/program/src/rrd_hw.h, + branches/1.3/program/src/rrd_i18n.h, + branches/1.3/program/src/rrd_info.c, + branches/1.3/program/src/rrd_is_thread_safe.h, + branches/1.3/program/src/rrd_last.c, + branches/1.3/program/src/rrd_lastupdate.c, + branches/1.3/program/src/rrd_not_thread_safe.c, + branches/1.3/program/src/rrd_open.c, + branches/1.3/program/src/rrd_resize.c, + branches/1.3/program/src/rrd_restore.c, + branches/1.3/program/src/rrd_rpncalc.c, + branches/1.3/program/src/rrd_rpncalc.h, + branches/1.3/program/src/rrd_thread_safe.c, + branches/1.3/program/src/rrd_thread_safe_nt.c, + branches/1.3/program/src/rrd_tool.c, + branches/1.3/program/src/rrd_tool.h, + branches/1.3/program/src/rrd_tune.c, + branches/1.3/program/src/rrd_update.c, + branches/1.3/program/src/rrd_version.c, + branches/1.3/program/src/rrd_xport.c, + branches/1.3/program/src/rrd_xport.h, + branches/1.3/program/src/rrdupdate.c: prepare for the release of + rrdtool-1.3.6 + +2009-01-14 08:14 oetiker + + * branches/1.3/program/src/rrd_graph.c, src/rrd_graph.c: In + rrd_graph: the width/height values are written into + rrd_infoval_t's u_cnt but read out of u_int (u_long vs. int). This + breaks on LP64BE. Patch by Rafal Boni rafal pobox.com + +2009-01-09 06:14 oetiker + + * branches/1.3/website/download.wml, + branches/1.3/website/sponsor.wml, + branches/1.3/website/tut/index.wml: added links + +2009-01-06 16:32 oetiker + + * branches/1.3/program/src/rrd_resize.c, src/rrd_resize.c: with MMAP + enabled rrd resize GROW was broken ... this fixes it ... + +2009-01-06 15:45 oetiker + + * branches/1.2/program/src/rrd_graph.c, + branches/1.3/program/src/rrd_graph.c, src/rrd_graph.c: TICK with + negative numbers should 'start from the top of the graph' looking + down ... now it does. + +2009-01-06 14:54 oetiker + + * branches/1.2/program/src/rrd_cgi.c, + branches/1.3/program/src/rrd_cgi.c, src/rrd_cgi.c: fix for + segfault in rrd_cgi: caused by freeing a invalid address when + printing an error message. + +2008-12-26 08:05 oetiker + + * branches/1.3/program/configure.ac, + branches/1.3/program/src/rrd_graph.h, configure.ac, + src/rrd_graph.h: Include libgen.h to get prototype for basename in + a POSIX conformant way. Fix for #202. + +2008-12-26 08:03 oetiker + + * branches/1.3/program/doc/rrdbuild.pod, doc/rrdbuild.pod: + improvements for build docs by Zorzoli, Pablo + +2008-12-22 21:23 oetiker + + * branches/1.3/program/src/rrd_fetch.c, src/rrd_fetch.c: should free + memory after a successful fetch too ... + +2008-12-22 21:23 oetiker + + * branches/1.3/program/bindings/perl-shared/RRDs.pm, + bindings/perl-shared/RRDs.pm: documentation fixes + +2008-12-22 10:25 oetiker + + * branches/1.3/website/logos/asdasd_101x51.png: fixed size + +2008-12-22 07:21 oetiker + + * branches/1.3/program/doc/rrdgraph.pod, doc/rrdgraph.pod: Fix for + POD error by Sebasian Harl + +2008-12-22 07:20 oetiker + + * branches/1.3/program/doc/bin_dec_hex.pod, + branches/1.3/program/doc/rpntutorial.pod, + branches/1.3/program/doc/rrdbuild.pod, + branches/1.3/program/doc/rrdcgi.pod, + branches/1.3/program/doc/rrdgraph-old.pod, + branches/1.3/program/doc/rrdgraph.pod, + branches/1.3/program/doc/rrdgraph_data.pod, + branches/1.3/program/doc/rrdgraph_examples.pod, + branches/1.3/program/doc/rrdgraph_graph.pod, + branches/1.3/program/doc/rrdtool.pod, + branches/1.3/program/doc/rrdtutorial.pod, doc/bin_dec_hex.pod, + doc/rpntutorial.pod, doc/rrdbuild.pod, doc/rrdcgi.pod, + doc/rrdgraph-old.pod, doc/rrdgraph.pod, doc/rrdgraph_data.pod, + doc/rrdgraph_examples.pod, doc/rrdgraph_graph.pod, + doc/rrdgraph_libdbi.pod, doc/rrdtool.pod, doc/rrdtutorial.pod: + Fixes some typos by Sebastian Harl. + +2008-12-19 14:26 oetiker + + * branches/1.3/program/src/Makefile.am, + branches/1.3/program/src/plbasename.c, + branches/1.3/program/src/plbasename.h, + branches/1.3/program/src/rrd_graph.c, + branches/1.3/program/src/rrd_update.c, + branches/1.3/program/win32/rrdlib.vcproj, src/Makefile.am, + src/plbasename.c, src/plbasename.h, src/rrd_graph.c, + src/rrd_update.c, win32/rrdlib.vcproj: win32 fixes by Stefan . + Ludewig . exitgames . com * added portable plbasename since + basename is not available on stock win32 * rrd_update was using %d + to show a timestamp ... %lli is better since it also will show + 64bit time_t correctly. + +2008-12-18 23:56 oetiker + + * branches/1.3/program/Makefile.am, Makefile.am: fix extra dist to + include missing win32 files + +2008-12-18 07:34 oetiker + + * branches/1.3/website/index.wml, + branches/1.3/website/logos/hitmeister.gif, + branches/1.3/website/sponsor.wml: added hitmeister sponsor + +2008-12-16 08:04 oetiker + + * branches/1.3/website/inc/trac.css: special css for trac + 2008-12-15 22:06 oetiker * branches/1.3/program/bindings/perl-piped/RRDp.pm, diff --git a/Makefile.am b/Makefile.am index 7b6595e..b703754 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,4 @@ +ACLOCAL_AMFLAGS = -I m4 ## Process this file with automake to produce Makefile.in RSYNC = rsync --rsh=ssh @@ -13,10 +14,10 @@ SUBDIRS = $(PO) src examples doc bindings # the following files are not mentioned in any other Makefile EXTRA_DIST = COPYRIGHT CHANGES WIN32-BUILD-TIPS.txt TODO CONTRIBUTORS THREADS \ intltool-extract.in intltool-merge.in intltool-update.in \ - rrdtool.spec favicon.ico win32/config.h win32/rrd.dsp \ - win32/rrdlib.vcproj win32/rrd.vcproj win32/rrdtool.dsp win32/rrdtool.dsw \ - win32/rrdtool.vcproj win32/Makefile \ - win32/rrd_config.h.msvc netware/Makefile + rrdtool.spec favicon.ico win32/Makefile win32/config.h \ + win32/rrd.dsp win32/rrd.sln win32/rrd.vcproj \ + win32/rrd_config.h.msvc win32/rrdlib.vcproj win32/rrdtool.dsp \ + win32/rrdtool.dsw win32/rrdtool.vcproj netware/Makefile diff --git a/Makefile.in b/Makefile.in index 180f131..bfb43fc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -293,6 +293,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +ACLOCAL_AMFLAGS = -I m4 RSYNC = rsync --rsh=ssh @BUILD_LIBINTL_FALSE@PO = @@ -301,10 +302,10 @@ RSYNC = rsync --rsh=ssh SUBDIRS = $(PO) src examples doc bindings EXTRA_DIST = COPYRIGHT CHANGES WIN32-BUILD-TIPS.txt TODO CONTRIBUTORS THREADS \ intltool-extract.in intltool-merge.in intltool-update.in \ - rrdtool.spec favicon.ico win32/config.h win32/rrd.dsp \ - win32/rrdlib.vcproj win32/rrd.vcproj win32/rrdtool.dsp win32/rrdtool.dsw \ - win32/rrdtool.vcproj win32/Makefile \ - win32/rrd_config.h.msvc netware/Makefile + rrdtool.spec favicon.ico win32/Makefile win32/config.h \ + win32/rrd.dsp win32/rrd.sln win32/rrd.vcproj \ + win32/rrd_config.h.msvc win32/rrdlib.vcproj win32/rrdtool.dsp \ + win32/rrdtool.dsw win32/rrdtool.vcproj netware/Makefile CLEANFILES = config.cache diff --git a/WIN32-BUILD-TIPS.txt b/WIN32-BUILD-TIPS.txt index 67d2dd9..b3fae96 100644 --- a/WIN32-BUILD-TIPS.txt +++ b/WIN32-BUILD-TIPS.txt @@ -151,7 +151,7 @@ and cd to the bindings\perl-shared subdirectory. (8) Run vcvars32.bat; this batch file, in your vc98\bin directory will set necessary environment options for command line compiling. (9) In bindings\perl-shared, run -perl ntmake.pl +perl ntmake-build nmake nmake test If nmake test succeeds, you are good to go. RRDs.dll is in diff --git a/bindings/Makefile.am b/bindings/Makefile.am index cd5cd21..d975032 100644 --- a/bindings/Makefile.am +++ b/bindings/Makefile.am @@ -8,7 +8,7 @@ SUBDIRS = $(SUB_tcl) # the following files are not mentioned in any other Makefile EXTRA_DIST = perl-piped/MANIFEST perl-piped/README perl-piped/Makefile.PL perl-piped/RRDp.pm perl-piped/t/base.t \ - perl-shared/ntmake.pl perl-shared/MANIFEST perl-shared/README perl-shared/Makefile.PL perl-shared/RRDs.pm perl-shared/RRDs.xs perl-shared/t/base.t \ + perl-shared/ntmake-build perl-shared/MANIFEST perl-shared/README perl-shared/Makefile.PL perl-shared/RRDs.pm perl-shared/RRDs.xs perl-shared/t/base.t \ ruby/CHANGES ruby/README ruby/extconf.rb ruby/main.c ruby/test.rb \ python/ACKNOWLEDGEMENT python/AUTHORS python/COPYING python/README python/rrdtoolmodule.c python/setup.py diff --git a/bindings/Makefile.in b/bindings/Makefile.in index a08bb0f..284d7fa 100644 --- a/bindings/Makefile.in +++ b/bindings/Makefile.in @@ -284,7 +284,7 @@ SUBDIRS = $(SUB_tcl) # the following files are not mentioned in any other Makefile EXTRA_DIST = perl-piped/MANIFEST perl-piped/README perl-piped/Makefile.PL perl-piped/RRDp.pm perl-piped/t/base.t \ - perl-shared/ntmake.pl perl-shared/MANIFEST perl-shared/README perl-shared/Makefile.PL perl-shared/RRDs.pm perl-shared/RRDs.xs perl-shared/t/base.t \ + perl-shared/ntmake-build perl-shared/MANIFEST perl-shared/README perl-shared/Makefile.PL perl-shared/RRDs.pm perl-shared/RRDs.xs perl-shared/t/base.t \ ruby/CHANGES ruby/README ruby/extconf.rb ruby/main.c ruby/test.rb \ python/ACKNOWLEDGEMENT python/AUTHORS python/COPYING python/README python/rrdtoolmodule.c python/setup.py diff --git a/bindings/perl-piped/RRDp.pm b/bindings/perl-piped/RRDp.pm index 618707e..dc79358 100644 --- a/bindings/perl-piped/RRDp.pm +++ b/bindings/perl-piped/RRDp.pm @@ -121,7 +121,7 @@ sub cmd (@); sub end (); sub read (); -$VERSION=1.3005; +$VERSION=1.3007; sub start ($){ croak "rrdtool is already running" diff --git a/bindings/perl-shared/MANIFEST b/bindings/perl-shared/MANIFEST index 664d231..0f30b7e 100644 --- a/bindings/perl-shared/MANIFEST +++ b/bindings/perl-shared/MANIFEST @@ -1,4 +1,4 @@ -ntmake.pl +ntmake-build MANIFEST README Makefile.PL diff --git a/bindings/perl-shared/RRDs.pm b/bindings/perl-shared/RRDs.pm index 0b1958e..c9889d0 100644 --- a/bindings/perl-shared/RRDs.pm +++ b/bindings/perl-shared/RRDs.pm @@ -7,7 +7,7 @@ use vars qw(@ISA $VERSION); require DynaLoader; -$VERSION=1.3005; +$VERSION=1.3007; bootstrap RRDs $VERSION; @@ -38,9 +38,9 @@ RRDs - Access RRDtool as a shared module =head2 Calling Sequence -This module accesses RRDtool functionality directly from within perl. The +This module accesses RRDtool functionality directly from within Perl. The arguments to the functions listed in the SYNOPSIS are explained in the regular -RRDtool documentation. The commandline call +RRDtool documentation. The command line call rrdtool update mydemo.rrd --template in:out N:12:13 @@ -98,7 +98,7 @@ the values of the properties. print "$key = $$hash{$key}\n"; } -B takes the same paramters as B but it returns a +B takes the same parameters as B but it returns a pointer to hash. The hash returned contains meta information about the graph. Like its size as well as the position of the graph area on the image. When calling with and empty filename than the contents of the graph will be @@ -135,8 +135,8 @@ See the examples directory for more ways to use this extension. =head1 NOTE -If you are manipulating the TZ variable you should also call the posixs -function tzset to initialize all internal state of the library for properly +If you are manipulating the TZ variable you should also call the POSIX +function L to initialize all internal state of the library for properly operating in the timezone of your choice. use POSIX qw(tzset); diff --git a/bindings/perl-shared/ntmake-build b/bindings/perl-shared/ntmake-build new file mode 100644 index 0000000..047b76f --- /dev/null +++ b/bindings/perl-shared/ntmake-build @@ -0,0 +1,27 @@ +use ExtUtils::MakeMaker; +use Config; +# See lib/ExtUtils/MakeMaker.pm for details of how to influence +# the contents of the Makefile that is written. +# Run VCVARS32.BAT before generating makefile/compiling. +WriteMakefile( + 'NAME' => 'RRDs', + 'VERSION_FROM' => 'RRDs.pm', +# 'DEFINE' => "-DPERLPATCHLEVEL=$Config{PATCHLEVEL}", +# keep compatible w/ ActiveState 5xx builds + 'DEFINE' => "-DPERLPATCHLEVEL=5", + + 'INC' => '-I../../src/ "-I/Program Files/GnuWin32/include"', +# Since we are now using GnuWin32 libraries dynamically (instead of static +# complile with code redistributed with rrdtool), use /MD instead of /MT. +# Yes, this means we need msvcrt.dll but GnuWin32 dlls already require it +# and it is available on most versions of Windows. + 'OPTIMIZE' => '-O2 -MD', + 'LIBS' => '../../src/release/rrd.lib "/Program Files/GnuWin32/lib/libart_lgpl.lib" "/Program Files/GnuWin32/lib/libz.lib" "/Program Files/GnuWin32/lib/libpng.lib" "/Program Files/GnuWin32/lib/libfreetype.lib"', + 'realclean' => {FILES => 't/demo?.rrd t/demo?.png' }, + ($] ge '5.005') ? ( + 'AUTHOR' => 'Tobias Oetiker (tobi@oetiker.ch)', + 'ABSTRACT' => 'Round Robin Database Tool', + ) : () + + +); diff --git a/bindings/perl-shared/ntmake.pl b/bindings/perl-shared/ntmake.pl deleted file mode 100644 index 047b76f..0000000 --- a/bindings/perl-shared/ntmake.pl +++ /dev/null @@ -1,27 +0,0 @@ -use ExtUtils::MakeMaker; -use Config; -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. -# Run VCVARS32.BAT before generating makefile/compiling. -WriteMakefile( - 'NAME' => 'RRDs', - 'VERSION_FROM' => 'RRDs.pm', -# 'DEFINE' => "-DPERLPATCHLEVEL=$Config{PATCHLEVEL}", -# keep compatible w/ ActiveState 5xx builds - 'DEFINE' => "-DPERLPATCHLEVEL=5", - - 'INC' => '-I../../src/ "-I/Program Files/GnuWin32/include"', -# Since we are now using GnuWin32 libraries dynamically (instead of static -# complile with code redistributed with rrdtool), use /MD instead of /MT. -# Yes, this means we need msvcrt.dll but GnuWin32 dlls already require it -# and it is available on most versions of Windows. - 'OPTIMIZE' => '-O2 -MD', - 'LIBS' => '../../src/release/rrd.lib "/Program Files/GnuWin32/lib/libart_lgpl.lib" "/Program Files/GnuWin32/lib/libz.lib" "/Program Files/GnuWin32/lib/libpng.lib" "/Program Files/GnuWin32/lib/libfreetype.lib"', - 'realclean' => {FILES => 't/demo?.rrd t/demo?.png' }, - ($] ge '5.005') ? ( - 'AUTHOR' => 'Tobias Oetiker (tobi@oetiker.ch)', - 'ABSTRACT' => 'Round Robin Database Tool', - ) : () - - -); diff --git a/configure b/configure index bf3cd23..094d188 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for rrdtool 1.3.5. +# Generated by GNU Autoconf 2.61 for rrdtool 1.3.7. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -726,8 +726,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='rrdtool' PACKAGE_TARNAME='rrdtool' -PACKAGE_VERSION='1.3.5' -PACKAGE_STRING='rrdtool 1.3.5' +PACKAGE_VERSION='1.3.7' +PACKAGE_STRING='rrdtool 1.3.7' PACKAGE_BUGREPORT='' ac_default_prefix=/usr/local/rrdtool-$PACKAGE_VERSION @@ -1513,7 +1513,7 @@ if test "$ac_init_help" = "long"; then # 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 <<_ACEOF -\`configure' configures rrdtool 1.3.5 to adapt to many kinds of systems. +\`configure' configures rrdtool 1.3.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1584,7 +1584,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rrdtool 1.3.5:";; + short | recursive ) echo "Configuration of rrdtool 1.3.7:";; esac cat <<\_ACEOF @@ -1724,7 +1724,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rrdtool configure 1.3.5 +rrdtool configure 1.3.7 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1738,7 +1738,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rrdtool $as_me 1.3.5, which was +It was created by rrdtool $as_me 1.3.7, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2092,10 +2092,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -NUMVERS=1.3005 +NUMVERS=1.3007 -LIBVERS=4:4:0 +LIBVERS=4:6:0 ac_aux_dir= @@ -2541,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='rrdtool' - VERSION='1.3.5' + VERSION='1.3.7' cat >>confdefs.h <<_ACEOF @@ -2712,6 +2712,7 @@ fi + ac_config_headers="$ac_config_headers rrd_config.h" @@ -4874,7 +4875,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4877 "configure"' > conftest.$ac_ext + echo '#line 4878 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7697,11 +7698,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7700: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7701: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7704: \$? = $ac_status" >&5 + echo "$as_me:7705: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7987,11 +7988,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7990: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7991: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7994: \$? = $ac_status" >&5 + echo "$as_me:7995: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8091,11 +8092,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8094: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8095: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8098: \$? = $ac_status" >&5 + echo "$as_me:8099: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10468,7 +10469,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12973: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12976: \$? = $ac_status" >&5 + echo "$as_me:12977: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -13073,11 +13074,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13076: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13077: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13080: \$? = $ac_status" >&5 + echo "$as_me:13081: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14671,11 +14672,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14674: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14675: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14678: \$? = $ac_status" >&5 + echo "$as_me:14679: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14775,11 +14776,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14778: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14779: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14782: \$? = $ac_status" >&5 + echo "$as_me:14783: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16995,11 +16996,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16998: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16999: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17002: \$? = $ac_status" >&5 + echo "$as_me:17003: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17285,11 +17286,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17288: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17289: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17292: \$? = $ac_status" >&5 + echo "$as_me:17293: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17389,11 +17390,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17392: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17393: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17396: \$? = $ac_status" >&5 + echo "$as_me:17397: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -20604,7 +20605,8 @@ fi -for ac_header in features.h sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h + +for ac_header in libgen.h features.h sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -21767,8 +21769,170 @@ esac +for ac_func in tzset fsync mbstowcs opendir readdir chdir chroot getuid setlocale strerror snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* 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 +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +{ echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 +echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strerror_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef strerror_r + (void) strerror_r; +#endif -for ac_func in tzset fsync mbstowcs opendir readdir chdir chroot getuid setlocale strerror strerror_r snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_strerror_r=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_strerror_r=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6; } +if test $ac_cv_have_decl_strerror_r = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R 0 +_ACEOF + + +fi + + + +for ac_func in strerror_r do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -21861,6 +22025,132 @@ _ACEOF fi done +{ echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 +echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6; } +if test "${ac_cv_func_strerror_r_char_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || x; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_func_strerror_r_char_p=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else + # strerror_r is not declared. Choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns `int'. + # This test should segfault on the DEC system. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + extern char *strerror_r (); +int +main () +{ +char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + return ! isalpha (x); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strerror_r_char_p=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 +echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STRERROR_R_CHAR_P 1 +_ACEOF + +fi + case $TERM in @@ -33240,7 +33530,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rrdtool $as_me 1.3.5, which was +This file was extended by rrdtool $as_me 1.3.7, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33293,7 +33583,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -rrdtool config.status 1.3.5 +rrdtool config.status 1.3.7 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index a700831..496841f 100644 --- a/configure.ac +++ b/configure.ac @@ -9,14 +9,14 @@ dnl tell automake the this script is for rrdtool dnl the official version number is dnl a.b.c -AC_INIT([rrdtool],[1.3.5]) +AC_INIT([rrdtool],[1.3.7]) dnl for testing a numberical version number comes handy dnl the released version are dnl a.bccc dnl the devel versions will be something like dnl a.b999yymmddhh -NUMVERS=1.3005 +NUMVERS=1.3007 AC_SUBST(NUMVERS) dnl for the linker to understand which versions the library are compatible with @@ -27,13 +27,14 @@ dnl - if any functionality was removed do c++,r=0,a=0. dnl dnl see http://sourceware.org/autobook/autobook/autobook_91.html dnl -LIBVERS=4:4:0 +LIBVERS=4:6:0 AC_SUBST(LIBVERS) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE AM_MAINTAINER_MODE +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([rrd_config.h]) dnl all our local stuff like install scripts and include files @@ -160,7 +161,7 @@ CONFIGURE_PART(Checking for Header Files) dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT -AC_CHECK_HEADERS(features.h sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h) +AC_CHECK_HEADERS(libgen.h features.h sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -187,7 +188,9 @@ AC_C_BIGENDIAN dnl for each function found we get a definition in config.h dnl of the form HAVE_FUNCTION -AC_CHECK_FUNCS(tzset fsync mbstowcs opendir readdir chdir chroot getuid setlocale strerror strerror_r snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday) +AC_CHECK_FUNCS(tzset fsync mbstowcs opendir readdir chdir chroot getuid setlocale strerror snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday) + +AC_FUNC_STRERROR_R CONFIGURE_PART(Map/Fadvis/Madvise checking) diff --git a/doc/RRDs.html b/doc/RRDs.html index fc71f3c..a0db39b 100644 --- a/doc/RRDs.html +++ b/doc/RRDs.html @@ -60,9 +60,9 @@

Calling Sequence

-

This module accesses RRDtool functionality directly from within perl. The +

This module accesses RRDtool functionality directly from within Perl. The arguments to the functions listed in the SYNOPSIS are explained in the regular -RRDtool documentation. The commandline call

+RRDtool documentation. The command line call

  rrdtool update mydemo.rrd --template in:out N:12:13

gets turned into

@@ -111,7 +111,7 @@ the values of the properties.

foreach my $key (keys %$hash){ print "$key = $$hash{$key}\n"; } -

RRDs::graphv takes the same paramters as RRDs::graph but it returns a +

RRDs::graphv takes the same parameters as RRDs::graph but it returns a pointer to hash. The hash returned contains meta information about the graph. Like its size as well as the position of the graph area on the image. When calling with and empty filename than the contents of the graph will be @@ -145,8 +145,8 @@ epoch (1970-01-01) for the supplied ``start'' and ``end'' arguments, respectivel


NOTE

-

If you are manipulating the TZ variable you should also call the posixs -function tzset to initialize all internal state of the library for properly +

If you are manipulating the TZ variable you should also call the POSIX +function tzset(3) to initialize all internal state of the library for properly operating in the timezone of your choice.

  use POSIX qw(tzset);
diff --git a/doc/bin_dec_hex.1 b/doc/bin_dec_hex.1
index 13b92bb..c4936de 100644
--- a/doc/bin_dec_hex.1
+++ b/doc/bin_dec_hex.1
@@ -129,7 +129,7 @@
 .\" ========================================================================
 .\"
 .IX Title "BIN_DEC_HEX 1"
-.TH BIN_DEC_HEX 1 "2008-03-15" "1.3.5" "rrdtool"
+.TH BIN_DEC_HEX 1 "2009-02-21" "1.3.7" "rrdtool"
 .SH "NAME"
 bin_dec_hex \- How to use binary, decimal, and hexadecimal notation.
 .SH "DESCRIPTION"
@@ -300,7 +300,8 @@ you're writing in. Some of the prefixes are \*(L"0x\*(R" for C, \*(L"$\*(R" for
 Pascal, \*(L"#\*(R" for \s-1HTML\s0.  It is common to assume that if a number starts
 with a zero, it is octal. It does not matter what is used as long as
 you know what it is. I will use \*(L"0x\*(R" for hexadecimal, \*(L"%\*(R" for binary
-and \*(L"0\*(R" for octal.  The following numbers are all the same, just their represenatation (base) is different: 021 0x11 17 \f(CW%00010001\fR
+and \*(L"0\*(R" for octal.  The following numbers are all the same, just their
+representation (base) is different: 021 0x11 17 \f(CW%00010001\fR
 .PP
 To do arithmetics and conversions you need to understand one more thing.
 It is something you already know but perhaps you do not \*(L"see\*(R" it yet:
@@ -408,7 +409,7 @@ is therefore \*(L"0\*(R" and we now have 0xA0??.
 (which is just plain 16) four times and write down \*(L"4\*(R" to get 0xA04?.
 Subtract 64 from 69 (69 \- 4*16) and the last digit is 5 \-\-> 0xA045.
 .PP
-The other method builds ub the number from the right. Let's try 41'029
+The other method builds up the number from the right. Let's try 41'029
 again.  Divide by 16 and do not use fractions (only whole numbers).
 .PP
 .Vb 4
@@ -532,4 +533,4 @@ other people by pointing them to this document when they are asking
 basic questions. They will not only get their answer, but at the same
 time learn a whole lot more.
 .PP
-Alex van den Bogaerdt  
+Alex van den Bogaerdt  
diff --git a/doc/bin_dec_hex.html b/doc/bin_dec_hex.html
index 7fcc027..1592801 100644
--- a/doc/bin_dec_hex.html
+++ b/doc/bin_dec_hex.html
@@ -170,7 +170,8 @@ you're writing in. Some of the prefixes are ``0x'' for C, ``$'' for
 Pascal, ``#'' for HTML.  It is common to assume that if a number starts
 with a zero, it is octal. It does not matter what is used as long as
 you know what it is. I will use ``0x'' for hexadecimal, ``%'' for binary
-and ``0'' for octal.  The following numbers are all the same, just their represenatation (base) is different: 021 0x11 17 %00010001

+and ``0'' for octal. The following numbers are all the same, just their +representation (base) is different: 021 0x11 17 %00010001

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

If you write down 1234, (no prefix, so it is decimal) you are talking @@ -249,7 +250,7 @@ is therefore ``0'' and we now have 0xA0??. 69 is smaller than 16^2 and bigger than 16^1-1. We can subtract 16^1 (which is just plain 16) four times and write down ``4'' to get 0xA04?. Subtract 64 from 69 (69 - 4*16) and the last digit is 5 --> 0xA045.

-

The other method builds ub the number from the right. Let's try 41'029 +

The other method builds up the number from the right. Let's try 41'029 again. Divide by 16 and do not use fractions (only whole numbers).

  41'029 / 16 is 2'564 with a remainder of 5. Write down 5.
@@ -349,7 +350,7 @@ calculator and can compute in binary or hexadecimal.

other people by pointing them to this document when they are asking basic questions. They will not only get their answer, but at the same time learn a whole lot more.

-

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

+

Alex van den Bogaerdt <alex@vandenbogaerdt.nl>

diff --git a/doc/bin_dec_hex.pod b/doc/bin_dec_hex.pod index 7a2adf5..5d3d925 100644 --- a/doc/bin_dec_hex.pod +++ b/doc/bin_dec_hex.pod @@ -160,7 +160,8 @@ you're writing in. Some of the prefixes are "0x" for C, "$" for Pascal, "#" for HTML. It is common to assume that if a number starts with a zero, it is octal. It does not matter what is used as long as you know what it is. I will use "0x" for hexadecimal, "%" for binary -and "0" for octal. The following numbers are all the same, just their represenatation (base) is different: 021 0x11 17 %00010001 +and "0" for octal. The following numbers are all the same, just their +representation (base) is different: 021 0x11 17 %00010001 To do arithmetics and conversions you need to understand one more thing. It is something you already know but perhaps you do not "see" it yet: @@ -256,7 +257,7 @@ is therefore "0" and we now have 0xA0??. (which is just plain 16) four times and write down "4" to get 0xA04?. Subtract 64 from 69 (69 - 4*16) and the last digit is 5 --> 0xA045. -The other method builds ub the number from the right. Let's try 41'029 +The other method builds up the number from the right. Let's try 41'029 again. Divide by 16 and do not use fractions (only whole numbers). 41'029 / 16 is 2'564 with a remainder of 5. Write down 5. @@ -368,4 +369,4 @@ other people by pointing them to this document when they are asking basic questions. They will not only get their answer, but at the same time learn a whole lot more. -Alex van den Bogaerdt Ealex@ergens.op.het.netE +Alex van den Bogaerdt Ealex@vandenbogaerdt.nlE diff --git a/doc/bin_dec_hex.txt b/doc/bin_dec_hex.txt index 25c8447..7e81115 100644 --- a/doc/bin_dec_hex.txt +++ b/doc/bin_dec_hex.txt @@ -159,7 +159,7 @@ DDEESSCCRRIIPPTTIIOONN for HTML. It is common to assume that if a number starts with a zero, it is octal. It does not matter what is used as long as you know what it is. I will use "0x" for hexadecimal, "%" for binary and "0" for - octal. The following numbers are all the same, just their represenata- + octal. The following numbers are all the same, just their representa- tion (base) is different: 021 0x11 17 %00010001 To do arithmetics and conversions you need to understand one more @@ -258,7 +258,7 @@ DDEESSCCRRIIPPTTIIOONN get 0xA04?. Subtract 64 from 69 (69 - 4*16) and the last digit is 5 --> 0xA045. - The other method builds ub the number from the right. Let's try 41'029 + The other method builds up the number from the right. Let's try 41'029 again. Divide by 16 and do not use fractions (only whole numbers). 41'029 / 16 is 2'564 with a remainder of 5. Write down 5. @@ -367,8 +367,8 @@ AAUUTTHHOORR basic questions. They will not only get their answer, but at the same time learn a whole lot more. - Alex van den Bogaerdt + Alex van den Bogaerdt -1.3.5 2008-03-15 BIN_DEC_HEX(1) +1.3.7 2009-02-21 BIN_DEC_HEX(1) diff --git a/doc/cdeftutorial.1 b/doc/cdeftutorial.1 index 07ec9b2..74e995f 100644 --- a/doc/cdeftutorial.1 +++ b/doc/cdeftutorial.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "CDEFTUTORIAL 1" -.TH CDEFTUTORIAL 1 "2008-10-30" "1.3.5" "rrdtool" +.TH CDEFTUTORIAL 1 "2009-02-21" "1.3.7" "rrdtool" .SH "NAME" cdeftutorial \- Alex van den Bogaerdt's CDEF tutorial .SH "DESCRIPTION" @@ -142,7 +142,7 @@ adding it to this document would benefit most users, please do ask me to add it. I will then try to provide an answer in the next release of this tutorial. No feedback equals no changes! Additions to this document are also welcome. \*(-- Alex van den Bogaerdt - + .Sh "Why this tutorial?" .IX Subsection "Why this tutorial?" One of the powerful parts of RRDtool is its ability to do all sorts @@ -978,7 +978,7 @@ This document was created from questions asked by either myself or by other people on the RRDtool mailing list. Please let me know if you find errors in it or if you have trouble understanding it. If you think there should be an addition, mail me: - + .PP Remember: \fBNo feedback equals no changes!\fR .SH "SEE ALSO" @@ -987,4 +987,4 @@ The RRDtool manpages .SH "AUTHOR" .IX Header "AUTHOR" Alex van den Bogaerdt - + diff --git a/doc/cdeftutorial.html b/doc/cdeftutorial.html index 1a99135..679ec0e 100644 --- a/doc/cdeftutorial.html +++ b/doc/cdeftutorial.html @@ -78,7 +78,7 @@ adding it to this document would benefit most users, please do ask me to add it. I will then try to provide an answer in the next release of this tutorial. No feedback equals no changes! Additions to this document are also welcome. -- Alex van den Bogaerdt -<alex@ergens.op.het.net>

+<alex@vandenbogaerdt.nl>

Why this tutorial?

@@ -817,7 +817,7 @@ sign before it: ``CDEF:wipeout2=wipeout,-1,*''

other people on the RRDtool mailing list. Please let me know if you find errors in it or if you have trouble understanding it. If you think there should be an addition, mail me: -<alex@ergens.op.het.net>

+<alex@vandenbogaerdt.nl>

Remember: No feedback equals no changes!

@@ -829,7 +829,7 @@ think there should be an addition, mail me:

AUTHOR

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

+<alex@vandenbogaerdt.nl>

diff --git a/doc/cdeftutorial.pod b/doc/cdeftutorial.pod index 2cfe586..2bd8fd6 100644 --- a/doc/cdeftutorial.pod +++ b/doc/cdeftutorial.pod @@ -12,7 +12,7 @@ adding it to this document would benefit most users, please do ask me to add it. I will then try to provide an answer in the next release of this tutorial. No feedback equals no changes! Additions to this document are also welcome. -- Alex van den Bogaerdt -Ealex@ergens.op.het.netE +Ealex@vandenbogaerdt.nlE =head2 Why this tutorial? @@ -875,7 +875,7 @@ This document was created from questions asked by either myself or by other people on the RRDtool mailing list. Please let me know if you find errors in it or if you have trouble understanding it. If you think there should be an addition, mail me: -Ealex@ergens.op.het.netE +Ealex@vandenbogaerdt.nlE Remember: B @@ -886,4 +886,4 @@ The RRDtool manpages =head1 AUTHOR Alex van den Bogaerdt -Ealex@ergens.op.het.netE +Ealex@vandenbogaerdt.nlE diff --git a/doc/cdeftutorial.txt b/doc/cdeftutorial.txt index d419ed6..0b34ba0 100644 --- a/doc/cdeftutorial.txt +++ b/doc/cdeftutorial.txt @@ -13,8 +13,8 @@ DDEESSCCRRIIPPTTIIOONN adding it to this document would benefit most users, please do ask me to add it. I will then try to provide an answer in the next release of this tutorial. No feedback equals no changes! Additions to this docu- - ment are also welcome. -- Alex van den Bogaerdt - + ment are also welcome. -- Alex van den Bogaerdt WWhhyy tthhiiss ttuuttoorriiaall?? @@ -787,7 +787,7 @@ OOuutt ooff iiddeeaass ffoorr nnooww This document was created from questions asked by either myself or by other people on the RRDtool mailing list. Please let me know if you find errors in it or if you have trouble understanding it. If you think - there should be an addition, mail me: + there should be an addition, mail me: Remember: NNoo ffeeeeddbbaacckk eeqquuaallss nnoo cchhaannggeess!! @@ -795,8 +795,8 @@ SSEEEE AALLSSOO The RRDtool manpages AAUUTTHHOORR - Alex van den Bogaerdt + Alex van den Bogaerdt -1.3.5 2008-10-30 CDEFTUTORIAL(1) +1.3.7 2009-02-21 CDEFTUTORIAL(1) diff --git a/doc/rpntutorial.1 b/doc/rpntutorial.1 index 47a87c0..a5aa87a 100644 --- a/doc/rpntutorial.1 +++ b/doc/rpntutorial.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RPNTUTORIAL 1" -.TH RPNTUTORIAL 1 "2008-03-15" "1.3.5" "rrdtool" +.TH RPNTUTORIAL 1 "2008-12-22" "1.3.7" "rrdtool" .SH "NAME" rpntutorial \- Reading RRDtool RPN Expressions by Steve Rader .SH "DESCRIPTION" @@ -181,7 +181,7 @@ important to be able to read \s-1IF\s0 operators along with the \s-1LT\s0, \s-1L .IX Header "Some Examples" While compound expressions can look overly complex, they can be considered elegantly simple. To quickly comprehend \s-1RPN\s0 expressions, -you must know the the algorithm for evaluating \s-1RPN\s0 expressions: +you must know the algorithm for evaluating \s-1RPN\s0 expressions: iterate searches from the left to the right looking for an operator. When it's found, apply that operator by popping the operator and some number of values (and by definition, not operators) off the stack. @@ -239,7 +239,7 @@ with \*(L"A\*(R": .Ve .PP read \*(L"if A then 10 else input\*(R". Now replace A with it's verbose -description againg and\*(--voila!\-\-you have a easily readable description +description again and\*(--voila!\-\-you have a easily readable description of the expression: .PP .Vb 1 diff --git a/doc/rpntutorial.html b/doc/rpntutorial.html index d3c0956..58d239c 100644 --- a/doc/rpntutorial.html +++ b/doc/rpntutorial.html @@ -83,7 +83,7 @@ GT, GE and EQ operators.

Some Examples

While compound expressions can look overly complex, they can be considered elegantly simple. To quickly comprehend RPN expressions, -you must know the the algorithm for evaluating RPN expressions: +you must know the algorithm for evaluating RPN expressions: iterate searches from the left to the right looking for an operator. When it's found, apply that operator by popping the operator and some number of values (and by definition, not operators) off the stack.

@@ -121,7 +121,7 @@ with ``A'':

  2) A,10,input,IF            eval is A,10,input,IF

read ``if A then 10 else input''. Now replace A with it's verbose -description againg and--voila!--you have a easily readable description +description again and--voila!--you have a easily readable description of the expression:

  if input > 10 then 10 else input
diff --git a/doc/rpntutorial.pod b/doc/rpntutorial.pod index b3beac1..b830f27 100644 --- a/doc/rpntutorial.pod +++ b/doc/rpntutorial.pod @@ -55,7 +55,7 @@ GT, GE and EQ operators. While compound expressions can look overly complex, they can be considered elegantly simple. To quickly comprehend RPN expressions, -you must know the the algorithm for evaluating RPN expressions: +you must know the algorithm for evaluating RPN expressions: iterate searches from the left to the right looking for an operator. When it's found, apply that operator by popping the operator and some number of values (and by definition, not operators) off the stack. @@ -102,7 +102,7 @@ with "A": 2) A,10,input,IF eval is A,10,input,IF read "if A then 10 else input". Now replace A with it's verbose -description againg and--voila!--you have a easily readable description +description again and--voila!--you have a easily readable description of the expression: if input > 10 then 10 else input diff --git a/doc/rpntutorial.txt b/doc/rpntutorial.txt index 79d0476..8c70ad5 100644 --- a/doc/rpntutorial.txt +++ b/doc/rpntutorial.txt @@ -51,7 +51,7 @@ RReeaaddiinngg tthhee IIFF OOppeerraattoorr SSoommee EExxaammpplleess While compound expressions can look overly complex, they can be consid- ered elegantly simple. To quickly comprehend RPN expressions, you must - know the the algorithm for evaluating RPN expressions: iterate searches + know the algorithm for evaluating RPN expressions: iterate searches from the left to the right looking for an operator. When it's found, apply that operator by popping the operator and some number of values (and by definition, not operators) off the stack. @@ -96,7 +96,7 @@ SSoommee EExxaammpplleess 2) A,10,input,IF eval is A,10,input,IF read "if A then 10 else input". Now replace A with it's verbose - description againg and--voila!--you have a easily readable description + description again and--voila!--you have a easily readable description of the expression: if input > 10 then 10 else input @@ -187,4 +187,4 @@ AAUUTTHHOORR -1.3.5 2008-03-15 RPNTUTORIAL(1) +1.3.7 2008-12-22 RPNTUTORIAL(1) diff --git a/doc/rrd-beginners.1 b/doc/rrd-beginners.1 index 409df53..a06c0dd 100644 --- a/doc/rrd-beginners.1 +++ b/doc/rrd-beginners.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RRD-BEGINNERS 1" -.TH RRD-BEGINNERS 1 "2008-03-15" "1.3.5" "rrdtool" +.TH RRD-BEGINNERS 1 "2008-03-15" "1.3.7" "rrdtool" .SH "NAME" rrd\-beginners \- RRDtool Beginners' Guide .SH "SYNOPSIS" diff --git a/doc/rrd-beginners.txt b/doc/rrd-beginners.txt index 871a97c..12056ea 100644 --- a/doc/rrd-beginners.txt +++ b/doc/rrd-beginners.txt @@ -318,4 +318,4 @@ AAUUTTHHOORR -1.3.5 2008-03-15 RRD-BEGINNERS(1) +1.3.7 2008-03-15 RRD-BEGINNERS(1) diff --git a/doc/rrdbuild.1 b/doc/rrdbuild.1 index 3cb645a..f95c206 100644 --- a/doc/rrdbuild.1 +++ b/doc/rrdbuild.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RRDBUILD 1" -.TH RRDBUILD 1 "2008-12-15" "1.3.5" "rrdtool" +.TH RRDBUILD 1 "2009-04-07" "1.3.7" "rrdtool" .SH "NAME" rrdbuild \- Instructions for building RRDtool .SH "OVERVIEW" @@ -163,7 +163,7 @@ Once you have decided. Save the two locations into environment variables. .PP .Vb 2 \& BUILD_DIR=/tmp/rrdbuild -\& INSTALL_DIR=/usr/local/rrdtool\-1.3.5 +\& INSTALL_DIR=/usr/local/rrdtool\-1.3.7 .Ve .PP If your \fI/tmp\fR is mounted with the option noexec (\s-1RHEL\s0 seems todo that) you have to choose @@ -180,9 +180,9 @@ Lets first assume you already have all the necessary libraries pre\-installed. .PP .Vb 4 -\& wget http://oss.oetiker.ch/rrdtool/pub/rrdtool\-1.3.5.tar.gz -\& gunzip \-c rrdtool\-1.3.5.tar.gz | tar xf \- -\& cd rrdtool\-1.3.5 +\& wget http://oss.oetiker.ch/rrdtool/pub/rrdtool\-1.3.7.tar.gz +\& gunzip \-c rrdtool\-1.3.7.tar.gz | tar xf \- +\& cd rrdtool\-1.3.7 \& ./configure \-\-prefix=$INSTALL_DIR && make && make install .Ve .PP @@ -193,9 +193,11 @@ Ok, this was very optimistic. This try will probably have ended with If your \s-1OS\s0 lets you install additional packages from a software repository, you may get away with installing the missing packages. When the packages are installed, run configure again and try to compile again. Below you find some -hints on getting your \s-1OS\s0 ready for the rrdtool compilation. +hints on getting your \s-1OS\s0 ready for the rrdtool compilation. .PP -Additions to this list are welcome. +Additions to this list are welcome. In general rrdtool should work with the +latest versions of the libraries. The versions listed here are just what was +current when I tested this. .Sh "OpenSolaris 2008.05" .IX Subsection "OpenSolaris 2008.05" Just add a compiler and the gnome development package: @@ -205,9 +207,9 @@ Just add a compiler and the gnome development package: \& pkg install SUNWgnome\-common\-devel .Ve .PP -There is a problem with \fIcairo.pc\fR on opensolaris. It suggests that +There is a problem with \fIcairo.pc\fR on OpenSolaris. It suggests that xrender is required for compilation with cairo. This is not true and also -bad since opensolaris does not include an \fIxrender.pc\fR file. Use perl to +bad since OpenSolaris does not include an \fIxrender.pc\fR file. Use Perl to fix this: .PP .Vb 1 @@ -220,7 +222,7 @@ Make sure rrdtool finds your new compiler \& export PATH=/opt/SunStudioExpress/bin .Ve .PP -Since there does not seem to ba a viable msgfmt tool on opensolaris (short +Since there does not seem to be a viable msgfmt tool on OpenSolaris (short of installing it yourself). You have to call configure with the .PP .Vb 1 @@ -273,7 +275,7 @@ possible that they are pretty old and thus don't live up to our expectations, so you may want to compile their latest versions. .Sh "General build tips for \s-1AIX\s0" .IX Subsection "General build tips for AIX" -If you are working with \s-1AIX\s0, you may find the the \fB\-\-disable\-shared\fR option +If you are working with \s-1AIX\s0, you may find the \fB\-\-disable\-shared\fR option will cause things to break for you. In that case you may have to install the shared libraries into the rrdtool \s-1PREFIX\s0 and work with \fB\-\-disable\-static\fR instead. @@ -311,12 +313,13 @@ the syntax again differs from system to system: if you are using the Sun Studio/Forte compiler, you may also want to set .Sp .Vb 2 -\& CFLAGS="\-xO3 \-xcode=pic13" (SPARC) -\& CFLAGS="\-xO3 \-Kpic" (x86) +\& export CFLAGS="\-xO3 \-xcode=pic13" (SPARC) +\& export CFLAGS="\-xO3 \-Kpic" (x86) .Ve .IP "Linux" 4 .IX Item "Linux" -.Vb 1 +.Vb 2 +\& export CFLAGS="\-O3 \-fPIC" \& export LDFLAGS="\-Wl,\-\-rpath \-Wl,${INSTALL_DIR}/lib" .Ve .IP "\s-1HPUX\s0" 4 @@ -330,7 +333,7 @@ if you are using the Sun Studio/Forte compiler, you may also want to set \& export LDFLAGS="\-Wl,\-blibpath:${INSTALL_DIR}/lib" .Ve .PP -If you have GNUmake installed and it is not called 'make', +If you have \s-1GNU\s0 make installed and it is not called 'make', then do .PP .Vb 2 @@ -355,11 +358,18 @@ not available natively, here is how to compile it. \& wget http://pkgconfig.freedesktop.org/releases/pkg\-config\-0.23.tar.gz \& gunzip \-c pkg\-config\-0.23.tar.gz | tar xf \- \& cd pkg\-config\-0.23 -\& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" +\& ./configure \-\-prefix=$INSTALL_DIR \& $MAKE \& $MAKE install .Ve .PP +After installing pkgconfig in a custom directory, setting up the corresponding +environment variable will be helpful. +.PP +.Vb 1 +\& export PKG_CONFIG=$INSTALL_DIR/bin/pkg\-config +.Ve +.PP \fIBuilding zlib\fR .IX Subsection "Building zlib" .PP @@ -370,7 +380,7 @@ Chances are very high that you already have that on your system ... \& wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib\-1.2.3.tar.gz \& gunzip \-c zlib\-1.2.3.tar.gz | tar xf \- \& cd zlib\-1.2.3 -\& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" \-\-shared +\& ./configure \-\-prefix=$INSTALL_DIR \-\-shared \& $MAKE \& $MAKE install .Ve @@ -387,8 +397,8 @@ the end of line 4 means that line 4 and line 5 are on one line. \& cd $BUILD_DIR \& wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng\-1.2.18.tar.gz \& gunzip \-c libpng\-1.2.18.tar.gz | tar xf \- -\& cd libpng\-1.2.10 -\& env CFLAGS="\-O3 \-fPIC" ./configure \-\-prefix=$INSTALL_DIR +\& cd libpng\-1.2.18 +\& ./configure \-\-prefix=$INSTALL_DIR \& $MAKE \& $MAKE install .Ve @@ -418,10 +428,10 @@ add the following at the start the configure line: .PP .Vb 7 \& cd $BUILD_DIR -\& wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2\-sources\-2.6.31.tar.gz -\& gunzip \-c libxml2\-sources\-2.6.31.tar.gz | tar xf \- -\& cd libxml2\-sources\-2.6.31 -\& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" +\& wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2\-2.6.32.tar.gz +\& gunzip \-c libxml2\-2.6.32.tar.gz | tar xf \- +\& cd libxml2\-2.6.32 +\& ./configure \-\-prefix=$INSTALL_DIR \& $MAKE \& $MAKE install .Ve @@ -439,7 +449,7 @@ config file. \& wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig\-2.4.2.tar.gz \& gunzip \-c fontconfig\-2.4.2.tar.gz | tar xf \- \& cd fontconfig\-2.4.2 -\& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" +\& ./configure \-\-prefix=$INSTALL_DIR \-\-with\-freetype\-config=$INSTALL_DIR/bin/freetype\-config \& $MAKE \& $MAKE install .Ve @@ -452,7 +462,7 @@ config file. \& wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman\-0.10.0.tar.gz \& gunzip \-c pixman\-0.10.0.tar.gz | tar xf \- \& cd pixman\-0.10.0 -\& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" +\& ./configure \-\-prefix=$INSTALL_DIR \& $MAKE \& $MAKE install .Ve @@ -460,16 +470,15 @@ config file. \fIBuilding Cairo\fR .IX Subsection "Building Cairo" .PP -.Vb 11 +.Vb 10 \& cd $BUILD_DIR \& wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo\-1.6.4.tar.gz \& gunzip \-c cairo\-1.6.4.tar.gz | tar xf \- -\& cd cairo\-1.4.10 +\& cd cairo\-1.6.4 \& ./configure \-\-prefix=$INSTALL_DIR \e \& \-\-enable\-xlib=no \e \& \-\-enable\-xlib\-render=no \e -\& \-\-enable\-win32=no \e -\& CFLAGS="\-O3 \-fPIC" +\& \-\-enable\-win32=no \& $MAKE \& $MAKE install .Ve @@ -482,7 +491,7 @@ config file. \& wget http://oss.oetiker.ch/rrdtool/pub/libs/glib\-2.15.4.tar.gz \& gunzip \-c glib\-2.15.4.tar.gz | tar xf \- \& cd glib\-2.15.4 -\& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" +\& ./configure \-\-prefix=$INSTALL_DIR \& $MAKE \& $MAKE install .Ve @@ -492,10 +501,10 @@ config file. .PP .Vb 7 \& cd $BUILD_DIR -\& wget http://oss.oetiker.ch/rrdtool/pub/libs/pango\-1.21.1.tar.gz -\& gunzip \-c pango\-1.21.1.tar.gz | tar xf \- +\& wget http://oss.oetiker.ch/rrdtool/pub/libs/pango\-1.21.1.tar.bz2 +\& bunzip2 \-c pango\-1.21.1.tar.bz2 | tar xf \- \& cd pango\-1.21.1 -\& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" \-\-without\-x +\& ./configure \-\-prefix=$INSTALL_DIR \-\-without\-x \& $MAKE \& $MAKE install .Ve @@ -512,14 +521,14 @@ tcl setups that would prevent rrdtool from building if they are included in their current state. .PP .Vb 5 -\& cd $BUILD_DIR/rrdtool\-1.3.5 +\& cd $BUILD_DIR/rrdtool\-1.3.7 \& ./configure \-\-prefix=$INSTALL_DIR \-\-disable\-tcl \-\-disable\-python \& $MAKE clean \& $MAKE \& $MAKE install .Ve .PP -\&\s-1SOLARIS\s0 \s-1HINT:\s0 if you want to build the perl module for the native perl (the +\&\s-1SOLARIS\s0 \s-1HINT:\s0 if you want to build the Perl module for the native Perl (the one shipping with Solaris) you will need the Sun Forte compiler installed on your box or you have to hand-tune bindings/perl\-shared/Makefile while building! diff --git a/doc/rrdbuild.html b/doc/rrdbuild.html index 8df3f44..bf9a9ae 100644 --- a/doc/rrdbuild.html +++ b/doc/rrdbuild.html @@ -90,7 +90,7 @@ tar and GNU make respectively. It could be that they a

Once you have decided. Save the two locations into environment variables.

  BUILD_DIR=/tmp/rrdbuild
- INSTALL_DIR=/usr/local/rrdtool-1.3.5
+ INSTALL_DIR=/usr/local/rrdtool-1.3.7

If your /tmp is mounted with the option noexec (RHEL seems todo that) you have to choose a different directory!

Now make sure the BUILD_DIR exists and go there:

@@ -100,9 +100,9 @@ a different directory!

Lets first assume you already have all the necessary libraries pre-installed.

- wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.5.tar.gz
- gunzip -c rrdtool-1.3.5.tar.gz | tar xf -
- cd rrdtool-1.3.5
+ wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.7.tar.gz
+ gunzip -c rrdtool-1.3.7.tar.gz | tar xf -
+ cd rrdtool-1.3.7
  ./configure --prefix=$INSTALL_DIR && make && make install

Ok, this was very optimistic. This try will probably have ended with configure complaining about several missing libraries.

@@ -114,7 +114,9 @@ pre-installed.

you may get away with installing the missing packages. When the packages are installed, run configure again and try to compile again. Below you find some hints on getting your OS ready for the rrdtool compilation.

-

Additions to this list are welcome.

+

Additions to this list are welcome. In general rrdtool should work with the +latest versions of the libraries. The versions listed here are just what was +current when I tested this.

OpenSolaris 2008.05

@@ -122,16 +124,16 @@ hints on getting your OS ready for the rrdtool compilation.

  pkg install sunstudioexpress
  pkg install SUNWgnome-common-devel
-

There is a problem with cairo.pc on opensolaris. It suggests that +

There is a problem with cairo.pc on OpenSolaris. It suggests that xrender is required for compilation with cairo. This is not true and also -bad since opensolaris does not include an xrender.pc file. Use perl to +bad since OpenSolaris does not include an xrender.pc file. Use Perl to fix this:

  perl -i~ -p -e 's/(Requires.*?)\s*xrender.*/$1/' /usr/lib/pkgconfig/cairo.pc

Make sure rrdtool finds your new compiler

  export PATH=/opt/SunStudioExpress/bin
-

Since there does not seem to ba a viable msgfmt tool on opensolaris (short +

Since there does not seem to be a viable msgfmt tool on OpenSolaris (short of installing it yourself). You have to call configure with the

  --disable-libintl
@@ -178,7 +180,7 @@ expectations, so you may want to compile their latest versions.

General build tips for AIX

-

If you are working with AIX, you may find the the --disable-shared option +

If you are working with AIX, you may find the --disable-shared option will cause things to break for you. In that case you may have to install the shared libraries into the rrdtool PREFIX and work with --disable-static instead.

@@ -208,13 +210,14 @@ the syntax again differs from system to system:

export LDFLAGS=-R${INSTALL_DIR}/lib

if you are using the Sun Studio/Forte compiler, you may also want to set

- CFLAGS="-xO3 -xcode=pic13"   (SPARC)
- CFLAGS="-xO3 -Kpic"          (x86)
+ export CFLAGS="-xO3 -xcode=pic13" (SPARC) + export CFLAGS="-xO3 -Kpic" (x86)
Linux
+ export CFLAGS="-O3 -fPIC"
  export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"
HPUX
@@ -230,7 +233,7 @@ the syntax again differs from system to system:

export LDFLAGS="-Wl,-blibpath:${INSTALL_DIR}/lib" -

If you have GNUmake installed and it is not called 'make', +

If you have GNU make installed and it is not called 'make', then do

  export MAKE=gmake
@@ -248,9 +251,13 @@ not available natively, here is how to compile it.

wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz gunzip -c pkg-config-0.23.tar.gz | tar xf - cd pkg-config-0.23 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install
+

After installing pkgconfig in a custom directory, setting up the corresponding +environment variable will be helpful.

+
+ export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config

Building zlib

@@ -260,7 +267,7 @@ not available natively, here is how to compile it.

wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz gunzip -c zlib-1.2.3.tar.gz | tar xf - cd zlib-1.2.3 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --shared + ./configure --prefix=$INSTALL_DIR --shared $MAKE $MAKE install

@@ -274,8 +281,8 @@ the end of line 4 means that line 4 and line 5 are on one line.

cd $BUILD_DIR wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz gunzip -c libpng-1.2.18.tar.gz | tar xf - - cd libpng-1.2.10 - env CFLAGS="-O3 -fPIC" ./configure --prefix=$INSTALL_DIR + cd libpng-1.2.18 + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install

@@ -298,10 +305,10 @@ add the following at the start the configure line:

Building LibXML2

  cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-sources-2.6.31.tar.gz
- gunzip -c libxml2-sources-2.6.31.tar.gz | tar xf -
- cd libxml2-sources-2.6.31
- ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
+ wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz
+ gunzip -c libxml2-2.6.32.tar.gz | tar xf -
+ cd libxml2-2.6.32
+ ./configure --prefix=$INSTALL_DIR
  $MAKE
  $MAKE install

@@ -316,7 +323,7 @@ config file.

wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz gunzip -c fontconfig-2.4.2.tar.gz | tar xf - cd fontconfig-2.4.2 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR --with-freetype-config=$INSTALL_DIR/bin/freetype-config $MAKE $MAKE install

@@ -327,7 +334,7 @@ config file.

wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz gunzip -c pixman-0.10.0.tar.gz | tar xf - cd pixman-0.10.0 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install

@@ -337,12 +344,11 @@ config file.

cd $BUILD_DIR wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz gunzip -c cairo-1.6.4.tar.gz | tar xf - - cd cairo-1.4.10 + cd cairo-1.6.4 ./configure --prefix=$INSTALL_DIR \ --enable-xlib=no \ --enable-xlib-render=no \ - --enable-win32=no \ - CFLAGS="-O3 -fPIC" + --enable-win32=no $MAKE $MAKE install

@@ -353,7 +359,7 @@ config file.

wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz gunzip -c glib-2.15.4.tar.gz | tar xf - cd glib-2.15.4 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install

@@ -361,10 +367,10 @@ config file.

Building Pango

  cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.gz
- gunzip -c pango-1.21.1.tar.gz  | tar xf -
+ wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2
+ bunzip2 -c pango-1.21.1.tar.bz2 | tar xf -
  cd pango-1.21.1
- ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --without-x
+ ./configure --prefix=$INSTALL_DIR --without-x
  $MAKE
  $MAKE install

@@ -379,12 +385,12 @@ because it seems that a fair number of people have ill configured python and tcl setups that would prevent rrdtool from building if they are included in their current state.

- cd $BUILD_DIR/rrdtool-1.3.5
+ cd $BUILD_DIR/rrdtool-1.3.7
  ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
  $MAKE clean
  $MAKE
  $MAKE install
-

SOLARIS HINT: if you want to build the perl module for the native perl (the +

SOLARIS HINT: if you want to build the Perl module for the native Perl (the one shipping with Solaris) you will need the Sun Forte compiler installed on your box or you have to hand-tune bindings/perl-shared/Makefile while building!

diff --git a/doc/rrdbuild.pod b/doc/rrdbuild.pod index 44fc962..8509722 100644 --- a/doc/rrdbuild.pod +++ b/doc/rrdbuild.pod @@ -41,7 +41,7 @@ Where you want to install the software. Once you have decided. Save the two locations into environment variables. BUILD_DIR=/tmp/rrdbuild - INSTALL_DIR=/usr/local/rrdtool-1.3.5 + INSTALL_DIR=/usr/local/rrdtool-1.3.7 If your F is mounted with the option noexec (RHEL seems todo that) you have to choose @@ -55,9 +55,9 @@ Now make sure the BUILD_DIR exists and go there: Lets first assume you already have all the necessary libraries pre-installed. - wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.5.tar.gz - gunzip -c rrdtool-1.3.5.tar.gz | tar xf - - cd rrdtool-1.3.5 + wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.7.tar.gz + gunzip -c rrdtool-1.3.7.tar.gz | tar xf - + cd rrdtool-1.3.7 ./configure --prefix=$INSTALL_DIR && make && make install Ok, this was very optimistic. This try will probably have ended with @@ -68,9 +68,11 @@ B complaining about several missing libraries. If your OS lets you install additional packages from a software repository, you may get away with installing the missing packages. When the packages are installed, run configure again and try to compile again. Below you find some -hints on getting your OS ready for the rrdtool compilation. +hints on getting your OS ready for the rrdtool compilation. -Additions to this list are welcome. +Additions to this list are welcome. In general rrdtool should work with the +latest versions of the libraries. The versions listed here are just what was +current when I tested this. =head2 OpenSolaris 2008.05 @@ -79,9 +81,9 @@ Just add a compiler and the gnome development package: pkg install sunstudioexpress pkg install SUNWgnome-common-devel -There is a problem with F on opensolaris. It suggests that +There is a problem with F on OpenSolaris. It suggests that xrender is required for compilation with cairo. This is not true and also -bad since opensolaris does not include an F file. Use perl to +bad since OpenSolaris does not include an F file. Use Perl to fix this: perl -i~ -p -e 's/(Requires.*?)\s*xrender.*/$1/' /usr/lib/pkgconfig/cairo.pc @@ -90,7 +92,7 @@ Make sure rrdtool finds your new compiler export PATH=/opt/SunStudioExpress/bin -Since there does not seem to ba a viable msgfmt tool on opensolaris (short +Since there does not seem to be a viable msgfmt tool on OpenSolaris (short of installing it yourself). You have to call configure with the --disable-libintl @@ -139,7 +141,7 @@ expectations, so you may want to compile their latest versions. =head2 General build tips for AIX -If you are working with AIX, you may find the the B<--disable-shared> option +If you are working with AIX, you may find the B<--disable-shared> option will cause things to break for you. In that case you may have to install the shared libraries into the rrdtool PREFIX and work with B<--disable-static> instead. @@ -174,12 +176,13 @@ the syntax again differs from system to system: if you are using the Sun Studio/Forte compiler, you may also want to set - CFLAGS="-xO3 -xcode=pic13" (SPARC) - CFLAGS="-xO3 -Kpic" (x86) + export CFLAGS="-xO3 -xcode=pic13" (SPARC) + export CFLAGS="-xO3 -Kpic" (x86) =item Linux + export CFLAGS="-O3 -fPIC" export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib" =item HPUX @@ -192,7 +195,7 @@ if you are using the Sun Studio/Forte compiler, you may also want to set =back -If you have GNUmake installed and it is not called 'make', +If you have GNU make installed and it is not called 'make', then do export MAKE=gmake @@ -211,10 +214,15 @@ not available natively, here is how to compile it. wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz gunzip -c pkg-config-0.23.tar.gz | tar xf - cd pkg-config-0.23 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install +After installing pkgconfig in a custom directory, setting up the corresponding +environment variable will be helpful. + + export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config + =head3 Building zlib Chances are very high that you already have that on your system ... @@ -223,7 +231,7 @@ Chances are very high that you already have that on your system ... wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz gunzip -c zlib-1.2.3.tar.gz | tar xf - cd zlib-1.2.3 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --shared + ./configure --prefix=$INSTALL_DIR --shared $MAKE $MAKE install @@ -237,8 +245,8 @@ the end of line 4 means that line 4 and line 5 are on one line. cd $BUILD_DIR wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz gunzip -c libpng-1.2.18.tar.gz | tar xf - - cd libpng-1.2.10 - env CFLAGS="-O3 -fPIC" ./configure --prefix=$INSTALL_DIR + cd libpng-1.2.18 + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install @@ -260,10 +268,10 @@ add the following at the start the configure line: =head3 Building LibXML2 cd $BUILD_DIR - wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-sources-2.6.31.tar.gz - gunzip -c libxml2-sources-2.6.31.tar.gz | tar xf - - cd libxml2-sources-2.6.31 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz + gunzip -c libxml2-2.6.32.tar.gz | tar xf - + cd libxml2-2.6.32 + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install @@ -278,7 +286,7 @@ config file. wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz gunzip -c fontconfig-2.4.2.tar.gz | tar xf - cd fontconfig-2.4.2 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR --with-freetype-config=$INSTALL_DIR/bin/freetype-config $MAKE $MAKE install @@ -288,7 +296,7 @@ config file. wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz gunzip -c pixman-0.10.0.tar.gz | tar xf - cd pixman-0.10.0 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install @@ -297,12 +305,11 @@ config file. cd $BUILD_DIR wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz gunzip -c cairo-1.6.4.tar.gz | tar xf - - cd cairo-1.4.10 + cd cairo-1.6.4 ./configure --prefix=$INSTALL_DIR \ --enable-xlib=no \ --enable-xlib-render=no \ - --enable-win32=no \ - CFLAGS="-O3 -fPIC" + --enable-win32=no $MAKE $MAKE install @@ -312,17 +319,17 @@ config file. wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz gunzip -c glib-2.15.4.tar.gz | tar xf - cd glib-2.15.4 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install =head3 Building Pango cd $BUILD_DIR - wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.gz - gunzip -c pango-1.21.1.tar.gz | tar xf - + wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2 + bunzip2 -c pango-1.21.1.tar.bz2 | tar xf - cd pango-1.21.1 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --without-x + ./configure --prefix=$INSTALL_DIR --without-x $MAKE $MAKE install @@ -338,13 +345,13 @@ because it seems that a fair number of people have ill configured python and tcl setups that would prevent rrdtool from building if they are included in their current state. - cd $BUILD_DIR/rrdtool-1.3.5 + cd $BUILD_DIR/rrdtool-1.3.7 ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python $MAKE clean $MAKE $MAKE install -SOLARIS HINT: if you want to build the perl module for the native perl (the +SOLARIS HINT: if you want to build the Perl module for the native Perl (the one shipping with Solaris) you will need the Sun Forte compiler installed on your box or you have to hand-tune bindings/perl-shared/Makefile while building! diff --git a/doc/rrdbuild.txt b/doc/rrdbuild.txt index 743a3e9..18e2696 100644 --- a/doc/rrdbuild.txt +++ b/doc/rrdbuild.txt @@ -35,7 +35,7 @@ OOPPTTIIMMIISSTTIICC BBUUIILLDD ables. BUILD_DIR=/tmp/rrdbuild - INSTALL_DIR=/usr/local/rrdtool-1.3.5 + INSTALL_DIR=/usr/local/rrdtool-1.3.7 If your _/_t_m_p is mounted with the option noexec (RHEL seems todo that) you have to choose a different directory! @@ -48,9 +48,9 @@ OOPPTTIIMMIISSTTIICC BBUUIILLDD Lets first assume you already have all the necessary libraries pre-installed. - wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.5.tar.gz - gunzip -c rrdtool-1.3.5.tar.gz | tar xf - - cd rrdtool-1.3.5 + wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.7.tar.gz + gunzip -c rrdtool-1.3.7.tar.gz | tar xf - + cd rrdtool-1.3.7 ./configure --prefix=$INSTALL_DIR && make && make install Ok, this was very optimistic. This try will probably have ended with @@ -63,7 +63,9 @@ IINNSSTTAALLLLIINNGG DDEEPPEENNDDEENNCCIIEESS Below you find some hints on getting your OS ready for the rrdtool com- pilation. - Additions to this list are welcome. + Additions to this list are welcome. In general rrdtool should work with + the latest versions of the libraries. The versions listed here are just + what was current when I tested this. OOppeennSSoollaarriiss 22000088..0055 @@ -72,9 +74,9 @@ IINNSSTTAALLLLIINNGG DDEEPPEENNDDEENNCCIIEESS pkg install sunstudioexpress pkg install SUNWgnome-common-devel - There is a problem with _c_a_i_r_o_._p_c on opensolaris. It suggests that xren- + There is a problem with _c_a_i_r_o_._p_c on OpenSolaris. It suggests that xren- der is required for compilation with cairo. This is not true and also - bad since opensolaris does not include an _x_r_e_n_d_e_r_._p_c file. Use perl to + bad since OpenSolaris does not include an _x_r_e_n_d_e_r_._p_c file. Use Perl to fix this: perl -i~ -p -e 's/(Requires.*?)\s*xrender.*/$1/' /usr/lib/pkgconfig/cairo.pc @@ -83,7 +85,7 @@ IINNSSTTAALLLLIINNGG DDEEPPEENNDDEENNCCIIEESS export PATH=/opt/SunStudioExpress/bin - Since there does not seem to ba a viable msgfmt tool on opensolaris + Since there does not seem to be a viable msgfmt tool on OpenSolaris (short of installing it yourself). You have to call configure with the --disable-libintl @@ -132,8 +134,8 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS GGeenneerraall bbuuiilldd ttiippss ffoorr AAIIXX - If you are working with AIX, you may find the the ----ddiissaabbllee--sshhaarreedd - option will cause things to break for you. In that case you may have to + If you are working with AIX, you may find the ----ddiissaabbllee--sshhaarreedd option + will cause things to break for you. In that case you may have to install the shared libraries into the rrdtool PREFIX and work with ----ddiissaabbllee--ssttaattiicc instead. @@ -166,10 +168,11 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS if you are using the Sun Studio/Forte compiler, you may also want to set - CFLAGS="-xO3 -xcode=pic13" (SPARC) - CFLAGS="-xO3 -Kpic" (x86) + export CFLAGS="-xO3 -xcode=pic13" (SPARC) + export CFLAGS="-xO3 -Kpic" (x86) Linux + export CFLAGS="-O3 -fPIC" export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib" HPUX @@ -178,7 +181,7 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS AIX export LDFLAGS="-Wl,-blibpath:${INSTALL_DIR}/lib" - If you have GNUmake installed and it is not called 'make', then do + If you have GNU make installed and it is not called 'make', then do export MAKE=gmake export GNUMAKE=gmake @@ -196,10 +199,15 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz gunzip -c pkg-config-0.23.tar.gz | tar xf - cd pkg-config-0.23 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install + After installing pkgconfig in a custom directory, setting up the corre- + sponding environment variable will be helpful. + + export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config + _B_u_i_l_d_i_n_g _z_l_i_b Chances are very high that you already have that on your system ... @@ -208,7 +216,7 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz gunzip -c zlib-1.2.3.tar.gz | tar xf - cd zlib-1.2.3 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --shared + ./configure --prefix=$INSTALL_DIR --shared $MAKE $MAKE install @@ -222,8 +230,8 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS cd $BUILD_DIR wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz gunzip -c libpng-1.2.18.tar.gz | tar xf - - cd libpng-1.2.10 - env CFLAGS="-O3 -fPIC" ./configure --prefix=$INSTALL_DIR + cd libpng-1.2.18 + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install @@ -245,10 +253,10 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS _B_u_i_l_d_i_n_g _L_i_b_X_M_L_2 cd $BUILD_DIR - wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-sources-2.6.31.tar.gz - gunzip -c libxml2-sources-2.6.31.tar.gz | tar xf - - cd libxml2-sources-2.6.31 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz + gunzip -c libxml2-2.6.32.tar.gz | tar xf - + cd libxml2-2.6.32 + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install @@ -263,7 +271,7 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz gunzip -c fontconfig-2.4.2.tar.gz | tar xf - cd fontconfig-2.4.2 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR --with-freetype-config=$INSTALL_DIR/bin/freetype-config $MAKE $MAKE install @@ -273,7 +281,7 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz gunzip -c pixman-0.10.0.tar.gz | tar xf - cd pixman-0.10.0 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install @@ -282,12 +290,11 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS cd $BUILD_DIR wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz gunzip -c cairo-1.6.4.tar.gz | tar xf - - cd cairo-1.4.10 + cd cairo-1.6.4 ./configure --prefix=$INSTALL_DIR \ --enable-xlib=no \ --enable-xlib-render=no \ - --enable-win32=no \ - CFLAGS="-O3 -fPIC" + --enable-win32=no $MAKE $MAKE install @@ -297,17 +304,17 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz gunzip -c glib-2.15.4.tar.gz | tar xf - cd glib-2.15.4 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" + ./configure --prefix=$INSTALL_DIR $MAKE $MAKE install _B_u_i_l_d_i_n_g _P_a_n_g_o cd $BUILD_DIR - wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.gz - gunzip -c pango-1.21.1.tar.gz | tar xf - + wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2 + bunzip2 -c pango-1.21.1.tar.bz2 | tar xf - cd pango-1.21.1 - ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --without-x + ./configure --prefix=$INSTALL_DIR --without-x $MAKE $MAKE install @@ -324,13 +331,13 @@ BBUUIILLDDIINNGG DDEEPPEENNDDEENNCCIIEESS python and tcl setups that would prevent rrdtool from building if they are included in their current state. - cd $BUILD_DIR/rrdtool-1.3.5 + cd $BUILD_DIR/rrdtool-1.3.7 ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python $MAKE clean $MAKE $MAKE install - SOLARIS HINT: if you want to build the perl module for the native perl + SOLARIS HINT: if you want to build the Perl module for the native Perl (the one shipping with Solaris) you will need the Sun Forte compiler installed on your box or you have to hand-tune bind- ings/perl-shared/Makefile while building! @@ -343,4 +350,4 @@ AAUUTTHHOORR -1.3.5 2008-12-15 RRDBUILD(1) +1.3.7 2009-04-07 RRDBUILD(1) diff --git a/doc/rrdcgi.1 b/doc/rrdcgi.1 index 3338986..99f62fa 100644 --- a/doc/rrdcgi.1 +++ b/doc/rrdcgi.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RRDCGI 1" -.TH RRDCGI 1 "2008-03-15" "1.3.5" "rrdtool" +.TH RRDCGI 1 "2008-12-22" "1.3.7" "rrdtool" .SH "NAME" rrdcgi \- Create web pages containing RRD graphs based on templates .SH "SYNOPSIS" @@ -308,7 +308,7 @@ you want to use as source for your graph. .SH "EXAMPLE 3" .IX Header "EXAMPLE 3" This example shows how to handle the case where the \s-1RRD\s0, graphs and -cgi-bins are seperate directories +cgi-bins are separate directories .PP .Vb 14 \& #!/.../bin/rrdcgi diff --git a/doc/rrdcgi.html b/doc/rrdcgi.html index 917ab97..6cdda17 100644 --- a/doc/rrdcgi.html +++ b/doc/rrdcgi.html @@ -235,7 +235,7 @@ you want to use as source for your graph.


EXAMPLE 3

This example shows how to handle the case where the RRD, graphs and -cgi-bins are seperate directories

+cgi-bins are separate directories

  #!/.../bin/rrdcgi
  <HTML>
diff --git a/doc/rrdcgi.pod b/doc/rrdcgi.pod
index 4c81e01..e34d4c0 100644
--- a/doc/rrdcgi.pod
+++ b/doc/rrdcgi.pod
@@ -193,7 +193,7 @@ you want to use as source for your graph.
 =head1 EXAMPLE 3
 
 This example shows how to handle the case where the RRD, graphs and
-cgi-bins are seperate directories
+cgi-bins are separate directories
 
  #!/.../bin/rrdcgi
  
diff --git a/doc/rrdcgi.txt b/doc/rrdcgi.txt
index ebb291c..cc4bc6f 100644
--- a/doc/rrdcgi.txt
+++ b/doc/rrdcgi.txt
@@ -177,7 +177,7 @@ EEXXAAMMPPLLEE 22
 
 EEXXAAMMPPLLEE 33
        This example shows how to handle the case where the RRD, graphs and
-       cgi-bins are seperate directories
+       cgi-bins are separate directories
 
         #!/.../bin/rrdcgi
         
@@ -204,4 +204,4 @@ AAUUTTHHOORR
 
 
 
-1.3.5                             2008-03-15                         RRDCGI(1)
+1.3.7                             2008-12-22                         RRDCGI(1)
diff --git a/doc/rrdcreate.1 b/doc/rrdcreate.1
index a592a42..6e20b3c 100644
--- a/doc/rrdcreate.1
+++ b/doc/rrdcreate.1
@@ -129,7 +129,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RRDCREATE 1"
-.TH RRDCREATE 1 "2008-06-11" "1.3.5" "rrdtool"
+.TH RRDCREATE 1 "2008-06-11" "1.3.7" "rrdtool"
 .SH "NAME"
 rrdcreate \- Set up a new Round Robin Database
 .SH "SYNOPSIS"
diff --git a/doc/rrdcreate.txt b/doc/rrdcreate.txt
index 678ea43..627e92d 100644
--- a/doc/rrdcreate.txt
+++ b/doc/rrdcreate.txt
@@ -530,4 +530,4 @@ AAUUTTHHOORR
 
 
 
-1.3.5                             2008-06-11                      RRDCREATE(1)
+1.3.7                             2008-06-11                      RRDCREATE(1)
diff --git a/doc/rrddump.1 b/doc/rrddump.1
index 3b4da7e..0d36ce2 100644
--- a/doc/rrddump.1
+++ b/doc/rrddump.1
@@ -129,7 +129,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RRDDUMP 1"
-.TH RRDDUMP 1 "2008-05-16" "1.3.5" "rrdtool"
+.TH RRDDUMP 1 "2008-05-16" "1.3.7" "rrdtool"
 .SH "NAME"
 rrddump \- dump the contents of an RRD to XML format
 .SH "SYNOPSIS"
diff --git a/doc/rrddump.txt b/doc/rrddump.txt
index 7179826..11c2d32 100644
--- a/doc/rrddump.txt
+++ b/doc/rrddump.txt
@@ -48,4 +48,4 @@ AAUUTTHHOORR
 
 
 
-1.3.5                             2008-05-16                        RRDDUMP(1)
+1.3.7                             2008-05-16                        RRDDUMP(1)
diff --git a/doc/rrdfetch.1 b/doc/rrdfetch.1
index e2a949e..95bb79a 100644
--- a/doc/rrdfetch.1
+++ b/doc/rrdfetch.1
@@ -129,7 +129,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RRDFETCH 1"
-.TH RRDFETCH 1 "2008-03-15" "1.3.5" "rrdtool"
+.TH RRDFETCH 1 "2008-03-15" "1.3.7" "rrdtool"
 .SH "NAME"
 rrdfetch \- Fetch data from an RRD.
 .SH "SYNOPSIS"
diff --git a/doc/rrdfetch.txt b/doc/rrdfetch.txt
index b2ba2c8..810e4bc 100644
--- a/doc/rrdfetch.txt
+++ b/doc/rrdfetch.txt
@@ -228,4 +228,4 @@ AAUUTTHHOORR
 
 
 
-1.3.5                             2008-03-15                       RRDFETCH(1)
+1.3.7                             2008-03-15                       RRDFETCH(1)
diff --git a/doc/rrdfirst.1 b/doc/rrdfirst.1
index 615dda3..dd78da9 100644
--- a/doc/rrdfirst.1
+++ b/doc/rrdfirst.1
@@ -129,7 +129,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RRDFIRST 1"
-.TH RRDFIRST 1 "2008-03-15" "1.3.5" "rrdtool"
+.TH RRDFIRST 1 "2008-03-15" "1.3.7" "rrdtool"
 .SH "NAME"
 rrdfirst \- Return the date of the first data sample in an RRA within an RRD
 .SH "SYNOPSIS"
diff --git a/doc/rrdfirst.txt b/doc/rrdfirst.txt
index 3eb1808..d233415 100644
--- a/doc/rrdfirst.txt
+++ b/doc/rrdfirst.txt
@@ -26,4 +26,4 @@ AAUUTTHHOORR
 
 
 
-1.3.5                             2008-03-15                       RRDFIRST(1)
+1.3.7                             2008-03-15                       RRDFIRST(1)
diff --git a/doc/rrdgraph.1 b/doc/rrdgraph.1
index d3c50dd..6dac276 100644
--- a/doc/rrdgraph.1
+++ b/doc/rrdgraph.1
@@ -129,7 +129,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RRDGRAPH 1"
-.TH RRDGRAPH 1 "2008-12-09" "1.3.5" "rrdtool"
+.TH RRDGRAPH 1 "2009-04-07" "1.3.7" "rrdtool"
 .SH "NAME"
 rrdgraph \- Round Robin Database tool grapher functions
 .SH "SYNOPSIS"
@@ -213,9 +213,8 @@ one pixel will silently be ignored.
 .PP
 A horizontal string at the top of the graph and/or a vertically
 placed string at the left hand side of the graph.
-.RE
-.IP "Right Axis"
-.IX Item "Right Axis"
+.Sh "Right Axis"
+.IX Subsection "Right Axis"
 [\fB\-\-right\-axis\fR \fIscale\fR\fB:\fR\fIshift\fR]
 [\fB\-\-right\-axis\-label\fR \fIlabel\fR]
 .PP
@@ -289,7 +288,7 @@ and thus the throughput may be higher than the \s-1WAN\s0 line speed.
 .PP
 In order to avoid anti-aliasing blurring effects rrdtool snaps
 points to device resolution pixels, this results in a crisper
-aperance. If this is not to your liking, you can use this switch
+appearance. If this is not to your liking, you can use this switch
 to turn this behaviour off.
 .PP
 Gridfitting is turned off for \s-1PDF\s0, \s-1EPS\s0, \s-1SVG\s0 output by default.
@@ -344,7 +343,7 @@ placed every \fIlabel factor\fR lines.  You can specify \f(CW\*(C`\-y none\*(C'\
 suppress the grid and labels altogether.  The default for this option is
 to automatically select sensible values.
 .Sp
-If you have set \-\-y\-grid to 'none' not only the labels get supressed, also
+If you have set \-\-y\-grid to 'none' not only the labels get suppressed, also
 the space reserved for the labels is removed. You can still add space
 manually if you use the \-\-units\-length command to explicitly reserve space.
 .Sp
@@ -394,8 +393,12 @@ Note that for linear graphs, \s-1SI\s0 notation is used by default.
 [\fB\-z\fR|\fB\-\-lazy\fR]
 .PP
 Only generate the graph if the current graph is out of date or not existent.
-Note, that only the image size will be returned, if you run with lazy even
-when using graphv and even when using \s-1PRINT\s0.
+Note, that all the calculations will happen regardless so that the output of
+\&\s-1PRINT\s0 and graphv will be complete regardless. Note that the behaviour of
+lazy in this regard has seen several changes over time. The only thing you
+can realy rely on before rrdtool 1.3.7 is that lazy will not generate the
+graph when it is already there and up to date, and also that it will output
+the size of the graph.
 .PP
 [\fB\-f\fR|\fB\-\-imginfo\fR \fIprintfstr\fR]
 .PP
@@ -440,11 +443,11 @@ edge of the graph.
 .PP
 Use Times for the title: \f(CW\*(C`\-\-font TITLE:13:Times\*(C'\fR
 .PP
-If you do not give a font string you can modify just the sice of the default font:
+If you do not give a font string you can modify just the size of the default font:
 \&\f(CW\*(C`\-\-font TITLE:13:\*(C'\fR.
 .PP
 If you specify the size 0 then you can modify just the font without touching
-the size. This is especially usefull for altering the default font without
+the size. This is especially useful for altering the default font without
 resetting the default fontsizes: \f(CW\*(C`\-\-font DEFAULT:0:Courier\*(C'\fR.
 .PP
 RRDtool comes with a preset default font. You can set the environment
@@ -555,7 +558,7 @@ measurement, 1 kb/s is 1000 b/s.
 .PP
 [\fB\-W\fR|\fB\-\-watermark\fR \fIstring\fR]
 .PP
-Adds the given string as a watermark, horizontally centred, at the bottom 
+Adds the given string as a watermark, horizontally centered, at the bottom 
 of the graph.
 .Sh "Data and variables"
 .IX Subsection "Data and variables"
@@ -578,20 +581,22 @@ See rrdgraph_graph for the exact format.
 .IX Subsection "graphv"
 Calling rrdtool with the graphv option will return information in the
 rrdtool info format. On the command line this means that all output will be
-in key=value format. When used from the perl and ruby bindings a hash
+in key=value format. When used from the Perl and Ruby bindings a hash
 pointer will be returned from the call.
 .PP
 When the filename '\-' is given, the contents of the graph itself will also
 be returned through this interface (hash key 'image'). On the command line
 the output will look like this:
 .PP
-.Vb 12
+.Vb 14
 \& print[0] = "0.020833"
 \& print[1] = "0.0440833"
 \& graph_left = 51
 \& graph_top = 22
 \& graph_width = 400
 \& graph_height = 100
+\& graph_start = 1232908800
+\& graph_end = 1232914200
 \& image_width = 481
 \& image_height = 154
 \& value_min = 0.0000000000e+00
@@ -615,4 +620,5 @@ Make sure to read rrdgraph_examples for tips&tricks.
 .IX Header "AUTHOR"
 Program by Tobias Oetiker 
 .PP
-This manual page by Alex van den Bogaerdt 
+This manual page by Alex van den Bogaerdt 
+with corrections and/or additions by several people
diff --git a/doc/rrdgraph.html b/doc/rrdgraph.html
index 86155da..c3abf01 100644
--- a/doc/rrdgraph.html
+++ b/doc/rrdgraph.html
@@ -26,6 +26,7 @@
 		
  • filename
  • Time range
  • Labels
  • +
  • Right Axis
  • Size
  • Limits
  • Grid
  • @@ -130,10 +131,9 @@ one pixel will silently be ignored.

    [-v|--vertical-label string]

    A horizontal string at the top of the graph and/or a vertically placed string at the left hand side of the graph.

    -
    -
    Right Axis
    - -
    +

    +

    +

    Right Axis

    [--right-axis scale:shift] [--right-axis-label label]

    A second axis will be drawn to the right of the graph. It is tied to the @@ -143,8 +143,6 @@ for the right axis.

    By default the format of the axis lables gets determined automatically. If you want todo this your self, use this option with the same %lf arguments you know from the PRING and GPRINT commands.

    -
    -

    Size

    @@ -196,7 +194,7 @@ and thus the throughput may be higher than the WAN line speed.

    [-N|--no-gridfit]

    In order to avoid anti-aliasing blurring effects rrdtool snaps points to device resolution pixels, this results in a crisper -aperance. If this is not to your liking, you can use this switch +appearance. If this is not to your liking, you can use this switch to turn this behaviour off.

    Gridfitting is turned off for PDF, EPS, SVG output by default.

    @@ -243,7 +241,7 @@ as they specify the complete day and not just midnight.

    placed every label factor lines. You can specify -y none to suppress the grid and labels altogether. The default for this option is to automatically select sensible values.

    -

    If you have set --y-grid to 'none' not only the labels get supressed, also +

    If you have set --y-grid to 'none' not only the labels get suppressed, also the space reserved for the labels is removed. You can still add space manually if you use the --units-length command to explicitly reserve space.

    [-Y|--alt-y-grid]

    @@ -284,8 +282,12 @@ Note that for linear graphs, SI notation is used by default.

    Miscellaneous

    [-z|--lazy]

    Only generate the graph if the current graph is out of date or not existent. -Note, that only the image size will be returned, if you run with lazy even -when using graphv and even when using PRINT.

    +Note, that all the calculations will happen regardless so that the output of +PRINT and graphv will be complete regardless. Note that the behaviour of +lazy in this regard has seen several changes over time. The only thing you +can realy rely on before rrdtool 1.3.7 is that lazy will not generate the +graph when it is already there and up to date, and also that it will output +the size of the graph.

    [-f|--imginfo printfstr]

    After the image has been created, the graph function uses printf together with this format string to create output similar to the PRINT @@ -317,10 +319,10 @@ for the title, AXIS for the axis labels, UNIT for the label, LEGEND for the graph legend, WATERMARK for the watermark on the edge of the graph.

    Use Times for the title: --font TITLE:13:Times

    -

    If you do not give a font string you can modify just the sice of the default font: +

    If you do not give a font string you can modify just the size of the default font: --font TITLE:13:.

    If you specify the size 0 then you can modify just the font without touching -the size. This is especially usefull for altering the default font without +the size. This is especially useful for altering the default font without resetting the default fontsizes: --font DEFAULT:0:Courier.

    RRDtool comes with a preset default font. You can set the environment variable RRD_DEFAULT_FONT if you want to change this.

    @@ -391,7 +393,7 @@ behaviour of pre 1.0.42 versions).

    should be set to 1024 so that one Kb is 1024 byte. For traffic measurement, 1 kb/s is 1000 b/s.

    [-W|--watermark string]

    -

    Adds the given string as a watermark, horizontally centred, at the bottom +

    Adds the given string as a watermark, horizontally centered, at the bottom of the graph.

    @@ -411,7 +413,7 @@ See the rrdgraph_graph manpage for the exa

    graphv

    Calling rrdtool with the graphv option will return information in the rrdtool info format. On the command line this means that all output will be -in key=value format. When used from the perl and ruby bindings a hash +in key=value format. When used from the Perl and Ruby bindings a hash pointer will be returned from the call.

    When the filename '-' is given, the contents of the graph itself will also be returned through this interface (hash key 'image'). On the command line @@ -423,6 +425,8 @@ the output will look like this:

    graph_top = 22 graph_width = 400 graph_height = 100 + graph_start = 1232908800 + graph_end = 1232914200 image_width = 481 image_height = 154 value_min = 0.0000000000e+00 @@ -446,7 +450,8 @@ know what is where on the graph.


    AUTHOR

    Program by Tobias Oetiker <tobi@oetiker.ch>

    -

    This manual page by Alex van den Bogaerdt <alex@ergens.op.het.net>

    +

    This manual page by Alex van den Bogaerdt <alex@vandenbogaerdt.nl> +with corrections and/or additions by several people

    diff --git a/doc/rrdgraph.pod b/doc/rrdgraph.pod index 6cb0234..06bf679 100644 --- a/doc/rrdgraph.pod +++ b/doc/rrdgraph.pod @@ -93,7 +93,7 @@ one pixel will silently be ignored. A horizontal string at the top of the graph and/or a vertically placed string at the left hand side of the graph. -=item Right Axis +=head2 Right Axis [B<--right-axis> IB<:>I] [B<--right-axis-label> I

    Don't forget to create the database directory /var/rrd and reinitialize your inetd.

    -

    If all was setup correctly, you can access the server with perl +

    If all was setup correctly, you can access the server with Perl sockets, tools like netcat, or in a quick interactive test by using 'telnet localhost rrdsrv'.

    NOTE: that there is no authentication with this feature! Do not setup diff --git a/doc/rrdtool.pod b/doc/rrdtool.pod index 154afe7..e3523fe 100644 --- a/doc/rrdtool.pod +++ b/doc/rrdtool.pod @@ -36,8 +36,8 @@ B can be remotely controlled through a set of pipes. This saves a considerable amount of startup time when you plan to make B do a lot of things quickly. Check the section on L further down. There is also a number of language bindings -for RRDtool which allow you to use it directly from perl, python, tcl, -php, etc. +for RRDtool which allow you to use it directly from Perl, python, Tcl, +PHP, etc. =over 8 @@ -111,7 +111,7 @@ data available at a constant time interval. Unfortunately, you may not always be able to fetch data at exactly the time you want to. Therefore B lets you update the logfile at any time you want. It will automatically interpolate the value of the data-source -(B) at the latest official time-slot (intervall) and write this +(B) at the latest official time-slot (interval) and write this interpolated value to the log. The original value you have supplied is stored as well and is also taken into account when interpolating the next log entry. @@ -267,7 +267,7 @@ followed by timing information of the form BI BI. Both values are the running totals of seconds since RRDtool was started. If an error occurs, a line of the form 'C I' will be printed instead. B will not abort, -unless something realy serious happens. If +unless something really serious happens. If a B is specified and the UID is 0, RRDtool will do a chroot to that workdir. If the UID is not 0, RRDtool only changes the current directory to B. @@ -291,7 +291,7 @@ I. For example: Don't forget to create the database directory /var/rrd and reinitialize your inetd. -If all was setup correctly, you can access the server with perl +If all was setup correctly, you can access the server with Perl sockets, tools like netcat, or in a quick interactive test by using 'telnet localhost rrdsrv'. diff --git a/doc/rrdtool.txt b/doc/rrdtool.txt index 92d4099..19528bd 100644 --- a/doc/rrdtool.txt +++ b/doc/rrdtool.txt @@ -37,7 +37,7 @@ DDEESSCCRRIIPPTTIIOONN amount of startup time when you plan to make RRRRDDttooooll do a lot of things quickly. Check the section on Remote_Control further down. There is also a number of language bindings for RRDtool which allow you to use - it directly from perl, python, tcl, php, etc. + it directly from Perl, python, Tcl, PHP, etc. ccrreeaattee Set up a new Round Robin Database (RRD). Check rrdcreate. @@ -85,7 +85,7 @@ DDEESSCCRRIIPPTTIIOONN you want to. Therefore RRRRDDttooooll lets you update the logfile at any time you want. It will automatically interpolate the value of the data-source (DDSS) at the latest official time-slot - (intervall) and write this interpolated value to the log. The + (interval) and write this interpolated value to the log. The original value you have supplied is stored as well and is also taken into account when interpolating the next log entry. @@ -231,7 +231,7 @@ DDEESSCCRRIIPPTTIIOONN Both values are the running totals of seconds since RRDtool was started. If an error occurs, a line of the form '"ERROR:" _D_e_s_c_r_i_p_t_i_o_n _o_f _e_r_r_o_r' will be printed instead. RRRRDDttooooll will not abort, unless some- - thing realy serious happens. If a wwoorrkkddiirr is specified and the UID is + thing really serious happens. If a wwoorrkkddiirr is specified and the UID is 0, RRDtool will do a chroot to that workdir. If the UID is not 0, RRD- tool only changes the current directory to wwoorrkkddiirr. @@ -254,7 +254,7 @@ DDEESSCCRRIIPPTTIIOONN Don't forget to create the database directory /var/rrd and reinitialize your inetd. - If all was setup correctly, you can access the server with perl sock- + If all was setup correctly, you can access the server with Perl sock- ets, tools like netcat, or in a quick interactive test by using 'telnet localhost rrdsrv'. @@ -273,4 +273,4 @@ AAUUTTHHOORR -1.3.5 2008-09-06 RRDTOOL(1) +1.3.7 2008-12-22 RRDTOOL(1) diff --git a/doc/rrdtune.1 b/doc/rrdtune.1 index c4553c9..ef1b0f0 100644 --- a/doc/rrdtune.1 +++ b/doc/rrdtune.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RRDTUNE 1" -.TH RRDTUNE 1 "2008-03-15" "1.3.5" "rrdtool" +.TH RRDTUNE 1 "2008-03-15" "1.3.7" "rrdtool" .SH "NAME" rrdtune \- Modify some basic properties of a Round Robin Database .SH "SYNOPSIS" diff --git a/doc/rrdtune.txt b/doc/rrdtune.txt index 1ebe9d3..b300baa 100644 --- a/doc/rrdtune.txt +++ b/doc/rrdtune.txt @@ -159,4 +159,4 @@ AAUUTTHHOORR -1.3.5 2008-03-15 RRDTUNE(1) +1.3.7 2008-03-15 RRDTUNE(1) diff --git a/doc/rrdtutorial.1 b/doc/rrdtutorial.1 index 7388d18..00998d8 100644 --- a/doc/rrdtutorial.1 +++ b/doc/rrdtutorial.1 @@ -129,14 +129,13 @@ .\" ======================================================================== .\" .IX Title "RRDTUTORIAL 1" -.TH RRDTUTORIAL 1 "2008-03-15" "1.3.5" "rrdtool" -.SH "NAME" +.TH RRDTUTORIAL 1 "2009-02-21" "1.3.7" "rrdtool" rrdtutorial \- Alex van den Bogaerdt's RRDtool tutorial .SH "DESCRIPTION" .IX Header "DESCRIPTION" RRDtool is written by Tobias Oetiker with contributions from many people all around the world. This document is -written by Alex van den Bogaerdt to help you +written by Alex van den Bogaerdt to help you understand what RRDtool is and what it can do for you. .PP The documentation provided with RRDtool can be too technical for some @@ -151,13 +150,32 @@ networking. Please don't skip ahead in this document! The first part of this document explains the basics and may be boring. But if you don't understand the basics, the examples will not be as meaningful to you. +.PP +Sometimes things change. This example used to provide numbers like +\&\*(L"0.04\*(R" in stead of \*(L"4.00000e\-02\*(R". Those are really the same numbers, +just written down differently. Don't be alarmed if a future version +of rrdtool displays a slightly different form of output. The examples +in this document are correct for version 1.2.0 of RRDtool. +.PP +Also, sometimes bugs do occur. They may also influence the outcome of +the examples. Example speed4.png was suffering from this (the handling +of unknown data in an if-statement was wrong). Normal data will be +just fine (a bug in rrdtool wouldn't last long) but special cases like +NaN, \s-1INF\s0 and so on may last a bit longer. Try another version if you +can, or just live with it. +.PP +I fixed the speed4.png example (and added a note). There may be other +examples which suffer from the same or a similar bug. Try to fix it +yourself, which is a great excercise. But please do not submit your +result as a fix to the source of this document. Discuss it on the +user's list, or write to me. .Sh "What is RRDtool?" .IX Subsection "What is RRDtool?" RRDtool refers to Round Robin Database tool. Round robin is a technique that works with a fixed amount of data, and a pointer to the current element. Think of a circle with some dots plotted -on the edge \*(-- these dots are the places where data can be stored. Draw an -arrow from the center of the circle to one of the dots \*(-- this is the pointer. +on the edge. These dots are the places where data can be stored. Draw an +arrow from the center of the circle to one of the dots; this is the pointer. When the current data is read or written, the pointer moves to the next element. As we are on a circle there is neither a beginning nor an end, you can go on and on and on. After a while, all the available places will be used and @@ -167,15 +185,15 @@ RRDtool works with with Round Robin Databases (RRDs). It stores and retrieves data from them. .Sh "What data can be put into an \s-1RRD\s0?" .IX Subsection "What data can be put into an RRD?" -You name it, it will probably fit as long as it is some sort of time-series -data. This means you have to be able to measure some value at several points in time and -provide this information to RRDtool. If you can do this, RRDtool will be -able to store it. The values must be numerical but don't have to be -integers, as is the case with \s-1MRTG\s0 (the next section will give more details -on this more specialized application). +You name it, it will probably fit as long as it is some sort of +time-series data. This means you have to be able to measure some value +at several points in time and provide this information to RRDtool. If +you can do this, RRDtool will be able to store it. The values must be +numerical but don't have to be integers, as is the case with \s-1MRTG\s0 (the +next section will give more details on this more specialized application). .PP Many examples below talk about \s-1SNMP\s0 which is an acronym for Simple Network -Management Protocol. \*(L"Simple\*(R" refers to the protocol \*(-- it does not +Management Protocol. \*(L"Simple\*(R" refers to the protocol. It does not mean it is simple to manage or monitor a network. After working your way through this document, you should know enough to be able to understand what people are talking about. For now, just realize that @@ -261,7 +279,7 @@ Most discussions about networking talk about bits per second so lets get used to that right away. Assume a byte is eight bits and start to think in bits not bytes. The counter, however, still counts bytes! In the \s-1SNMP\s0 world most of the counters are 32 bits. That means they are -counting from 0 to 4'294'967'295. We will use these values in the examples. +counting from 0 to 4294967295. We will use these values in the examples. The device, when asked, returns the current value of the counter. We know the time that has passes since we last asked so we now know how many bytes have been transfered ***on average*** per second. This is @@ -287,36 +305,36 @@ most into miles per hour by dividing km by 1.6 (close enough). I will use the following abbreviations: .PP .Vb 6 -\& M: meter -\& KM: kilometer (= 1\(aq000 meters). -\& H: hour -\& S: second -\& KM/H: kilometers per hour -\& M/S: meters per second +\& m: meter +\& km: kilometer (= 1000 meters). +\& h: hour +\& s: second +\& km/h: kilometers per hour +\& m/s: meters per second .Ve .PP You are driving a car. At 12:05 you read the counter in the dashboard -and it tells you that the car has moved 12'345 \s-1KM\s0 until that moment. -At 12:10 you look again, it reads 12'357 \s-1KM\s0. This means you have -traveled 12 \s-1KM\s0 in five minutes. A scientist would translate that +and it tells you that the car has moved 12345 km until that moment. +At 12:10 you look again, it reads 12357 km. This means you have +traveled 12 km in five minutes. A scientist would translate that into meters per second and this makes a nice comparison toward the problem of (bytes per five minutes) versus (bits per second). .PP -We traveled 12 kilometers which is 12'000 meters. We did that in five -minutes or 300 seconds. Our speed is 12'000M / 300S or 40 M/S. +We traveled 12 kilometers which is 12000 meters. We did that in five +minutes or 300 seconds. Our speed is 12000m / 300s or 40 m/s. .PP -We could also calculate the speed in \s-1KM/H:\s0 12 times 5 minutes -is an hour, so we have to multiply 12 \s-1KM\s0 by 12 to get 144 \s-1KM/H\s0. -For our native English speaking friends: that's 90 \s-1MPH\s0 so don't +We could also calculate the speed in km/h: 12 times 5 minutes +is an hour, so we have to multiply 12 km by 12 to get 144 km/h. +For our native English speaking friends: that's 90 mph so don't try this example at home or where I live :) .PP Remember: these numbers are averages only. There is no way to figure out from the numbers, if you drove at a constant speed. There is an example later on in this tutorial that explains this. .PP -I hope you understand that there is no difference in calculating M/S or -bps; only the way we collect the data is different. Even the K from kilo -is the same as in networking terms k also means 1'000. +I hope you understand that there is no difference in calculating m/s or +bps; only the way we collect the data is different. Even the k from kilo +is the same as in networking terms k also means 1000. .PP We will now create a database where we can keep all these interesting numbers. The method used to start the program may differ slightly from @@ -339,7 +357,7 @@ and skip all of the '\e' characters. .IX Subsection "What has been created?" We created the round robin database called test (test.rrd) which starts at noon the day I started writing this document, 7th of March, 1999 (this date -translates to 920'804'400 seconds as explained below). Our database holds +translates to 920804400 seconds as explained below). Our database holds one data source (\s-1DS\s0) named \*(L"speed\*(R" that represents a counter. This counter is read every five minutes (this is the default therefore you don't have to put \f(CW\*(C`\-\-step=300\*(C'\fR). In the same database two round robin archives (RRAs) @@ -362,21 +380,21 @@ We now have to fill our database with some numbers. We'll pretend to have read the following numbers: .PP .Vb 15 -\& 12:05 12345 KM -\& 12:10 12357 KM -\& 12:15 12363 KM -\& 12:20 12363 KM -\& 12:25 12363 KM -\& 12:30 12373 KM -\& 12:35 12383 KM -\& 12:40 12393 KM -\& 12:45 12399 KM -\& 12:50 12405 KM -\& 12:55 12411 KM -\& 13:00 12415 KM -\& 13:05 12420 KM -\& 13:10 12422 KM -\& 13:15 12423 KM +\& 12:05 12345 km +\& 12:10 12357 km +\& 12:15 12363 km +\& 12:20 12363 km +\& 12:25 12363 km +\& 12:30 12373 km +\& 12:35 12383 km +\& 12:40 12393 km +\& 12:45 12399 km +\& 12:50 12405 km +\& 12:55 12411 km +\& 13:00 12415 km +\& 13:05 12420 km +\& 13:10 12422 km +\& 13:15 12423 km .Ve .PP We fill the database as follows: @@ -438,12 +456,7 @@ If it doesn't, something may be wrong. Perhaps your \s-1OS\s0 will print writes \*(L"U\*(R" or \*(L"\s-1UNKN\s0\*(R" or something similar that's okay. If something else is wrong, it will probably be due to an error you made (assuming that my tutorial is correct of course :\-). In that case: delete the -database and try again. Sometimes things change. This example used -to provide numbers like \*(L"0.04\*(R" in stead of \*(L"4.00000e\-02\*(R". Those are -really the same numbers, just written down differently. Don't be -alarmed if a future version of rrdtool displays a slightly different -form of output. The examples in this document are correct for version -1.2.0 of RRDtool. +database and try again. .PP The meaning of the above output will become clear below. .Sh "Time to create some graphics" @@ -484,8 +497,8 @@ The \*(L"color\*(R" black is all colors off: 000000 \& gray #555555 (one third of all components) .Ve .PP -Additionally you can add an alpha channel (transparency). The default -will be \*(L"\s-1FF\s0\*(R" which means non\-transparent. +Additionally you can (with a recent RRDtool) add an alpha channel +(transparency). The default will be \*(L"\s-1FF\s0\*(R" which means non\-transparent. .PP The \s-1PNG\s0 you just created can be displayed using your favorite image viewer. Web browsers will display the \s-1PNG\s0 via the \s-1URL\s0 @@ -494,18 +507,18 @@ viewer. Web browsers will display the \s-1PNG\s0 via the \s-1URL\s0 .IX Subsection "Graphics with some math" When looking at the image, you notice that the horizontal axis is labeled 12:10, 12:20, 12:30, 12:40 and 12:50. Sometimes a label doesn't fit (12:00 -and 13:00 would be candidates) so they are skipped. +and 13:00 would be likely candidates) so they are skipped. .PP The vertical axis displays the range we entered. We provided kilometers and when divided by 300 seconds, we get very small -numbers. To be exact, the first value was 12 (12'357\-12'345) and divided +numbers. To be exact, the first value was 12 (12357\-12345) and divided by 300 this makes 0.04, which is displayed by RRDtool as \*(L"40 m\*(R" -meaning \*(L"40/1'000\*(R". The \*(L"m\*(R" (milli) has nothing to do with meters, +meaning \*(L"40/1000\*(R". The \*(L"m\*(R" (milli) has nothing to do with meters (also m), kilometers or millimeters! RRDtool doesn't know about the physical units of our data, it just works with dimensionless numbers. .PP If we had measured our distances in meters, this would have been -(12'357'000\-12'345'000)/300 = 12'000/300 = 40. +(12357000\-12345000)/300 = 12000/300 = 40. .PP As most people have a better feel for numbers in this range, we'll correct that. We could recreate our database and store the correct @@ -521,10 +534,19 @@ the png file! \& LINE2:realspeed#FF0000 .Ve .PP -Note: Make sure not to forget the backslash \e in front of the -multiplication operator * above. The backslash is needed to \*(L"escape\*(R" -the * as some operating systems might interpret and expand * instead -of passing it to the rrdtool command. +Note: I need to escape the multiplication operator * with a backslash. +If I don't, the operating system may interpret it and use it for file +name expansion. You could also place the line within quotation marks +like so: +.PP +.Vb 1 +\& "CDEF:realspeed=myspeed,1000,*" \e +.Ve +.PP +It boils down to: it is RRDtool which should see *, not your shell. +And it is your shell interpreting \e, not RRDtool. You may need to +adjust examples accordingly if you happen to use an operating +system or shell which behaves differently. .PP After viewing this \s-1PNG\s0, you notice the \*(L"m\*(R" (milli) has disappeared. This it what the correct result would be. Also, a label @@ -538,22 +560,22 @@ those\*(R". Don't bother with \s-1RPN\s0 yet, it will be explained later on in more detail. Also, you may want to read my tutorial on CDEFs and Steve Rader's tutorial on \s-1RPN\s0. But first finish this tutorial. .PP -Hang on! If we can multiply values with 1'000, it should also be possible +Hang on! If we can multiply values with 1000, it should also be possible to display kilometers per hour from the same data! .PP To change a value that is measured in meters per second: .PP .Vb 3 -\& Calculate meters per hour: value * 3\(aq600 -\& Calculate kilometers per hour: value / 1\(aq000 -\& Together this makes: value * (3\(aq600/1\(aq000) or value * 3.6 +\& Calculate meters per hour: value * 3600 +\& Calculate kilometers per hour: value / 1000 +\& Together this makes: value * (3600/1000) or value * 3.6 .Ve .PP In our example database we made a mistake and we need to compensate for -this by multiplying with 1'000. Applying that correction: +this by multiplying with 1000. Applying that correction: .PP .Vb 1 -\& value * 3.6 * 1\(aq000 == value * 3\(aq600 +\& value * 3.6 * 1000 == value * 3600 .Ve .PP Now let's create this \s-1PNG\s0, and add some more magic ... @@ -574,7 +596,7 @@ Now let's create this \s-1PNG\s0, and add some more magic ... Note: here we use another means to escape the * operator by enclosing the whole string in double quotes. .PP -This graph looks much better. Speed is shown in \s-1KM/H\s0 and there is even +This graph looks much better. Speed is shown in km/h and there is even an extra line with the maximum allowed speed (on the road I travel on). I also changed the colors used to display speed and changed it from a line into an area. @@ -599,12 +621,13 @@ I like to believe there are virtually no limits to how RRDtool graph can manipulate data. I will not explain how it works, but look at the following \s-1PNG:\s0 .PP -.Vb 12 +.Vb 13 \& rrdtool graph speed4.png \e \& \-\-start 920804400 \-\-end 920808000 \e \& \-\-vertical\-label km/h \e \& DEF:myspeed=test.rrd:speed:AVERAGE \e -\& "CDEF:kmh=myspeed,3600,*" \e +\& CDEF:nonans=myspeed,UN,0,myspeed,IF \e +\& CDEF:kmh=nonans,3600,* \e \& CDEF:fast=kmh,100,GT,100,0,IF \e \& CDEF:over=kmh,100,GT,kmh,100,\-,0,IF \e \& CDEF:good=kmh,100,GT,0,kmh,IF \e @@ -614,6 +637,10 @@ following \s-1PNG:\s0 \& STACK:over#FF0000:"Over speed" .Ve .PP +Remember the note in the beginning? I had to remove unknown data from +this example. The 'nonans' \s-1CDEF\s0 is new, and the 6th line (which used to +be the 5th line) used to read 'CDEF:kmh=myspeed,3600,*' +.PP Let's create a quick and dirty \s-1HTML\s0 page to view the three PNGs: .PP .Vb 7 @@ -670,7 +697,7 @@ whatever. Any incrementing counter can be monitored and graphed using the stuff you learned so far. Later on we will also be able to monitor other types of values like temperature. .PP -Most (?) people interested in RRDtool will use the counter that keeps track +Many people interested in RRDtool will use the counter that keeps track of octets (bytes) transfered by a network device. So let's do just that next. We will start with a description of how to collect data. .PP @@ -898,8 +925,8 @@ Then, after collecting data for a day, try to create an image using: .Ve .PP This should produce a picture with one day worth of traffic. -One day is 24 hours of 60 minutes of 60 seconds: 24*60*60=86'400, we -start at now minus 86'400 seconds. We define (with DEFs) inoctets and +One day is 24 hours of 60 minutes of 60 seconds: 24*60*60=86400, we +start at now minus 86400 seconds. We define (with DEFs) inoctets and outoctets as the average values from the database myrouter.rrd and draw an area for the \*(L"in\*(R" traffic and a line for the \*(L"out\*(R" traffic. .PP @@ -917,16 +944,16 @@ the maximum values instead of the average values. Let's go into this a bit more. .PP Recall all the stuff about the speed of the car. Suppose we drove at 144 -\&\s-1KM/H\s0 during 5 minutes and then were stopped by the police for 25 minutes. +km/h during 5 minutes and then were stopped by the police for 25 minutes. At the end of the lecture we would take our laptop and create and view the image taken from the database. If we look at the second \s-1RRA\s0 we did create, we would have the average from 6 samples. The samples measured would be 144+0+0+0+0+0=144, divided by 30 minutes, corrected for the -error by 1000, translated into \s-1KM/H\s0, with a result of 24 \s-1KM/H\s0. +error by 1000, translated into km/h, with a result of 24 km/h. I would still get a ticket but not for speeding anymore :) .PP Obviously, in this case we shouldn't look at the averages. In some -cases they are handy. If you want to know how many \s-1KM\s0 you had traveled, +cases they are handy. If you want to know how many km you had traveled, the averaged picture would be the right one to look at. On the other hand, for the speed that we traveled at, the maximum numbers seen is much more interesting. Later we will see more types. @@ -938,9 +965,9 @@ we have created, there are two archives that keep data per day. The archive that keeps averages will show low numbers, the archive that shows maxima will have higher numbers. .PP -For my car this would translate in averages per day of 96/24=4 \s-1KM/H\s0 +For my car this would translate in averages per day of 96/24=4 km/h (as I travel about 94 kilometers on a day) during working days, and -maxima of 120 \s-1KM/H\s0 (my top speed that I reach every day). +maxima of 120 km/h (my top speed that I reach every day). .PP Big difference. Do not look at the second graph to estimate the distances that I travel and do not look at the first graph to @@ -948,11 +975,11 @@ estimate my speed. This will work if the samples are close together, as they are in five minutes, but not if you average. .PP On some days, I go for a long ride. If I go across Europe and travel -for 12 hours, the first graph will rise to about 60 \s-1KM/H\s0. The second -one will show 180 \s-1KM/H\s0. This means that I traveled a distance of 60 -\&\s-1KM/H\s0 times 24 H = 1440 \s-1KM\s0. I did this with a higher speed and a -maximum around 180 \s-1KM/H\s0. However, it probably doesn't mean that I -traveled for 8 hours at a constant speed of 180 \s-1KM/H\s0! +for 12 hours, the first graph will rise to about 60 km/h. The second +one will show 180 km/h. This means that I traveled a distance of 60 +km/h times 24 h = 1440 km. I did this with a higher speed and a +maximum around 180 km/h. However, it probably doesn't mean that I +traveled for 8 hours at a constant speed of 180 km/h! .PP This is a real example: go with the flow through Germany (fast!) and stop a few times for gas and coffee. Drive slowly through Austria and the @@ -969,7 +996,7 @@ day. From this one value, we cannot see much detail, of course. .PP Make sure you understand the last few paragraphs. There is no value in only a line and a few axis, you need to know what they mean and -interpret the data in ana appropriate way. This is true for all data. +interpret the data in an appropriate way. This is true for all data. .PP The biggest mistake you can make is to use the collected data for something that it is not suitable for. You would be better off if @@ -978,8 +1005,8 @@ you didn't have the graph at all. .IX Subsection "Let's review what you now should know" You know how to create a database and can put data in it. You can get the numbers out again by creating an image, do math on the data from -the database and view the resulte instead of the raw data. You know -about the difference between averages and maxima, and when to use +the database and view the result instead of the raw data. You know +about the difference between averages and maximum, and when to use which (or at least you should have an idea). .PP RRDtool can do more than what we have learned up to now. Before you @@ -1026,7 +1053,7 @@ The two additional types are \s-1DERIVE\s0 and \s-1ABSOLUTE\s0. Absolute can be counter with one difference: RRDtool assumes the counter is reset when it's read. That is: its delta is known without calculation by RRDtool whereas RRDtool needs to calculate it for the counter type. -Example: our first example (12'345, 12'357, 12'363, 12'363) would read: +Example: our first example (12345, 12357, 12363, 12363) would read: unknown, 12, 6, 0. The rest of the calculations stay the same. The other one, derive, is like counter. Unlike counter, it can also decrease so it can have a negative delta. Again, the rest of the @@ -1070,7 +1097,7 @@ Line B is of type \s-1GAUGE\s0. These are \*(L"real\*(R" values so they should m what we put in: a sort of a wave. .IP "\(bu" 2 Line C is of type \s-1DERIVE\s0. It should be a counter that can decrease. It does -so between 2'400 and 0, with 1'800 in\-between. +so between 2400 and 0, with 1800 in\-between. .IP "\(bu" 2 Line D is of type \s-1ABSOLUTE\s0. This is like counter but it works on values without calculating the difference. The numbers are the same @@ -1123,10 +1150,10 @@ increasing values. .IX Subsection "Counter Wraps" There are a few more basics to show. Some important options are still to be covered and we haven't look at counter wraps yet. First the counter wrap: -In our car we notice that the counter shows 999'987. We travel 20 \s-1KM\s0 and -the counter should go to 1'000'007. Unfortunately, there are only six digits -on our counter so it really shows 000'007. If we would plot that on a type -\&\s-1DERIVE\s0, it would mean that the counter was set back 999'980 \s-1KM\s0. It wasn't, +In our car we notice that the counter shows 999987. We travel 20 km and +the counter should go to 1000007. Unfortunately, there are only six digits +on our counter so it really shows 000007. If we would plot that on a type +\&\s-1DERIVE\s0, it would mean that the counter was set back 999980 km. It wasn't, and there has to be some protection for this. This protection is only available for type \s-1COUNTER\s0 which should be used for this kind of counter anyways. How does it work? Type counter should never decrease and @@ -1135,11 +1162,11 @@ If the delta is negative, this can be compensated for by adding the maximum value of the counter + 1. For our car this would be: .PP .Vb 1 -\& Delta = 7 \- 999\(aq987 = \-999\(aq980 (instead of 1\(aq000\(aq007\-999\(aq987=20) +\& Delta = 7 \- 999987 = \-999980 (instead of 1000007\-999987=20) .Ve .PP .Vb 1 -\& Real delta = \-999\(aq980 + 999\(aq999 + 1 = 20 +\& Real delta = \-999980 + 999999 + 1 = 20 .Ve .PP At the time of writing this document, RRDtool knows of counters that @@ -1147,8 +1174,8 @@ are either 32 bits or 64 bits of size. These counters can handle the following different values: .PP .Vb 2 -\& \- 32 bits: 0 .. 4\(aq294\(aq967\(aq295 -\& \- 64 bits: 0 .. 18\(aq446\(aq744\(aq073\(aq709\(aq551\(aq615 +\& \- 32 bits: 0 .. 4294967295 +\& \- 64 bits: 0 .. 18446744073709551615 .Ve .PP If these numbers look strange to you, you can view them in @@ -1181,50 +1208,50 @@ can't handle the numbers :) Correction numbers: .PP .Vb 3 -\& \- 32 bits: (4\(aq294\(aq967\(aq295 + 1) = 4\(aq294\(aq967\(aq296 -\& \- 64 bits: (18\(aq446\(aq744\(aq073\(aq709\(aq551\(aq615 + 1) -\& \- correction1 = 18\(aq446\(aq744\(aq069\(aq414\(aq584\(aq320 +\& \- 32 bits: (4294967295 + 1) = 4294967296 +\& \- 64 bits: (18446744073709551615 + 1) +\& \- correction1 = 18446744069414584320 .Ve .PP .Vb 6 -\& Before: 4\(aq294\(aq967\(aq200 +\& Before: 4294967200 \& Increase: 100 -\& Should become: 4\(aq294\(aq967\(aq300 +\& Should become: 4294967300 \& But really is: 4 -\& Delta: \-4\(aq294\(aq967\(aq196 -\& Correction1: \-4\(aq294\(aq967\(aq196 + 4\(aq294\(aq967\(aq296 = 100 +\& Delta: \-4294967196 +\& Correction1: \-4294967196 + 4294967296 = 100 .Ve .PP .Vb 9 -\& Before: 18\(aq446\(aq744\(aq073\(aq709\(aq551\(aq000 +\& Before: 18446744073709551000 \& Increase: 800 -\& Should become: 18\(aq446\(aq744\(aq073\(aq709\(aq551\(aq800 +\& Should become: 18446744073709551800 \& But really is: 184 -\& Delta: \-18\(aq446\(aq744\(aq073\(aq709\(aq550\(aq816 -\& Correction1: \-18\(aq446\(aq744\(aq073\(aq709\(aq550\(aq816 -\& + 4\(aq294\(aq967\(aq296 = \-18\(aq446\(aq744\(aq069\(aq414\(aq583\(aq520 -\& Correction2: \-18\(aq446\(aq744\(aq069\(aq414\(aq583\(aq520 -\& + 18\(aq446\(aq744\(aq069\(aq414\(aq584\(aq320 = 800 +\& Delta: \-18446744073709550816 +\& Correction1: \-18446744073709550816 +\& + 4294967296 = \-18446744069414583520 +\& Correction2: \-18446744069414583520 +\& + 18446744069414584320 = 800 .Ve .PP .Vb 7 -\& Before: 18\(aq446\(aq744\(aq073\(aq709\(aq551\(aq615 ( maximum value ) -\& Increase: 18\(aq446\(aq744\(aq069\(aq414\(aq584\(aq320 ( absurd increase, minimum for -\& Should become: 36\(aq893\(aq488\(aq143\(aq124\(aq135\(aq935 this example to work ) -\& But really is: 18\(aq446\(aq744\(aq069\(aq414\(aq584\(aq319 -\& Delta: \-4\(aq294\(aq967\(aq296 -\& Correction1: \-4\(aq294\(aq967\(aq296 + 4\(aq294\(aq967\(aq296 = 0 +\& Before: 18446744073709551615 ( maximum value ) +\& Increase: 18446744069414584320 ( absurd increase, minimum for +\& Should become: 36893488143124135935 this example to work ) +\& But really is: 18446744069414584319 +\& Delta: \-4294967296 +\& Correction1: \-4294967296 + 4294967296 = 0 \& (not negative \-> no correction2) .Ve .PP .Vb 7 -\& Before: 18\(aq446\(aq744\(aq073\(aq709\(aq551\(aq615 ( maximum value ) -\& Increase: 18\(aq446\(aq744\(aq069\(aq414\(aq584\(aq319 ( one less increase ) -\& Should become: 36\(aq893\(aq488\(aq143\(aq124\(aq135\(aq934 -\& But really is: 18\(aq446\(aq744\(aq069\(aq414\(aq584\(aq318 -\& Delta: \-4\(aq294\(aq967\(aq297 -\& Correction1: \-4\(aq294\(aq967\(aq297 + 4\(aq294\(aq967\(aq296 = \-1 -\& Correction2: \-1 + 18\(aq446\(aq744\(aq069\(aq414\(aq584\(aq320 = 18\(aq446\(aq744\(aq069\(aq414\(aq584\(aq319 +\& Before: 18446744073709551615 ( maximum value ) +\& Increase: 18446744069414584319 ( one less increase ) +\& Should become: 36893488143124135934 +\& But really is: 18446744069414584318 +\& Delta: \-4294967297 +\& Correction1: \-4294967297 + 4294967296 = \-1 +\& Correction2: \-1 + 18446744069414584320 = 18446744069414584319 .Ve .PP As you can see from the last two examples, you need strange numbers @@ -1278,8 +1305,8 @@ RRDtool interpolates and stores 300 as it should be. \& time+900: 900 delta=300 time+900: 900 delta=297 .Ve .PP -Let's create two identical databases. I've chosen the time range 920'805'000 -to 920'805'900 as this goes very well with the example numbers. +Let's create two identical databases. I've chosen the time range 920805000 +to 920805900 as this goes very well with the example numbers. .PP .Vb 4 \& rrdtool create seconds1.rrd \e @@ -1335,7 +1362,7 @@ It's time now to wrap up this tutorial. We covered all the basics for you to be able to work with RRDtool and to read the additional documentation available. There is plenty more to discover about RRDtool and you will find more and more uses for this package. You can -easly create graphs using just the examples provided and using only +easily create graphs using just the examples provided and using only RRDtool. You can also use one of the front ends to RRDtool that are available. .SH "MAILINGLIST" @@ -1360,4 +1387,4 @@ basic questions. They will not only get their answers, but at the same time learn a whole lot more. .PP Alex van den Bogaerdt - + diff --git a/doc/rrdtutorial.html b/doc/rrdtutorial.html index 86eb7db..fc73b90 100644 --- a/doc/rrdtutorial.html +++ b/doc/rrdtutorial.html @@ -15,7 +15,6 @@

      -
    • NAME
    • DESCRIPTION
    • TUTORIAL
      • @@ -50,9 +49,6 @@ --> -

        -

        -

        NAME

        rrdtutorial - Alex van den Bogaerdt's RRDtool tutorial

        @@ -60,7 +56,7 @@

        DESCRIPTION

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

        The documentation provided with RRDtool can be too technical for some people. This tutorial is here to help you understand the basics of @@ -77,14 +73,30 @@ networking.

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

        +

        Sometimes things change. This example used to provide numbers like +``0.04'' in stead of ``4.00000e-02''. Those are really the same numbers, +just written down differently. Don't be alarmed if a future version +of rrdtool displays a slightly different form of output. The examples +in this document are correct for version 1.2.0 of RRDtool.

        +

        Also, sometimes bugs do occur. They may also influence the outcome of +the examples. Example speed4.png was suffering from this (the handling +of unknown data in an if-statement was wrong). Normal data will be +just fine (a bug in rrdtool wouldn't last long) but special cases like +NaN, INF and so on may last a bit longer. Try another version if you +can, or just live with it.

        +

        I fixed the speed4.png example (and added a note). There may be other +examples which suffer from the same or a similar bug. Try to fix it +yourself, which is a great excercise. But please do not submit your +result as a fix to the source of this document. Discuss it on the +user's list, or write to me.

        What is RRDtool?

        RRDtool refers to Round Robin Database tool. Round robin is a technique that works with a fixed amount of data, and a pointer to the current element. Think of a circle with some dots plotted -on the edge -- these dots are the places where data can be stored. Draw an -arrow from the center of the circle to one of the dots -- this is the pointer. +on the edge. These dots are the places where data can be stored. Draw an +arrow from the center of the circle to one of the dots; this is the pointer. When the current data is read or written, the pointer moves to the next element. As we are on a circle there is neither a beginning nor an end, you can go on and on and on. After a while, all the available places will be used and @@ -95,14 +107,14 @@ data from them.

        What data can be put into an RRD?

        -

        You name it, it will probably fit as long as it is some sort of time-series -data. This means you have to be able to measure some value at several points in time and -provide this information to RRDtool. If you can do this, RRDtool will be -able to store it. The values must be numerical but don't have to be -integers, as is the case with MRTG (the next section will give more details -on this more specialized application).

        +

        You name it, it will probably fit as long as it is some sort of +time-series data. This means you have to be able to measure some value +at several points in time and provide this information to RRDtool. If +you can do this, RRDtool will be able to store it. The values must be +numerical but don't have to be integers, as is the case with MRTG (the +next section will give more details on this more specialized application).

        Many examples below talk about SNMP which is an acronym for Simple Network -Management Protocol. ``Simple'' refers to the protocol -- it does not +Management Protocol. ``Simple'' refers to the protocol. It does not mean it is simple to manage or monitor a network. After working your way through this document, you should know enough to be able to understand what people are talking about. For now, just realize that @@ -182,7 +194,7 @@ in the world such as the mileage counter in a car.

        get used to that right away. Assume a byte is eight bits and start to think in bits not bytes. The counter, however, still counts bytes! In the SNMP world most of the counters are 32 bits. That means they are -counting from 0 to 4'294'967'295. We will use these values in the examples. +counting from 0 to 4294967295. We will use these values in the examples. The device, when asked, returns the current value of the counter. We know the time that has passes since we last asked so we now know how many bytes have been transfered ***on average*** per second. This is @@ -208,30 +220,30 @@ Do not try this example, and if you do, don't blame me for the results!

        most into miles per hour by dividing km by 1.6 (close enough). I will use the following abbreviations:

        - M:    meter
        - KM:   kilometer (= 1'000 meters).
        - H:    hour
        - S:    second
        - KM/H: kilometers per hour
        - M/S:  meters per second
        + m: meter + km: kilometer (= 1000 meters). + h: hour + s: second + km/h: kilometers per hour + m/s: meters per second

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

        -

        We traveled 12 kilometers which is 12'000 meters. We did that in five -minutes or 300 seconds. Our speed is 12'000M / 300S or 40 M/S.

        -

        We could also calculate the speed in KM/H: 12 times 5 minutes -is an hour, so we have to multiply 12 KM by 12 to get 144 KM/H. -For our native English speaking friends: that's 90 MPH so don't +

        We traveled 12 kilometers which is 12000 meters. We did that in five +minutes or 300 seconds. Our speed is 12000m / 300s or 40 m/s.

        +

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

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

        -

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

        +

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

        We will now create a database where we can keep all these interesting numbers. The method used to start the program may differ slightly from OS to OS, but I assume you can figure it out if it works different on @@ -251,7 +263,7 @@ and skip all of the '\' characters.

        What has been created?

        We created the round robin database called test (test.rrd) which starts at noon the day I started writing this document, 7th of March, 1999 (this date -translates to 920'804'400 seconds as explained below). Our database holds +translates to 920804400 seconds as explained below). Our database holds one data source (DS) named ``speed'' that represents a counter. This counter is read every five minutes (this is the default therefore you don't have to put --step=300). In the same database two round robin archives (RRAs) @@ -270,21 +282,21 @@ As an example: where I will see ``12:05'' the UK folks will see ``11:05''.

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

        - 12:05  12345 KM
        - 12:10  12357 KM
        - 12:15  12363 KM
        - 12:20  12363 KM
        - 12:25  12363 KM
        - 12:30  12373 KM
        - 12:35  12383 KM
        - 12:40  12393 KM
        - 12:45  12399 KM
        - 12:50  12405 KM
        - 12:55  12411 KM
        - 13:00  12415 KM
        - 13:05  12420 KM
        - 13:10  12422 KM
        - 13:15  12423 KM
        + 12:05 12345 km + 12:10 12357 km + 12:15 12363 km + 12:20 12363 km + 12:25 12363 km + 12:30 12373 km + 12:35 12383 km + 12:40 12393 km + 12:45 12399 km + 12:50 12405 km + 12:55 12411 km + 13:00 12415 km + 13:05 12420 km + 13:10 12422 km + 13:15 12423 km

        We fill the database as follows:

          rrdtool update test.rrd 920804700:12345 920805000:12357 920805300:12363
        @@ -328,12 +340,7 @@ the real maximum per line is OS dependent.

        writes ``U'' or ``UNKN'' or something similar that's okay. If something else is wrong, it will probably be due to an error you made (assuming that my tutorial is correct of course :-). In that case: delete the -database and try again. Sometimes things change. This example used -to provide numbers like ``0.04'' in stead of ``4.00000e-02''. Those are -really the same numbers, just written down differently. Don't be -alarmed if a future version of rrdtool displays a slightly different -form of output. The examples in this document are correct for version -1.2.0 of RRDtool.

        +database and try again.

        The meaning of the above output will become clear below.

        @@ -365,8 +372,8 @@ The ``color'' black is all colors off: 000000

        blue #0000FF magenta #FF00FF (mixed red with blue) gray #555555 (one third of all components)
        -

        Additionally you can add an alpha channel (transparency). The default -will be ``FF'' which means non-transparent.

        +

        Additionally you can (with a recent RRDtool) add an alpha channel +(transparency). The default will be ``FF'' which means non-transparent.

        The PNG you just created can be displayed using your favorite image viewer. Web browsers will display the PNG via the URL ``file:///the/path/to/speed.png''

        @@ -375,16 +382,16 @@ viewer. Web browsers will display the PNG via the URL

        Graphics with some math

        When looking at the image, you notice that the horizontal axis is labeled 12:10, 12:20, 12:30, 12:40 and 12:50. Sometimes a label doesn't fit (12:00 -and 13:00 would be candidates) so they are skipped.

        +and 13:00 would be likely candidates) so they are skipped.

        The vertical axis displays the range we entered. We provided kilometers and when divided by 300 seconds, we get very small -numbers. To be exact, the first value was 12 (12'357-12'345) and divided +numbers. To be exact, the first value was 12 (12357-12345) and divided by 300 this makes 0.04, which is displayed by RRDtool as ``40 m'' -meaning ``40/1'000''. The ``m'' (milli) has nothing to do with meters, +meaning ``40/1000''. The ``m'' (milli) has nothing to do with meters (also m), kilometers or millimeters! RRDtool doesn't know about the physical units of our data, it just works with dimensionless numbers.

        If we had measured our distances in meters, this would have been -(12'357'000-12'345'000)/300 = 12'000/300 = 40.

        +(12357000-12345000)/300 = 12000/300 = 40.

        As most people have a better feel for numbers in this range, we'll correct that. We could recreate our database and store the correct data, but there is a better way: we do some calculations while creating @@ -396,10 +403,16 @@ the png file!

        DEF:myspeed=test.rrd:speed:AVERAGE \ CDEF:realspeed=myspeed,1000,\* \ LINE2:realspeed#FF0000 -

        Note: Make sure not to forget the backslash \ in front of the -multiplication operator * above. The backslash is needed to ``escape'' -the * as some operating systems might interpret and expand * instead -of passing it to the rrdtool command.

        +

        Note: I need to escape the multiplication operator * with a backslash. +If I don't, the operating system may interpret it and use it for file +name expansion. You could also place the line within quotation marks +like so:

        +
        +      "CDEF:realspeed=myspeed,1000,*"                  \
        +

        It boils down to: it is RRDtool which should see *, not your shell. +And it is your shell interpreting \, not RRDtool. You may need to +adjust examples accordingly if you happen to use an operating +system or shell which behaves differently.

        After viewing this PNG, you notice the ``m'' (milli) has disappeared. This it what the correct result would be. Also, a label has been added to the image. Apart from the things mentioned above, @@ -410,17 +423,17 @@ Reverse Polish Notation (``RPN''). What we requested RRDtool to do is: those''. Don't bother with RPN yet, it will be explained later on in more detail. Also, you may want to read my tutorial on CDEFs and Steve Rader's tutorial on RPN. But first finish this tutorial.

        -

        Hang on! If we can multiply values with 1'000, it should also be possible +

        Hang on! If we can multiply values with 1000, it should also be possible to display kilometers per hour from the same data!

        To change a value that is measured in meters per second:

        - Calculate meters per hour:     value * 3'600
        - Calculate kilometers per hour: value / 1'000
        - Together this makes:           value * (3'600/1'000) or value * 3.6
        + Calculate meters per hour: value * 3600 + Calculate kilometers per hour: value / 1000 + Together this makes: value * (3600/1000) or value * 3.6

        In our example database we made a mistake and we need to compensate for -this by multiplying with 1'000. Applying that correction:

        +this by multiplying with 1000. Applying that correction:

        - value * 3.6  * 1'000 == value * 3'600
        + value * 3.6 * 1000 == value * 3600

        Now let's create this PNG, and add some more magic ...

          rrdtool graph speed3.png                             \
        @@ -435,7 +448,7 @@ this by multiplying with 1'000. Applying that correction:

        AREA:fast#FF0000:"Too fast"

        Note: here we use another means to escape the * operator by enclosing the whole string in double quotes.

        -

        This graph looks much better. Speed is shown in KM/H and there is even +

        This graph looks much better. Speed is shown in km/h and there is even an extra line with the maximum allowed speed (on the road I travel on). I also changed the colors used to display speed and changed it from a line into an area.

        @@ -459,7 +472,8 @@ following PNG:

        --start 920804400 --end 920808000 \ --vertical-label km/h \ DEF:myspeed=test.rrd:speed:AVERAGE \ - "CDEF:kmh=myspeed,3600,*" \ + CDEF:nonans=myspeed,UN,0,myspeed,IF \ + CDEF:kmh=nonans,3600,* \ CDEF:fast=kmh,100,GT,100,0,IF \ CDEF:over=kmh,100,GT,kmh,100,-,0,IF \ CDEF:good=kmh,100,GT,0,kmh,IF \ @@ -467,6 +481,9 @@ following PNG:

        AREA:good#00FF00:"Good speed" \ AREA:fast#550000:"Too fast" \ STACK:over#FF0000:"Over speed" +

        Remember the note in the beginning? I had to remove unknown data from +this example. The 'nonans' CDEF is new, and the 6th line (which used to +be the 5th line) used to read 'CDEF:kmh=myspeed,3600,*'

        Let's create a quick and dirty HTML page to view the three PNGs:

            <HTML><HEAD><TITLE>Speed</TITLE></HEAD><BODY>
        @@ -513,7 +530,7 @@ coffee machine, a device that counts the electricity used,
         whatever. Any incrementing counter can be monitored and graphed using
         the stuff you learned so far. Later on we will also be able to monitor
         other types of values like temperature.

        -

        Most (?) people interested in RRDtool will use the counter that keeps track +

        Many people interested in RRDtool will use the counter that keeps track of octets (bytes) transfered by a network device. So let's do just that next. We will start with a description of how to collect data.

        Some people will make a remark that there are tools which can do this data @@ -678,8 +695,8 @@ to do exactly on your OS to make it work.

        AREA:inoctets#00FF00:"In traffic" \ LINE1:outoctets#0000FF:"Out traffic"

        This should produce a picture with one day worth of traffic. -One day is 24 hours of 60 minutes of 60 seconds: 24*60*60=86'400, we -start at now minus 86'400 seconds. We define (with DEFs) inoctets and +One day is 24 hours of 60 minutes of 60 seconds: 24*60*60=86400, we +start at now minus 86400 seconds. We define (with DEFs) inoctets and outoctets as the average values from the database myrouter.rrd and draw an area for the ``in'' traffic and a line for the ``out'' traffic.

        View the image and keep logging data for a few more days. @@ -695,15 +712,15 @@ second.

        the maximum values instead of the average values. Let's go into this a bit more.

        Recall all the stuff about the speed of the car. Suppose we drove at 144 -KM/H during 5 minutes and then were stopped by the police for 25 minutes. +km/h during 5 minutes and then were stopped by the police for 25 minutes. At the end of the lecture we would take our laptop and create and view the image taken from the database. If we look at the second RRA we did create, we would have the average from 6 samples. The samples measured would be 144+0+0+0+0+0=144, divided by 30 minutes, corrected for the -error by 1000, translated into KM/H, with a result of 24 KM/H. +error by 1000, translated into km/h, with a result of 24 km/h. I would still get a ticket but not for speeding anymore :)

        Obviously, in this case we shouldn't look at the averages. In some -cases they are handy. If you want to know how many KM you had traveled, +cases they are handy. If you want to know how many km you had traveled, the averaged picture would be the right one to look at. On the other hand, for the speed that we traveled at, the maximum numbers seen is much more interesting. Later we will see more types.

        @@ -713,19 +730,19 @@ Over time, they will grow apart more and more. In the last database we have created, there are two archives that keep data per day. The archive that keeps averages will show low numbers, the archive that shows maxima will have higher numbers.

        -

        For my car this would translate in averages per day of 96/24=4 KM/H +

        For my car this would translate in averages per day of 96/24=4 km/h (as I travel about 94 kilometers on a day) during working days, and -maxima of 120 KM/H (my top speed that I reach every day).

        +maxima of 120 km/h (my top speed that I reach every day).

        Big difference. Do not look at the second graph to estimate the distances that I travel and do not look at the first graph to estimate my speed. This will work if the samples are close together, as they are in five minutes, but not if you average.

        On some days, I go for a long ride. If I go across Europe and travel -for 12 hours, the first graph will rise to about 60 KM/H. The second -one will show 180 KM/H. This means that I traveled a distance of 60 -KM/H times 24 H = 1440 KM. I did this with a higher speed and a -maximum around 180 KM/H. However, it probably doesn't mean that I -traveled for 8 hours at a constant speed of 180 KM/H!

        +for 12 hours, the first graph will rise to about 60 km/h. The second +one will show 180 km/h. This means that I traveled a distance of 60 +km/h times 24 h = 1440 km. I did this with a higher speed and a +maximum around 180 km/h. However, it probably doesn't mean that I +traveled for 8 hours at a constant speed of 180 km/h!

        This is a real example: go with the flow through Germany (fast!) and stop a few times for gas and coffee. Drive slowly through Austria and the Netherlands. Be careful in the mountains and villages. If you would @@ -740,7 +757,7 @@ period of time. Therefore we average it, eventually to one value per day. From this one value, we cannot see much detail, of course.

        Make sure you understand the last few paragraphs. There is no value in only a line and a few axis, you need to know what they mean and -interpret the data in ana appropriate way. This is true for all data.

        +interpret the data in an appropriate way. This is true for all data.

        The biggest mistake you can make is to use the collected data for something that it is not suitable for. You would be better off if you didn't have the graph at all.

        @@ -749,8 +766,8 @@ you didn't have the graph at all.

        Let's review what you now should know

        You know how to create a database and can put data in it. You can get the numbers out again by creating an image, do math on the data from -the database and view the resulte instead of the raw data. You know -about the difference between averages and maxima, and when to use +the database and view the result instead of the raw data. You know +about the difference between averages and maximum, and when to use which (or at least you should have an idea).

        RRDtool can do more than what we have learned up to now. Before you continue with the rest of this doc, I recommend that you reread from @@ -792,7 +809,7 @@ GAUGE. There are more such data types:

        counter with one difference: RRDtool assumes the counter is reset when it's read. That is: its delta is known without calculation by RRDtool whereas RRDtool needs to calculate it for the counter type. -Example: our first example (12'345, 12'357, 12'363, 12'363) would read: +Example: our first example (12345, 12357, 12363, 12363) would read: unknown, 12, 6, 0. The rest of the calculations stay the same. The other one, derive, is like counter. Unlike counter, it can also decrease so it can have a negative delta. Again, the rest of the @@ -837,7 +854,7 @@ what we put in: a sort of a wave.

      • Line C is of type DERIVE. It should be a counter that can decrease. It does -so between 2'400 and 0, with 1'800 in-between.

        +so between 2400 and 0, with 1800 in-between.

      • Line D is of type ABSOLUTE. This is like counter but it works on @@ -893,10 +910,10 @@ increasing values.

        Counter Wraps

        There are a few more basics to show. Some important options are still to be covered and we haven't look at counter wraps yet. First the counter wrap: -In our car we notice that the counter shows 999'987. We travel 20 KM and -the counter should go to 1'000'007. Unfortunately, there are only six digits -on our counter so it really shows 000'007. If we would plot that on a type -DERIVE, it would mean that the counter was set back 999'980 KM. It wasn't, +In our car we notice that the counter shows 999987. We travel 20 km and +the counter should go to 1000007. Unfortunately, there are only six digits +on our counter so it really shows 000007. If we would plot that on a type +DERIVE, it would mean that the counter was set back 999980 km. It wasn't, and there has to be some protection for this. This protection is only available for type COUNTER which should be used for this kind of counter anyways. How does it work? Type counter should never decrease and @@ -904,15 +921,15 @@ therefore RRDtool must assume it wrapped if it does decrease! If the delta is negative, this can be compensated for by adding the maximum value of the counter + 1. For our car this would be:

        - Delta = 7 - 999'987 = -999'980    (instead of 1'000'007-999'987=20)
        + Delta = 7 - 999987 = -999980 (instead of 1000007-999987=20)
        - Real delta = -999'980 + 999'999 + 1 = 20
        + Real delta = -999980 + 999999 + 1 = 20

        At the time of writing this document, RRDtool knows of counters that are either 32 bits or 64 bits of size. These counters can handle the following different values:

        - - 32 bits: 0 ..           4'294'967'295
        - - 64 bits: 0 .. 18'446'744'073'709'551'615
        + - 32 bits: 0 .. 4294967295 + - 64 bits: 0 .. 18446744073709551615

        If these numbers look strange to you, you can view them in their hexadecimal form:

        @@ -936,42 +953,42 @@ Try to do the calculations yourself or just believe me if your calculator
         can't handle the numbers :)

        Correction numbers:

        - - 32 bits: (4'294'967'295 + 1) =                                4'294'967'296
        - - 64 bits: (18'446'744'073'709'551'615 + 1)
        -                                    - correction1 = 18'446'744'069'414'584'320
        + - 32 bits: (4294967295 + 1) = 4294967296 + - 64 bits: (18446744073709551615 + 1) + - correction1 = 18446744069414584320
        - Before:        4'294'967'200
        + Before:        4294967200
          Increase:                100
        - Should become: 4'294'967'300
        + Should become: 4294967300
          But really is:             4
        - Delta:        -4'294'967'196
        - Correction1:  -4'294'967'196 + 4'294'967'296 = 100
        + Delta: -4294967196 + Correction1: -4294967196 + 4294967296 = 100
        - Before:        18'446'744'073'709'551'000
        + Before:        18446744073709551000
          Increase:                             800
        - Should become: 18'446'744'073'709'551'800
        + Should become: 18446744073709551800
          But really is:                        184
        - Delta:        -18'446'744'073'709'550'816
        - Correction1:  -18'446'744'073'709'550'816
        -                                + 4'294'967'296 = -18'446'744'069'414'583'520
        - Correction2:  -18'446'744'069'414'583'520
        -                   + 18'446'744'069'414'584'320 = 800
        + Delta: -18446744073709550816 + Correction1: -18446744073709550816 + + 4294967296 = -18446744069414583520 + Correction2: -18446744069414583520 + + 18446744069414584320 = 800
        - Before:        18'446'744'073'709'551'615 ( maximum value )
        - Increase:      18'446'744'069'414'584'320 ( absurd increase, minimum for
        - Should become: 36'893'488'143'124'135'935             this example to work )
        - But really is: 18'446'744'069'414'584'319
        - Delta:                     -4'294'967'296
        - Correction1:  -4'294'967'296 + 4'294'967'296 = 0
        + Before:        18446744073709551615 ( maximum value )
        + Increase:      18446744069414584320 ( absurd increase, minimum for
        + Should become: 36893488143124135935             this example to work )
        + But really is: 18446744069414584319
        + Delta:                     -4294967296
        + Correction1:  -4294967296 + 4294967296 = 0
          (not negative -> no correction2)
        - Before:        18'446'744'073'709'551'615 ( maximum value )
        - Increase:      18'446'744'069'414'584'319 ( one less increase )
        - Should become: 36'893'488'143'124'135'934
        - But really is: 18'446'744'069'414'584'318
        - Delta:                     -4'294'967'297
        - Correction1:  -4'294'967'297 + 4'294'967'296 = -1
        - Correction2:  -1 + 18'446'744'069'414'584'320 = 18'446'744'069'414'584'319
        + Before: 18446744073709551615 ( maximum value ) + Increase: 18446744069414584319 ( one less increase ) + Should become: 36893488143124135934 + But really is: 18446744069414584318 + Delta: -4294967297 + Correction1: -4294967297 + 4294967296 = -1 + Correction2: -1 + 18446744069414584320 = 18446744069414584319

        As you can see from the last two examples, you need strange numbers for RRDtool to fail (provided it's bug free of course), so this should not happen. However, SNMP or whatever method you choose to collect the @@ -1017,8 +1034,8 @@ RRDtool interpolates and stores 300 as it should be.

        time+300: 300 delta=300 time+300: 300 delta=300 time+600: 600 delta=300 time+603: 603 delta=303 time+900: 900 delta=300 time+900: 900 delta=297 -

        Let's create two identical databases. I've chosen the time range 920'805'000 -to 920'805'900 as this goes very well with the example numbers.

        +

        Let's create two identical databases. I've chosen the time range 920805000 +to 920805900 as this goes very well with the example numbers.

            rrdtool create seconds1.rrd   \
               --start 920804700          \
        @@ -1064,7 +1081,7 @@ input being different.

        you to be able to work with RRDtool and to read the additional documentation available. There is plenty more to discover about RRDtool and you will find more and more uses for this package. You can -easly create graphs using just the examples provided and using only +easily create graphs using just the examples provided and using only RRDtool. You can also use one of the front ends to RRDtool that are available.

        @@ -1094,7 +1111,7 @@ other people by pointing them to this document when they are asking basic questions. They will not only get their answers, but at the same time learn a whole lot more.

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

        +<alex@vandenbogaerdt.nl>

        diff --git a/doc/rrdtutorial.pod b/doc/rrdtutorial.pod index 30a4868..6651a80 100644 --- a/doc/rrdtutorial.pod +++ b/doc/rrdtutorial.pod @@ -1,3 +1,4 @@ +=for changes please consult me first. Thanks, Alex =head1 NAME rrdtutorial - Alex van den Bogaerdt's RRDtool tutorial @@ -6,7 +7,7 @@ rrdtutorial - Alex van den Bogaerdt's RRDtool tutorial RRDtool is written by Tobias Oetiker Etobi@oetiker.chE with contributions from many people all around the world. This document is -written by Alex van den Bogaerdt Ealex@ergens.op.het.netE to help you +written by Alex van den Bogaerdt Ealex@vandenbogaerdt.nlE to help you understand what RRDtool is and what it can do for you. The documentation provided with RRDtool can be too technical for some @@ -23,13 +24,32 @@ Please don't skip ahead in this document! The first part of this document explains the basics and may be boring. But if you don't understand the basics, the examples will not be as meaningful to you. +Sometimes things change. This example used to provide numbers like +"0.04" in stead of "4.00000e-02". Those are really the same numbers, +just written down differently. Don't be alarmed if a future version +of rrdtool displays a slightly different form of output. The examples +in this document are correct for version 1.2.0 of RRDtool. + +Also, sometimes bugs do occur. They may also influence the outcome of +the examples. Example speed4.png was suffering from this (the handling +of unknown data in an if-statement was wrong). Normal data will be +just fine (a bug in rrdtool wouldn't last long) but special cases like +NaN, INF and so on may last a bit longer. Try another version if you +can, or just live with it. + +I fixed the speed4.png example (and added a note). There may be other +examples which suffer from the same or a similar bug. Try to fix it +yourself, which is a great excercise. But please do not submit your +result as a fix to the source of this document. Discuss it on the +user's list, or write to me. + =head2 What is RRDtool? RRDtool refers to Round Robin Database tool. Round robin is a technique that works with a fixed amount of data, and a pointer to the current element. Think of a circle with some dots plotted -on the edge -- these dots are the places where data can be stored. Draw an -arrow from the center of the circle to one of the dots -- this is the pointer. +on the edge. These dots are the places where data can be stored. Draw an +arrow from the center of the circle to one of the dots; this is the pointer. When the current data is read or written, the pointer moves to the next element. As we are on a circle there is neither a beginning nor an end, you can go on and on and on. After a while, all the available places will be used and @@ -40,15 +60,15 @@ data from them. =head2 What data can be put into an RRD? -You name it, it will probably fit as long as it is some sort of time-series -data. This means you have to be able to measure some value at several points in time and -provide this information to RRDtool. If you can do this, RRDtool will be -able to store it. The values must be numerical but don't have to be -integers, as is the case with MRTG (the next section will give more details -on this more specialized application). +You name it, it will probably fit as long as it is some sort of +time-series data. This means you have to be able to measure some value +at several points in time and provide this information to RRDtool. If +you can do this, RRDtool will be able to store it. The values must be +numerical but don't have to be integers, as is the case with MRTG (the +next section will give more details on this more specialized application). Many examples below talk about SNMP which is an acronym for Simple Network -Management Protocol. "Simple" refers to the protocol -- it does not +Management Protocol. "Simple" refers to the protocol. It does not mean it is simple to manage or monitor a network. After working your way through this document, you should know enough to be able to understand what people are talking about. For now, just realize that @@ -138,7 +158,7 @@ Most discussions about networking talk about bits per second so lets get used to that right away. Assume a byte is eight bits and start to think in bits not bytes. The counter, however, still counts bytes! In the SNMP world most of the counters are 32 bits. That means they are -counting from 0 to 4'294'967'295. We will use these values in the examples. +counting from 0 to 4294967295. We will use these values in the examples. The device, when asked, returns the current value of the counter. We know the time that has passes since we last asked so we now know how many bytes have been transfered ***on average*** per second. This is @@ -171,35 +191,35 @@ People who are not used to think in kilometers per hour can translate most into miles per hour by dividing km by 1.6 (close enough). I will use the following abbreviations: - M: meter - KM: kilometer (= 1'000 meters). - H: hour - S: second - KM/H: kilometers per hour - M/S: meters per second + m: meter + km: kilometer (= 1000 meters). + h: hour + s: second + km/h: kilometers per hour + m/s: meters per second You are driving a car. At 12:05 you read the counter in the dashboard -and it tells you that the car has moved 12'345 KM until that moment. -At 12:10 you look again, it reads 12'357 KM. This means you have -traveled 12 KM in five minutes. A scientist would translate that +and it tells you that the car has moved 12345 km until that moment. +At 12:10 you look again, it reads 12357 km. This means you have +traveled 12 km in five minutes. A scientist would translate that into meters per second and this makes a nice comparison toward the problem of (bytes per five minutes) versus (bits per second). -We traveled 12 kilometers which is 12'000 meters. We did that in five -minutes or 300 seconds. Our speed is 12'000M / 300S or 40 M/S. +We traveled 12 kilometers which is 12000 meters. We did that in five +minutes or 300 seconds. Our speed is 12000m / 300s or 40 m/s. -We could also calculate the speed in KM/H: 12 times 5 minutes -is an hour, so we have to multiply 12 KM by 12 to get 144 KM/H. -For our native English speaking friends: that's 90 MPH so don't +We could also calculate the speed in km/h: 12 times 5 minutes +is an hour, so we have to multiply 12 km by 12 to get 144 km/h. +For our native English speaking friends: that's 90 mph so don't try this example at home or where I live :) Remember: these numbers are averages only. There is no way to figure out from the numbers, if you drove at a constant speed. There is an example later on in this tutorial that explains this. -I hope you understand that there is no difference in calculating M/S or -bps; only the way we collect the data is different. Even the K from kilo -is the same as in networking terms k also means 1'000. +I hope you understand that there is no difference in calculating m/s or +bps; only the way we collect the data is different. Even the k from kilo +is the same as in networking terms k also means 1000. We will now create a database where we can keep all these interesting numbers. The method used to start the program may differ slightly from @@ -221,7 +241,7 @@ and skip all of the '\' characters. We created the round robin database called test (test.rrd) which starts at noon the day I started writing this document, 7th of March, 1999 (this date -translates to 920'804'400 seconds as explained below). Our database holds +translates to 920804400 seconds as explained below). Our database holds one data source (DS) named "speed" that represents a counter. This counter is read every five minutes (this is the default therefore you don't have to put C<--step=300>). In the same database two round robin archives (RRAs) @@ -243,21 +263,21 @@ As an example: where I will see "12:05" the UK folks will see "11:05". We now have to fill our database with some numbers. We'll pretend to have read the following numbers: - 12:05 12345 KM - 12:10 12357 KM - 12:15 12363 KM - 12:20 12363 KM - 12:25 12363 KM - 12:30 12373 KM - 12:35 12383 KM - 12:40 12393 KM - 12:45 12399 KM - 12:50 12405 KM - 12:55 12411 KM - 13:00 12415 KM - 13:05 12420 KM - 13:10 12422 KM - 13:15 12423 KM + 12:05 12345 km + 12:10 12357 km + 12:15 12363 km + 12:20 12363 km + 12:25 12363 km + 12:30 12373 km + 12:35 12383 km + 12:40 12393 km + 12:45 12399 km + 12:50 12405 km + 12:55 12411 km + 13:00 12415 km + 13:05 12420 km + 13:10 12422 km + 13:15 12423 km We fill the database as follows: @@ -308,12 +328,8 @@ If it doesn't, something may be wrong. Perhaps your OS will print writes "U" or "UNKN" or something similar that's okay. If something else is wrong, it will probably be due to an error you made (assuming that my tutorial is correct of course :-). In that case: delete the -database and try again. Sometimes things change. This example used -to provide numbers like "0.04" in stead of "4.00000e-02". Those are -really the same numbers, just written down differently. Don't be -alarmed if a future version of rrdtool displays a slightly different -form of output. The examples in this document are correct for version -1.2.0 of RRDtool. +database and try again. + The meaning of the above output will become clear below. @@ -352,8 +368,8 @@ The "color" black is all colors off: 000000 magenta #FF00FF (mixed red with blue) gray #555555 (one third of all components) -Additionally you can add an alpha channel (transparency). The default -will be "FF" which means non-transparent. +Additionally you can (with a recent RRDtool) add an alpha channel +(transparency). The default will be "FF" which means non-transparent. The PNG you just created can be displayed using your favorite image viewer. Web browsers will display the PNG via the URL @@ -363,18 +379,18 @@ viewer. Web browsers will display the PNG via the URL When looking at the image, you notice that the horizontal axis is labeled 12:10, 12:20, 12:30, 12:40 and 12:50. Sometimes a label doesn't fit (12:00 -and 13:00 would be candidates) so they are skipped. +and 13:00 would be likely candidates) so they are skipped. The vertical axis displays the range we entered. We provided kilometers and when divided by 300 seconds, we get very small -numbers. To be exact, the first value was 12 (12'357-12'345) and divided +numbers. To be exact, the first value was 12 (12357-12345) and divided by 300 this makes 0.04, which is displayed by RRDtool as "40 m" -meaning "40/1'000". The "m" (milli) has nothing to do with meters, +meaning "40/1000". The "m" (milli) has nothing to do with meters (also m), kilometers or millimeters! RRDtool doesn't know about the physical units of our data, it just works with dimensionless numbers. If we had measured our distances in meters, this would have been -(12'357'000-12'345'000)/300 = 12'000/300 = 40. +(12357000-12345000)/300 = 12000/300 = 40. As most people have a better feel for numbers in this range, we'll correct that. We could recreate our database and store the correct @@ -388,10 +404,17 @@ the png file! CDEF:realspeed=myspeed,1000,\* \ LINE2:realspeed#FF0000 -Note: Make sure not to forget the backslash \ in front of the -multiplication operator * above. The backslash is needed to "escape" -the * as some operating systems might interpret and expand * instead -of passing it to the rrdtool command. +Note: I need to escape the multiplication operator * with a backslash. +If I don't, the operating system may interpret it and use it for file +name expansion. You could also place the line within quotation marks +like so: + + "CDEF:realspeed=myspeed,1000,*" \ + +It boils down to: it is RRDtool which should see *, not your shell. +And it is your shell interpreting \, not RRDtool. You may need to +adjust examples accordingly if you happen to use an operating +system or shell which behaves differently. After viewing this PNG, you notice the "m" (milli) has disappeared. This it what the correct result would be. Also, a label @@ -405,19 +428,19 @@ those". Don't bother with RPN yet, it will be explained later on in more detail. Also, you may want to read my tutorial on CDEFs and Steve Rader's tutorial on RPN. But first finish this tutorial. -Hang on! If we can multiply values with 1'000, it should also be possible +Hang on! If we can multiply values with 1000, it should also be possible to display kilometers per hour from the same data! To change a value that is measured in meters per second: - Calculate meters per hour: value * 3'600 - Calculate kilometers per hour: value / 1'000 - Together this makes: value * (3'600/1'000) or value * 3.6 + Calculate meters per hour: value * 3600 + Calculate kilometers per hour: value / 1000 + Together this makes: value * (3600/1000) or value * 3.6 In our example database we made a mistake and we need to compensate for -this by multiplying with 1'000. Applying that correction: +this by multiplying with 1000. Applying that correction: - value * 3.6 * 1'000 == value * 3'600 + value * 3.6 * 1000 == value * 3600 Now let's create this PNG, and add some more magic ... @@ -435,7 +458,7 @@ Now let's create this PNG, and add some more magic ... Note: here we use another means to escape the * operator by enclosing the whole string in double quotes. -This graph looks much better. Speed is shown in KM/H and there is even +This graph looks much better. Speed is shown in km/h and there is even an extra line with the maximum allowed speed (on the road I travel on). I also changed the colors used to display speed and changed it from a line into an area. @@ -461,7 +484,8 @@ following PNG: --start 920804400 --end 920808000 \ --vertical-label km/h \ DEF:myspeed=test.rrd:speed:AVERAGE \ - "CDEF:kmh=myspeed,3600,*" \ + CDEF:nonans=myspeed,UN,0,myspeed,IF \ + CDEF:kmh=nonans,3600,* \ CDEF:fast=kmh,100,GT,100,0,IF \ CDEF:over=kmh,100,GT,kmh,100,-,0,IF \ CDEF:good=kmh,100,GT,0,kmh,IF \ @@ -470,6 +494,10 @@ following PNG: AREA:fast#550000:"Too fast" \ STACK:over#FF0000:"Over speed" +Remember the note in the beginning? I had to remove unknown data from +this example. The 'nonans' CDEF is new, and the 6th line (which used to +be the 5th line) used to read 'CDEF:kmh=myspeed,3600,*' + Let's create a quick and dirty HTML page to view the three PNGs: Speed @@ -522,7 +550,7 @@ whatever. Any incrementing counter can be monitored and graphed using the stuff you learned so far. Later on we will also be able to monitor other types of values like temperature. -Most (?) people interested in RRDtool will use the counter that keeps track +Many people interested in RRDtool will use the counter that keeps track of octets (bytes) transfered by a network device. So let's do just that next. We will start with a description of how to collect data. @@ -713,8 +741,8 @@ Then, after collecting data for a day, try to create an image using: LINE1:outoctets#0000FF:"Out traffic" This should produce a picture with one day worth of traffic. -One day is 24 hours of 60 minutes of 60 seconds: 24*60*60=86'400, we -start at now minus 86'400 seconds. We define (with DEFs) inoctets and +One day is 24 hours of 60 minutes of 60 seconds: 24*60*60=86400, we +start at now minus 86400 seconds. We define (with DEFs) inoctets and outoctets as the average values from the database myrouter.rrd and draw an area for the "in" traffic and a line for the "out" traffic. @@ -733,16 +761,16 @@ the maximum values instead of the average values. Let's go into this a bit more. Recall all the stuff about the speed of the car. Suppose we drove at 144 -KM/H during 5 minutes and then were stopped by the police for 25 minutes. +km/h during 5 minutes and then were stopped by the police for 25 minutes. At the end of the lecture we would take our laptop and create and view the image taken from the database. If we look at the second RRA we did create, we would have the average from 6 samples. The samples measured would be 144+0+0+0+0+0=144, divided by 30 minutes, corrected for the -error by 1000, translated into KM/H, with a result of 24 KM/H. +error by 1000, translated into km/h, with a result of 24 km/h. I would still get a ticket but not for speeding anymore :) Obviously, in this case we shouldn't look at the averages. In some -cases they are handy. If you want to know how many KM you had traveled, +cases they are handy. If you want to know how many km you had traveled, the averaged picture would be the right one to look at. On the other hand, for the speed that we traveled at, the maximum numbers seen is much more interesting. Later we will see more types. @@ -754,9 +782,9 @@ we have created, there are two archives that keep data per day. The archive that keeps averages will show low numbers, the archive that shows maxima will have higher numbers. -For my car this would translate in averages per day of 96/24=4 KM/H +For my car this would translate in averages per day of 96/24=4 km/h (as I travel about 94 kilometers on a day) during working days, and -maxima of 120 KM/H (my top speed that I reach every day). +maxima of 120 km/h (my top speed that I reach every day). Big difference. Do not look at the second graph to estimate the distances that I travel and do not look at the first graph to @@ -764,11 +792,11 @@ estimate my speed. This will work if the samples are close together, as they are in five minutes, but not if you average. On some days, I go for a long ride. If I go across Europe and travel -for 12 hours, the first graph will rise to about 60 KM/H. The second -one will show 180 KM/H. This means that I traveled a distance of 60 -KM/H times 24 H = 1440 KM. I did this with a higher speed and a -maximum around 180 KM/H. However, it probably doesn't mean that I -traveled for 8 hours at a constant speed of 180 KM/H! +for 12 hours, the first graph will rise to about 60 km/h. The second +one will show 180 km/h. This means that I traveled a distance of 60 +km/h times 24 h = 1440 km. I did this with a higher speed and a +maximum around 180 km/h. However, it probably doesn't mean that I +traveled for 8 hours at a constant speed of 180 km/h! This is a real example: go with the flow through Germany (fast!) and stop a few times for gas and coffee. Drive slowly through Austria and the @@ -785,7 +813,7 @@ day. From this one value, we cannot see much detail, of course. Make sure you understand the last few paragraphs. There is no value in only a line and a few axis, you need to know what they mean and -interpret the data in ana appropriate way. This is true for all data. +interpret the data in an appropriate way. This is true for all data. The biggest mistake you can make is to use the collected data for something that it is not suitable for. You would be better off if @@ -796,8 +824,8 @@ you didn't have the graph at all. You know how to create a database and can put data in it. You can get the numbers out again by creating an image, do math on the data from -the database and view the resulte instead of the raw data. You know -about the difference between averages and maxima, and when to use +the database and view the result instead of the raw data. You know +about the difference between averages and maximum, and when to use which (or at least you should have an idea). RRDtool can do more than what we have learned up to now. Before you @@ -843,7 +871,7 @@ The two additional types are DERIVE and ABSOLUTE. Absolute can be used like counter with one difference: RRDtool assumes the counter is reset when it's read. That is: its delta is known without calculation by RRDtool whereas RRDtool needs to calculate it for the counter type. -Example: our first example (12'345, 12'357, 12'363, 12'363) would read: +Example: our first example (12345, 12357, 12363, 12363) would read: unknown, 12, 6, 0. The rest of the calculations stay the same. The other one, derive, is like counter. Unlike counter, it can also decrease so it can have a negative delta. Again, the rest of the @@ -893,7 +921,7 @@ what we put in: a sort of a wave. =item * Line C is of type DERIVE. It should be a counter that can decrease. It does -so between 2'400 and 0, with 1'800 in-between. +so between 2400 and 0, with 1800 in-between. =item * @@ -961,10 +989,10 @@ increasing values. There are a few more basics to show. Some important options are still to be covered and we haven't look at counter wraps yet. First the counter wrap: -In our car we notice that the counter shows 999'987. We travel 20 KM and -the counter should go to 1'000'007. Unfortunately, there are only six digits -on our counter so it really shows 000'007. If we would plot that on a type -DERIVE, it would mean that the counter was set back 999'980 KM. It wasn't, +In our car we notice that the counter shows 999987. We travel 20 km and +the counter should go to 1000007. Unfortunately, there are only six digits +on our counter so it really shows 000007. If we would plot that on a type +DERIVE, it would mean that the counter was set back 999980 km. It wasn't, and there has to be some protection for this. This protection is only available for type COUNTER which should be used for this kind of counter anyways. How does it work? Type counter should never decrease and @@ -972,16 +1000,16 @@ therefore RRDtool must assume it wrapped if it does decrease! If the delta is negative, this can be compensated for by adding the maximum value of the counter + 1. For our car this would be: - Delta = 7 - 999'987 = -999'980 (instead of 1'000'007-999'987=20) + Delta = 7 - 999987 = -999980 (instead of 1000007-999987=20) - Real delta = -999'980 + 999'999 + 1 = 20 + Real delta = -999980 + 999999 + 1 = 20 At the time of writing this document, RRDtool knows of counters that are either 32 bits or 64 bits of size. These counters can handle the following different values: - - 32 bits: 0 .. 4'294'967'295 - - 64 bits: 0 .. 18'446'744'073'709'551'615 + - 32 bits: 0 .. 4294967295 + - 64 bits: 0 .. 18446744073709551615 If these numbers look strange to you, you can view them in their hexadecimal form: @@ -1010,42 +1038,42 @@ can't handle the numbers :) Correction numbers: - - 32 bits: (4'294'967'295 + 1) = 4'294'967'296 - - 64 bits: (18'446'744'073'709'551'615 + 1) - - correction1 = 18'446'744'069'414'584'320 + - 32 bits: (4294967295 + 1) = 4294967296 + - 64 bits: (18446744073709551615 + 1) + - correction1 = 18446744069414584320 - Before: 4'294'967'200 + Before: 4294967200 Increase: 100 - Should become: 4'294'967'300 + Should become: 4294967300 But really is: 4 - Delta: -4'294'967'196 - Correction1: -4'294'967'196 + 4'294'967'296 = 100 + Delta: -4294967196 + Correction1: -4294967196 + 4294967296 = 100 - Before: 18'446'744'073'709'551'000 + Before: 18446744073709551000 Increase: 800 - Should become: 18'446'744'073'709'551'800 + Should become: 18446744073709551800 But really is: 184 - Delta: -18'446'744'073'709'550'816 - Correction1: -18'446'744'073'709'550'816 - + 4'294'967'296 = -18'446'744'069'414'583'520 - Correction2: -18'446'744'069'414'583'520 - + 18'446'744'069'414'584'320 = 800 - - Before: 18'446'744'073'709'551'615 ( maximum value ) - Increase: 18'446'744'069'414'584'320 ( absurd increase, minimum for - Should become: 36'893'488'143'124'135'935 this example to work ) - But really is: 18'446'744'069'414'584'319 - Delta: -4'294'967'296 - Correction1: -4'294'967'296 + 4'294'967'296 = 0 + Delta: -18446744073709550816 + Correction1: -18446744073709550816 + + 4294967296 = -18446744069414583520 + Correction2: -18446744069414583520 + + 18446744069414584320 = 800 + + Before: 18446744073709551615 ( maximum value ) + Increase: 18446744069414584320 ( absurd increase, minimum for + Should become: 36893488143124135935 this example to work ) + But really is: 18446744069414584319 + Delta: -4294967296 + Correction1: -4294967296 + 4294967296 = 0 (not negative -> no correction2) - Before: 18'446'744'073'709'551'615 ( maximum value ) - Increase: 18'446'744'069'414'584'319 ( one less increase ) - Should become: 36'893'488'143'124'135'934 - But really is: 18'446'744'069'414'584'318 - Delta: -4'294'967'297 - Correction1: -4'294'967'297 + 4'294'967'296 = -1 - Correction2: -1 + 18'446'744'069'414'584'320 = 18'446'744'069'414'584'319 + Before: 18446744073709551615 ( maximum value ) + Increase: 18446744069414584319 ( one less increase ) + Should become: 36893488143124135934 + But really is: 18446744069414584318 + Delta: -4294967297 + Correction1: -4294967297 + 4294967296 = -1 + Correction2: -1 + 18446744069414584320 = 18446744069414584319 As you can see from the last two examples, you need strange numbers for RRDtool to fail (provided it's bug free of course), so this should @@ -1095,8 +1123,8 @@ RRDtool interpolates and stores 300 as it should be. time+600: 600 delta=300 time+603: 603 delta=303 time+900: 900 delta=300 time+900: 900 delta=297 -Let's create two identical databases. I've chosen the time range 920'805'000 -to 920'805'900 as this goes very well with the example numbers. +Let's create two identical databases. I've chosen the time range 920805000 +to 920805900 as this goes very well with the example numbers. rrdtool create seconds1.rrd \ --start 920804700 \ @@ -1145,7 +1173,7 @@ It's time now to wrap up this tutorial. We covered all the basics for you to be able to work with RRDtool and to read the additional documentation available. There is plenty more to discover about RRDtool and you will find more and more uses for this package. You can -easly create graphs using just the examples provided and using only +easily create graphs using just the examples provided and using only RRDtool. You can also use one of the front ends to RRDtool that are available. @@ -1173,5 +1201,5 @@ basic questions. They will not only get their answers, but at the same time learn a whole lot more. Alex van den Bogaerdt -Ealex@ergens.op.het.netE +Ealex@vandenbogaerdt.nlE diff --git a/doc/rrdtutorial.txt b/doc/rrdtutorial.txt index 50e3583..b6bb973 100644 --- a/doc/rrdtutorial.txt +++ b/doc/rrdtutorial.txt @@ -2,13 +2,12 @@ RRDTUTORIAL(1) rrdtool RRDTUTORIAL(1) -NNAAMMEE - rrdtutorial - Alex van den Bogaerdt's RRDtool tutorial +rrdtutorial - Alex van den Bogaerdt's RRDtool tutorial DDEESSCCRRIIPPTTIIOONN RRDtool is written by Tobias Oetiker with contribu- tions from many people all around the world. This document is written - by Alex van den Bogaerdt to help you under- + by Alex van den Bogaerdt to help you under- stand what RRDtool is and what it can do for you. The documentation provided with RRDtool can be too technical for some @@ -24,15 +23,34 @@ TTUUTTOORRIIAALL ment explains the basics and may be boring. But if you don't under- stand the basics, the examples will not be as meaningful to you. + Sometimes things change. This example used to provide numbers like + "0.04" in stead of "4.00000e-02". Those are really the same numbers, + just written down differently. Don't be alarmed if a future version of + rrdtool displays a slightly different form of output. The examples in + this document are correct for version 1.2.0 of RRDtool. + + Also, sometimes bugs do occur. They may also influence the outcome of + the examples. Example speed4.png was suffering from this (the handling + of unknown data in an if-statement was wrong). Normal data will be just + fine (a bug in rrdtool wouldn't last long) but special cases like NaN, + INF and so on may last a bit longer. Try another version if you can, + or just live with it. + + I fixed the speed4.png example (and added a note). There may be other + examples which suffer from the same or a similar bug. Try to fix it + yourself, which is a great excercise. But please do not submit your + result as a fix to the source of this document. Discuss it on the + user's list, or write to me. + WWhhaatt iiss RRRRDDttooooll?? RRDtool refers to Round Robin Database tool. Round robin is a tech- nique that works with a fixed amount of data, and a pointer to the cur- - rent element. Think of a circle with some dots plotted on the edge -- - these dots are the places where data can be stored. Draw an arrow from - the center of the circle to one of the dots -- this is the pointer. - When the current data is read or written, the pointer moves to the next - element. As we are on a circle there is neither a beginning nor an end, + rent element. Think of a circle with some dots plotted on the edge. + These dots are the places where data can be stored. Draw an arrow from + the center of the circle to one of the dots; this is the pointer. When + the current data is read or written, the pointer moves to the next ele- + ment. As we are on a circle there is neither a beginning nor an end, you can go on and on and on. After a while, all the available places will be used and the process automatically reuses old locations. This way, the dataset will not grow in size and therefore requires no main- @@ -50,12 +68,12 @@ TTUUTTOORRIIAALL tion). Many examples below talk about SNMP which is an acronym for Simple Net- - work Management Protocol. "Simple" refers to the protocol -- it does - not mean it is simple to manage or monitor a network. After working - your way through this document, you should know enough to be able to - understand what people are talking about. For now, just realize that - SNMP can be used to query devices for the values of counters they keep. - It is the value from those counters that we want to store in the RRD. + work Management Protocol. "Simple" refers to the protocol. It does not + mean it is simple to manage or monitor a network. After working your + way through this document, you should know enough to be able to under- + stand what people are talking about. For now, just realize that SNMP + can be used to query devices for the values of counters they keep. It + is the value from those counters that we want to store in the RRD. WWhhaatt ccaann II ddoo wwiitthh tthhiiss ttooooll?? @@ -140,7 +158,7 @@ TTUUTTOORRIIAALL get used to that right away. Assume a byte is eight bits and start to think in bits not bytes. The counter, however, still counts bytes! In the SNMP world most of the counters are 32 bits. That means they are - counting from 0 to 4'294'967'295. We will use these values in the exam- + counting from 0 to 4294967295. We will use these values in the exam- ples. The device, when asked, returns the current value of the counter. We know the time that has passes since we last asked so we now know how many bytes have been transfered ***on average*** per second. @@ -165,35 +183,35 @@ TTUUTTOORRIIAALL most into miles per hour by dividing km by 1.6 (close enough). I will use the following abbreviations: - M: meter - KM: kilometer (= 1'000 meters). - H: hour - S: second - KM/H: kilometers per hour - M/S: meters per second + m: meter + km: kilometer (= 1000 meters). + h: hour + s: second + km/h: kilometers per hour + m/s: meters per second You are driving a car. At 12:05 you read the counter in the dashboard - and it tells you that the car has moved 12'345 KM until that moment. - At 12:10 you look again, it reads 12'357 KM. This means you have trav- - eled 12 KM in five minutes. A scientist would translate that into - meters per second and this makes a nice comparison toward the problem - of (bytes per five minutes) versus (bits per second). - - We traveled 12 kilometers which is 12'000 meters. We did that in five - minutes or 300 seconds. Our speed is 12'000M / 300S or 40 M/S. - - We could also calculate the speed in KM/H: 12 times 5 minutes is an - hour, so we have to multiply 12 KM by 12 to get 144 KM/H. For our - native English speaking friends: that's 90 MPH so don't try this exam- + and it tells you that the car has moved 12345 km until that moment. At + 12:10 you look again, it reads 12357 km. This means you have traveled + 12 km in five minutes. A scientist would translate that into meters per + second and this makes a nice comparison toward the problem of (bytes + per five minutes) versus (bits per second). + + We traveled 12 kilometers which is 12000 meters. We did that in five + minutes or 300 seconds. Our speed is 12000m / 300s or 40 m/s. + + We could also calculate the speed in km/h: 12 times 5 minutes is an + hour, so we have to multiply 12 km by 12 to get 144 km/h. For our + native English speaking friends: that's 90 mph so don't try this exam- ple at home or where I live :) Remember: these numbers are averages only. There is no way to figure out from the numbers, if you drove at a constant speed. There is an example later on in this tutorial that explains this. - I hope you understand that there is no difference in calculating M/S or - bps; only the way we collect the data is different. Even the K from - kilo is the same as in networking terms k also means 1'000. + I hope you understand that there is no difference in calculating m/s or + bps; only the way we collect the data is different. Even the k from + kilo is the same as in networking terms k also means 1000. We will now create a database where we can keep all these interesting numbers. The method used to start the program may differ slightly from @@ -215,7 +233,7 @@ TTUUTTOORRIIAALL We created the round robin database called test (test.rrd) which starts at noon the day I started writing this document, 7th of March, 1999 - (this date translates to 920'804'400 seconds as explained below). Our + (this date translates to 920804400 seconds as explained below). Our database holds one data source (DS) named "speed" that represents a counter. This counter is read every five minutes (this is the default therefore you don't have to put "--step=300"). In the same database @@ -238,21 +256,21 @@ TTUUTTOORRIIAALL We now have to fill our database with some numbers. We'll pretend to have read the following numbers: - 12:05 12345 KM - 12:10 12357 KM - 12:15 12363 KM - 12:20 12363 KM - 12:25 12363 KM - 12:30 12373 KM - 12:35 12383 KM - 12:40 12393 KM - 12:45 12399 KM - 12:50 12405 KM - 12:55 12411 KM - 13:00 12415 KM - 13:05 12420 KM - 13:10 12422 KM - 13:15 12423 KM + 12:05 12345 km + 12:10 12357 km + 12:15 12363 km + 12:20 12363 km + 12:25 12363 km + 12:30 12373 km + 12:35 12383 km + 12:40 12393 km + 12:45 12399 km + 12:50 12405 km + 12:55 12411 km + 13:00 12415 km + 13:05 12420 km + 13:10 12422 km + 13:15 12423 km We fill the database as follows: @@ -303,12 +321,7 @@ TTUUTTOORRIIAALL writes "U" or "UNKN" or something similar that's okay. If something else is wrong, it will probably be due to an error you made (assuming that my tutorial is correct of course :-). In that case: delete the - database and try again. Sometimes things change. This example used to - provide numbers like "0.04" in stead of "4.00000e-02". Those are - really the same numbers, just written down differently. Don't be - alarmed if a future version of rrdtool displays a slightly different - form of output. The examples in this document are correct for version - 1.2.0 of RRDtool. + database and try again. The meaning of the above output will become clear below. @@ -346,8 +359,8 @@ TTUUTTOORRIIAALL magenta #FF00FF (mixed red with blue) gray #555555 (one third of all components) - Additionally you can add an alpha channel (transparency). The default - will be "FF" which means non-transparent. + Additionally you can (with a recent RRDtool) add an alpha channel + (transparency). The default will be "FF" which means non-transparent. The PNG you just created can be displayed using your favorite image viewer. Web browsers will display the PNG via the URL @@ -357,18 +370,18 @@ TTUUTTOORRIIAALL When looking at the image, you notice that the horizontal axis is labeled 12:10, 12:20, 12:30, 12:40 and 12:50. Sometimes a label doesn't - fit (12:00 and 13:00 would be candidates) so they are skipped. + fit (12:00 and 13:00 would be likely candidates) so they are skipped. The vertical axis displays the range we entered. We provided kilometers and when divided by 300 seconds, we get very small numbers. To be - exact, the first value was 12 (12'357-12'345) and divided by 300 this - makes 0.04, which is displayed by RRDtool as "40 m" meaning "40/1'000". - The "m" (milli) has nothing to do with meters, kilometers or millime- - ters! RRDtool doesn't know about the physical units of our data, it - just works with dimensionless numbers. + exact, the first value was 12 (12357-12345) and divided by 300 this + makes 0.04, which is displayed by RRDtool as "40 m" meaning "40/1000". + The "m" (milli) has nothing to do with meters (also m), kilometers or + millimeters! RRDtool doesn't know about the physical units of our data, + it just works with dimensionless numbers. If we had measured our distances in meters, this would have been - (12'357'000-12'345'000)/300 = 12'000/300 = 40. + (12357000-12345000)/300 = 12000/300 = 40. As most people have a better feel for numbers in this range, we'll cor- rect that. We could recreate our database and store the correct data, @@ -382,10 +395,17 @@ TTUUTTOORRIIAALL CDEF:realspeed=myspeed,1000,\* \ LINE2:realspeed#FF0000 - Note: Make sure not to forget the backslash \ in front of the multipli- - cation operator * above. The backslash is needed to "escape" the * as - some operating systems might interpret and expand * instead of passing - it to the rrdtool command. + Note: I need to escape the multiplication operator * with a backslash. + If I don't, the operating system may interpret it and use it for file + name expansion. You could also place the line within quotation marks + like so: + + "CDEF:realspeed=myspeed,1000,*" \ + + It boils down to: it is RRDtool which should see *, not your shell. + And it is your shell interpreting \, not RRDtool. You may need to + adjust examples accordingly if you happen to use an operating system or + shell which behaves differently. After viewing this PNG, you notice the "m" (milli) has disappeared. This it what the correct result would be. Also, a label has been added @@ -399,19 +419,19 @@ TTUUTTOORRIIAALL detail. Also, you may want to read my tutorial on CDEFs and Steve Rader's tutorial on RPN. But first finish this tutorial. - Hang on! If we can multiply values with 1'000, it should also be possi- + Hang on! If we can multiply values with 1000, it should also be possi- ble to display kilometers per hour from the same data! To change a value that is measured in meters per second: - Calculate meters per hour: value * 3'600 - Calculate kilometers per hour: value / 1'000 - Together this makes: value * (3'600/1'000) or value * 3.6 + Calculate meters per hour: value * 3600 + Calculate kilometers per hour: value / 1000 + Together this makes: value * (3600/1000) or value * 3.6 In our example database we made a mistake and we need to compensate for - this by multiplying with 1'000. Applying that correction: + this by multiplying with 1000. Applying that correction: - value * 3.6 * 1'000 == value * 3'600 + value * 3.6 * 1000 == value * 3600 Now let's create this PNG, and add some more magic ... @@ -429,7 +449,7 @@ TTUUTTOORRIIAALL Note: here we use another means to escape the * operator by enclosing the whole string in double quotes. - This graph looks much better. Speed is shown in KM/H and there is even + This graph looks much better. Speed is shown in km/h and there is even an extra line with the maximum allowed speed (on the road I travel on). I also changed the colors used to display speed and changed it from a line into an area. @@ -455,7 +475,8 @@ TTUUTTOORRIIAALL --start 920804400 --end 920808000 \ --vertical-label km/h \ DEF:myspeed=test.rrd:speed:AVERAGE \ - "CDEF:kmh=myspeed,3600,*" \ + CDEF:nonans=myspeed,UN,0,myspeed,IF \ + CDEF:kmh=nonans,3600,* \ CDEF:fast=kmh,100,GT,100,0,IF \ CDEF:over=kmh,100,GT,kmh,100,-,0,IF \ CDEF:good=kmh,100,GT,0,kmh,IF \ @@ -464,6 +485,10 @@ TTUUTTOORRIIAALL AREA:fast#550000:"Too fast" \ STACK:over#FF0000:"Over speed" + Remember the note in the beginning? I had to remove unknown data from + this example. The 'nonans' CDEF is new, and the 6th line (which used to + be the 5th line) used to read 'CDEF:kmh=myspeed,3600,*' + Let's create a quick and dirty HTML page to view the three PNGs: Speed @@ -518,10 +543,9 @@ TTUUTTOORRIIAALL learned so far. Later on we will also be able to monitor other types of values like temperature. - Most (?) people interested in RRDtool will use the counter that keeps - track of octets (bytes) transfered by a network device. So let's do - just that next. We will start with a description of how to collect - data. + Many people interested in RRDtool will use the counter that keeps track + of octets (bytes) transfered by a network device. So let's do just that + next. We will start with a description of how to collect data. Some people will make a remark that there are tools which can do this data collection for you. They are right! However, I feel it is impor- @@ -591,8 +615,8 @@ TTUUTTOORRIIAALL The device should answer with a description of itself, perhaps an empty one. Until you got a valid answer from a device, perhaps using a dif- - ferent "password", or a different device, there is no point in - continuing. + ferent "password", or a different device, there is no point in continu- + ing. snmpget -v2c -c public myrouter interfaces.ifNumber.0 @@ -714,8 +738,8 @@ TTUUTTOORRIIAALL LINE1:outoctets#0000FF:"Out traffic" This should produce a picture with one day worth of traffic. One day - is 24 hours of 60 minutes of 60 seconds: 24*60*60=86'400, we start at - now minus 86'400 seconds. We define (with DEFs) inoctets and outoctets + is 24 hours of 60 minutes of 60 seconds: 24*60*60=86400, we start at + now minus 86400 seconds. We define (with DEFs) inoctets and outoctets as the average values from the database myrouter.rrd and draw an area for the "in" traffic and a line for the "out" traffic. @@ -733,16 +757,16 @@ TTUUTTOORRIIAALL more. Recall all the stuff about the speed of the car. Suppose we drove at - 144 KM/H during 5 minutes and then were stopped by the police for 25 + 144 km/h during 5 minutes and then were stopped by the police for 25 minutes. At the end of the lecture we would take our laptop and create and view the image taken from the database. If we look at the second RRA we did create, we would have the average from 6 samples. The sam- ples measured would be 144+0+0+0+0+0=144, divided by 30 minutes, cor- - rected for the error by 1000, translated into KM/H, with a result of 24 - KM/H. I would still get a ticket but not for speeding anymore :) + rected for the error by 1000, translated into km/h, with a result of 24 + km/h. I would still get a ticket but not for speeding anymore :) Obviously, in this case we shouldn't look at the averages. In some - cases they are handy. If you want to know how many KM you had traveled, + cases they are handy. If you want to know how many km you had traveled, the averaged picture would be the right one to look at. On the other hand, for the speed that we traveled at, the maximum numbers seen is much more interesting. Later we will see more types. @@ -754,9 +778,9 @@ TTUUTTOORRIIAALL that keeps averages will show low numbers, the archive that shows max- ima will have higher numbers. - For my car this would translate in averages per day of 96/24=4 KM/H (as + For my car this would translate in averages per day of 96/24=4 km/h (as I travel about 94 kilometers on a day) during working days, and maxima - of 120 KM/H (my top speed that I reach every day). + of 120 km/h (my top speed that I reach every day). Big difference. Do not look at the second graph to estimate the dis- tances that I travel and do not look at the first graph to estimate my @@ -764,11 +788,11 @@ TTUUTTOORRIIAALL five minutes, but not if you average. On some days, I go for a long ride. If I go across Europe and travel - for 12 hours, the first graph will rise to about 60 KM/H. The second - one will show 180 KM/H. This means that I traveled a distance of 60 - KM/H times 24 H = 1440 KM. I did this with a higher speed and a maximum - around 180 KM/H. However, it probably doesn't mean that I traveled for - 8 hours at a constant speed of 180 KM/H! + for 12 hours, the first graph will rise to about 60 km/h. The second + one will show 180 km/h. This means that I traveled a distance of 60 + km/h times 24 h = 1440 km. I did this with a higher speed and a maximum + around 180 km/h. However, it probably doesn't mean that I traveled for + 8 hours at a constant speed of 180 km/h! This is a real example: go with the flow through Germany (fast!) and stop a few times for gas and coffee. Drive slowly through Austria and @@ -785,7 +809,7 @@ TTUUTTOORRIIAALL Make sure you understand the last few paragraphs. There is no value in only a line and a few axis, you need to know what they mean and inter- - pret the data in ana appropriate way. This is true for all data. + pret the data in an appropriate way. This is true for all data. The biggest mistake you can make is to use the collected data for some- thing that it is not suitable for. You would be better off if you @@ -795,9 +819,9 @@ TTUUTTOORRIIAALL You know how to create a database and can put data in it. You can get the numbers out again by creating an image, do math on the data from - the database and view the resulte instead of the raw data. You know - about the difference between averages and maxima, and when to use which - (or at least you should have an idea). + the database and view the result instead of the raw data. You know + about the difference between averages and maximum, and when to use + which (or at least you should have an idea). RRDtool can do more than what we have learned up to now. Before you continue with the rest of this doc, I recommend that you reread from @@ -842,7 +866,7 @@ TTUUTTOORRIIAALL like counter with one difference: RRDtool assumes the counter is reset when it's read. That is: its delta is known without calculation by RRD- tool whereas RRDtool needs to calculate it for the counter type. Exam- - ple: our first example (12'345, 12'357, 12'363, 12'363) would read: + ple: our first example (12345, 12357, 12363, 12363) would read: unknown, 12, 6, 0. The rest of the calculations stay the same. The other one, derive, is like counter. Unlike counter, it can also decrease so it can have a negative delta. Again, the rest of the calcu- @@ -885,7 +909,7 @@ TTUUTTOORRIIAALL what we put in: a sort of a wave. · Line C is of type DERIVE. It should be a counter that can decrease. - It does so between 2'400 and 0, with 1'800 in-between. + It does so between 2400 and 0, with 1800 in-between. · Line D is of type ABSOLUTE. This is like counter but it works on val- ues without calculating the difference. The numbers are the same and @@ -937,11 +961,11 @@ TTUUTTOORRIIAALL There are a few more basics to show. Some important options are still to be covered and we haven't look at counter wraps yet. First the - counter wrap: In our car we notice that the counter shows 999'987. We - travel 20 KM and the counter should go to 1'000'007. Unfortunately, - there are only six digits on our counter so it really shows 000'007. If - we would plot that on a type DERIVE, it would mean that the counter was - set back 999'980 KM. It wasn't, and there has to be some protection for + counter wrap: In our car we notice that the counter shows 999987. We + travel 20 km and the counter should go to 1000007. Unfortunately, there + are only six digits on our counter so it really shows 000007. If we + would plot that on a type DERIVE, it would mean that the counter was + set back 999980 km. It wasn't, and there has to be some protection for this. This protection is only available for type COUNTER which should be used for this kind of counter anyways. How does it work? Type counter should never decrease and therefore RRDtool must assume it @@ -949,16 +973,16 @@ TTUUTTOORRIIAALL compensated for by adding the maximum value of the counter + 1. For our car this would be: - Delta = 7 - 999'987 = -999'980 (instead of 1'000'007-999'987=20) + Delta = 7 - 999987 = -999980 (instead of 1000007-999987=20) - Real delta = -999'980 + 999'999 + 1 = 20 + Real delta = -999980 + 999999 + 1 = 20 At the time of writing this document, RRDtool knows of counters that are either 32 bits or 64 bits of size. These counters can handle the following different values: - - 32 bits: 0 .. 4'294'967'295 - - 64 bits: 0 .. 18'446'744'073'709'551'615 + - 32 bits: 0 .. 4294967295 + - 64 bits: 0 .. 18446744073709551615 If these numbers look strange to you, you can view them in their hex- adecimal form: @@ -987,42 +1011,42 @@ TTUUTTOORRIIAALL Correction numbers: - - 32 bits: (4'294'967'295 + 1) = 4'294'967'296 - - 64 bits: (18'446'744'073'709'551'615 + 1) - - correction1 = 18'446'744'069'414'584'320 + - 32 bits: (4294967295 + 1) = 4294967296 + - 64 bits: (18446744073709551615 + 1) + - correction1 = 18446744069414584320 - Before: 4'294'967'200 + Before: 4294967200 Increase: 100 - Should become: 4'294'967'300 + Should become: 4294967300 But really is: 4 - Delta: -4'294'967'196 - Correction1: -4'294'967'196 + 4'294'967'296 = 100 + Delta: -4294967196 + Correction1: -4294967196 + 4294967296 = 100 - Before: 18'446'744'073'709'551'000 + Before: 18446744073709551000 Increase: 800 - Should become: 18'446'744'073'709'551'800 + Should become: 18446744073709551800 But really is: 184 - Delta: -18'446'744'073'709'550'816 - Correction1: -18'446'744'073'709'550'816 - + 4'294'967'296 = -18'446'744'069'414'583'520 - Correction2: -18'446'744'069'414'583'520 - + 18'446'744'069'414'584'320 = 800 - - Before: 18'446'744'073'709'551'615 ( maximum value ) - Increase: 18'446'744'069'414'584'320 ( absurd increase, minimum for - Should become: 36'893'488'143'124'135'935 this example to work ) - But really is: 18'446'744'069'414'584'319 - Delta: -4'294'967'296 - Correction1: -4'294'967'296 + 4'294'967'296 = 0 + Delta: -18446744073709550816 + Correction1: -18446744073709550816 + + 4294967296 = -18446744069414583520 + Correction2: -18446744069414583520 + + 18446744069414584320 = 800 + + Before: 18446744073709551615 ( maximum value ) + Increase: 18446744069414584320 ( absurd increase, minimum for + Should become: 36893488143124135935 this example to work ) + But really is: 18446744069414584319 + Delta: -4294967296 + Correction1: -4294967296 + 4294967296 = 0 (not negative -> no correction2) - Before: 18'446'744'073'709'551'615 ( maximum value ) - Increase: 18'446'744'069'414'584'319 ( one less increase ) - Should become: 36'893'488'143'124'135'934 - But really is: 18'446'744'069'414'584'318 - Delta: -4'294'967'297 - Correction1: -4'294'967'297 + 4'294'967'296 = -1 - Correction2: -1 + 18'446'744'069'414'584'320 = 18'446'744'069'414'584'319 + Before: 18446744073709551615 ( maximum value ) + Increase: 18446744069414584319 ( one less increase ) + Should become: 36893488143124135934 + But really is: 18446744069414584318 + Delta: -4294967297 + Correction1: -4294967297 + 4294967296 = -1 + Correction2: -1 + 18446744069414584320 = 18446744069414584319 As you can see from the last two examples, you need strange numbers for RRDtool to fail (provided it's bug free of course), so this should not @@ -1073,8 +1097,7 @@ TTUUTTOORRIIAALL time+900: 900 delta=300 time+900: 900 delta=297 Let's create two identical databases. I've chosen the time range - 920'805'000 to 920'805'900 as this goes very well with the example num- - bers. + 920805000 to 920805900 as this goes very well with the example numbers. rrdtool create seconds1.rrd \ --start 920804700 \ @@ -1119,11 +1142,11 @@ TTUUTTOORRIIAALL WWRRAAPPUUPP It's time now to wrap up this tutorial. We covered all the basics for - you to be able to work with RRDtool and to read the additional - documentation available. There is plenty more to discover about RRDtool - and you will find more and more uses for this package. You can easly - create graphs using just the examples provided and using only RRDtool. - You can also use one of the front ends to RRDtool that are available. + you to be able to work with RRDtool and to read the additional documen- + tation available. There is plenty more to discover about RRDtool and + you will find more and more uses for this package. You can easily cre- + ate graphs using just the examples provided and using only RRDtool. You + can also use one of the front ends to RRDtool that are available. MMAAIILLIINNGGLLIISSTT Remember to subscribe to the RRDtool mailing list. Even if you are not @@ -1145,8 +1168,8 @@ AAUUTTHHOORR basic questions. They will not only get their answers, but at the same time learn a whole lot more. - Alex van den Bogaerdt + Alex van den Bogaerdt -1.3.5 2008-03-15 RRDTUTORIAL(1) +1.3.7 2009-02-21 RRDTUTORIAL(1) diff --git a/doc/rrdupdate.1 b/doc/rrdupdate.1 index 177c5ec..6c46602 100644 --- a/doc/rrdupdate.1 +++ b/doc/rrdupdate.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RRDUPDATE 1" -.TH RRDUPDATE 1 "2008-03-15" "1.3.5" "rrdtool" +.TH RRDUPDATE 1 "2008-03-15" "1.3.7" "rrdtool" .SH "NAME" rrdupdate \- Store a new set of values into the RRD .SH "SYNOPSIS" diff --git a/doc/rrdupdate.txt b/doc/rrdupdate.txt index ef03d59..a60d97c 100644 --- a/doc/rrdupdate.txt +++ b/doc/rrdupdate.txt @@ -91,4 +91,4 @@ AAUUTTHHOORR -1.3.5 2008-03-15 RRDUPDATE(1) +1.3.7 2008-03-15 RRDUPDATE(1) diff --git a/doc/rrdxport.1 b/doc/rrdxport.1 index d675d5f..186dc1f 100644 --- a/doc/rrdxport.1 +++ b/doc/rrdxport.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RRDXPORT 1" -.TH RRDXPORT 1 "2008-03-15" "1.3.5" "rrdtool" +.TH RRDXPORT 1 "2008-03-15" "1.3.7" "rrdtool" .SH "NAME" rrdxport \- Export data in XML format based on data from one or several RRD .SH "SYNOPSIS" diff --git a/doc/rrdxport.txt b/doc/rrdxport.txt index 37c416d..1374bce 100644 --- a/doc/rrdxport.txt +++ b/doc/rrdxport.txt @@ -125,4 +125,4 @@ AAUUTTHHOORR -1.3.5 2008-03-15 RRDXPORT(1) +1.3.7 2008-03-15 RRDXPORT(1) diff --git a/rrd_config.h.in b/rrd_config.h.in index 2b756a1..7a4bff5 100644 --- a/rrd_config.h.in +++ b/rrd_config.h.in @@ -60,6 +60,10 @@ don't. */ #undef HAVE_DECL_POSIX_FADVISE +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you + don't. */ +#undef HAVE_DECL_STRERROR_R + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H @@ -136,6 +140,9 @@ /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBGEN_H + /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H @@ -295,6 +302,9 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define to 1 if strerror_r returns char *. */ +#undef STRERROR_R_CHAR_P + /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME diff --git a/rrdtool.spec b/rrdtool.spec index 838fe72..221e171 100644 --- a/rrdtool.spec +++ b/rrdtool.spec @@ -9,7 +9,7 @@ Summary: Round Robin Database Tool to store and display time-series data Name: rrdtool -Version: 1.3.5 +Version: 1.3.7 Release: 1 License: GPLv2+ with exceptions Group: Applications/Databases diff --git a/src/Makefile.am b/src/Makefile.am index f91ae6c..74d382f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -106,7 +106,7 @@ pkgconfig_DATA = librrd.pc # strftime is here because we do not usually need it. unices have propper # iso date support EXTRA_DIST= librrd.pc.in strftime.c strftime.h rrd_getopt.c rrd_getopt1.c rrd_getopt.h \ - win32comp.c rrd_thread_safe_nt.c get_ver.awk librrd.sym.in.in + win32comp.c rrd_thread_safe_nt.c get_ver.awk librrd.sym.in.in plbasename.c plbasename.h librrd.sym: librrd.sym.in grep -v LIBC_HAS_GETOPT_LONG librrd.sym.in >$@ diff --git a/src/Makefile.in b/src/Makefile.in index ef9ec66..f4eb128 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -437,7 +437,7 @@ pkgconfig_DATA = librrd.pc # strftime is here because we do not usually need it. unices have propper # iso date support EXTRA_DIST = librrd.pc.in strftime.c strftime.h rrd_getopt.c rrd_getopt1.c rrd_getopt.h \ - win32comp.c rrd_thread_safe_nt.c get_ver.awk librrd.sym.in.in + win32comp.c rrd_thread_safe_nt.c get_ver.awk librrd.sym.in.in plbasename.c plbasename.h all: all-am diff --git a/src/plbasename.c b/src/plbasename.c new file mode 100644 index 0000000..dd695bb --- /dev/null +++ b/src/plbasename.c @@ -0,0 +1,211 @@ +#ifdef WIN32 +/* + * + * Cross-platform basename/dirname + * + * Copyright 2005 Syd Logan, All Rights Reserved + * + * This code is distributed without warranty. You are free to use this + * code for any purpose, however, if this code is republished or + * redistributed in its original form, as hardcopy or electronically, + * then you must include this copyright notice along with the code. + * + */ + +// minor changes 2008 by Stefan Ludewig stefan.ludewig@exitgames.com for WIN32 version RRDtool + +#include +#include +#include "plbasename.h" +#include +#if defined(TEST) +#include +#endif + +#if defined(__cplusplus) + +extern "C" { + +#endif + +const char * +PL_basename(const char *name) +{ + const char *base; + char *p; + static char *tmp = NULL; + int len; + + if (tmp) { + free(tmp); + tmp = NULL; + } + + if (!name || !strcmp(name, "")) + return ""; + + if (!strcmp(name, "/")) + return "/"; + + len = strlen(name); + if (name[len - 1] == '/') { + // ditch the trailing '/' + p = tmp = (char*)malloc(len); + strncpy(p, name, len - 1); + } else { + p = (char *) name; + } + + for (base = p; *p; p++) + if (*p == '/') + base = p + 1; + + return base; +} + +const char * +PL_dirname(const char *name) +{ + static char *ret = NULL; + int len; + int size = 0; + const char *p; + + if (ret) { + free(ret); + ret = NULL; + } + + if (!name || !strcmp(name, "") || !strstr(name, "/")) + return("."); + + if (!strcmp(name, "/")) + return(name); + + // find the last slash in the string + + len = strlen(name); + p = &name[len - 1]; + + if (*p == '/') p--; // skip the trailing / + + while (p != name && *p != '/') p--; + + size = p - name; + if (size) { + ret = (char*)malloc(size + 1); + memcpy(ret, name, size); + ret[size] = '\0'; + } else if (*p == '/') + return "/"; + else + return ""; + + return (const char *) ret; +} + +#if defined(__cplusplus) + +} + +#endif + +#if defined(TEST) + +int +main(int argc, char *argv[]) +{ +/* run the following tests: + + path dirname basename + "/usr/lib" "/usr" "lib" + "/usr/" "/" "usr" + "usr" "." "usr" + "/" "/" "/" + "." "." "." + ".." "." ".." + NULL "." "" + "" "." "" + "./.." "." ".." + + These results can be verified by running the unix commands + basename(1) and dirname(1). One tweek to the test strategy + used here would be, on darwin and linux, to shell out to + get the expected results vs hardcoding. +*/ + if (!strcmp(PL_basename("/usr/lib"), "lib")) + printf("PL_basename /usr/lib passed\n"); + else + printf("PL_basename /usr/lib failed expected lib\n"); + if (!strcmp(PL_dirname("/usr/lib"), "/usr")) + printf("PL_dirname /usr/lib passed\n"); + else + printf("PL_dirname /usr/lib failed expected /usr\n"); + if (!strcmp(PL_basename("/usr/"), "usr")) + printf("PL_basename /usr/ passed\n"); + else + printf("PL_basename /usr/ failed expected usr\n"); + if (!strcmp(PL_dirname("/usr/"), "/")) + printf("PL_dirname /usr/ passed\n"); + else + printf("PL_dirname /usr/ failed expected /\n"); + if (!strcmp(PL_basename("usr"), "usr")) + printf("PL_basename usr passed\n"); + else + printf("PL_basename usr failed expected usr\n"); + if (!strcmp(PL_dirname("usr"), ".")) + printf("PL_dirname usr passed\n"); + else + printf("PL_dirname usr failed expected .\n"); + if (!strcmp(PL_basename("/"), "/")) + printf("PL_basename / passed\n"); + else + printf("PL_basename / failed expected /\n"); + if (!strcmp(PL_dirname("/"), "/")) + printf("PL_dirname / passed\n"); + else + printf("PL_dirname / failed expected /\n"); + if (!strcmp(PL_basename("."), ".")) + printf("PL_basename . passed\n"); + else + printf("PL_basename . failed\n"); + if (!strcmp(PL_dirname("."), ".")) + printf("PL_dirname . passed\n"); + else + printf("PL_dirname . failed expected .\n"); + if (!strcmp(PL_basename(".."), "..")) + printf("PL_basename .. passed\n"); + else + printf("PL_basename .. failed expected ..\n"); + if (!strcmp(PL_dirname(".."), ".")) + printf("PL_dirname .. passed\n"); + else + printf("PL_dirname .. failed expected .\n"); + if (!strcmp(PL_basename(NULL), "")) + printf("PL_basename NULL passed\n"); + else + printf("PL_basename NULL failed expected \"\"\n"); + if (!strcmp(PL_dirname(NULL), ".")) + printf("PL_dirname NULL passed\n"); + else + printf("PL_dirname NULL failed expected .\n"); + if (!strcmp(PL_basename(""), "")) + printf("PL_basename \"\" passed\n"); + else + printf("PL_basename \"\" failed expected \"\"\n"); + if (!strcmp(PL_dirname(""), ".")) + printf("PL_dirname \"\" passed\n"); + else + printf("PL_dirname \"\" failed expected .\n"); + + if (!strcmp(PL_basename("./.."), "..")) + printf("PL_basename ./.. passed\n"); + else + printf("PL_basename ./.. failed expected ..\n"); + if (!strcmp(PL_dirname("./.."), ".")) + printf("PL_dirname ./.. passed\n"); + else + printf("PL_dirname ./.. failed expected .\n"); +} +#endif +#endif // WIN32 diff --git a/src/plbasename.h b/src/plbasename.h new file mode 100644 index 0000000..28786a1 --- /dev/null +++ b/src/plbasename.h @@ -0,0 +1,45 @@ +#ifdef WIN32 +/* + * + * Cross-platform basename/dirname + * + * Copyright 2005 Syd Logan, All Rights Reserved + * + * This code is distributed without warranty. You are free to use this + * code for any purpose, however, if this code is republished or + * redistributed in its original form, as hardcopy or electronically, + * then you must include this copyright notice along with the code. + * + */ + +// minor changes 2008 by Stefan Ludewig stefan.ludewig@exitgames.com for WIN32 version RRDtool + +#if !defined(__PL_BASENAME_H__) +#define __PL_BASENAME_H__ + +/* + path dirname basename + "/usr/lib" "/usr" "lib" + "/usr/" "/" "usr" + "usr" "." "usr" + "/" "/" "/" + "." "." "." + ".." "." ".." +*/ + +#if defined(__cplusplus) +extern "C" { +#endif + +const char *PL_basename(const char *name); +const char *PL_dirname(const char *name); + +#define basename(name) ((char*)PL_basename(name)) +#define dirname(name) ((char*)PL_dirname(name)) + +#if defined(__cplusplus) +} +#endif + +#endif +#endif // WIN32 diff --git a/src/pngsize.c b/src/pngsize.c index 7369549..9cd29e5 100644 --- a/src/pngsize.c +++ b/src/pngsize.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * pngsize.c determine the size of a PNG image *****************************************************************************/ diff --git a/src/rrd.h b/src/rrd.h index 7e04636..cf9a303 100644 --- a/src/rrd.h +++ b/src/rrd.h @@ -1,9 +1,9 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrdlib.h Public header file for librrd ***************************************************************************** - * $Id: rrd.h 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd.h 1781 2009-04-07 07:31:53Z oetiker $ * $Log$ * Revision 1.9 2005/02/13 16:13:33 oetiker * let rrd_graph return the actual value range it picked ... diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index cb9ab72..ce619af 100644 --- a/src/rrd_cgi.c +++ b/src/rrd_cgi.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_cgi.c RRD Web Page Generator *****************************************************************************/ @@ -374,6 +374,7 @@ static void calfree( if (calcpr) { free(calcpr); } + calcpr=NULL; } } diff --git a/src/rrd_create.c b/src/rrd_create.c index bffad73..a31f23e 100644 --- a/src/rrd_create.c +++ b/src/rrd_create.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_create.c creates new rrds *****************************************************************************/ diff --git a/src/rrd_diff.c b/src/rrd_diff.c index fc93f5e..ad671ad 100644 --- a/src/rrd_diff.c +++ b/src/rrd_diff.c @@ -1,11 +1,11 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 * This code is stolen from rateup (mrtg-2.x) by Dave Rand ***************************************************************************** * diff calculate the difference between two very long integers available as * strings ***************************************************************************** - * $Id: rrd_diff.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_diff.c 1781 2009-04-07 07:31:53Z oetiker $ * $Log$ * Revision 1.4 2003/03/10 00:30:34 oetiker * handle cases with two negative numbers diff --git a/src/rrd_dump.c b/src/rrd_dump.c index 032748a..c2e3e5e 100644 --- a/src/rrd_dump.c +++ b/src/rrd_dump.c @@ -1,9 +1,9 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_dump Display a RRD ***************************************************************************** - * $Id: rrd_dump.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_dump.c 1781 2009-04-07 07:31:53Z oetiker $ * $Log$ * Revision 1.7 2004/05/25 20:53:21 oetiker * prevent small leak when resources are exhausted -- Mike Slifcak @@ -46,9 +46,14 @@ #include #endif + #include "rrd_tool.h" #include "rrd_rpncalc.h" +#ifdef HAVE_LOCALE_H +#include +#endif + #if !(defined(NETWARE) || defined(WIN32)) extern char *tzname[2]; #endif @@ -69,7 +74,7 @@ int rrd_dump_opt_r( rrd_t rrd; rrd_value_t value; struct tm tm; - + char *old_locale = ""; rrd_file = rrd_open(filename, &rrd, RRD_READONLY | RRD_READAHEAD); if (rrd_file == NULL) { rrd_free(&rrd); @@ -84,7 +89,9 @@ int rrd_dump_opt_r( } else { out_file = stdout; } - +#ifdef HAVE_SETLOCALE + old_locale = setlocale(LC_NUMERIC, "C"); +#endif if (!opt_noheader) { fputs("\n", out_file); fputs @@ -100,7 +107,7 @@ int rrd_dump_opt_r( } fprintf(out_file, "\t %lu \n", rrd.stat_head->pdp_step); -#if HAVE_STRFTIME +#ifdef HAVE_STRFTIME localtime_r(&rrd.live_head->last_up, &tm); strftime(somestring, 200, "%Y-%m-%d %H:%M:%S %Z", &tm); #else @@ -389,7 +396,7 @@ int rrd_dump_opt_r( rrd_seek(rrd_file, (rra_start + (rrd.rra_ptr[i].cur_row + 1) * rrd.stat_head->ds_cnt * sizeof(rrd_value_t)), SEEK_SET); - timer = -(rrd.rra_def[i].row_cnt - 1); + timer = - (long)(rrd.rra_def[i].row_cnt - 1); ii = rrd.rra_ptr[i].cur_row; for (ix = 0; ix < rrd.rra_def[i].row_cnt; ix++) { ii++; @@ -429,6 +436,9 @@ int rrd_dump_opt_r( if (out_file != stdout) { fclose(out_file); } +#ifdef HAVE_SETLOCALE + setlocale(LC_NUMERIC, old_locale); +#endif return rrd_close(rrd_file); } diff --git a/src/rrd_error.c b/src/rrd_error.c index abe12c5..ef99e8a 100644 --- a/src/rrd_error.c +++ b/src/rrd_error.c @@ -1,9 +1,9 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_error.c Common Header File ***************************************************************************** - * $Id: rrd_error.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_error.c 1781 2009-04-07 07:31:53Z oetiker $ * $Log$ * Revision 1.4 2003/02/22 21:57:03 oetiker * a patch to avoid a memory leak and a Makefile.am patch to diff --git a/src/rrd_fetch.c b/src/rrd_fetch.c index d02acf6..7c2708e 100644 --- a/src/rrd_fetch.c +++ b/src/rrd_fetch.c @@ -1,9 +1,9 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_fetch.c read date from an rrd to use for further processing ***************************************************************************** - * $Id: rrd_fetch.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_fetch.c 1781 2009-04-07 07:31:53Z oetiker $ * $Log$ * Revision 1.8 2004/05/18 18:53:03 oetiker * big spell checking patch -- slif@bellsouth.net @@ -443,6 +443,8 @@ int rrd_fetch_fn( } rrd_close(rrd_file); + rrd_free(&rrd); + return (0); err_free_data: free(*data); diff --git a/src/rrd_first.c b/src/rrd_first.c index cd01af4..6a951a2 100644 --- a/src/rrd_first.c +++ b/src/rrd_first.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_first Return ***************************************************************************** @@ -83,7 +83,7 @@ time_t rrd_first_r( (rra_start + (rrd.rra_ptr[rraindex].cur_row + 1) * rrd.stat_head->ds_cnt * sizeof(rrd_value_t)), SEEK_SET); - timer = -(rrd.rra_def[rraindex].row_cnt - 1); + timer = -(long)(rrd.rra_def[rraindex].row_cnt - 1); if (rrd.rra_ptr[rraindex].cur_row + 1 > rrd.rra_def[rraindex].row_cnt) { rrd_seek(rrd_file, rra_start, SEEK_SET); } diff --git a/src/rrd_format.c b/src/rrd_format.c index fbf7c69..19bf105 100644 --- a/src/rrd_format.c +++ b/src/rrd_format.c @@ -1,9 +1,9 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_format.c RRD Database Format helper functions ***************************************************************************** - * $Id: rrd_format.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_format.c 1781 2009-04-07 07:31:53Z oetiker $ * $Log$ * Revision 1.5 2004/05/18 18:53:03 oetiker * big spell checking patch -- slif@bellsouth.net diff --git a/src/rrd_format.h b/src/rrd_format.h index 06adcc4..524b91e 100644 --- a/src/rrd_format.h +++ b/src/rrd_format.h @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_format.h RRD Database Format header *****************************************************************************/ diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c index 941cfd1..4f0cd42 100644 --- a/src/rrd_gfx.c +++ b/src/rrd_gfx.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 **************************************************************************** * rrd_gfx.c graphics wrapper for rrdtool **************************************************************************/ diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 0323077..0d25f99 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 **************************************************************************** * rrd__graph.c produce graphs from data in rrdfiles ****************************************************************************/ @@ -9,7 +9,9 @@ #ifdef WIN32 #include "strftime.h" +#include "plbasename.h" #endif + #include "rrd_tool.h" #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) @@ -3030,16 +3032,7 @@ int graph_paint( graph_desc_t *lastgdes = NULL; rrd_infoval_t info; -// PangoFontMap *font_map = pango_cairo_font_map_get_default(); - /* if we want and can be lazy ... quit now */ - if (lazy) { - info.u_cnt = im->ximg; - grinfo_push(im, sprintf_alloc("image_width"), RD_I_CNT, info); - info.u_cnt = im->yimg; - grinfo_push(im, sprintf_alloc("image_height"), RD_I_CNT, info); - return 0; - } /* pull the data from the rrd files ... */ if (data_fetch(im) == -1) return -1; @@ -3055,7 +3048,7 @@ int graph_paint( if (i < 0) return -1; - if ((i == 0) || lazy) + if (i == 0) return 0; /************************************************************** @@ -3077,6 +3070,14 @@ int graph_paint( grinfo_push(im, sprintf_alloc("image_width"), RD_I_CNT, info); info.u_cnt = im->yimg; grinfo_push(im, sprintf_alloc("image_height"), RD_I_CNT, info); + info.u_cnt = im->start; + grinfo_push(im, sprintf_alloc("graph_start"), RD_I_CNT, info); + info.u_cnt = im->end; + grinfo_push(im, sprintf_alloc("graph_end"), RD_I_CNT, info); + + /* if we want and can be lazy ... quit now */ + if (lazy) + return 0; /* get actual drawing data and find min and max values */ if (data_proc(im) == -1) @@ -3187,7 +3188,7 @@ int graph_paint( if (im->gdes[i].yrule > 0) { gfx_line(im, im->xorigin + ii, - im->yorigin, + im->yorigin + 1.0, im->xorigin + ii, im->yorigin - im->gdes[i].yrule * @@ -3195,11 +3196,11 @@ int graph_paint( } else if (im->gdes[i].yrule < 0) { gfx_line(im, im->xorigin + ii, - im->yorigin - im->ysize, + im->yorigin - im->ysize - 1.0, im->xorigin + ii, - im->yorigin - (1 - + im->yorigin - im->ysize - im->gdes[i]. - yrule) * + yrule * im->ysize, 1.0, im->gdes[i].col); } } @@ -3652,9 +3653,9 @@ int rrd_graph( *ymax = 0; while (walker) { if (strcmp(walker->key, "image_width") == 0) { - *xsize = walker->value.u_int; + *xsize = walker->value.u_cnt; } else if (strcmp(walker->key, "image_height") == 0) { - *ysize = walker->value.u_int; + *ysize = walker->value.u_cnt; } else if (strcmp(walker->key, "value_min") == 0) { *ymin = walker->value.u_val; } else if (strcmp(walker->key, "value_max") == 0) { diff --git a/src/rrd_graph.h b/src/rrd_graph.h index a42b20b..1cab51e 100644 --- a/src/rrd_graph.h +++ b/src/rrd_graph.h @@ -11,6 +11,11 @@ #include #include +#ifdef HAVE_LIBGEN_H +/* for basename */ +# include +#endif + #include "rrd_tool.h" #include "rrd_rpncalc.h" diff --git a/src/rrd_graph_helper.c b/src/rrd_graph_helper.c index 2add7ad..31ea023 100644 --- a/src/rrd_graph_helper.c +++ b/src/rrd_graph_helper.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 **************************************************************************** * rrd_graph_helper.c commandline parser functions * this code initially written by Alex van den Bogaerdt diff --git a/src/rrd_hw.c b/src/rrd_hw.c index e95fa08..e20aea6 100644 --- a/src/rrd_hw.c +++ b/src/rrd_hw.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_hw.c : Support for Holt-Winters Smoothing/ Aberrant Behavior Detection ***************************************************************************** @@ -168,7 +168,7 @@ int apply_smoother( free(rrd_values); return -1; } - rrd_flush(rrd_file); + /* could read all data in a single block, but we need to * check for NA values */ for (i = 0; i < row_count; ++i) { @@ -272,7 +272,6 @@ int apply_smoother( baseline[j]; } /* flush cdp to disk */ - rrd_flush(rrd_file); if (rrd_seek(rrd_file, sizeof(stat_head_t) + rrd->stat_head->ds_cnt * sizeof(ds_def_t) + rrd->stat_head->rra_cnt * sizeof(rra_def_t) + @@ -295,7 +294,6 @@ int apply_smoother( /* endif CF_SEASONAL */ /* flush updated values to disk */ - rrd_flush(rrd_file); if (rrd_seek(rrd_file, rra_start, SEEK_SET)) { rrd_set_error("apply_smoother: seek to pos %d failed", rra_start); free(rrd_values); @@ -310,7 +308,6 @@ int apply_smoother( return -1; } - rrd_flush(rrd_file); free(rrd_values); free(baseline); return 0; diff --git a/src/rrd_hw.h b/src/rrd_hw.h index fbb55b5..8ae7346 100644 --- a/src/rrd_hw.h +++ b/src/rrd_hw.h @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_hw.h : Support for Holt-Winters Smoothing/ Aberrant Behavior Detection *****************************************************************************/ diff --git a/src/rrd_i18n.h b/src/rrd_i18n.h index bb777ee..1099041 100644 --- a/src/rrd_i18n.h +++ b/src/rrd_i18n.h @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Takao Fujiwara, 2008 + * RRDtool 1.3.7 Copyright by Takao Fujiwara, 2008 ***************************************************************************** * rrd_i18n.h Common Header File *****************************************************************************/ diff --git a/src/rrd_info.c b/src/rrd_info.c index bf1c2c2..d4e6219 100644 --- a/src/rrd_info.c +++ b/src/rrd_info.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_info Get Information about the configuration of an RRD *****************************************************************************/ diff --git a/src/rrd_is_thread_safe.h b/src/rrd_is_thread_safe.h index 01707c7..105ec71 100644 --- a/src/rrd_is_thread_safe.h +++ b/src/rrd_is_thread_safe.h @@ -1,12 +1,12 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 * This file: Copyright 2003 Peter Stamfest * & Tobias Oetiker * Distributed under the GPL ***************************************************************************** * rrd_is_thread_safe.c Poisons some nasty function calls using GNU cpp ***************************************************************************** - * $Id: rrd_is_thread_safe.h 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_is_thread_safe.h 1781 2009-04-07 07:31:53Z oetiker $ *************************************************************************** */ #ifndef _RRD_IS_THREAD_SAFE_H diff --git a/src/rrd_last.c b/src/rrd_last.c index 83603c9..cceeb4c 100644 --- a/src/rrd_last.c +++ b/src/rrd_last.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_last.c ***************************************************************************** diff --git a/src/rrd_lastupdate.c b/src/rrd_lastupdate.c index 1c769dd..7e843f4 100644 --- a/src/rrd_lastupdate.c +++ b/src/rrd_lastupdate.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_lastupdate Get the last datum entered for each DS *****************************************************************************/ diff --git a/src/rrd_not_thread_safe.c b/src/rrd_not_thread_safe.c index 5c1bee8..65c025c 100644 --- a/src/rrd_not_thread_safe.c +++ b/src/rrd_not_thread_safe.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 * This file: Copyright 2003 Peter Stamfest * & Tobias Oetiker * Distributed under the GPL @@ -7,7 +7,7 @@ * rrd_not_thread_safe.c Contains routines used when thread safety is not * an issue ***************************************************************************** - * $Id: rrd_not_thread_safe.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_not_thread_safe.c 1781 2009-04-07 07:31:53Z oetiker $ *************************************************************************** */ #include "rrd.h" #include "rrd_tool.h" diff --git a/src/rrd_open.c b/src/rrd_open.c index f825ad7..a19d5e0 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -1,9 +1,9 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_open.c Open an RRD File ***************************************************************************** - * $Id: rrd_open.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_open.c 1781 2009-04-07 07:31:53Z oetiker $ *****************************************************************************/ #include "rrd_tool.h" @@ -13,6 +13,7 @@ #include #include #include +#include #endif #define MEMBLK 8192 diff --git a/src/rrd_resize.c b/src/rrd_resize.c index 322de04..f53d3c5 100644 --- a/src/rrd_resize.c +++ b/src/rrd_resize.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_resize.c Alters size of an RRA ***************************************************************************** @@ -102,10 +102,14 @@ int rrd_resize( rrd_set_error("Can't create '%s': %s", outfilename, rrd_strerror(errno)); rrd_free(&rrdnew); + rrd_free(&rrdold); + rrd_close(rrd_file); + rrd_close(rrd_out_file); return (-1); } if (rrd_lock(rrd_out_file) != 0) { rrd_set_error("could not lock new RRD"); + rrd_free(&rrdnew); rrd_free(&rrdold); rrd_close(rrd_file); rrd_close(rrd_out_file); @@ -203,7 +207,7 @@ int rrd_resize( case 3: break; case 1: - rrdold.stat_head->version[3] = '3'; + rrdnew.stat_head->version[3] = '3'; break; default: rrd_set_error("Do not know how to handle RRD version %s", @@ -260,17 +264,12 @@ int rrd_resize( rrd_write(rrd_out_file, &buffer, sizeof(rrd_value_t) * 1); l--; } -#ifndef HAVE_MMAP buffer = DNAN; l = rrdnew.stat_head->ds_cnt * modify; while (l > 0) { rrd_write(rrd_out_file, &buffer, sizeof(rrd_value_t) * 1); l--; } -#else - /* for the mmap case, we did already fill the whole new file with DNAN - * before we copied the old values, so nothing to do here. */ -#endif } else { /* Removing rows. Normally this would be just after the cursor ** however this may also mean that we wrap to the beginning of diff --git a/src/rrd_restore.c b/src/rrd_restore.c index e7fa6d6..6e5d276 100644 --- a/src/rrd_restore.c +++ b/src/rrd_restore.c @@ -1,11 +1,11 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 * This file: Copyright 2008 Florian octo Forster * Distributed under the GPL ***************************************************************************** * rrd_restore.c Contains logic to parse XML input and create an RRD file ***************************************************************************** - * $Id: rrd_restore.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_restore.c 1781 2009-04-07 07:31:53Z oetiker $ *************************************************************************** */ /* diff --git a/src/rrd_rpncalc.c b/src/rrd_rpncalc.c index 06b91bd..fd56ffb 100644 --- a/src/rrd_rpncalc.c +++ b/src/rrd_rpncalc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 **************************************************************************** * rrd_rpncalc.c RPN calculator functions ****************************************************************************/ diff --git a/src/rrd_rpncalc.h b/src/rrd_rpncalc.h index 9dea443..f15aa25 100644 --- a/src/rrd_rpncalc.h +++ b/src/rrd_rpncalc.h @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 **************************************************************************** * rrd_rpncalc.h RPN calculator functions ****************************************************************************/ diff --git a/src/rrd_thread_safe.c b/src/rrd_thread_safe.c index 1639926..32355e4 100644 --- a/src/rrd_thread_safe.c +++ b/src/rrd_thread_safe.c @@ -1,12 +1,12 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 * This file: Copyright 2003 Peter Stamfest * & Tobias Oetiker * Distributed under the GPL ***************************************************************************** * rrd_thread_safe.c Contains routines used when thread safety is required ***************************************************************************** - * $Id: rrd_thread_safe.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_thread_safe.c 1781 2009-04-07 07:31:53Z oetiker $ *************************************************************************** */ #include @@ -59,11 +59,38 @@ const char *rrd_strerror( int err) { rrd_context_t *ctx = rrd_get_context(); + char *ret = "unknown error"; - if (strerror_r(err, ctx->lib_errstr, sizeof(ctx->lib_errstr))) - return "strerror_r failed. sorry!"; - else - return ctx->lib_errstr; + *ctx->lib_errstr = '\0'; + + /* Even though POSIX/XSI requires "strerror_r" to return an "int", some + * systems (e.g. the GNU libc) return a "char *" _and_ ignore the second + * argument ... -tokkee */ +#if STRERROR_R_CHAR_P + ret = strerror_r(err, ctx->lib_errstr, sizeof(ctx->lib_errstr)); + if ((! ret) || (*ret == '\0')) { + if (*ctx->lib_errstr != '\0') + ret = ctx->lib_errstr; + else { + /* according to the manpage this should not happen - + let's handle it somehow sanely anyway */ + snprintf(ctx->lib_errstr, sizeof(ctx->lib_errstr), + "unknown error %i - strerror_r did not return anything", + err); + ctx->lib_errstr[sizeof(ctx->lib_errstr) - 1] = '\0'; + ret = ctx->lib_errstr; + } + } +#else /* ! STRERROR_R_CHAR_P */ + if (strerror_r(err, ctx->lib_errstr, sizeof(ctx->lib_errstr))) { + snprintf(ctx->lib_errstr, sizeof(ctx->lib_errstr), + "unknown error %i - strerror_r returned with errno = %i", + err, errno); + ctx->lib_errstr[sizeof(ctx->lib_errstr) - 1] = '\0'; + } + ret = ctx->lib_errstr; +#endif + return ret; } #else #undef strerror diff --git a/src/rrd_thread_safe_nt.c b/src/rrd_thread_safe_nt.c index a0ce240..ed33e89 100644 --- a/src/rrd_thread_safe_nt.c +++ b/src/rrd_thread_safe_nt.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 * This file: Copyright 2003 Peter Stamfest * & Tobias Oetiker * Distributed under the GPL @@ -7,7 +7,7 @@ * rrd_thread_safe.c Contains routines used when thread safety is required * for win32 ***************************************************************************** - * $Id: rrd_thread_safe_nt.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_thread_safe_nt.c 1781 2009-04-07 07:31:53Z oetiker $ *************************************************************************** */ #include diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 09bdbbe..3df092b 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_tool.c Startup wrapper *****************************************************************************/ @@ -49,7 +49,7 @@ void PrintUsage( const char *help_main = N_("RRDtool %s" - " Copyright 1997-2008 by Tobias Oetiker \n" + " Copyright 1997-2009 by Tobias Oetiker \n" " Compiled %s %s\n\n" "Usage: rrdtool [options] command command_options\n\n"); diff --git a/src/rrd_tool.h b/src/rrd_tool.h index 94f255e..8678777 100644 --- a/src/rrd_tool.h +++ b/src/rrd_tool.h @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_tool.h Common Header File *****************************************************************************/ diff --git a/src/rrd_tune.c b/src/rrd_tune.c index 1f4a62e..2b7298e 100644 --- a/src/rrd_tune.c +++ b/src/rrd_tune.c @@ -1,9 +1,9 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * change header parameters of an rrd ***************************************************************************** - * $Id: rrd_tune.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_tune.c 1781 2009-04-07 07:31:53Z oetiker $ * $Log$ * Revision 1.6 2004/05/26 22:11:12 oetiker * reduce compiler warnings. Many small fixes. -- Mike Slifcak diff --git a/src/rrd_update.c b/src/rrd_update.c index 4db346e..ebc0f2c 100644 --- a/src/rrd_update.c +++ b/src/rrd_update.c @@ -1,10 +1,10 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_update.c RRD Update Function ***************************************************************************** - * $Id: rrd_update.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrd_update.c 1781 2009-04-07 07:31:53Z oetiker $ *****************************************************************************/ #include "rrd_tool.h" @@ -1943,7 +1943,7 @@ static int write_RRA_row( /* append info to the return hash */ *pcdp_summary = rrd_info_push(*pcdp_summary, sprintf_alloc - ("[%d]RRA[%s][%lu]DS[%s]", rra_time, + ("[%lli]RRA[%s][%lu]DS[%s]", (long long)rra_time, rrd->rra_def[rra_idx].cf_nam, rrd->rra_def[rra_idx].pdp_cnt, rrd->ds_def[ds_idx].ds_nam), diff --git a/src/rrd_version.c b/src/rrd_version.c index 7eb9d42..5c59dec 100644 --- a/src/rrd_version.c +++ b/src/rrd_version.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrd_version Return ***************************************************************************** diff --git a/src/rrd_xport.c b/src/rrd_xport.c index 66cb5a1..efb1cee 100644 --- a/src/rrd_xport.c +++ b/src/rrd_xport.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 **************************************************************************** * rrd_xport.c export RRD data ****************************************************************************/ @@ -227,7 +227,7 @@ int rrd_xport_fn( case GF_XPORT: ref_list[xport_counter++] = i; *step_list_ptr = im->gdes[im->gdes[i].vidx].step; - printf("%s:%lu\n",im->gdes[i].legend,*step_list_ptr); + /* printf("%s:%lu\n",im->gdes[i].legend,*step_list_ptr); */ *step_list_ptr++; /* reserve room for one legend entry */ /* is FMT_LEG_LEN + 5 the correct size? */ @@ -255,7 +255,7 @@ int rrd_xport_fn( *step_list_ptr=0; /* find a common step */ *step = lcd(step_list); - printf("step: %lu\n",*step); + /* printf("step: %lu\n",*step); */ free(step_list); *start = im->start - im->start % (*step); diff --git a/src/rrd_xport.h b/src/rrd_xport.h index 72b3104..85dd072 100644 --- a/src/rrd_xport.h +++ b/src/rrd_xport.h @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 **************************************************************************** * rrd_xport.h contains XML related constants ****************************************************************************/ diff --git a/src/rrdupdate.c b/src/rrdupdate.c index d872bf8..8f32d5e 100644 --- a/src/rrdupdate.c +++ b/src/rrdupdate.c @@ -1,9 +1,9 @@ /***************************************************************************** - * RRDtool 1.3.5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.7 Copyright by Tobi Oetiker, 1997-2009 ***************************************************************************** * rrdupdate.c Main program for the (standalone) rrdupdate utility ***************************************************************************** - * $Id: rrdupdate.c 1710 2008-12-15 22:06:22Z oetiker $ + * $Id: rrdupdate.c 1781 2009-04-07 07:31:53Z oetiker $ *****************************************************************************/ #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(HAVE_CONFIG_H) diff --git a/win32/rrd.sln b/win32/rrd.sln new file mode 100644 index 0000000..7f07ad3 --- /dev/null +++ b/win32/rrd.sln @@ -0,0 +1,29 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rrdlib", "rrdlib.vcproj", "{CC158E1D-1364-43CA-9B2D-4AF54225C7CA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rrdtool", "rrdtool.vcproj", "{11CD05F8-E5E1-476E-A75F-A112655D4E94}" + ProjectSection(ProjectDependencies) = postProject + {CC158E1D-1364-43CA-9B2D-4AF54225C7CA} = {CC158E1D-1364-43CA-9B2D-4AF54225C7CA} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CC158E1D-1364-43CA-9B2D-4AF54225C7CA}.Debug|Win32.ActiveCfg = Debug|Win32 + {CC158E1D-1364-43CA-9B2D-4AF54225C7CA}.Debug|Win32.Build.0 = Debug|Win32 + {CC158E1D-1364-43CA-9B2D-4AF54225C7CA}.Release|Win32.ActiveCfg = Release|Win32 + {CC158E1D-1364-43CA-9B2D-4AF54225C7CA}.Release|Win32.Build.0 = Release|Win32 + {11CD05F8-E5E1-476E-A75F-A112655D4E94}.Debug|Win32.ActiveCfg = Debug|Win32 + {11CD05F8-E5E1-476E-A75F-A112655D4E94}.Debug|Win32.Build.0 = Debug|Win32 + {11CD05F8-E5E1-476E-A75F-A112655D4E94}.Release|Win32.ActiveCfg = Release|Win32 + {11CD05F8-E5E1-476E-A75F-A112655D4E94}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/rrdlib.vcproj b/win32/rrdlib.vcproj index 00a8b01..dd5947e 100644 --- a/win32/rrdlib.vcproj +++ b/win32/rrdlib.vcproj @@ -164,6 +164,10 @@ RelativePath="..\src\hash_32.c" > + + @@ -298,6 +302,10 @@ RelativePath="..\src\fnv.h" > + +