[Orca-checkins] rev 110 - in trunk/orca: . lib src packages/rrdtool-0.99.31 packages/rrdtool-0.99.31/src packages/rrdtool-0.99.31/perl-piped packages/rrdtool-0.99.31/doc packages/rrdtool-0.99.31/perl-shared
blair at orcaware.com
blair at orcaware.com
Sat Jul 13 19:13:01 PDT 2002
Author: blair
Date: Fri, 28 Jun 2002 21:59:39 -0700
New Revision: 110
Added:
trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.1
trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.html
trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.pod
trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.txt
trunk/orca/packages/rrdtool-0.99.31/src/rrd_resize.c
Removed:
trunk/orca/packages/rrdtool-0.99.31/doc/rrdintro.pod
Modified:
trunk/orca/CHANGES
trunk/orca/INSTALL
trunk/orca/NEWS
trunk/orca/TODO
trunk/orca/configure
trunk/orca/configure.in
trunk/orca/lib/orcallator.cfg.in
trunk/orca/packages/rrdtool-0.99.31/CHANGES
trunk/orca/packages/rrdtool-0.99.31/CONTRIBUTORS
trunk/orca/packages/rrdtool-0.99.31/MANIFEST
trunk/orca/packages/rrdtool-0.99.31/Makefile.dist
trunk/orca/packages/rrdtool-0.99.31/doc/GNUmakefile.in
trunk/orca/packages/rrdtool-0.99.31/doc/RRDp.3
trunk/orca/packages/rrdtool-0.99.31/doc/RRDs.3
trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.1
trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.html
trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.pod
trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.txt
trunk/orca/packages/rrdtool-0.99.31/doc/rrdtutorial.pod
trunk/orca/packages/rrdtool-0.99.31/perl-piped/RRDp.pm
trunk/orca/packages/rrdtool-0.99.31/perl-shared/RRDs.pm
trunk/orca/packages/rrdtool-0.99.31/src/Makefile.in
trunk/orca/packages/rrdtool-0.99.31/src/rrd_create.c
trunk/orca/packages/rrdtool-0.99.31/src/rrd_diff.c
trunk/orca/packages/rrdtool-0.99.31/src/rrd_dump.c
trunk/orca/packages/rrdtool-0.99.31/src/rrd_error.c
trunk/orca/packages/rrdtool-0.99.31/src/rrd_fetch.c
trunk/orca/packages/rrdtool-0.99.31/src/rrd_format.c
trunk/orca/packages/rrdtool-0.99.31/src/rrd_format.h
trunk/orca/packages/rrdtool-0.99.31/src/rrd_graph.c
trunk/orca/packages/rrdtool-0.99.31/src/rrd_last.c
trunk/orca/packages/rrdtool-0.99.31/src/rrd_open.c
trunk/orca/packages/rrdtool-0.99.31/src/rrd_tool.c
trunk/orca/packages/rrdtool-0.99.31/src/rrd_tool.h
trunk/orca/packages/rrdtool-0.99.31/src/rrd_tune.c
trunk/orca/packages/rrdtool-0.99.31/src/rrd_update.c
trunk/orca/src/orca.pl
Log:
Load orca-0.22 into trunk/orca.
Modified: trunk/orca/configure
==============================================================================
--- trunk/orca/configure (original)
+++ trunk/orca/configure Sat Jul 13 19:11:59 2002
@@ -651,7 +651,7 @@
# The path packages gets added where necessary.
DIGEST_MD5_DIR=Digest-MD5-2.07
MATH_INTERPOLATE_DIR=Math-Interpolate-1.02
-RRDTOOL_DIR=rrdtool-0.99.29.1
+RRDTOOL_DIR=rrdtool-0.99.31
STORABLE_DIR=Storable-0.6 at 3
Modified: trunk/orca/TODO
==============================================================================
--- trunk/orca/TODO (original)
+++ trunk/orca/TODO Sat Jul 13 19:12:00 2002
@@ -1,3 +1,6 @@
+Other:
+ Mention the AIX tool nmon.
+
Orca:
Come up with a better error scheme than using warn() for some
errors and the email warn for others.
Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in (original)
+++ trunk/orca/configure.in Sat Jul 13 19:12:00 2002
@@ -14,7 +14,7 @@
# The path packages gets added where necessary.
DIGEST_MD5_DIR=Digest-MD5-2.07
MATH_INTERPOLATE_DIR=Math-Interpolate-1.02
-RRDTOOL_DIR=rrdtool-0.99.29.1
+RRDTOOL_DIR=rrdtool-0.99.31
STORABLE_DIR=Storable-0.6 at 3
AC_SUBST(DIGEST_MD5_DIR)
AC_SUBST(MATH_INTERPOLATE_DIR)
Modified: trunk/orca/lib/orcallator.cfg.in
==============================================================================
--- trunk/orca/lib/orcallator.cfg.in (original)
+++ trunk/orca/lib/orcallator.cfg.in Sat Jul 13 19:12:00 2002
@@ -1,8 +1,22 @@
# Orca configuration file for orcallator files.
+# base_dir is prepended to the paths data_dir, find_files, html_dir,
+# and state_file only if the path does not match the regular
+# expression ^\\?\.{0,2}/, which matches /, ./, ../, and \./.
base_dir @RRD_DIR@/orcallator
+
+# data_dir specifies the location of the generated RRD data files.
+data_dir .
+
+# state_file specifies the location of the state file that remembers
+# the modification time of each source data file.
state_file orca.state
+
+# html_dir specifies the top of the HTML tree created by Orca.
html_dir @HTML_DIR@
+
+# By default create .meta tag files for all GIFs so that the web
+# browser will automatically reload them.
expire_gifs 1
# Find files at the following times:
Modified: trunk/orca/INSTALL
==============================================================================
--- trunk/orca/INSTALL (original)
+++ trunk/orca/INSTALL Sat Jul 13 19:12:00 2002
@@ -124,7 +124,7 @@
-----------------------------------------------------------------------
Digest::MD5 version 2.00 or greater 2.07
Math::IntervalSearch 1.00 or greater 1.02
- RRDs version 0.99.29 or greater 0.99.29
+ RRDs version 0.99.29 or greater 0.99.31
Storable 0.603 or greater 0.603
All four of these modules are included with the Orca distribution
Modified: trunk/orca/src/orca.pl
==============================================================================
--- trunk/orca/src/orca.pl (original)
+++ trunk/orca/src/orca.pl Sat Jul 13 19:12:00 2002
@@ -17,7 +17,7 @@
# This is the version of Orca.
use vars qw($VERSION);
-$VERSION = '0.21';
+$VERSION = '0.22';
# This is the version number used in creating the DS names in RRDs.
# This should be updated any time a new version of Orca needs some new
@@ -28,31 +28,43 @@
# The number of seconds in one day.
my $day_seconds = 24*60*60;
-# These define the different RRAs to create, how far back in time they
-# go, how many primary data points go into a consolidated data point,
-# and the default how to create RRAs. The first array holds the names
-# of the different plot types to create. The second array holds the
-# number of 300 intervals are used to create a consolidated data
-# point. The third array is the number of consolidated data points
-# held in the RRA. The first one is every 5 minutes for 200 hours, the
-# second is every 30 minutes for 31 days, the third is every 2 hours
-# for 100 days, and the last is every day for 3 years. The last array
+# These define the name of the different RRAs create in each RRD file,
+# how many primary data points go into a consolidated data point, and
+# how far back in time they go.
+#
+# The first RRA one is every 5 minutes for 200 hours, the second is
+# every 30 minutes for 31 days, the third is every 2 hours for 100
+# days, and the last is every day for 3 years.
+#
+# The first array holds the names of the different plot types to
+# create. The second array holds the number of 300 second intervals
+# are used to create a consolidated data point. The third array is
+# the number of consolidated data points held in the RRA.
+my @rra_plot_type = qw(daily weekly monthly yearly);
+my @rra_pdp_count = ( 1, 6, 24, 288);
+my @rra_row_count = ( 2400, 1488, 1200, 1098);
+
+# Define the different plots to create. These settings do not need to
+# be exactly the same as the RRA definitions, but they can be. Here
+# create a quarterly plot (100 days) between the monthly and yearly
+# plots. Only update the quarterly plot daily. The last array here
# holds the number of days back in time to plot in the GIF. Be
# careful to not increase this so much that the number of data points
# to plot are greater than the number of pixels available for the GIF,
# otherwise there will be a 30% slowdown due to a reduction
# calculation to resample the data to the lower resolution for the
# plot. For example, with 40 days of 2 hour data, there are 480 data
-# points. For no slowdown to occur, the GIF should be atleast 480
+# points. For no slowdown to occur, the GIF should be atleast 481
# pixels wide.
-my @rra_plot_type = qw(daily weekly monthly yearly);
-my @rra_pdp_count = ( 1, 6, 24, 288);
-my @rra_row_count = ( 2400, 1488, 1200, 1098);
-my @rra_days_back = ( 1.5, 10.0, 40.0, 500.0);
+my @gif_plot_type = (@rra_plot_type[0..2], 'quarterly', $rra_plot_type[3]);
+my @gif_pdp_count = (@rra_pdp_count[0..2], @rra_pdp_count[3, 3]);
+my @gif_days_back = ( 1.5, 10, 40, 100, 428);
+# Data points -> (432 , 480, 480, 100, 428);
# These are command line options.
-my $opt_verbose = 0;
-my $opt_once_only = 0;
+my $opt_verbose = 0;
+my $opt_once_only = 0;
+my $opt_rrd_update_only = 0;
# Set up a signal handler to force looking for new files.
my $force_find_files = 0;
@@ -269,28 +281,6 @@
1;
}
-sub list {
- keys %{$_[0]->{_hash}};
-}
-
-sub select {
- my ($self, $timeout) = @_;
-
- my $read_in = $self->{_vec};
- my $read_out;
-
- my $found = select($read_out=$read_in, undef, undef, $timeout);
-
- return () unless $found;
-
- my @found;
- while (my ($filename, $fileno) = each %{$self->{_filenos}}) {
- push(@found, $filename) if vec($read_out, $fileno, 1);
- }
-
- @found;
-}
-
sub get_fd {
my ($self, $filename) = @_;
@@ -302,38 +292,6 @@
}
}
-sub sysread_readline {
- my ($self, $filename) = @_;
-
- return unless defined $self->{_hash}{$filename};
-
- # If there is no \n in the buffer, then attempt load more data from
- # the file.
- my $pos = index($self->{_buffer}{$filename}, "\n");
- if ($pos == -1) {
- my $buffer;
- my $bytes = sysread($self->{_hash}{$filename}{fd},
- $buffer,
- 1 << 14,
- 0);
- $self->{_buffer}{$filename} .= $buffer;
- }
-
- # Find the first \n and return all the characters up to and
- # including that point.
- $pos = index($self->{_buffer}{$filename}, "\n");
- my $line = '';
- if ($pos != -1) {
- $pos++;
- $line = substr($self->{_buffer}{$filename}, 0, $pos);
- $self->{_buffer}{$filename} = substr($self->{_buffer}{$filename},
- $pos,
- length($self->{_buffer}{$filename})-$pos);
- }
-
- $line;
-}
-
sub is_open {
defined $_[0]->{_hash}{$_[1]};
}
@@ -361,8 +319,8 @@
_last_stat_time => -1,
_file_dev => -1,
_file_ino => -1,
- _file_mtime => -1},
- $class;
+ _file_mtime => -1
+ }, $class;
$self->update_stat;
$self;
}
@@ -398,8 +356,7 @@
# instead.
my $time = time;
if ($time > $self->{_last_stat_time} + 1) {
- my @stat = stat($self->{_filename});
- if (@stat) {
+ if (my @stat = stat($self->{_filename})) {
$self->{_file_dev} = $stat[0];
$self->{_file_ino} = $stat[1];
$self->{_file_mtime} = $stat[9];
@@ -502,7 +459,8 @@
_interval => int($config_files->{$files_key}{interval}+0.5),
_expire => $config_options->{expire_gifs},
_gif_height => 0,
- _gif_width => 0
+ _gif_width => 0,
+ _graph_options => []
}, $class;
# If the GIF already exists, then use its last modification time to
@@ -511,14 +469,80 @@
# assume that the GIF needs to be recreated. This data will cause
# the GIF to be created if the GIF does not exist.
my $plot_end_time = $self->plot_end_time;
- foreach my $plot_type (@rra_plot_type) {
- $self->{"_${plot_type}_update_time"} = -1;
+ foreach my $plot_type (@gif_plot_type) {
my @stat = stat("$gif_basename-$plot_type.gif");
if (@stat and $stat[9] <= $plot_end_time) {
$self->{"_${plot_type}_update_time"} = $stat[9];
}
+ else {
+ $self->{"_${plot_type}_update_time"} = -1;
+ }
}
+ $self->_update_graph_options;
+}
+
+sub _update_graph_options {
+ my $self = shift;
+
+ my $plot_ref = $self->{_plot_ref};
+ my $group = $self->{_group};
+
+ # Create the options for RRDs::graph that do not change across any
+ # invocations of RRDs::graph.
+ my @options = (
+ '-t', ::replace_group_name($plot_ref->{title}, $group),
+ '-v', ::replace_group_name($plot_ref->{y_legend}, $group)
+ );
+ # Add the lower-limit and upper-limit flags if defined.
+ if (defined $plot_ref->{plot_min}) {
+ push(@options, '-l', $plot_ref->{plot_min});
+ }
+ if (defined $plot_ref->{plot_max}) {
+ push(@options, '-u', $plot_ref->{plot_max});
+ }
+ if (defined $plot_ref->{rigid_min_max}) {
+ push(@options, '-r');
+ }
+ my $data_sources = @{$self->{_my_rrd_list}};
+ for (my $i=0; $i<$data_sources; ++$i) {
+ my $rrd_key = $self->{_my_rrd_list}[$i];
+ my $rrd = $self->{_all_rrd_ref}{$rrd_key};
+ my $rrd_filename = $rrd->filename;
+ my $rrd_version = $rrd->version;
+ push(@options, "DEF:average$i=$rrd_filename:Orca$rrd_version:AVERAGE");
+ }
+ my @legends;
+ my $max_legend_length = 0;
+ for (my $i=0; $i<$data_sources; ++$i) {
+ my $legend = ::replace_group_name($plot_ref->{legend}[$i], $group);
+ my $line_type = $plot_ref->{line_type}[$i];
+ my $color = $plot_ref->{color}[$i];
+ push(@options, "$line_type:average$i#$color:$legend");
+ $legend =~ s:%:\200:g;
+ $legend =~ s:\200:%%:g;
+ my $legend_length = length($legend);
+ $max_legend_length = $legend_length if $legend_length > $max_legend_length;
+ push(@legends, $legend);
+ }
+
+ # Force a break between the plot legend and comments.
+ push(@options, 'COMMENT:\s',);
+
+ # Generate the legends containing the current, average, minimum, and
+ # maximum values on the plot.
+ for (my $i=0; $i<$data_sources; ++$i) {
+ my $legend = $legends[$i];
+ $legend .= ' ' x ($max_legend_length - length($legend));
+ push(@options, "GPRINT:average$i:LAST:$legend Current\\: %f",
+ "GPRINT:average$i:AVERAGE:Average\\: %f",
+ "GPRINT:average$i:MIN:Min\\: %f",
+ "GPRINT:average$i:MAX:Max\\: %f\\l"
+ );
+ }
+
+ $self->{_graph_options} = \@options;
+
$self;
}
@@ -527,7 +551,7 @@
$self->{_my_rrd_list} = [ &::unique(@{$self->{_my_rrd_list}}, @_) ];
- $self;
+ $self->_update_graph_options;
}
sub files_key {
@@ -550,7 +574,7 @@
return "width=$_[0]->{_gif_width} height=$_[0]->{_gif_height}";
}
else {
- return "";
+ return '';
}
}
@@ -593,10 +617,10 @@
# Make the plots and specify how far back in time to plot.
my $plot_made = 0;
- for (my $i=0; $i<@rra_plot_type; ++$i) {
- if ($self->_plot($rra_plot_type[$i],
- $rra_days_back[$i],
- $rra_pdp_count[$i])) {
+ for (my $i=0; $i<@gif_plot_type; ++$i) {
+ if ($self->_plot($gif_plot_type[$i],
+ $gif_days_back[$i],
+ $gif_pdp_count[$i])) {
$plot_made = 1;
}
}
@@ -605,7 +629,7 @@
}
sub _plot {
- my ($self, $plot_type, $days_back, $rra_pdp_count) = @_;
+ my ($self, $plot_type, $gif_days_back, $gif_pdp_count) = @_;
# Get the time stamp of the last data point entered into the RRDs
# that are used to generate this GIF.
@@ -620,81 +644,29 @@
# after a data point falls into a new bin, where the bin ends on
# multiples of the sampling iterval.
my $interval = $self->{_interval};
- $rra_pdp_count = int($rra_pdp_count*300.0/$interval + 0.5);
- $rra_pdp_count = 1 if $rra_pdp_count < 1;
- my $plot_age = $rra_pdp_count*$interval;
+ $gif_pdp_count = int($gif_pdp_count*300.0/$interval + 0.5);
+ $gif_pdp_count = 1 if $gif_pdp_count < 1;
+ my $plot_age = $gif_pdp_count*$interval;
my $time_update_key = "_${plot_type}_update_time";
if (int($self->{$time_update_key}/$plot_age) == int($plot_end_time/$plot_age)) {
return;
}
- # Generate the options that will be the same for each plot type.
- my $plot_ref = $self->{_plot_ref};
- my $group = $self->{_group};
- my @options = (
- '-e', $plot_end_time,
- '-v', ::replace_group_name($plot_ref->{y_legend}, $group),
- '-t', ::replace_group_name($plot_ref->{title}, $group),
- '-w', $plot_ref->{plot_width},
- '-h', $plot_ref->{plot_height}
- );
- # Add the lower-limit and upper-limit flags if defined.
- if (defined $plot_ref->{plot_min}) {
- push(@options, '-l', $plot_ref->{plot_min});
- }
- if (defined $plot_ref->{plot_max}) {
- push(@options, '-u', $plot_ref->{plot_max});
- }
- if (defined $plot_ref->{rigid_min_max}) {
- push(@options, '-r');
- }
- my $data_sources = @{$self->{_my_rrd_list}};
- for (my $i=0; $i<$data_sources; ++$i) {
- my $rrd_key = $self->{_my_rrd_list}[$i];
- my $rrd = $self->{_all_rrd_ref}{$rrd_key};
- my $rrd_filename = $rrd->filename;
- my $rrd_version = $rrd->version;
- push(@options, "DEF:average$i=$rrd_filename:Orca$rrd_version:AVERAGE");
- }
- my @legends;
- my $max_legend_length = 0;
- for (my $i=0; $i<$data_sources; ++$i) {
- my $legend = ::replace_group_name($plot_ref->{legend}[$i], $group);
- my $line_type = $plot_ref->{line_type}[$i];
- my $color = $plot_ref->{color}[$i];
- push(@options, "$line_type:average$i#$color:$legend");
- $legend =~ s:%:\200:g;
- $legend =~ s:\200:%%:g;
- my $legend_length = length($legend);
- $max_legend_length = $legend_length if $legend_length > $max_legend_length;
- push(@legends, $legend);
- }
-
- # Force a break between the plot legend and comments.
- push(@options, 'COMMENT:\s',);
-
- # Generate the legends containing the current, average, minimum, and
- # maximum values on the plot.
- for (my $i=0; $i<$data_sources; ++$i) {
- my $legend = $legends[$i];
- $legend .= ' ' x ($max_legend_length - length($legend));
- push(@options, "GPRINT:average$i:LAST:$legend Current\\: %f",
- "GPRINT:average$i:AVERAGE:Average\\: %f",
- "GPRINT:average$i:MIN:Min\\: %f",
- "GPRINT:average$i:MAX:Max\\: %f\\l"
- );
- }
- push(@options, 'COMMENT:\s',
- 'COMMENT:Last data entered at ' .
- localtime($plot_end_time) . '.');
-
my $gif_filename = "$self->{_gif_basename}-$plot_type.gif";
print " Creating `$gif_filename'.\n" if $opt_verbose > 1;
+ my $plot_ref = $self->{_plot_ref};
+
my ($graph_return, $gif_width, $gif_height) =
- RRDs::graph $gif_filename,
- '-s', ($plot_end_time-$days_back*$day_seconds),
- @options;
+ RRDs::graph
+ $gif_filename,
+ @{$self->{_graph_options}},
+ '-s', ($plot_end_time-$gif_days_back*$day_seconds),
+ '-e', $plot_end_time,
+ '-w', $plot_ref->{plot_width},
+ '-h', $plot_ref->{plot_height},
+ 'COMMENT:\s',
+ 'COMMENT:Last data entered at ' . localtime($plot_end_time) . '.';
if (my $error = RRDs::error) {
warn "$0: warning: cannot create `$gif_filename': $error\n";
}
@@ -747,7 +719,7 @@
@ISA = qw(Orca::DataFile);
sub new {
- unless (@_ == 8) {
+ unless (@_ == 7) {
confess "$0: Orca::RRDFile::new passed incorrect number of arguments.\n";
}
@@ -757,12 +729,7 @@
$files_key,
$group,
$name,
- $plot_ref,
- $choose_data_sub) = @_;
-
- unless (ref($choose_data_sub) eq 'CODE') {
- confess "$0: Orca::RRDFile::new not passed a valid CODE ref for choosing data.\n";
- }
+ $plot_ref) = @_;
# Remove any special characters from the unique name and do some
# replacements.
@@ -784,11 +751,11 @@
return unless $self;
$self->{_name} = $name;
$self->{_new_data} = {};
- $self->{_choose_data_sub} = $choose_data_sub;
$self->{_created_gifs} = {};
$self->{_plot_ref} = $plot_ref;
$self->{_interval} = int($config_files->{$files_key}{interval}+0.5);
$self->{_rrd_version} = $ORCA_RRD_VERSION;
+ $self->{_choose_data_subs} = {};
# See if the RRD file meets two requirements. The first is to see if
# the last update time can be sucessfully read. The second is to
@@ -855,33 +822,22 @@
values %{$_[0]->{_created_gifs}};
}
-# Given a row of data from a source data file, take the required data
-# from it.
-# Call: $self->(unix_epoch_time, element1, element2, element3, ...);
-# Return: 0 timestamp older than latest data point in RRD
-# 1 data added to queue
-# -1 undefined value returned from data choosing subroutine
+# Queue a list of (time, value) data pairs. Return the number of data
+# pairs sucessfully queued.
+# Call: $self->(unix_epoch_time1, value1, unix_epoch_time2, value2, ...);
sub queue_data {
- unless (@_ > 2) {
- confess "$0: internal error: queue_data passed too few arguments.\n";
- }
- my ($self, $time) = splice(@_, 0, 2);
-
- return 0 if $time <= $self->{_rrd_update_time};
+ my $self = shift;
- my $value = &{$self->{_choose_data_sub}}(@_);
- my $saw_undefined = 0;
- if (defined $value) {
+ my $count = 0;
+ my $rrd_update_time = $self->{_rrd_update_time};
+ while (@_ > 1) {
+ my ($time, $value) = splice(@_, 0, 2);
+ next if $time <= $rrd_update_time;
$self->{_new_data}{$time} = $value;
- }
- else {
- $saw_undefined = 1;
- my $filename = $self->filename;
- warn "$0: undefined value not sent to `$filename' at time ",
- scalar localtime($time), " ($time).\n";
+ ++$count;
}
- $saw_undefined ? -1 : 1;
+ $count;
}
sub flush_data {
@@ -968,6 +924,30 @@
return 1;
}
+package Orca::Config::Plot;
+
+use Carp;
+
+sub new {
+ unless (@_ == 2) {
+ confess "$0: Orca::Config::Plot::new passed incorrect number of arguments.\n";
+ }
+
+ bless $_[1], $_[0];
+}
+
+package Orca::Config::FilesGroup;
+
+use Carp;
+
+sub new {
+ unless (@_ == 2) {
+ confess "$0: Orca::Config::FilesGroup::new passed incorrect number of arguments.\n";
+ }
+
+ bless $_[1], $_[0];
+}
+
package Orca::SourceDataFile;
use Carp;
@@ -977,10 +957,6 @@
@ISA = qw(Orca::DataFile);
-# This is a static variable that caches the anonymous subroutines that
-# return the correct data from the input file.
-my %read_value_subs;
-
# This is a static variable that lists all of the column names for a
# particular files key.
my %files_key_column_names;
@@ -993,7 +969,8 @@
# These are caches for the different objects that are used to add a
# plot.
my %all_rrds_cache;
-my %my_rrds_cache;
+my %my_rrd_list_cache;
+my %choose_data_sub_cache;
sub new {
unless (@_ == 10) {
@@ -1018,9 +995,10 @@
$self->{_date_source} = $date_source;
$self->{_date_format} = $date_format;
$self->{_warn_email} = $warn_email;
- $self->{_my_rrd_hash} = {};
+ $self->{_my_rrd_list} = [];
$self->{_all_rrd_ref} = undef;
$self->{_files_keys} = {};
+ $self->{_choose_data_sub} = undef;
$self->{_column_description} = $column_description;
$self->{_last_data_time} = -1;
@@ -1078,10 +1056,10 @@
}
}
-# Return 1 if the source data file is current or not. Alsot note the
-# day that this test was performed. This lets the code ignore files
-# that are not current because a new file was generated for the next
-# day.
+# Return 1 if the source data file is current or 0 otherwise. Also
+# note the day that this test was performed. This lets the code
+# ignore files that are not current because a new file was generated
+# for the next day.
sub is_current {
my $self = shift;
@@ -1206,11 +1184,20 @@
my $plot_key = join("\200", $files_key, $group, @column_description);
my $cache_key = md5($plot_key);
if (defined $all_rrds_cache{$cache_key}) {
- $self->{_all_rrd_ref} = $all_rrds_cache{$cache_key};
- $self->{_my_rrd_hash} = $my_rrds_cache{$cache_key};
+ $self->{_all_rrd_ref} = $all_rrds_cache{$cache_key};
+ $self->{_my_rrd_list} = $my_rrd_list_cache{$cache_key};
+ $self->{_choose_data_sub} = $choose_data_sub_cache{$cache_key};
return 1;
}
+ # Use this hash to keep a list of RRDs that this file uses.
+ my %my_rrd_list;
+
+ # This is the source for an anonymous subroutine that given a row
+ # from a source data file returns a hash keyed by RRD name with the
+ # values calculated from the row.
+ my $choose_data_expr = "sub {\n return (\n";
+
# Go through each plot to create and process it for this file.
my @regexp_pos = map { 0 } (1..@$config_plots);
my $oldest_regexp_index = 0;
@@ -1398,12 +1385,12 @@
# the same files key. In this case the data argument for this
# file will not be used.
my @datas;
- my $optional = $plot->{optional};
foreach my $one_data (@{$plot->{data}}) {
push(@datas, [@$one_data]);
}
+ my $optional = $plot->{optional};
my $match_any = 0;
- for (my $j=0; $j<@datas; $j++) {
+ for (my $j=0; $j<@datas; ++$j) {
my $match_one_data = 0;
for (my $k=0; $k<@{$datas[$j]}; ++$k) {
my $element = $datas[$j][$k];
@@ -1433,38 +1420,39 @@
# At this point we have a plot to create.
- # For each data source, create an executable subroutine that takes
- # a row of elements and returns the requested value. Also create
- # an unique Orca data file name for this plot and a name for this
- # plot that does not include the group.
+ # For each data source in this plot, try to create an anonymous
+ # subroutine to see if the eval succeeds. Place each data source
+ # into a large anonymous subroutine that takes a single row of data
+ # from an input source file and returns a hash keyed by the named
+ # used for a RRD and the value calculated using the input row of
+ # data. Also create an unique Orca data file name for this plot
+ # and a name for this plot that does not include the group.
my @my_rrds;
my @no_group_name;
my @group_name;
for (my $j=0; $j<@datas; ++$j) {
- my $working_data = defined $datas[$j];
- my $choose_data_sub = undef;
- my $data_name = join('_', @{$plot->{data}[$j]});
-
- if ($working_data) {
- my $expr = "sub {\n return @{$datas[$j]};\n}\n";
- my $expr_hash = md5($expr);
+ my $expr = "@{$datas[$j]}";
+ my $sub_expr_sub = undef;
+ my $data_name = join('_', @{$plot->{data}[$j]});
+
+ if (defined $datas[$j]) {
+ my $sub_expr = "sub {\n return $expr;\n}\n";
+ my $sub_expr_md5 = md5($sub_expr);
- unless (defined ($choose_data_sub = $read_value_subs{$expr_hash})) {
+ unless (defined ($sub_expr_sub = $choose_data_sub_cache{$sub_expr_md5})) {
{
local $SIG{__WARN__} = sub { die $_[0] };
- $choose_data_sub = eval $expr;
+ $sub_expr_sub = eval $sub_expr;
}
if ($@) {
+ $sub_expr_sub = undef;
unless ($optional) {
my $m = $old_i + 1;
- warn "$0: warning: bad evaluation of commands for plot #$m `data @{$plot->{data}[$j]}'.\nOutput: $@\n";
+ warn "$0: warning: bad evaluation of commands for plot #$m `data @{$plot->{data}[$j]}':\n$sub_expr\nOutput: $@\n";
}
- $choose_data_sub = undef;
- }
- else {
- $read_value_subs{$expr_hash} = $choose_data_sub;
}
+ $choose_data_sub_cache{$sub_expr_md5} = $sub_expr_sub;
}
}
@@ -1473,20 +1461,21 @@
push(@group_name, $name);
# Create a new RRD only if it doesn't already exist and if a
- # valid get data subroutine is created.
- if ($choose_data_sub) {
+ # valid get data subroutine is created. Keep the
+ # choose_data_sub for this file.
+ if (defined $sub_expr_sub) {
+ $choose_data_expr .= " '$name', $expr,\n";
unless (defined $rrd_data_files_ref->{$name}) {
my $rrd_file = Orca::RRDFile->new($config_options,
$config_files,
$files_key,
$group,
$name,
- $plot,
- $choose_data_sub);
+ $plot);
$rrd_data_files_ref->{$name} = $rrd_file;
}
- $self->{_all_rrd_ref} = $rrd_data_files_ref;
- $self->{_my_rrd_hash}{$name}++;
+ $self->{_all_rrd_ref} = $rrd_data_files_ref;
+ $my_rrd_list{$name} = 1;
push(@my_rrds, $name);
}
}
@@ -1519,8 +1508,21 @@
}
}
- $all_rrds_cache{$cache_key} = $self->{_all_rrd_ref};
- $my_rrds_cache{$cache_key} = $self->{_my_rrd_hash};
+ $choose_data_expr .= " );\n}\n";
+ {
+ local $SIG{__WARN__} = sub { die $_[0] };
+ $self->{_choose_data_sub} = eval $choose_data_expr;
+ }
+ if ($@) {
+ my $m = $old_i + 1;
+ die "$0: warning: bad evaluation of command for plot #$m:\n$choose_data_expr\nOutput: $@\n";
+ }
+
+ $all_rrds_cache{$cache_key} = $self->{_all_rrd_ref};
+ $choose_data_sub_cache{$cache_key} = $self->{_choose_data_sub};
+ my $tmp = [sort keys %my_rrd_list];
+ $my_rrd_list_cache{$cache_key} = $tmp;
+ $self->{_my_rrd_list} = $tmp;
1;
}
@@ -1575,7 +1577,7 @@
# of any RRD files that depend on this source file.
my $last_data_time = $self->{_last_data_time};
unless ($load_data) {
- foreach my $rrd_key (keys %{$self->{_my_rrd_hash}}) {
+ foreach my $rrd_key (@{$self->{_my_rrd_list}}) {
if ($self->{_all_rrd_ref}{$rrd_key}->rrd_update_time < $last_data_time) {
$load_data = 1;
last;
@@ -1602,13 +1604,19 @@
my $use_file_mtime = $self->{_date_source}[0] eq 'file_mtime';
my $number_added = 0;
my $close_once_done = 0;
+ my $number_columns = @{$self->{_column_description}};
while (my $line = <$fd>) {
+ # Skip the line if the word timestamp appears in it. This is a
+ # temporary fix for orcallator.se to place a new information line
+ # in the output file when it starts up.
+ next if $line =~ /timestamp/;
+
my @line = split(' ', $line);
# Skip this input line if 1) the file uses the first line to
# define the column names, 2) the number of columns loaded is not
# equal to the number of columns in the column description.
- if ($self->{_first_line} and @line != @{$self->{_column_description}}) {
+ if ($self->{_first_line} and @line != $number_columns) {
warn "$0: number of columns in line $. of `$filename' does not match column description.\n";
next;
}
@@ -1618,19 +1626,24 @@
# If the file status from the source data file is greater than
# zero, then it means the file has changed in some way, so we need
- # to do updates for all plots. Load the available data and push
- # it to the plots.
+ # to do updates for all plots. Load the available data, calculate
+ # the value that needs to go to each RRD and push the value to the
+ # RRD.
my $add = 0;
- foreach my $rrd_key (keys %{$self->{_my_rrd_hash}}) {
- my $result = $self->{_all_rrd_ref}{$rrd_key}->queue_data($time, @line);
- if ($result == 1) {
- if ($opt_verbose > 2 and !$add) {
- print " Loaded `@line' at ", scalar localtime($time), " ($time).\n";
+ my %values = &{$self->{_choose_data_sub}}(@line);
+ foreach my $rrd_key (@{$self->{_my_rrd_list}}) {
+ my $value = $values{$rrd_key};
+ if (defined $value) {
+ if ($self->{_all_rrd_ref}{$rrd_key}->queue_data($time, $value)) {
+ if ($opt_verbose > 2 and !$add) {
+ print " Loaded `@line' at ", scalar localtime($time), " ($time).\n";
+ }
+ $add = 1;
}
- $add = 1;
}
- elsif ($result == -1) {
+ else {
$close_once_done = 1;
+ warn "$0: internal error: expecting RRD name `$rrd_key' but no data loaded from `" . $self->filename . "' at time ", scalar localtime($time), " ($time).\n";
}
}
++$number_added if $add;
@@ -1668,13 +1681,13 @@
}
sub rrds {
- keys %{$_[0]->{_my_rrd_hash}};
+ @{$_[0]->{_my_rrd_list}};
}
package main;
sub Usage {
- die "usage: $0 [-o] [-v] config_file\n";
+ die "usage: $0 [-o] [-r] [-v] config_file\n";
}
while (@ARGV and $ARGV[0] =~ /^-\w/) {
@@ -1685,6 +1698,9 @@
elsif ($arg eq '-v') {
++$opt_verbose;
}
+ elsif ($arg eq '-r') {
+ ++$opt_rrd_update_only;
+ }
else {
Usage;
}
@@ -1907,6 +1923,7 @@
}
foreach my $rrd (sort {$a->name cmp $b->name} values %this_group_rrds) {
$rrd->flush_data;
+ next if $opt_rrd_update_only;
foreach my $gif ($rrd->created_gifs) {
next if $gif->rrds > 1;
$gif->plot;
@@ -1919,21 +1936,24 @@
&save_state($config_options->{state_file}, $new_found_files_ref);
}
- # Plot the data in each gif.
- print "Updating GIFs.\n" if $opt_verbose;;
- foreach my $gif (@{$gif_files_ref->{list}}) {
- $gif->plot;
- }
-
- # Make the HTML files.
- if ($found_new_files) {
- &create_html_files($config_options,
- $config_files,
- $config_plots,
- $new_found_files_ref,
- $group_files_ref,
- $gif_files_ref);
- $found_new_files = 0;
+ # Create the HTML and GIF files now.
+ unless ($opt_rrd_update_only) {
+ # Plot the data in each gif.
+ print "Updating GIFs.\n" if $opt_verbose;;
+ foreach my $gif (@{$gif_files_ref->{list}}) {
+ $gif->plot;
+ }
+
+ # Make the HTML files.
+ if ($found_new_files) {
+ &create_html_files($config_options,
+ $config_files,
+ $config_plots,
+ $new_found_files_ref,
+ $group_files_ref,
+ $gif_files_ref);
+ $found_new_files = 0;
+ }
}
# Return now if this loop is being run only once.
@@ -2055,7 +2075,7 @@
# Create the HTML code for the main index.html file.
my $group_basename = strip_key_name($html_group);
my $element = "<table border=2><tr><td><b>$html_group</b></td></tr>\n<tr><td>\n";
- foreach my $plot_type (@rra_plot_type) {
+ foreach my $plot_type (@gif_plot_type) {
$element .= "<a href=\"$group_basename-$plot_type.html\">";
my $Plot_Type = Capatialize($plot_type);
$element .= "$Plot_Type</a><br>\n";
@@ -2072,7 +2092,7 @@
# Create the daily, weekly, monthly, yearly, and all HTML files
# for this group.
my @html_files;
- foreach my $plot_type (@rra_plot_type, 'all') {
+ foreach my $plot_type (@gif_plot_type, 'all') {
my $href = "$group_basename-$plot_type.html";
my $filename = "$html_dir/$href";
my $Plot_Type = Capatialize($plot_type);
@@ -2228,7 +2248,7 @@
# yearly, and all plots. Use the legend name to create this
# list.
$legend_html_files{$legend_no_group} = [];
- foreach my $plot_type (@rra_plot_type, 'all') {
+ foreach my $plot_type (@gif_plot_type, 'all') {
my $href = "$no_group_name-$plot_type.html";
my $filename = "$html_dir/$href";
my $Plot_Type = Capatialize($plot_type);
@@ -2276,7 +2296,7 @@
# Create the HTML code that goes into the main index.html that
# links to these other HTML files.
my $element = "<td><b>$legend_no_group</b></td>\n";
- foreach my $plot_type (@rra_plot_type, 'all') {
+ foreach my $plot_type (@gif_plot_type, 'all') {
$element .= "<td><a href=\"$no_group_name-$plot_type.html\">";
$element .= Capatialize($plot_type) . "</a></td>\n";
}
@@ -2308,7 +2328,7 @@
my $gif_filename = $with_group_name;
$gif_filename = $gif->group . "/$gif_filename" if $sub_dir;
my $gif_size = $gif->gif_img_src_size;
- foreach my $plot_type (@rra_plot_type) {
+ foreach my $plot_type (@gif_plot_type) {
my $Plot_Type = Capatialize($plot_type);
$summarize_html->print("<hr>\n<h2>$Plot_Type $legend_with_group</h2>\n",
"<img src=\"$gif_filename-$plot_type.gif\"",
@@ -2455,7 +2475,7 @@
foreach my $element (@_) {
unless (defined $a{$element}) {
push(@unique, $element);
- $a{$element}++;
+ $a{$element} = 1;
}
}
@unique;
@@ -2529,7 +2549,7 @@
# Now for each file, create the Orca::SourceDataFile object that
# manages that file and the GIFs that get generated from the file.
- # Delete from the list of filenames those files that have
+ # Delete from the list of filenames those files that have not
# successfully created Orca::SourceDataFile objects.
for (my $i=0; $i<@filenames;) {
my $filename = $filenames[$i];
@@ -2795,10 +2815,15 @@
die "$0: error: must define at least one `files' in `$config_filename'.\n";
}
- # For each files parameter there are required options.
+ # For each files parameter there are required options. Convert the
+ # unblessed reference to a hash to a Orca::Config::FilesGroup
+ # object.
foreach my $files_key (keys %$config_files) {
+ my $files_group = Orca::Config::FilesGroup->new($config_files->{$files_key});
+ $config_files->{$files_key} = $files_group;
+
foreach my $option (@cc_required_files) {
- unless (defined $config_files->{$files_key}{$option}) {
+ unless (defined $files_group->{$option}) {
die "$0: error: must define `$option' for `files $files_key' in `$config_filename'.\n";
}
}
@@ -2806,20 +2831,20 @@
# Optional files options will be set to '' here if they haven't
# been set by the user.
foreach my $option (@cc_optional_files) {
- unless (defined $config_files->{$files_key}{$option}) {
- $config_files->{$files_key}{$option} = '';
+ unless (defined $files_group->{$option}) {
+ $files_group->{$option} = '';
}
}
# Check that the date_source is either column_name followed by a
# column name or file_mtime for the file modification time. If a
# column_name is used, then the date_format is required.
- my $date_source = $config_files->{$files_key}{date_source}[0];
+ my $date_source = $files_group->{date_source}[0];
if ($date_source eq 'column_name') {
- unless (@{$config_files->{$files_key}{date_source}} == 2) {
+ unless (@{$files_group->{date_source}} == 2) {
die "$0: error: incorrect number of arguments for `date_source' for `files $files_key'.\n";
}
- unless (defined $config_files->{$files_key}{date_format}) {
+ unless (defined $files_group->{date_format}) {
die "$0: error: must define `date_format' with `date_source columns ...' for `files $files_key'.\n";
}
}
@@ -2828,7 +2853,7 @@
die "$0: error: illegal argument for `date_source' for `files $files_key'.\n";
}
}
- $config_files->{$files_key}{date_source}[0] = $date_source;
+ $files_group->{date_source}[0] = $date_source;
# Check that we have a valid regular expression for find_files and
# get a unique list of them. Also to see if the find_files match
@@ -2841,23 +2866,23 @@
# since this will match single character files and directories.
my $sub_dir = 0;
my %find_files;
- my $number_finds = @{$config_files->{$files_key}{find_files}};
+ my $number_finds = @{$files_group->{find_files}};
for (my $i=0; $i<$number_finds; ++$i) {
- my $orig_find = $config_files->{$files_key}{find_files}[$i];
+ my $orig_find = $files_group->{find_files}[$i];
my $find = $orig_find;
$find =~ s:^\\./::;
$find =~ s:/\\./:/:g;
$find = $orig_find unless $find;
- $config_files->{$files_key}{find_files}[$i] = $find;
+ $files_group->{find_files}[$i] = $find;
my $test_string = 'abcdefg';
local $SIG{__WARN__} = sub { die $_[0] };
eval { $test_string =~ /$find/ };
die "$0: error: illegal regular expression in `find_files $orig_find' for `files $files_key' in `$config_filename':\n$@\n" if $@;
- $find_files{$find}++;
+ $find_files{$find} = 1;
$sub_dir = 1 if $find =~ m:\(.+\):;
}
- $config_files->{$files_key}{find_files} = [sort keys %find_files];
- $config_files->{$files_key}{sub_dir} = $sub_dir || $config_options->{sub_dir};
+ $files_group->{find_files} = [sort keys %find_files];
+ $files_group->{sub_dir} = $sub_dir || $config_options->{sub_dir};
}
# There must be at least one plot.
@@ -2868,91 +2893,94 @@
# Foreach plot there are required options. Create default options
# if the user has not done so.
for (my $i=0; $i<@$config_plots; ++$i) {
+ my $plot = Orca::Config::Plot->new($config_plots->[$i]);
+ $config_plots->[$i] = $plot;
+
my $j = $i + 1;
foreach my $option (@cc_required_plots) {
- unless (defined $config_plots->[$i]{$option}) {
+ unless (defined $plot->{$option}) {
die "$0: error: must define `$option' for `plot' #$j in `$config_filename'.\n";
}
}
# Create an array for each plot that will have a list of GIFs that
# were generated from this plot.
- $config_plots->[$i]{creates} = [];
+ $plot->{creates} = [];
# Optional options will be set to '' here if they haven't been set
# by the user.
foreach my $option (@cc_optional_plots) {
- unless (defined $config_plots->[$i]{$option}) {
- $config_plots->[$i]{$option} = '';
+ unless (defined $plot->{$option}) {
+ $plot->{$option} = '';
}
}
# Set the default plot width and height.
- $config_plots->[$i]{plot_width} = 500 unless $config_plots->[$i]{plot_width};
- $config_plots->[$i]{plot_height} = 125 unless $config_plots->[$i]{plot_height};
+ $plot->{plot_width} = 500 unless $plot->{plot_width};
+ $plot->{plot_height} = 125 unless $plot->{plot_height};
# Set the plot minimum and maximum values to U unless they are
# set.
- unless (defined $config_plots->[$i]{data_min}) {
- $config_plots->[$i]{data_min} = 'U';
+ unless (defined $plot->{data_min}) {
+ $plot->{data_min} = 'U';
}
- unless (defined $config_plots->[$i]{data_max}) {
- $config_plots->[$i]{data_max} = 'U';
+ unless (defined $plot->{data_max}) {
+ $plot->{data_max} = 'U';
}
# The data type must be either gauge, absolute, or counter.
- if (defined $config_plots->[$i]{data_type}) {
- my $type = substr($config_plots->[$i]{data_type}, 0, 1);
+ if (defined $plot->{data_type}) {
+ my $type = substr($plot->{data_type}, 0, 1);
if ($type eq 'g' or $type eq 'G') {
- $config_plots->[$i]{data_type} = 'GAUGE';
+ $plot->{data_type} = 'GAUGE';
}
elsif ($type eq 'c' or $type eq 'C') {
- $config_plots->[$i]{data_type} = 'COUNTER';
+ $plot->{data_type} = 'COUNTER';
}
elsif ($type eq 'a' or $type eq 'A') {
- $config_plots->[$i]{data_type} = 'ABSOLUTE';
+ $plot->{data_type} = 'ABSOLUTE';
}
elsif ($type eq 'd' or $type eq 'D') {
- $config_plots->[$i]{data_type} = 'DERIVE';
+ $plot->{data_type} = 'DERIVE';
}
else {
- die "$0: error: `data_type $config_plots->[$i]{data_type}' for `plot' #$j in `$config_filename' must be gauge, counter, derive, or absolute.\n";
+ die "$0: error: `data_type $plot->{data_type}' for `plot' #$j in `$config_filename' must be gauge, counter, derive, or absolute.\n";
}
}
else {
- $config_plots->[$i]{data_type} = 'GAUGE';
+ $plot->{data_type} = 'GAUGE';
}
# The data source needs to be a valid files key.
- my $source = $config_plots->[$i]{source};
+ my $source = $plot->{source};
unless (defined $config_files->{$source}) {
die "$0: error: plot #$j `source $source' references non-existant `files' in `$config_filename'.\n";
}
- unless ($config_plots->[$i]{source}) {
+ unless ($plot->{source}) {
die "$0: error: plot #$j `source $source' requires one files_key argument in `$config_filename'.\n";
}
# Set the legends of any columns not defined.
- unless (defined $config_plots->[$i]{legend}) {
- $config_plots->[$i]{legend} = [];
+ unless (defined $plot->{legend}) {
+ $plot->{legend} = [];
}
- my $number_datas = @{$config_plots->[$i]{data}};
- for (my $k=@{$config_plots->[$i]{legend}}; $k<$number_datas; ++$k) {
- $config_plots->[$i]{legend}[$k] = "@{$config_plots->[$i]{data}[$k]}";
+ my $number_datas = @{$plot->{data}};
+ for (my $k=@{$plot->{legend}}; $k<$number_datas; ++$k) {
+ $plot->{legend}[$k] = "@{$plot->{data}[$k]}";
}
# Set the colors of any data not defined.
- unless (defined $config_plots->[$i]{color}) {
- $config_plots->[$i]{color} = [];
+ unless (defined $plot->{color}) {
+ $plot->{color} = [];
}
- for (my $k=@{$config_plots->[$i]{color}}; $k<$number_datas; ++$k) {
- $config_plots->[$i]{color}[$k] = $::cc_default_colors[$k];
+ for (my $k=@{$plot->{color}}; $k<$number_datas; ++$k) {
+ $plot->{color}[$k] = $::cc_default_colors[$k];
}
# Check each line type setting.
for (my $k=0; $k<$number_datas; ++$k) {
- if (defined $config_plots->[$i]{line_type}[$k]) {
- my $line_type = $config_plots->[$i]{line_type}[$k];
+ if (defined $plot->{line_type}[$k]) {
+ my $line_type = $plot->{line_type}[$k];
if ($line_type =~ /^line([123])$/i) {
$line_type = "LINE$1";
}
@@ -2965,34 +2993,36 @@
else {
die "$0: error: plot #$j illegal `line_type' `$line_type'.\n";
}
- $config_plots->[$i]{line_type}[$k] = $line_type;
+ $plot->{line_type}[$k] = $line_type;
}
else {
- $config_plots->[$i]{line_type}[$k] = 'LINE1';
+ $plot->{line_type}[$k] = 'LINE1';
}
}
# If the generic y_legend is not set, then set it equal to the
# first legend.
- unless (defined $config_plots->[$i]{y_legend}) {
- $config_plots->[$i]{y_legend} = $config_plots->[$i]{legend}[0];
+ unless (defined $plot->{y_legend}) {
+ $plot->{y_legend} = $plot->{legend}[0];
}
# If the title is not set, then set it equal to all of the legends
# with the group name prepended.
- unless (defined $config_plots->[$i]{title}) {
+ unless (defined $plot->{title}) {
my $title = '%G ';
for (my $k=0; $k<$number_datas; ++$k) {
- $title .= $config_plots->[$i]{legend}[$k];
+ $title .= $plot->{legend}[$k];
$title .= " & " if $k < $number_datas-1;
}
- $config_plots->[$i]{title} = $title;
+ $plot->{title} = $title;
}
}
- # Create the necessary GIF files in the HTML directory. This should
- # include orga.gif and rrdtool.gif. Convert the hexadecimal forms
- # stored in the DATA section to the raw GIF form on disk.
+ # Create the necessary GIF files in the HTML directory unless only
+ # RRD files should be updated. This should include orga.gif and
+ # rrdtool.gif. Convert the hexadecimal forms stored in the DATA
+ # section to the raw GIF form on disk.
+ return if $opt_rrd_update_only;
my $gif_filename = '';
while (<main::DATA>) {
chomp;
@@ -3093,10 +3123,10 @@
data
legend
line_type);
- @pcl_filepath_elements = qw(state_file
- data_dir
+ @pcl_filepath_elements = qw(data_dir
find_files
- html_dir);
+ html_dir
+ state_file);
@pcl_no_arg_elements = qw(flush_regexps
optional
rigid_min_max);
@@ -3169,7 +3199,7 @@
# Handle options for plot.
if ($pcl_plot_index !~ /^-/) {
if ($key eq '}') {
- $pcl_plot_index++;
+ ++$pcl_plot_index;
$pcl_plot_index = "-$pcl_plot_index";
return;
}
@@ -3300,7 +3330,7 @@
=head1 SYNOPSIS
- orca [-v [-v [-v]]] [-o] configuration_file
+ orca [-o] [-r] [-v [-v [-v]]] configuration_file
=head1 DESCRIPTION
@@ -3352,16 +3382,21 @@
=head1 COMMAND LINE OPTIONS
-Orca has only two command line options. They are:
-
-B<-v>: Verbose. Have Orca spit out more verbose messages. As you add
-more B<-v>'s to the command line, more messages are sent out. Any more
-than three B<-v>'s are not used by Orca.
+Orca has only three command line options. They are:
B<-o>: Once. This tells Orca to go through the steps of finding files,
updating the RRDs, updating the GIFs, and creating the HTML files once.
Normally, Orca loops continuously looking for new and updated files.
+B<-r>: RRD only. Have Orca only update its RRD files. Do not generate
+any HTML or GIF files. This is useful if you are loading in a large
+amount of data in several invocations of Orca and do not want to create
+the HTML and GIF files in each run since it is time consuming.
+
+B<-v>: Verbose. Have Orca spit out more verbose messages. As you add
+more B<-v>'s to the command line, more messages are sent out. Any more
+than three B<-v>'s are not used by Orca.
+
After the command line options are listed, Orca takes one more argument
which is the name of the configuration file to use. Sample configuration
files can be found in the sample_configs directory with the distribution
@@ -3373,9 +3408,9 @@
locally mounts the web server content be the same machine that runs Orca.
In addition, the RRD data files that Orca uses also require a good amount
of IO. The machine running Orca should always have the B<data_dir>
-directory locally mounted. It is more important this B<data_dir> be
-locally stored than B<html_dir> for performance concerns. The two options
-B<data_dir> and B<html_dir> are described in more detail below.
+directory locally mounted. It is more important this B<data_dir>
+be locally stored than B<html_dir> for performance concerns. The two
+options B<data_dir> and B<html_dir> are described in more detail below.
=head1 INSTALLATION AND CONFIGURATION
@@ -3479,7 +3514,8 @@
If B<expire_gifs> is set then .meta files will be created for all
generated GIF files. If the Apache web server 1.3.2 or greater is being
-used, then the following modifications must added to srm.conf:
+used, then the following modifications must added to srm.conf or
+httpd.conf.
<
< #MetaDir .web
Modified: trunk/orca/CHANGES
==============================================================================
--- trunk/orca/CHANGES (original)
+++ trunk/orca/CHANGES Sat Jul 13 19:12:01 2002
@@ -1,3 +1,63 @@
+Wed May 26 17:54:26 PDT 1999
+
+ Release version 0.22.
+
+Wed May 26 12:10:42 PDT 1999
+
+ Move the portions of the code that generate the RRDs::graph
+ options that do not change between invocations to the
+ _update_graph_options method. This method gets called when the
+ Orca::GIFFile is constructed and any time add_rrds is called.
+ This speeds Orca up slightly.
+
+ Include RRDtool 0.99.31 but continue to only require 0.99.29.
+
+ Add a new quarterly plot that shows the last 100 days. This is
+ a nice transition between the monthly and yearly plots.
+
+ Change the number of days shown in the yearly plot from 500 to
+ 428, which is one year and two months. Reducing the number
+ of days from 500 by at least one day will speed up the GIF
+ generation time because by default the plot portion of the GIFs
+ are 500 pixels wide.
+
+ Add two new classes Orca::Config::Plot and
+ Orca::Config::FilesGroup that do not do anything yet but
+ will provide an object-oriented interface to config_plots and
+ config_files. Currently all the values in @$config_plots and
+ %$config_files are now bless objects instead of unblessed objects.
+
+Thu May 20 10:59:26 PDT 1999
+
+ Put a closing ) in a error message in RRDtool 0.99.29.1.
+
+ Fix a bug in queue_data where it was sending data to
+ rrd_update that was already in the RRD file.
+
+Wed May 19 10:43:48 PDT 1999
+
+ Restructured the code so each Orca::SourceDataFile has only
+ one anonymous subroutine to read in all the valued from a single
+ line of the source data file. This sped Orca up slightly.
+
+ Add a -r option to Orca to have it not create any HTML or
+ GIF files and only update the RRD files.
+
+ Fix a bug where if the number of columns changed in from one
+ source file to the next source file in a files group, the
+ column index used to get a particular value is the old index
+ for the old file and not the new index for the new file. This
+ fix involved having the Orca::SourceDataFile object run the
+ anonymous subroutines to pick the correct data from a line
+ instead of Orca::RRDFile.
+
+ Remove some unused methods: Orca::OpenFileHash::list,
+ Orca::OpenFileHash::select, Orca::OpenFileHash::sysread_readline
+ Add some more documentation to orcallator.cfg.
+
+ Skip a line in an input source data file if the word timestamp
+ is found in it. This is a temporary fix.
+
Mon May 17 16:26:17 PDT 1999
Release version 0.21.
Modified: trunk/orca/NEWS
==============================================================================
--- trunk/orca/NEWS (original)
+++ trunk/orca/NEWS Sat Jul 13 19:12:01 2002
@@ -1,3 +1,23 @@
+New in version 0.22.
+ 1) Add a new command line option (-r) that tells Orca to only update
+ the RRD data files and not to generate any HTML or GIF files.
+ This is useful if you are loading in a large amount of data in several
+ invocations of Orca and do not want to create the HTML and GIF files
+ in each run since it is time consuming.
+ 2) Fix a bug where if the number of columns changed in from one source
+ file to the next source file in a files group, the column index used
+ to get a particular value is the index for the old file and not the
+ index for the new file. This required some internal restructuring
+ the speeds Orca up slightly.
+ 3) Add a new plot called quarterly that displays the last 100 days
+ of data. This is a nice transition between the monthly and yearly
+ plots.
+ 4) A temporary fix: Skip and do not complain about input source data
+ file lines containing the word timestamp in it.
+ 5) Removed some unused methods to make Orca smaller.
+ 6) Added some more documentation to orcallater.cfg.
+ 7) Make Orca slightly faster.
+
New in version 0.21.
1) Every file containing the words percollator, percol and perc has
been renamed to contain the word orcallator. A new make target named
Modified: trunk/orca/packages/rrdtool-0.99.31/Makefile.dist
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/Makefile.dist (original)
+++ trunk/orca/packages/rrdtool-0.99.31/Makefile.dist Sat Jul 13 19:12:01 2002
@@ -9,8 +9,8 @@
### Things you might NOT want to play with ...
###
-VER = 0.99.29
-PVER = 0.99029
+VER = 0.99.31
+PVER = 0.99031
ARCHIVE = rrdtool-$(VER).tar.gz
DIRNAME = rrdtool-$(VER)
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_format.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_format.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_format.c Sat Jul 13 19:12:01 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1999
*****************************************************************************
* rrd_format.c RRD Database Format helper functions
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_error.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_error.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_error.c Sat Jul 13 19:12:01 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997, 1998, 1999
*****************************************************************************
* rrd_error.c Common Header File
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_fetch.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_fetch.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_fetch.c Sat Jul 13 19:12:01 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997, 1998, 1999
*****************************************************************************
* rrd_fetch.c read date from an rrd to use for further processing
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-0.99.31/src/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/Makefile.in (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/Makefile.in Sat Jul 13 19:12:01 2002
@@ -25,7 +25,7 @@
SRCLIB = rrd_fetch.c rrd_create.c rrd_dump.c rrd_graph.c rrd_tune.c\
rrd_open.c rrd_diff.c rrd_last.c rrd_update.c rrd_format.c rrd_error.c\
- getopt.c getopt1.c parsetime.c
+ getopt.c getopt1.c parsetime.c rrd_resize.c
SRC = $(SRCLIB) rrd_tool.c
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_format.h
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_format.h (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_format.h Sat Jul 13 19:12:01 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997, 1998, 1999
*****************************************************************************
* rrd_format.h RRD Database Format header
*****************************************************************************/
Added: trunk/orca/packages/rrdtool-0.99.31/src/rrd_resize.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_resize.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_resize.c Sat Jul 13 19:12:01 2002
@@ -0,0 +1,187 @@
+/*****************************************************************************
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997, 1998, 1999
+ *****************************************************************************
+ * rrd_resize.c Alters size of an RRA
+ *****************************************************************************
+ * Initial version by Alex van den Bogaerdt
+ *****************************************************************************/
+
+#include "rrd_tool.h"
+
+int
+rrd_resize(int argc, char **argv)
+{
+ char *infilename,outfilename[11]="resize.rrd";
+ FILE *infile,*outfile;
+ rrd_t rrdold,rrdnew;
+ rrd_value_t buffer;
+ unsigned long l,rra;
+ long modify;
+ unsigned long target_rra;
+ int grow=0,shrink=0;
+ char *endptr;
+
+ infilename=argv[1];
+ if (!strcmp(infilename,"resize.rrd")) {
+ rrd_set_error("resize.rrd is a reserved name");
+ return(-1);
+ }
+ if (argc!=5) {
+ rrd_set_error("wrong number of parameters");
+ return(-1);
+ }
+
+ target_rra=strtol(argv[2],&endptr,0);
+
+ if (!strcmp(argv[3],"GROW")) grow=1;
+ else if (!strcmp(argv[3],"SHRINK")) shrink=1;
+ else {
+ rrd_set_error("I can only GROW or SHRINK");
+ return(-1);
+ }
+
+ modify=strtol(argv[4],&endptr,0);
+
+ if ((modify<1)) {
+ rrd_set_error("you must have at least one row in the RRA");
+ return(-1);
+ }
+
+ if (shrink) modify = -modify;
+
+
+ if (rrd_open(infilename, &infile, &rrdold, RRD_READWRITE)==-1) {
+ rrd_set_error("could not open RRD");
+ return(-1);
+ }
+ if (LockRRD(infile) != 0) {
+ rrd_set_error("could not lock original RRD");
+ rrd_free(&rrdold);
+ fclose(infile);
+ return(-1);
+ }
+
+ if (target_rra >= rrdold.stat_head->rra_cnt) {
+ rrd_set_error("no such RRA in this RRD");
+ rrd_free(&rrdold);
+ fclose(infile);
+ return(-1);
+ }
+ if ((rrdold.rra_def[target_rra].row_cnt+modify)<0) {
+ rrd_set_error("This RRA is not that big");
+ rrd_free(&rrdold);
+ fclose(infile);
+ return(-1);
+ }
+
+ rrdnew.stat_head = rrdold.stat_head;
+ rrdnew.ds_def = rrdold.ds_def;
+ rrdnew.rra_def = rrdold.rra_def;
+ rrdnew.live_head = rrdold.live_head;
+ rrdnew.pdp_prep = rrdold.pdp_prep;
+ rrdnew.cdp_prep = rrdold.cdp_prep;
+ rrdnew.rra_ptr = rrdold.rra_ptr;
+
+ if ((outfile=fopen(outfilename,"wb"))==NULL) {
+ rrd_set_error("Can't create '%s'",outfilename);
+ return(-1);
+ }
+ if (LockRRD(outfile) != 0) {
+ rrd_set_error("could not lock new RRD");
+ rrd_free(&rrdold);
+ fclose(infile);
+ fclose(outfile);
+ return(-1);
+ }
+ fwrite(rrdnew.stat_head, sizeof(stat_head_t),1,outfile);
+ fwrite(rrdnew.ds_def,sizeof(ds_def_t),rrdnew.stat_head->ds_cnt,outfile);
+ fwrite(rrdnew.rra_def,sizeof(rra_def_t),rrdnew.stat_head->rra_cnt,outfile);
+ fwrite(rrdnew.live_head,sizeof(live_head_t),1,outfile);
+ fwrite(rrdnew.pdp_prep,sizeof(pdp_prep_t),rrdnew.stat_head->ds_cnt,outfile);
+ fwrite(rrdnew.cdp_prep,sizeof(cdp_prep_t),rrdnew.stat_head->ds_cnt*rrdnew.stat_head->rra_cnt,outfile);
+ fwrite(rrdnew.rra_ptr,sizeof(rra_ptr_t),rrdnew.stat_head->rra_cnt,outfile);
+
+ /* Move the CDPs from the old to the new database.
+ ** This can be made (much) faster but isn't worth the efford. Clarity
+ ** is much more important.
+ */
+
+ /* Move data in unmodified RRAs
+ */
+ l=0;
+ for (rra=0;rra<target_rra;rra++) {
+ l+=rrdnew.stat_head->ds_cnt * rrdnew.rra_def[rra].row_cnt;
+ }
+ while (l>0) {
+ fread(&buffer,sizeof(rrd_value_t),1,infile);
+ fwrite(&buffer,sizeof(rrd_value_t),1,outfile);
+ l--;
+ }
+ /* Move data in this RRA, either removing or adding some rows
+ */
+ if (modify>0) {
+ /* Adding extra rows; insert unknown values just after the
+ ** current row number.
+ */
+ l = rrdnew.stat_head->ds_cnt * (rrdnew.rra_ptr[target_rra].cur_row+1);
+ while (l>0) {
+ fread(&buffer,sizeof(rrd_value_t),1,infile);
+ fwrite(&buffer,sizeof(rrd_value_t),1,outfile);
+ l--;
+ }
+ buffer=DNAN;
+ l=rrdnew.stat_head->ds_cnt * modify;
+ while (l>0) {
+ fwrite(&buffer,sizeof(rrd_value_t),1,outfile);
+ l--;
+ }
+ } else {
+ /* Removing rows. Normally this would be just after the cursor
+ ** however this may also mean that we wrap to the beginning of
+ ** the array.
+ */
+ signed long int remove_end=0;
+
+ remove_end=(rrdnew.rra_ptr[target_rra].cur_row-modify)%rrdnew.rra_def[target_rra].row_cnt;
+ if (remove_end <= rrdnew.rra_ptr[target_rra].cur_row) {
+ while (remove_end >= 0) {
+ fseek(infile,sizeof(rrd_value_t)*rrdnew.stat_head->ds_cnt,SEEK_CUR);
+ rrdnew.rra_ptr[target_rra].cur_row--;
+ rrdnew.rra_def[target_rra].row_cnt--;
+ remove_end--;
+ modify++;
+ }
+ remove_end=rrdnew.rra_def[target_rra].row_cnt-1;
+ }
+ for (l=0;l<=rrdnew.rra_ptr[target_rra].cur_row;l++) {
+ unsigned int tmp;
+ for (tmp=0;tmp<rrdnew.stat_head->ds_cnt;tmp++) {
+ fread(&buffer,sizeof(rrd_value_t),1,infile);
+ fwrite(&buffer,sizeof(rrd_value_t),1,outfile);
+ }
+ }
+ while (modify<0) {
+ fseek(infile,sizeof(rrd_value_t)*rrdnew.stat_head->ds_cnt,SEEK_CUR);
+ rrdnew.rra_def[target_rra].row_cnt--;
+ modify++;
+ }
+ }
+ /* Move the rest of the CDPs
+ */
+ while (!(feof(infile))) {
+ fread(&buffer,sizeof(rrd_value_t),1,infile);
+ fwrite(&buffer,sizeof(rrd_value_t),1,outfile);
+ }
+ rrdnew.rra_def[target_rra].row_cnt += modify;
+ fseek(outfile,sizeof(stat_head_t)+sizeof(ds_def_t)*rrdnew.stat_head->ds_cnt,SEEK_SET);
+ fwrite(rrdnew.rra_def,sizeof(rra_def_t),rrdnew.stat_head->rra_cnt, outfile);
+ fseek(outfile,sizeof(live_head_t),SEEK_CUR);
+ fseek(outfile,sizeof(pdp_prep_t)*rrdnew.stat_head->ds_cnt,SEEK_CUR);
+ fseek(outfile,sizeof(cdp_prep_t)*rrdnew.stat_head->ds_cnt*rrdnew.stat_head->rra_cnt,SEEK_CUR);
+ fwrite(rrdnew.rra_ptr,sizeof(rra_ptr_t),rrdnew.stat_head->rra_cnt, outfile);
+
+ fclose(outfile);
+ rrd_free(&rrdold);
+ fclose(infile);
+ return(0);
+}
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_open.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_open.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_open.c Sat Jul 13 19:12:02 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997, 1998, 1999
*****************************************************************************
* rrd_open.c Open an RRD File
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_graph.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_graph.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_graph.c Sat Jul 13 19:12:02 2002
@@ -1,5 +1,5 @@
/****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997,1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997,1998, 1999
****************************************************************************
* rrd__graph.c make creates ne rrds
****************************************************************************/
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_last.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_last.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_last.c Sat Jul 13 19:12:03 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997, 1998, 1999
*****************************************************************************
* rrd_last.c
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_create.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_create.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_create.c Sat Jul 13 19:12:03 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997, 1998, 1999
*****************************************************************************
* rrd_create.c creates new rrds
*****************************************************************************/
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_dump.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_dump.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_dump.c Sat Jul 13 19:12:03 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997, 1998, 1999
*****************************************************************************
* rrd_dump Display a RRD
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_diff.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_diff.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_diff.c Sat Jul 13 19:12:03 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1999
* This code is stolen from rateup (mrtg-2.x) by Dave Rand
*****************************************************************************
* diff calculate the difference between two very long integers available as
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_tune.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_tune.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_tune.c Sat Jul 13 19:12:03 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997, 1998, 1999
*****************************************************************************
* change header parameters of an rrd
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_tool.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_tool.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_tool.c Sat Jul 13 19:12:03 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997, 1998, 1999
*****************************************************************************
* rrd_tool.c Startup wrapper
*****************************************************************************
@@ -73,6 +73,9 @@
"\t\t[--data-source-rename|-r old-name:new-name\n"
"\t\t[--minimum|-i ds-name:min] [--maximum|-a ds-name:max]\n\n"
+ " * resize - alter the lenght of one of the RRAs in an RRD\n\n"
+ "\trrdtool resize filename rranum GROW|SHRINK rows\n\n"
+
"RRD TOOL is distributed under the Terms of the GNU General\n"
"Public License Version 2. (www.gnu.org/copyleft/gpl.html)\n\n"
@@ -160,6 +163,8 @@
rrd_create(argc-1, &argv[1]);
else if (strcmp("dump", argv[1]) == 0)
rrd_dump(argc-1, &argv[1]);
+ else if (strcmp("resize", argv[1]) == 0)
+ rrd_resize(argc-1, &argv[1]);
else if (strcmp("last", argv[1]) == 0)
printf("%ld\n",rrd_last(argc-1, &argv[1]));
else if (strcmp("update", argv[1]) == 0)
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_tool.h
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_tool.h (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_tool.h Sat Jul 13 19:12:04 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997,1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997,1998, 1999
*****************************************************************************
* rrd_tool.h Common Header File
*****************************************************************************
@@ -94,12 +94,14 @@
int rrd_dump(int argc, char **argv);
int rrd_tune(int argc, char **argv);
time_t rrd_last(int argc, char **argv);
+int rrd_resize(int argc, char **argv);
/* HELPER FUNCTIONS */
void rrd_set_error(char *fmt,...);
void rrd_clear_error(void);
int rrd_test_error(void);
char *rrd_get_error(void);
+int LockRRD(FILE *);
int rrd_create_fn(char *file_name, rrd_t *rrd);
int rrd_fetch_fn(char *filename, enum cf_en cf_idx,
Modified: trunk/orca/packages/rrdtool-0.99.31/src/rrd_update.c
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/src/rrd_update.c (original)
+++ trunk/orca/packages/rrdtool-0.99.31/src/rrd_update.c Sat Jul 13 19:12:04 2002
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDTOOL 0.99.29 Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDTOOL 0.99.31 Copyright Tobias Oetiker, 1997, 1998, 1999
*****************************************************************************
* rrd_update.c RRD Update Function
*****************************************************************************
@@ -224,7 +224,7 @@
if(current_time <= rrd.live_head->last_up){
rrd_set_error("illegal attempt to update using time %ld when "
- "last update time is %ld (minimum one second step ",
+ "last update time is %ld (minimum one second step)",
current_time, rrd.live_head->last_up);
break;
}
Modified: trunk/orca/packages/rrdtool-0.99.31/CONTRIBUTORS
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/CONTRIBUTORS (original)
+++ trunk/orca/packages/rrdtool-0.99.31/CONTRIBUTORS Sat Jul 13 19:12:04 2002
@@ -25,6 +25,7 @@
Jeremy Fischer <jeremy at pobox.com> (Makefile changes & RPM builds)
Alan Lichty <alan_lichty at eli.net>
Steen Linden <Steen.Linden at ebone.net>
+ Alex van den Bogaerdt <alex at ergens.op.het.net> (rrd_resize.c)
Documentation
Modified: trunk/orca/packages/rrdtool-0.99.31/perl-piped/RRDp.pm
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/perl-piped/RRDp.pm (original)
+++ trunk/orca/packages/rrdtool-0.99.31/perl-piped/RRDp.pm Sat Jul 13 19:12:04 2002
@@ -110,7 +110,7 @@
sub end ();
sub read ();
-$VERSION = 0.99029 ;
+$VERSION = 0.99031 ;
sub start ($){
croak "rrdtool is already running"
Modified: trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.1
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.1 (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.1 Sat Jul 13 19:12:04 2002
@@ -93,7 +93,7 @@
.nr % 0
.rr F
.\}
-.TH RRDTOOL 1 "19990426.22" "12/Feb/99" "rrdtool"
+.TH RRDTOOL 1 "19990525.23" "16/May/99" "rrdtool"
.UC
.if n .hy 0
.if n .na
@@ -312,7 +312,7 @@
.SH "SEE ALSO"
rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast
.SH "BUGS"
-There must be plenty ... this is alpha code ;\-) ...
+Bugs ? Features !
.SH "AUTHOR"
Tobias Oetiker <oetiker at ee.ethz.ch>
Added: trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.txt
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.txt (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.txt Sat Jul 13 19:12:04 2002
@@ -0,0 +1,66 @@
+
+
+
+RRDRESIZE(1) rrdtool RRDRESIZE(1)
+
+
+NNNNAAAAMMMMEEEE
+ rrdtool resize - alters the size of an RRA.
+
+SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
+ rrrrrrrrddddttttoooooooollll rrrreeeessssiiiizzzzeeee _f_i_l_e_n_a_m_e _r_r_a_-_n_u_m GGGGRRRROOOOWWWW_|SSSSHHHHRRRRIIIINNNNKKKK _r_o_w_s
+
+DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
+ The rrrreeeessssiiiizzzzeeee function is used to modify the number of rows
+ in an RRRRRRRRAAAA.
+
+ _f_i_l_e_n_a_m_e
+ the name of the RRRRRRRRDDDD you want to alter.
+
+ _r_r_a_-_n_u_m the RRRRRRRRAAAA you want to alter. You can find the number
+ using rrrrrrrrddddttttoooooooollll dddduuuummmmpppp.
+
+ GGGGRRRROOOOWWWW used if you want to add extra rows to an RRA. The
+ extra rows will be inserted as the rows that are
+ oldest.
+
+ SSSSHHHHRRRRIIIINNNNKKKK used if you want to remove rows from an RRA. The
+ rows that will be removed are the oldest rows.
+
+ _r_o_w_s the number of rows you want to add or remove.
+
+NNNNOOOOTTTTEEEESSSS
+ It is possible to abuse this tool and get strange results
+ by first removing some rows and then reinsert the same
+ amount (effectively clearing them to be Unknown). You may
+ thus end up with unknown data in one RRA while at the same
+ timestamp this data is available in another RRA.
+
+AAAAUUUUTTTTHHHHOOOORRRR
+ Alex van den Bogaerdt <alex at ergens.op.het.net>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+25/May/99 19990525.23 1
+
+
Added: trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.pod
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.pod (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.pod Sat Jul 13 19:12:04 2002
@@ -0,0 +1,50 @@
+=head1 NAME
+
+rrdtool resize - alters the size of an RRA.
+
+=head1 SYNOPSIS
+
+B<rrdtool> B<resize> I<filename> I<rra-num> B<GROW>I<|>B<SHRINK> I<rows>
+
+=head1 DESCRIPTION
+
+The B<resize> function is used to modify the number of rows in
+an B<RRA>.
+
+=over 8
+
+=item I<filename>
+
+the name of the B<RRD> you want to alter.
+
+=item I<rra-num>
+
+the B<RRA> you want to alter. You can find the number using B<rrdtool dump>.
+
+=item B<GROW>
+
+used if you want to add extra rows to an RRA. The extra rows will be inserted
+as the rows that are oldest.
+
+=item B<SHRINK>
+
+used if you want to remove rows from an RRA. The rows that will be removed
+are the oldest rows.
+
+=item I<rows>
+
+the number of rows you want to add or remove.
+
+=back
+
+=head1 NOTES
+
+It is possible to abuse this tool and get strange results
+by first removing some rows and then reinsert the same amount (effectively
+clearing them to be Unknown). You may thus end up with unknown data in one
+RRA while at the same timestamp this data is available in another RRA.
+
+=head1 AUTHOR
+
+Alex van den Bogaerdt <alex at ergens.op.het.net>
+
Modified: trunk/orca/packages/rrdtool-0.99.31/doc/GNUmakefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/GNUmakefile.in (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/GNUmakefile.in Sat Jul 13 19:12:04 2002
@@ -17,7 +17,7 @@
VER = `date +%Y%m%d.%H`
POD = rrdtool.pod rrdlast.pod rrdcreate.pod rrdupdate.pod rrdgraph.pod RRDs.pm RRDp.pm \
- rrdfetch.pod rrddump.pod rrdtune.pod
+ rrdfetch.pod rrddump.pod rrdtune.pod rrdresize.pod
MAN = $(POD:.pod=.1) $(POD:.pl=.1) $(POD:.pm=.3)
TXT = $(MAN:.1=.txt) $(POD:.3=.txt)
Added: trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.1
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.1 (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.1 Sat Jul 13 19:12:04 2002
@@ -0,0 +1,240 @@
+.rn '' }`
+''' $RCSfile$$Revision$$Date$
+'''
+''' $Log$
+'''
+.de Sh
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp
+.if t .sp .5v
+.if n .sp
+..
+.de Ip
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.de Vb
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve
+.ft R
+
+.fi
+..
+'''
+'''
+''' Set up \*(-- to give an unbreakable dash;
+''' string Tr holds user defined translation string.
+''' Bell System Logo is used as a dummy character.
+'''
+.tr \(*W-|\(bv\*(Tr
+.ie n \{\
+.ds -- \(*W-
+.ds PI pi
+.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+.ds L" ""
+.ds R" ""
+''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of
+''' \*(L" and \*(R", except that they are used on ".xx" lines,
+''' such as .IP and .SH, which do another additional levels of
+''' double-quote interpretation
+.ds M" """
+.ds S" """
+.ds N" """""
+.ds T" """""
+.ds L' '
+.ds R' '
+.ds M' '
+.ds S' '
+.ds N' '
+.ds T' '
+'br\}
+.el\{\
+.ds -- \(em\|
+.tr \*(Tr
+.ds L" ``
+.ds R" ''
+.ds M" ``
+.ds S" ''
+.ds N" ``
+.ds T" ''
+.ds L' `
+.ds R' '
+.ds M' `
+.ds S' '
+.ds N' `
+.ds T' '
+.ds PI \(*p
+'br\}
+.\" If the F register is turned on, we'll generate
+.\" index entries out stderr for the following things:
+.\" TH Title
+.\" SH Header
+.\" Sh Subsection
+.\" Ip Item
+.\" X<> Xref (embedded
+.\" Of course, you have to process the output yourself
+.\" in some meaninful fashion.
+.if \nF \{
+.de IX
+.tm Index:\\$1\t\\n%\t"\\$2"
+..
+.nr % 0
+.rr F
+.\}
+.TH RRDRESIZE 1 "19990525.23" "25/May/99" "rrdtool"
+.UC
+.if n .hy 0
+.if n .na
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.de CQ \" put $1 in typewriter font
+.ft CW
+'if n "\c
+'if t \\&\\$1\c
+'if n \\&\\$1\c
+'if n \&"
+\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
+'.ft R
+..
+.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
+. \" AM - accent mark definitions
+.bd B 3
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds ? ?
+. ds ! !
+. ds /
+. ds q
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
+. ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+. ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
+.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
+.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
+.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.ds oe o\h'-(\w'o'u*4/10)'e
+.ds Oe O\h'-(\w'O'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds v \h'-1'\o'\(aa\(ga'
+. ds _ \h'-1'^
+. ds . \h'-1'.
+. ds 3 3
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+. ds oe oe
+. ds Oe OE
+.\}
+.rm #[ #] #H #V #F C
+.SH "NAME"
+rrdtool resize \- alters the size of an RRA.
+.SH "SYNOPSIS"
+\fBrrdtool\fR \fBresize\fR \fIfilename\fR \fIrra-num\fR \fBGROW\fR\fI|\fR\fBSHRINK\fR \fIrows\fR
+.SH "DESCRIPTION"
+The \fBresize\fR function is used to modify the number of rows in
+an \fBRRA\fR.
+.Ip "\fIfilename\fR " 8
+the name of the \fB\s-1RRD\s0\fR you want to alter.
+.Ip "\fIrra-num\fR " 8
+the \fB\s-1RRA\s0\fR you want to alter. You can find the number using \fBrrdtool dump\fR.
+.Ip "\fB\s-1GROW\s0\fR " 8
+used if you want to add extra rows to an \s-1RRA\s0. The extra rows will be inserted
+as the rows that are oldest.
+.Ip "\fB\s-1SHRINK\s0\fR " 8
+used if you want to remove rows from an \s-1RRA\s0. The rows that will be removed
+are the oldest rows.
+.Ip "\fIrows\fR " 8
+the number of rows you want to add or remove.
+.SH "NOTES"
+It is possible to abuse this tool and get strange results
+by first removing some rows and then reinsert the same amount (effectively
+clearing them to be Unknown). You may thus end up with unknown data in one
+RRA while at the same timestamp this data is available in another RRA.
+.SH "AUTHOR"
+Alex van den Bogaerdt <alex at ergens.op.het.net>
+
+.rn }` ''
+.IX Title "RRDRESIZE 1"
+.IX Name "rrdtool resize - alters the size of an RRA."
+
+.IX Header "NAME"
+
+.IX Header "SYNOPSIS"
+
+.IX Header "DESCRIPTION"
+
+.IX Item "\fIfilename\fR "
+
+.IX Item "\fIrra-num\fR "
+
+.IX Item "\fB\s-1GROW\s0\fR "
+
+.IX Item "\fB\s-1SHRINK\s0\fR "
+
+.IX Item "\fIrows\fR "
+
+.IX Header "NOTES"
+
+.IX Header "AUTHOR"
+
Modified: trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.html
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.html (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.html Sat Jul 13 19:12:04 2002
@@ -275,7 +275,7 @@
<H1><A NAME="BUGS">BUGS
</A></H1>
-There must be plenty ... this is alpha code ;-) ...
+Bugs ? Features !
<P>
Modified: trunk/orca/packages/rrdtool-0.99.31/doc/rrdtutorial.pod
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/rrdtutorial.pod (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/rrdtutorial.pod Sat Jul 13 19:12:05 2002
@@ -404,7 +404,7 @@
CDEF:kmh=myspeed,3600,* \
CDEF:fast=kmh,100,GT,100,0,IF \
CDEF:over=kmh,100,GT,kmh,100,-,0,IF \
- CDEF:good=kmh,0,kmh,100,GT,IF \
+ CDEF:good=kmh,100,GT,0,kmh,IF \
HRULE:100#0000FF:"Maximum allowed" \
AREA:good#00FF00:"Good speed" \
AREA:fast#550000:"Too fast" \
Modified: trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.txt
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.txt (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.txt Sat Jul 13 19:12:05 2002
@@ -61,7 +61,7 @@
-12/Feb/99 19990426.22 1
+16/May/99 19990525.23 1
@@ -127,7 +127,7 @@
-12/Feb/99 19990426.22 2
+16/May/99 19990525.23 2
@@ -193,7 +193,7 @@
-12/Feb/99 19990426.22 3
+16/May/99 19990525.23 3
@@ -213,7 +213,7 @@
rrdtune, rrdlast
BBBBUUUUGGGGSSSS
- There must be plenty ... this is alpha code ;-) ...
+ Bugs ? Features !
AAAAUUUUTTTTHHHHOOOORRRR
Tobias Oetiker <oetiker at ee.ethz.ch>
@@ -259,6 +259,6 @@
-12/Feb/99 19990426.22 4
+16/May/99 19990525.23 4
Modified: trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.pod
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.pod (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/rrdtool.pod Sat Jul 13 19:12:05 2002
@@ -171,7 +171,7 @@
=head1 BUGS
-There must be plenty ... this is alpha code ;-) ...
+Bugs ? Features !
=head1 AUTHOR
Modified: trunk/orca/packages/rrdtool-0.99.31/doc/RRDp.3
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/RRDp.3 (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/RRDp.3 Sat Jul 13 19:12:05 2002
@@ -93,7 +93,7 @@
.nr % 0
.rr F
.\}
-.TH RRDp 3 "19990512.01" "12/May/99" "rrdtool"
+.TH RRDp 3 "19990527.00" "25/May/99" "rrdtool"
.UC
.if n .hy 0
.if n .na
Modified: trunk/orca/packages/rrdtool-0.99.31/doc/RRDs.3
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/RRDs.3 (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/RRDs.3 Sat Jul 13 19:12:05 2002
@@ -93,7 +93,7 @@
.nr % 0
.rr F
.\}
-.TH RRDs 3 "19990512.01" "12/May/99" "rrdtool"
+.TH RRDs 3 "19990527.00" "25/May/99" "rrdtool"
.UC
.if n .hy 0
.if n .na
Added: trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.html
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.html (original)
+++ trunk/orca/packages/rrdtool-0.99.31/doc/rrdresize.html Sat Jul 13 19:12:05 2002
@@ -0,0 +1,126 @@
+ <HTML>
+ <HEAD>
+ <TITLE>resize - alters the size of an RRA.
+
+</TITLE>
+ </HEAD>
+
+ <BODY>
+
+<!-- INDEX BEGIN -->
+<!--
+
+<UL>
+
+ <LI><A HREF="#NAME">NAME</A>
+ <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
+ <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
+ <LI><A HREF="#NOTES">NOTES</A>
+ <LI><A HREF="#AUTHOR">AUTHOR</A>
+</UL>
+-->
+<!-- INDEX END -->
+
+<P>
+<H1><A NAME="NAME">NAME
+
+</A></H1>
+rrdtool resize - alters the size of an RRA.
+
+
+<P>
+
+<P>
+<HR>
+<H1><A NAME="SYNOPSIS">SYNOPSIS
+
+</A></H1>
+<STRONG>rrdtool</STRONG> <STRONG>resize</STRONG> <EM>filename</EM> <EM>rra-num</EM> <STRONG>GROW</STRONG><EM>|</EM><STRONG>SHRINK</STRONG> <EM>rows</EM>
+
+
+
+
+<P>
+
+<P>
+<HR>
+<H1><A NAME="DESCRIPTION">DESCRIPTION
+
+</A></H1>
+The <STRONG>resize</STRONG> function is used to modify the number of rows in an <STRONG>RRA</STRONG>.
+
+
+<P>
+
+<DL>
+<DT><STRONG><A NAME="item_filename">filename
+
+</A></STRONG><DD>
+the name of the <STRONG>RRD</STRONG> you want to alter.
+
+
+<P>
+
+<DT><STRONG><A NAME="item_rra">rra-num
+
+</A></STRONG><DD>
+the <STRONG>RRA</STRONG> you want to alter. You can find the number using <STRONG>rrdtool dump</STRONG>.
+
+
+<P>
+
+<DT><STRONG><A NAME="item_GROW">GROW
+
+</A></STRONG><DD>
+used if you want to add extra rows to an RRA. The extra rows will be
+inserted as the rows that are oldest.
+
+
+<P>
+
+<DT><STRONG><A NAME="item_SHRINK">SHRINK
+
+</A></STRONG><DD>
+used if you want to remove rows from an RRA. The rows that will be removed
+are the oldest rows.
+
+
+<P>
+
+<DT><STRONG><A NAME="item_rows">rows
+
+</A></STRONG><DD>
+the number of rows you want to add or remove.
+
+
+<P>
+
+</DL>
+<P>
+<HR>
+<H1><A NAME="NOTES">NOTES
+
+</A></H1>
+It is possible to abuse this tool and get strange results by first removing
+some rows and then reinsert the same amount (effectively clearing them to
+be Unknown). You may thus end up with unknown data in one RRA while at the
+same timestamp this data is available in another RRA.
+
+
+<P>
+
+<P>
+<HR>
+<H1><A NAME="AUTHOR">AUTHOR
+
+</A></H1>
+Alex van den Bogaerdt <A
+HREF="MAILTO:<alex at ergens.op.het.net>"><alex at ergens.op.het.net></A>
+
+
+<P>
+
+</DL>
+ </BODY>
+
+ </HTML>
Deleted: trunk/orca/packages/rrdtool-0.99.31/doc/rrdintro.pod
Modified: trunk/orca/packages/rrdtool-0.99.31/perl-shared/RRDs.pm
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/perl-shared/RRDs.pm (original)
+++ trunk/orca/packages/rrdtool-0.99.31/perl-shared/RRDs.pm Sat Jul 13 19:12:06 2002
@@ -7,7 +7,7 @@
require DynaLoader;
-$VERSION = 0.99029 ;
+$VERSION = 0.99031 ;
bootstrap RRDs $VERSION;
Modified: trunk/orca/packages/rrdtool-0.99.31/MANIFEST
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/MANIFEST (original)
+++ trunk/orca/packages/rrdtool-0.99.31/MANIFEST Sat Jul 13 19:12:06 2002
@@ -52,11 +52,14 @@
doc/rrdgraph.html
doc/rrdgraph.pod
doc/rrdgraph.txt
-doc/rrdintro.pod
doc/rrdlast.1
doc/rrdlast.html
doc/rrdlast.pod
doc/rrdlast.txt
+doc/rrdresize.1
+doc/rrdresize.html
+doc/rrdresize.pod
+doc/rrdresize.txt
doc/rrdtool.1
doc/rrdtool.html
doc/rrdtool.pod
@@ -112,6 +115,7 @@
src/rrd_format.h
src/rrd_graph.c
src/rrd_open.c
+src/rrd_resize.c
src/rrd_last.c
src/rrd_tool.c
src/rrd_tool.h
Modified: trunk/orca/packages/rrdtool-0.99.31/CHANGES
==============================================================================
--- trunk/orca/packages/rrdtool-0.99.31/CHANGES (original)
+++ trunk/orca/packages/rrdtool-0.99.31/CHANGES Sat Jul 13 19:12:06 2002
@@ -1,5 +1,10 @@
-0.99.29b
-0) from blair .. fix for Makefile.in
+0.99.31
+From: Tobi
+0) hmpf ... forgot to add rrdresize.pod and friends to MANIFEST
+
+0.99.30
+From: Alex
+0) We can now alter the number of rows in an RRA with rrd_resize
0.99.29
From: Blair
More information about the Orca-checkins
mailing list