This manual is an attempt to assist beginners in understanding the concepts
+of RRDTool. It sheds a light on differences between RRDTool and other
+databases. With help of an example, it explains structure of RRDTool
+database. This is followed by an overview of the ``graph'' feature of RRDTool.
+At the end, it has sample scripts that illustrates the
+usage/wrapping of RRDTool within Shell/Perl.
RDtool is GNU licensed software developed by Tobies Oetiker, a system
+manager at the Swiss Federal Institute of Technology. Though it is a
+database, there are distinct differences between RRDtool database and other
+databases as listed below:
+
+
+RRDTool stores data; that makes it a back end tool. The RRDtool command set
+allows the creation of graphs; that makes it a front end tool as well. Other
+databases just stores data and can not create graphs.
+
+
+In case of linear databases, new data gets appended at the bottom of
+the database table. Thus its size keeps on increasing, whereas size of an RRDtool
+database is determined at creation time. Imagine an RRDtool database as the
+perimeter of a circle. Data is added along the perimeter. When new data
+reaches the starting point, it overwrites existing data. This way, the size of
+an RRDtool database always remains constant. The name ``Round Robin'' stems from this
+attribute.
+
+
+Other databases store the values as supplied. RRDtool can be configured to
+calculate the rate of change from the previous to the current value and
+store this information instead.
+
+
+Other databases get updated when values are supplied. The RRDTool database
+is structured in such a way that it needs data at predefined time
+intervals. If it does not get a new value during the interval, it stores an
+UNKNOWN value for that interval. So, when using the RRDTool database, it is
+imperative to use scripts that runs at regular intervals to ensure a constant
+data flow to update the RRDTool database.
+
+
RRDtool has a lot to do with time. With every data update, it also needs to
+know the time when that update occurred. Time is always expressed in
+seconds passed since epoch (01-01-1971). RRDTool can be installed on Unix as
+well as Windows. It has command set to carry out various
+operations on rrd database. This command set can be accessed from the command line,
+and from shell or perl scripts. The scripts
+act as wrappers for accessing data stored in RRDtool database.
The structure of an RRD database is different than other linear databases.
+Other databases define tables with columns, and many other parameters. These
+definitions sometime are very complex, especially in large databases.
+RRDTool databases are primarily used for monitoring purposes and
+hence are very simple in structure. The parameters
+that need to be defined are variables that hold values and archives of those
+values. Being time sensitive, a couple of time related parameters are also
+defined. Because of its structure, the definition of an RRDTool database also
+includes a provision to specify specific actions to take in the absence of
+update values. Data structure (DS), heartbeat, data structure type, round
+robin archive (RRA), and consolidation function (CF) are some of the
+terminologies related to RRDTool databases.
+
The structure of a database and the terminology associated with it can be
+best explained with an example.
This example creates a database named target.rrd. Start time (1023654125) is
+specified in total number of seconds since epoch (time in seconds since
+01-01-1970). While updating the database, update time is also specified.
+This update time MUST occur after start time and MUST be in seconds since
+epoch.
+
The step of 300 seconds indicates that database expects new values every
+300 seconds. The wrapper script should be scheduled to run every step
+seconds so that it updates the database every step seconds.
+
DS (data structure) is the actual variable which relates to the parameter on
+the device that has to be monitored. Its syntax is
+
+ DS:variable_name:DST:heartbeat:min:max
+
DS is a key word. variable_name is a name under which the parameter is
+saved in database. There can be as many DSs in a database as needed. After
+every step interval, a new value of DS is supplied to update the database.
+This value is also called as Primary Data Point (PDP). In our example
+mentioned above, a new PDP is generated every 300 seconds.
+
Note, that if you do NOT supply new datapoints exaclty every 300 seconds,
+this is not problem, RRDTool will interpolate the data accordingly.
+
DST (data structure type) defines type of DS. It can be COUNTER, DERIVE,
+ABSOLUTE, GAUGE. A DS declared as COUNTER will save the rate of change of
+the value over a step period. This assumes that the value is always
+increasing (difference between last two values is more than 0). Traffic
+counters on a router is an ideal candidate for using COUNTER as DST. DERIVE
+is same as COUNTER but it allows negative values as well. If you want to see
+the rate of change in free diskspace on your server, then you might want to
+use the DERIVE data type. ABSOULTE also saves the rate of change but it assumes
+that previous value is set to 0. The difference between current and previous
+value is always equal to the current value. So, it stores the current value divided
+by step interval (300 seconds in our example). GAUGE does not save the rate of
+change. It saves the actual value itself. There are no
+divisions/calculations. Memory consumption in a server is an ideal
+example of gauge. Difference among different types DSTs can be explained
+better with following example:
The next parameter is heartbeat. In our example, heartbeat is 600
+seconds. If database doesn not get a new PDP within 300
+seconds, it will wait for another 300 seconds (total 600 seconds).
+If it doesnt receive any PDP with in 600 seconds, it will save an UNKNOWN value
+into database. This UNKOWN value is a special feature of RRDTool - it is
+much better than to assume a missing value was 0 (zero).
+For example, the traffic flow counter on a router
+keeps on increasing. Lets say, a value is missed for an interval and 0 is stored
+instead of UNKNOWN. Now when next value becomes available, it will calculate
+difference between current value and previous value (0) which is not
+correct. So, inserting value UNKNOWN makes much more sense here.
+
The next two parameters are the minimum and maximum value respectively. If variable
+to be stored has predictable maximum and minimum value, this should be
+specified here. Any update value falling out of this range will be saved as
+UNKNOWN.
+
The next line declares a round robin archive (RRA). The syntax for declaring an RRA is
+
+ RRA:CF:xff:step:rows
+
RRA is the keyword to declare RRAs. The consolidation function (CF) can be
+AVERAGE, MINIMUM, MAXIMUM, and LAST. The concept of the consolidated data point (CDP)
+comes into the picture here. A CDP is CFed (averaged, maximum/minimum value or
+last value) from step number of PDPs. This RRA will hold rows CDPs.
+
Lets have a look at the example above. For the first RRA, 12 (steps) PDPs
+(DS variables) are AVERAGEed (CF) to form one CDP. 24 (rows) of theses CDPs
+are archived. Each PDP occurs at 300 seconds. 12 PDPs represent 12 times 300
+seconds which is 1 hour. It means 1 CDP (which is equal to 12 PDPs)
+represents data worth 1 hour. 24 such CDPs represent 1 day (1 hour times 24
+CDPs). It means, this RRA is an archive for one day. After 24 CDPs, CDP
+number 25 will replace the 1st CDP. Second RRA saves 31 CDPs; each CPD
+represents an AVERAGE value for a day (288 PDPs, each covering 300 seconds =
+24 hours). Therefore this RRA is an archive for one month. A single database
+can have many RRAs. If there are multiple DSs, each individual RRA will save
+data for all the DSes in the database. For example, if a database has 3 DSs;
+and daily, weekly, monthly, and yearly RRAs are declared, then each RRA will
+hold data from all 3 data sources.
Another important feature of RRDTool is its ability to create graphs. The
+``graph'' command uses ``fetch'' command internally to retrieve values from the
+database. With the retrieved values, it draws graphs as defined by the
+parameters supplied on the command line. A single graph can show different
+DS (variables) from within a database. It is also possible to show the
+values from more than one databases into a single graph. Often, it is
+necessary to perform some math on the values retrieved from database, before
+plotting them. For example, in SNMP replies, memory consumption values are
+usually specified in KBytes and traffic flow on interfaces is specified in
+Bytes. Graphs for these values will be more senseful if values are
+represented in MBytes and mbps. the RRDTool graph command allows to define
+such conversions. Apart from mathematical calculations, it is also possible
+to peform logical operations such as greater than, less than, and if then
+else. If a database contains more than one RRA archive, then a question may
+arise - how does RRDTool decide which RRA archive to use for retrieving the
+values? RRDtool takes looks at several things when making its choice. First
+it makes sure that the RRA covers as much of the graphing time frame as
+possible. Second it looks at the resolution of the RRA compared to the
+resolution of the graph. It tries to find one which has the same or better
+resolution. With the ``-r'' option you can force RRDtool to assume a different
+resolution than the one calculated from the pixel width of the graph.
+
Values of different variables can be presented in 5 different shapes in a
+graph - AREA, LINE1, LINE2, LINE3, and STACK. AREA is represented by a solid
+colored area with values as the boundary of this area. LINE1/2/3 (increasing
+width) are just plain lines representing the values. STACK is also an area
+but it is ``stack''ed on AREA or LINE1/2/3. Another important thing to note,
+is that variables are plotted in the order they are defined in graph
+command. So, care must be taken to define STACK only after defining
+AREA/LINE. It is also possible to put formatted comments within the graph.
+Detailed instructions be found under graph manual.
After understanding RRDTool, it is now a time to actually use RRDTool in
+scripts. Tasks involved in network management are data collection, data
+storage, and data retrieval. In the following example,
+the previously created target.rrd database is used. Data collection and data
+storage is done using Shell scrip. Data retrieval
+and report generation is done using Perl script. These
+scripts are as shown below:
+ #!/bin/sh
+ a=0
+ while [ "$a" == 0 ]; do
+ snmpwalk -c public 192.168.1.250 hrSWRunPerfMem > snmp_reply
+ total_mem=`awk 'BEGIN {tot_mem=0}
+ { if ($NF == "KBytes")
+ {tot_mem=tot_mem+$(NF-1)}
+ }
+ END {print tot_mem}' snmp_reply`
+ # I can use N as a replacement for the current time
+ rrdtool update target.rrd N:$total_mem
+ # sleep until the next 300 seconds are full
+ perl -e 'sleep 300 - time % 300'
+ done # end of while loop
+ #!/usr/bin/perl -w
+ #This script fetch data from target.rrd, creates graph of memory consumption
+ on target (Dual P3 Processor 1 GHz, 656 MB RAM)
+
+ #calling RRD perl module
+ use lib qw( /usr/local/rrdtool-1.0.41/lib/perl ../lib/perl );
+ use RRDs;
+ my $cur_time = time(); # setting current time
+ my $end_time = $cur_time - 86400; # setting end time to 24 hours behind current time
+ my $start_time = $end_time - 2592000; # setting start time to 30 days from end time
+
+ #fetching average values from rrd database between start and end time
+ my ($start,$step,$ds_names,$data) =
+ RRDs::fetch("target.rrd", "AVERAGE",
+ "-r", "600", "-s", "$start_time", "-e", "$end_time");
+ #saving fetched values in 2-dimensional array
+ my $rows = 0;
+ my $columns = 0;
+ my $time_variable = $start;
+ foreach $line (@$data) {
+ $vals[$rows][$columns] = $time_variable;
+ $time_variable = $time_variable + $step;
+ foreach $val (@$line) {
+ $vals[$rows][++$columns] = $val;}
+ $rows++;
+ $columns = 0;
+ }
+ my $tot_time = 0;
+ my $count = 0;
+ #saving values from 2-dimensional into 1-dimensional array
+ for $i ( 0 .. $#vals )
+ $tot_mem[$count] = $vals[$i][1];
+ $count++;
+ }
+ my $tot_mem_sum = 0;
+ #calculating total of all values
+ for $i ( 0 .. ($count-1) ) {
+ $tot_mem_sum = $tot_mem_sum + $tot_mem[$i];
+ }
+ #calculating average of array
+ my $tot_mem_ave = $tot_mem_sum/($count);
+ #creating graph
+ RRDs::graph ("/images/mem_$count.gif", \
+ "--title= Memory Usage", \
+ "--vertical-label=Memory Consumption (MB)", \
+ "--start=$start_time", \
+ "--end=$end_time", \
+ "--color=BACK#CCCCCC", \
+ "--color=CANVAS#CCFFFF", \
+ "--color=SHADEB#9999CC", \
+ "--height=125", \
+ "--upper-limit=656", \
+ "--lower-limit=0", \
+ "--rigid", \
+ "--base=1024", \
+ "DEF:tot_mem=target.rrd:mem:AVERAGE", \
+ "CDEF:correct_tot_mem=tot_mem,0,671744,LIMIT,UN,0,tot_mem,IF,1024,/",\
+ "CDEF:machine_mem=tot_mem,656,+,tot_mem,-",\
+ "COMMENT:Memory Consumption between $start_time",\
+ "COMMENT: and $end_time ",\
+ "HRULE:656#000000:Maximum Available Memory - 656 MB",\
+ "AREA:machine_mem#CCFFFF:Memory Unused", \
+ "AREA:correct_tot_mem#6699CC:Total memory consumed in MB");
+ my $err=RRDs::error;
+ if ($err) {print "problem generating the graph: $err\n";}
+ #printing the output
+ print "Average memory consumption is ";
+ printf "%5.2f",$tot_mem_ave/1024;
+ print " MB. Graphical representation can be found at /images/mem_$count.gif.";
+
+
+
+
Added: trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.pod
==============================================================================
--- (empty file)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.pod Thu Jul 3 16:26:45 2003
@@ -0,0 +1,316 @@
+=head1 NAME
+
+rrd-beginners - Beginners guide
+
+=head1 SYNOPSIS
+
+Helping new RRDTool users to understand the basics of RRDTool
+
+=head1 DESCRIPTION
+
+This manual is an attempt to assist beginners in understanding the concepts
+of RRDTool. It sheds a light on differences between RRDTool and other
+databases. With help of an example, it explains structure of RRDTool
+database. This is followed by an overview of the "graph" feature of RRDTool.
+At the end, it has sample scripts that illustrates the
+usage/wrapping of RRDTool within Shell/Perl.
+
+=head2 What makes RRDTool so special?
+
+RDtool is GNU licensed software developed by Tobies Oetiker, a system
+manager at the Swiss Federal Institute of Technology. Though it is a
+database, there are distinct differences between RRDtool database and other
+databases as listed below:
+
+=over
+
+=item *
+
+RRDTool stores data; that makes it a back end tool. The RRDtool command set
+allows the creation of graphs; that makes it a front end tool as well. Other
+databases just stores data and can not create graphs.
+
+=item *
+
+In case of linear databases, new data gets appended at the bottom of
+the database table. Thus its size keeps on increasing, whereas size of an RRDtool
+database is determined at creation time. Imagine an RRDtool database as the
+perimeter of a circle. Data is added along the perimeter. When new data
+reaches the starting point, it overwrites existing data. This way, the size of
+an RRDtool database always remains constant. The name "Round Robin" stems from this
+attribute.
+
+=item *
+
+Other databases store the values as supplied. RRDtool can be configured to
+calculate the rate of change from the previous to the current value and
+store this information instead.
+
+=item *
+
+Other databases get updated when values are supplied. The RRDTool database
+is structured in such a way that it needs data at predefined time
+intervals. If it does not get a new value during the interval, it stores an
+UNKNOWN value for that interval. So, when using the RRDTool database, it is
+imperative to use scripts that runs at regular intervals to ensure a constant
+data flow to update the RRDTool database.
+
+=back
+
+RRDtool has a lot to do with time. With every data update, it also needs to
+know the time when that update occurred. Time is always expressed in
+seconds passed since epoch (01-01-1971). RRDTool can be installed on Unix as
+well as Windows. It has command set to carry out various
+operations on rrd database. This command set can be accessed from the command line,
+and from shell or perl scripts. The scripts
+act as wrappers for accessing data stored in RRDtool database.
+
+=head2 Understanding by an example
+
+The structure of an RRD database is different than other linear databases.
+Other databases define tables with columns, and many other parameters. These
+definitions sometime are very complex, especially in large databases.
+RRDTool databases are primarily used for monitoring purposes and
+hence are very simple in structure. The parameters
+that need to be defined are variables that hold values and archives of those
+values. Being time sensitive, a couple of time related parameters are also
+defined. Because of its structure, the definition of an RRDTool database also
+includes a provision to specify specific actions to take in the absence of
+update values. Data structure (DS), heartbeat, data structure type, round
+robin archive (RRA), and consolidation function (CF) are some of the
+terminologies related to RRDTool databases.
+
+The structure of a database and the terminology associated with it can be
+best explained with an example.
+
+ rrdtool create target.rrd
+ --start 1023654125
+ --step 300
+ DS:mem:GAUGE:600:0:671744
+ RRA:AVERAGE:0.5:12:24
+ RRA:AVERAGE:0.5:288:31
+
+This example creates a database named F. Start time (1023654125) is
+specified in total number of seconds since epoch (time in seconds since
+01-01-1970). While updating the database, update time is also specified.
+This update time MUST occur after start time and MUST be in seconds since
+epoch.
+
+The step of 300 seconds indicates that database expects new values every
+300 seconds. The wrapper script should be scheduled to run every B
+seconds so that it updates the database every B seconds.
+
+DS (data structure) is the actual variable which relates to the parameter on
+the device that has to be monitored. Its syntax is
+
+ DS:variable_name:DST:heartbeat:min:max
+
+B is a key word. C is a name under which the parameter is
+saved in database. There can be as many DSs in a database as needed. After
+every step interval, a new value of DS is supplied to update the database.
+This value is also called as Primary Data Point B<(PDP)>. In our example
+mentioned above, a new PDP is generated every 300 seconds.
+
+Note, that if you do NOT supply new datapoints exaclty every 300 seconds,
+this is not problem, RRDTool will interpolate the data accordingly.
+
+B (data structure type) defines type of DS. It can be COUNTER, DERIVE,
+ABSOLUTE, GAUGE. A DS declared as COUNTER will save the rate of change of
+the value over a step period. This assumes that the value is always
+increasing (difference between last two values is more than 0). Traffic
+counters on a router is an ideal candidate for using COUNTER as DST. DERIVE
+is same as COUNTER but it allows negative values as well. If you want to see
+the rate of I in free diskspace on your server, then you might want to
+use the DERIVE data type. ABSOULTE also saves the rate of change but it assumes
+that previous value is set to 0. The difference between current and previous
+value is always equal to the current value. So, it stores the current value divided
+by step interval (300 seconds in our example). GAUGE does not save the rate of
+change. It saves the actual value itself. There are no
+divisions/calculations. Memory consumption in a server is an ideal
+example of gauge. Difference among different types DSTs can be explained
+better with following example:
+
+ Values = 300, 600, 900, 1200
+ Step = 300 seconds
+ COUNTER DS = 1, 1, 1, 1
+ DERIVE DS = 1, 1, 1, 1
+ ABSOLUTE DS = 1, 2, 3, 4
+ GAUGE DS = 300, 600, 900, 1200
+
+The next parameter is B. In our example, heartbeat is 600
+seconds. If database doesn not get a new PDP within 300
+seconds, it will wait for another 300 seconds (total 600 seconds).
+If it doesnt receive any PDP with in 600 seconds, it will save an UNKNOWN value
+into database. This UNKOWN value is a special feature of RRDTool - it is
+much better than to assume a missing value was 0 (zero).
+For example, the traffic flow counter on a router
+keeps on increasing. Lets say, a value is missed for an interval and 0 is stored
+instead of UNKNOWN. Now when next value becomes available, it will calculate
+difference between current value and previous value (0) which is not
+correct. So, inserting value UNKNOWN makes much more sense here.
+
+The next two parameters are the minimum and maximum value respectively. If variable
+to be stored has predictable maximum and minimum value, this should be
+specified here. Any update value falling out of this range will be saved as
+UNKNOWN.
+
+The next line declares a round robin archive (RRA). The syntax for declaring an RRA is
+
+ RRA:CF:xff:step:rows
+
+RRA is the keyword to declare RRAs. The consolidation function (CF) can be
+AVERAGE, MINIMUM, MAXIMUM, and LAST. The concept of the consolidated data point (CDP)
+comes into the picture here. A CDP is CFed (averaged, maximum/minimum value or
+last value) from I number of PDPs. This RRA will hold I CDPs.
+
+Lets have a look at the example above. For the first RRA, 12 (steps) PDPs
+(DS variables) are AVERAGEed (CF) to form one CDP. 24 (rows) of theses CDPs
+are archived. Each PDP occurs at 300 seconds. 12 PDPs represent 12 times 300
+seconds which is 1 hour. It means 1 CDP (which is equal to 12 PDPs)
+represents data worth 1 hour. 24 such CDPs represent 1 day (1 hour times 24
+CDPs). It means, this RRA is an archive for one day. After 24 CDPs, CDP
+number 25 will replace the 1st CDP. Second RRA saves 31 CDPs; each CPD
+represents an AVERAGE value for a day (288 PDPs, each covering 300 seconds =
+24 hours). Therefore this RRA is an archive for one month. A single database
+can have many RRAs. If there are multiple DSs, each individual RRA will save
+data for all the DSes in the database. For example, if a database has 3 DSs;
+and daily, weekly, monthly, and yearly RRAs are declared, then each RRA will
+hold data from all 3 data sources.
+
+=head2 Graphical Magic
+
+Another important feature of RRDTool is its ability to create graphs. The
+"graph" command uses "fetch" command internally to retrieve values from the
+database. With the retrieved values, it draws graphs as defined by the
+parameters supplied on the command line. A single graph can show different
+DS (variables) from within a database. It is also possible to show the
+values from more than one databases into a single graph. Often, it is
+necessary to perform some math on the values retrieved from database, before
+plotting them. For example, in SNMP replies, memory consumption values are
+usually specified in KBytes and traffic flow on interfaces is specified in
+Bytes. Graphs for these values will be more senseful if values are
+represented in MBytes and mbps. the RRDTool graph command allows to define
+such conversions. Apart from mathematical calculations, it is also possible
+to peform logical operations such as greater than, less than, and if then
+else. If a database contains more than one RRA archive, then a question may
+arise - how does RRDTool decide which RRA archive to use for retrieving the
+values? RRDtool takes looks at several things when making its choice. First
+it makes sure that the RRA covers as much of the graphing time frame as
+possible. Second it looks at the resolution of the RRA compared to the
+resolution of the graph. It tries to find one which has the same or better
+resolution. With the "-r" option you can force RRDtool to assume a different
+resolution than the one calculated from the pixel width of the graph.
+
+Values of different variables can be presented in 5 different shapes in a
+graph - AREA, LINE1, LINE2, LINE3, and STACK. AREA is represented by a solid
+colored area with values as the boundary of this area. LINE1/2/3 (increasing
+width) are just plain lines representing the values. STACK is also an area
+but it is "stack"ed on AREA or LINE1/2/3. Another important thing to note,
+is that variables are plotted in the order they are defined in graph
+command. So, care must be taken to define STACK only after defining
+AREA/LINE. It is also possible to put formatted comments within the graph.
+Detailed instructions be found under graph manual.
+
+=head2 Wrapping RRDTool within Shell/Perl script
+
+After understanding RRDTool, it is now a time to actually use RRDTool in
+scripts. Tasks involved in network management are data collection, data
+storage, and data retrieval. In the following example,
+the previously created target.rrd database is used. Data collection and data
+storage is done using Shell scrip. Data retrieval
+and report generation is done using Perl script. These
+scripts are as shown below:
+
+=head3 Shell script (collects data, updates database)
+
+ #!/bin/sh
+ a=0
+ while [ "$a" == 0 ]; do
+ snmpwalk -c public 192.168.1.250 hrSWRunPerfMem > snmp_reply
+ total_mem=`awk 'BEGIN {tot_mem=0}
+ { if ($NF == "KBytes")
+ {tot_mem=tot_mem+$(NF-1)}
+ }
+ END {print tot_mem}' snmp_reply`
+ # I can use N as a replacement for the current time
+ rrdtool update target.rrd N:$total_mem
+ # sleep until the next 300 seconds are full
+ perl -e 'sleep 300 - time % 300'
+ done # end of while loop
+
+=head3 Perl script (retrieves data from database and generates graphs and statistics)
+
+ #!/usr/bin/perl -w
+ #This script fetch data from target.rrd, creates graph of memory consumption
+ on target (Dual P3 Processor 1 GHz, 656 MB RAM)
+
+ #calling RRD perl module
+ use lib qw( /usr/local/rrdtool-1.0.41/lib/perl ../lib/perl );
+ use RRDs;
+ my $cur_time = time(); # setting current time
+ my $end_time = $cur_time - 86400; # setting end time to 24 hours behind current time
+ my $start_time = $end_time - 2592000; # setting start time to 30 days from end time
+
+ #fetching average values from rrd database between start and end time
+ my ($start,$step,$ds_names,$data) =
+ RRDs::fetch("target.rrd", "AVERAGE",
+ "-r", "600", "-s", "$start_time", "-e", "$end_time");
+ #saving fetched values in 2-dimensional array
+ my $rows = 0;
+ my $columns = 0;
+ my $time_variable = $start;
+ foreach $line (@$data) {
+ $vals[$rows][$columns] = $time_variable;
+ $time_variable = $time_variable + $step;
+ foreach $val (@$line) {
+ $vals[$rows][++$columns] = $val;}
+ $rows++;
+ $columns = 0;
+ }
+ my $tot_time = 0;
+ my $count = 0;
+ #saving values from 2-dimensional into 1-dimensional array
+ for $i ( 0 .. $#vals )
+ $tot_mem[$count] = $vals[$i][1];
+ $count++;
+ }
+ my $tot_mem_sum = 0;
+ #calculating total of all values
+ for $i ( 0 .. ($count-1) ) {
+ $tot_mem_sum = $tot_mem_sum + $tot_mem[$i];
+ }
+ #calculating average of array
+ my $tot_mem_ave = $tot_mem_sum/($count);
+ #creating graph
+ RRDs::graph ("/images/mem_$count.gif", \
+ "--title= Memory Usage", \
+ "--vertical-label=Memory Consumption (MB)", \
+ "--start=$start_time", \
+ "--end=$end_time", \
+ "--color=BACK#CCCCCC", \
+ "--color=CANVAS#CCFFFF", \
+ "--color=SHADEB#9999CC", \
+ "--height=125", \
+ "--upper-limit=656", \
+ "--lower-limit=0", \
+ "--rigid", \
+ "--base=1024", \
+ "DEF:tot_mem=target.rrd:mem:AVERAGE", \
+ "CDEF:correct_tot_mem=tot_mem,0,671744,LIMIT,UN,0,tot_mem,IF,1024,/",\
+ "CDEF:machine_mem=tot_mem,656,+,tot_mem,-",\
+ "COMMENT:Memory Consumption between $start_time",\
+ "COMMENT: and $end_time ",\
+ "HRULE:656#000000:Maximum Available Memory - 656 MB",\
+ "AREA:machine_mem#CCFFFF:Memory Unused", \
+ "AREA:correct_tot_mem#6699CC:Total memory consumed in MB");
+ my $err=RRDs::error;
+ if ($err) {print "problem generating the graph: $err\n";}
+ #printing the output
+ print "Average memory consumption is ";
+ printf "%5.2f",$tot_mem_ave/1024;
+ print " MB. Graphical representation can be found at /images/mem_$count.gif.";
+
+=head1 AUTHOR
+
+Ketan Patel Ek2pattu at yahoo.comE
+
Added: trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.txt
==============================================================================
--- (empty file)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrd-beginners.txt Thu Jul 3 16:26:45 2003
@@ -0,0 +1,395 @@
+RRD-BEGINNERS(1) rrdtool RRD-BEGINNERS(1)
+
+
+
+NNAAMMEE
+ rrd-beginners - Beginners guide
+
+SSYYNNOOPPSSIISS
+ Helping new RRDTool users to understand the basics of RRD-
+ Tool
+
+DDEESSCCRRIIPPTTIIOONN
+ This manual is an attempt to assist beginners in under-
+ standing the concepts of RRDTool. It sheds a light on dif-
+ ferences between RRDTool and other databases. With help of
+ an example, it explains structure of RRDTool database.
+ This is followed by an overview of the "graph" feature of
+ RRDTool. At the end, it has sample scripts that illus-
+ trates the usage/wrapping of RRDTool within Shell/Perl.
+
+ WWhhaatt mmaakkeess RRRRDDTTooooll ssoo ssppeecciiaall??
+
+ RDtool is GNU licensed software developed by Tobies
+ Oetiker, a system manager at the Swiss Federal Institute
+ of Technology. Though it is a database, there are distinct
+ differences between RRDtool database and other databases
+ as listed below:
+
+ +o RRDTool stores data; that makes it a back end tool.
+ The RRDtool command set allows the creation of graphs;
+ that makes it a front end tool as well. Other
+ databases just stores data and can not create graphs.
+
+ +o In case of linear databases, new data gets appended at
+ the bottom of the database table. Thus its size keeps
+ on increasing, whereas size of an RRDtool database is
+ determined at creation time. Imagine an RRDtool
+ database as the perimeter of a circle. Data is added
+ along the perimeter. When new data reaches the start-
+ ing point, it overwrites existing data. This way, the
+ size of an RRDtool database always remains constant.
+ The name "Round Robin" stems from this attribute.
+
+ +o Other databases store the values as supplied. RRDtool
+ can be configured to calculate the rate of change from
+ the previous to the current value and store this
+ information instead.
+
+ +o Other databases get updated when values are supplied.
+ The RRDTool database is structured in such a way that
+ it needs data at predefined time intervals. If it does
+ not get a new value during the interval, it stores an
+ UNKNOWN value for that interval. So, when using the
+ RRDTool database, it is imperative to use scripts that
+ runs at regular intervals to ensure a constant data
+ flow to update the RRDTool database.
+
+ RRDtool has a lot to do with time. With every data update,
+ it also needs to know the time when that update occurred.
+ Time is always expressed in seconds passed since epoch
+ (01-01-1971). RRDTool can be installed on Unix as well as
+ Windows. It has command set to carry out various opera-
+ tions on rrd database. This command set can be accessed
+ from the command line, and from shell or perl scripts. The
+ scripts act as wrappers for accessing data stored in RRD-
+ tool database.
+
+ UUnnddeerrssttaannddiinngg bbyy aann eexxaammppllee
+
+ The structure of an RRD database is different than other
+ linear databases. Other databases define tables with
+ columns, and many other parameters. These definitions
+ sometime are very complex, especially in large databases.
+ RRDTool databases are primarily used for monitoring pur-
+ poses and hence are very simple in structure. The parame-
+ ters that need to be defined are variables that hold val-
+ ues and archives of those values. Being time sensitive, a
+ couple of time related parameters are also defined.
+ Because of its structure, the definition of an RRDTool
+ database also includes a provision to specify specific
+ actions to take in the absence of update values. Data
+ structure (DS), heartbeat, data structure type, round
+ robin archive (RRA), and consolidation function (CF) are
+ some of the terminologies related to RRDTool databases.
+
+ The structure of a database and the terminology associated
+ with it can be best explained with an example.
+
+ rrdtool create target.rrd
+ --start 1023654125
+ --step 300
+ DS:mem:GAUGE:600:0:671744
+ RRA:AVERAGE:0.5:12:24
+ RRA:AVERAGE:0.5:288:31
+
+ This example creates a database named _t_a_r_g_e_t_._r_r_d. Start
+ time (1023654125) is specified in total number of seconds
+ since epoch (time in seconds since 01-01-1970). While
+ updating the database, update time is also specified.
+ This update time MUST occur after start time and MUST be
+ in seconds since epoch.
+
+ The step of 300 seconds indicates that database expects
+ new values every 300 seconds. The wrapper script should be
+ scheduled to run every sstteepp seconds so that it updates the
+ database every sstteepp seconds.
+
+ DS (data structure) is the actual variable which relates
+ to the parameter on the device that has to be monitored.
+ Its syntax is
+
+ DS:variable_name:DST:heartbeat:min:max
+
+ DDSS is a key word. "variable_name" is a name under which
+ the parameter is saved in database. There can be as many
+ DSs in a database as needed. After every step interval, a
+ new value of DS is supplied to update the database. This
+ value is also called as Primary Data Point ((PPDDPP)). In our
+ example mentioned above, a new PDP is generated every 300
+ seconds.
+
+ Note, that if you do NOT supply new datapoints exaclty
+ every 300 seconds, this is not problem, RRDTool will
+ interpolate the data accordingly.
+
+ DDSSTT (data structure type) defines type of DS. It can be
+ COUNTER, DERIVE, ABSOLUTE, GAUGE. A DS declared as COUNTER
+ will save the rate of change of the value over a step
+ period. This assumes that the value is always increasing
+ (difference between last two values is more than 0). Traf-
+ fic counters on a router is an ideal candidate for using
+ COUNTER as DST. DERIVE is same as COUNTER but it allows
+ negative values as well. If you want to see the rate of
+ _c_h_a_n_g_e in free diskspace on your server, then you might
+ want to use the DERIVE data type. ABSOULTE also saves the
+ rate of change but it assumes that previous value is set
+ to 0. The difference between current and previous value is
+ always equal to the current value. So, it stores the cur-
+ rent value divided by step interval (300 seconds in our
+ example). GAUGE does not save the rate of change. It saves
+ the actual value itself. There are no divisions/calcula-
+ tions. Memory consumption in a server is an ideal example
+ of gauge. Difference among different types DSTs can be
+ explained better with following example:
+
+ Values = 300, 600, 900, 1200
+ Step = 300 seconds
+ COUNTER DS = 1, 1, 1, 1
+ DERIVE DS = 1, 1, 1, 1
+ ABSOLUTE DS = 1, 2, 3, 4
+ GAUGE DS = 300, 600, 900, 1200
+
+ The next parameter is hheeaarrttbbeeaatt. In our example, heartbeat
+ is 600 seconds. If database doesn not get a new PDP within
+ 300 seconds, it will wait for another 300 seconds (total
+ 600 seconds). If it doesnt receive any PDP with in 600
+ seconds, it will save an UNKNOWN value into database. This
+ UNKOWN value is a special feature of RRDTool - it is much
+ better than to assume a missing value was 0 (zero). For
+ example, the traffic flow counter on a router keeps on
+ increasing. Lets say, a value is missed for an interval
+ and 0 is stored instead of UNKNOWN. Now when next value
+ becomes available, it will calculate difference between
+ current value and previous value (0) which is not correct.
+ So, inserting value UNKNOWN makes much more sense here.
+
+ The next two parameters are the minimum and maximum value
+ respectively. If variable to be stored has predictable
+ maximum and minimum value, this should be specified here.
+ Any update value falling out of this range will be saved
+ as UNKNOWN.
+
+ The next line declares a round robin archive (RRA). The
+ syntax for declaring an RRA is
+
+ RRA:CF:xff:step:rows
+
+ RRA is the keyword to declare RRAs. The consolidation
+ function (CF) can be AVERAGE, MINIMUM, MAXIMUM, and LAST.
+ The concept of the consolidated data point (CDP) comes
+ into the picture here. A CDP is CFed (averaged, maxi-
+ mum/minimum value or last value) from _s_t_e_p number of PDPs.
+ This RRA will hold _r_o_w_s CDPs.
+
+ Lets have a look at the example above. For the first RRA,
+ 12 (steps) PDPs (DS variables) are AVERAGEed (CF) to form
+ one CDP. 24 (rows) of theses CDPs are archived. Each PDP
+ occurs at 300 seconds. 12 PDPs represent 12 times 300 sec-
+ onds which is 1 hour. It means 1 CDP (which is equal to 12
+ PDPs) represents data worth 1 hour. 24 such CDPs represent
+ 1 day (1 hour times 24 CDPs). It means, this RRA is an
+ archive for one day. After 24 CDPs, CDP number 25 will
+ replace the 1st CDP. Second RRA saves 31 CDPs; each CPD
+ represents an AVERAGE value for a day (288 PDPs, each cov-
+ ering 300 seconds = 24 hours). Therefore this RRA is an
+ archive for one month. A single database can have many
+ RRAs. If there are multiple DSs, each individual RRA will
+ save data for all the DSes in the database. For example,
+ if a database has 3 DSs; and daily, weekly, monthly, and
+ yearly RRAs are declared, then each RRA will hold data
+ from all 3 data sources.
+
+ GGrraapphhiiccaall MMaaggiicc
+
+ Another important feature of RRDTool is its ability to
+ create graphs. The "graph" command uses "fetch" command
+ internally to retrieve values from the database. With the
+ retrieved values, it draws graphs as defined by the param-
+ eters supplied on the command line. A single graph can
+ show different DS (variables) from within a database. It
+ is also possible to show the values from more than one
+ databases into a single graph. Often, it is necessary to
+ perform some math on the values retrieved from database,
+ before plotting them. For example, in SNMP replies, memory
+ consumption values are usually specified in KBytes and
+ traffic flow on interfaces is specified in Bytes. Graphs
+ for these values will be more senseful if values are rep-
+ resented in MBytes and mbps. the RRDTool graph command
+ allows to define such conversions. Apart from mathematical
+ calculations, it is also possible to peform logical opera-
+ tions such as greater than, less than, and if then else.
+ If a database contains more than one RRA archive, then a
+ question may arise - how does RRDTool decide which RRA
+ archive to use for retrieving the values? RRDtool takes
+ looks at several things when making its choice. First it
+ makes sure that the RRA covers as much of the graphing
+ time frame as possible. Second it looks at the resolution
+ of the RRA compared to the resolution of the graph. It
+ tries to find one which has the same or better resolution.
+ With the "-r" option you can force RRDtool to assume a
+ different resolution than the one calculated from the
+ pixel width of the graph.
+
+ Values of different variables can be presented in 5 dif-
+ ferent shapes in a graph - AREA, LINE1, LINE2, LINE3, and
+ STACK. AREA is represented by a solid colored area with
+ values as the boundary of this area. LINE1/2/3 (increasing
+ width) are just plain lines representing the values. STACK
+ is also an area but it is "stack"ed on AREA or LINE1/2/3.
+ Another important thing to note, is that variables are
+ plotted in the order they are defined in graph command.
+ So, care must be taken to define STACK only after defining
+ AREA/LINE. It is also possible to put formatted comments
+ within the graph. Detailed instructions be found under
+ graph manual.
+
+ WWrraappppiinngg RRRRDDTTooooll wwiitthhiinn SShheellll//PPeerrll ssccrriipptt
+
+ After understanding RRDTool, it is now a time to actually
+ use RRDTool in scripts. Tasks involved in network manage-
+ ment are data collection, data storage, and data
+ retrieval. In the following example, the previously cre-
+ ated target.rrd database is used. Data collection and data
+ storage is done using Shell scrip. Data retrieval and
+ report generation is done using Perl script. These scripts
+ are as shown below:
+
+ _S_h_e_l_l _s_c_r_i_p_t _(_c_o_l_l_e_c_t_s _d_a_t_a_, _u_p_d_a_t_e_s _d_a_t_a_b_a_s_e_)
+
+
+
+
+
+
+ #!/bin/sh
+ a=0
+ while [ "$a" == 0 ]; do
+ snmpwalk -c public 192.168.1.250 hrSWRunPerfMem > snmp_reply
+ total_mem=`awk 'BEGIN {tot_mem=0}
+ { if ($NF == "KBytes")
+ {tot_mem=tot_mem+$(NF-1)}
+ }
+ END {print tot_mem}' snmp_reply`
+ # I can use N as a replacement for the current time
+ rrdtool update target.rrd N:$total_mem
+ # sleep until the next 300 seconds are full
+ perl -e 'sleep 300 - time % 300'
+ done # end of while loop
+
+ _P_e_r_l _s_c_r_i_p_t _(_r_e_t_r_i_e_v_e_s _d_a_t_a _f_r_o_m _d_a_t_a_b_a_s_e _a_n_d _g_e_n_e_r_a_t_e_s
+ _g_r_a_p_h_s _a_n_d _s_t_a_t_i_s_t_i_c_s_)
+
+ #!/usr/bin/perl -w
+ #This script fetch data from target.rrd, creates graph of memory consumption
+ on target (Dual P3 Processor 1 GHz, 656 MB RAM)
+
+ #calling RRD perl module
+ use lib qw( /usr/local/rrdtool-1.0.41/lib/perl ../lib/perl );
+ use RRDs;
+ my $cur_time = time(); # setting current time
+ my $end_time = $cur_time - 86400; # setting end time to 24 hours behind current time
+ my $start_time = $end_time - 2592000; # setting start time to 30 days from end time
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #fetching average values from rrd database between start and end time
+ my ($start,$step,$ds_names,$data) =
+ RRDs::fetch("target.rrd", "AVERAGE",
+ "-r", "600", "-s", "$start_time", "-e", "$end_time");
+ #saving fetched values in 2-dimensional array
+ my $rows = 0;
+ my $columns = 0;
+ my $time_variable = $start;
+ foreach $line (@$data) {
+ $vals[$rows][$columns] = $time_variable;
+ $time_variable = $time_variable + $step;
+ foreach $val (@$line) {
+ $vals[$rows][++$columns] = $val;}
+ $rows++;
+ $columns = 0;
+ }
+ my $tot_time = 0;
+ my $count = 0;
+ #saving values from 2-dimensional into 1-dimensional array
+ for $i ( 0 .. $#vals )
+ $tot_mem[$count] = $vals[$i][1];
+ $count++;
+ }
+ my $tot_mem_sum = 0;
+ #calculating total of all values
+ for $i ( 0 .. ($count-1) ) {
+ $tot_mem_sum = $tot_mem_sum + $tot_mem[$i];
+ }
+ #calculating average of array
+ my $tot_mem_ave = $tot_mem_sum/($count);
+ #creating graph
+ RRDs::graph ("/images/mem_$count.gif", \
+ "--title= Memory Usage", \
+ "--vertical-label=Memory Consumption (MB)", \
+ "--start=$start_time", \
+ "--end=$end_time", \
+ "--color=BACK#CCCCCC", \
+ "--color=CANVAS#CCFFFF", \
+ "--color=SHADEB#9999CC", \
+ "--height=125", \
+ "--upper-limit=656", \
+ "--lower-limit=0", \
+ "--rigid", \
+ "--base=1024", \
+ "DEF:tot_mem=target.rrd:mem:AVERAGE", \
+ "CDEF:correct_tot_mem=tot_mem,0,671744,LIMIT,UN,0,tot_mem,IF,1024,/",\
+ "CDEF:machine_mem=tot_mem,656,+,tot_mem,-",\
+ "COMMENT:Memory Consumption between $start_time",\
+ "COMMENT: and $end_time ",\
+ "HRULE:656#000000:Maximum Available Memory - 656 MB",\
+ "AREA:machine_mem#CCFFFF:Memory Unused", \
+ "AREA:correct_tot_mem#6699CC:Total memory consumed in MB");
+ my $err=RRDs::error;
+ if ($err) {print "problem generating the graph: $err\n";}
+ #printing the output
+ print "Average memory consumption is ";
+ printf "%5.2f",$tot_mem_ave/1024;
+ print " MB. Graphical representation can be found at /images/mem_$count.gif.";
+
+AAUUTTHHOORR
+ Ketan Patel
+
+
+
+1.0.43 2003-06-25 RRD-BEGINNERS(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.html
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdcgi.html (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.html Thu Jul 3 16:26:45 2003
@@ -49,7 +49,7 @@
is to run as a cgi-program and parse a web page template containing special
<RRD:: tags. rrdcgi will interpret and act according to these tags.
In the end it will printout a web page including the necessary CGI headers.
-
rrdcgi parses the contents of the template in 2 steps. In each step it looks
+
rrdcgi parses the contents of the template in 3 steps. In each step it looks
only for a subset of tags. This allows to nest tags.
The argument parser uses the same semantics as you are used from your c shell.
@@ -139,6 +139,17 @@
This gets replaced by the current time of day. The
time is strftime-formated with the string specified in the argument.
+
+This gets replaced by a strftime-formatted time using the format
+strftime-format on either start-spec or end-spec depending on
+whether START or END is specified. Both start-spec and end-spec
+must be supplied as either could be relative to the other. This is intended
+to allow pretty titles on graphs with times that are easier for non rrdtool
+folks to figure out than ``-2weeks''.
+
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.pod
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdcgi.pod (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.pod Thu Jul 3 16:26:45 2003
@@ -16,7 +16,7 @@
ERRD:: tags. B will interpret and act according to these tags.
In the end it will printout a web page including the necessary CGI headers.
-B parses the contents of the template in 2 steps. In each step it looks
+B parses the contents of the template in 3 steps. In each step it looks
only for a subset of tags. This allows to nest tags.
The argument parser uses the same semantics as you are used from your c shell.
@@ -93,6 +93,15 @@
This gets replaced by the current time of day. The
time is I-formated with the string specified in the argument.
+=item RRD::TIME::STRFTIME I I I I
+
+This gets replaced by a strftime-formatted time using the format
+I on either I or I depending on
+whether I or I is specified. Both I and I
+must be supplied as either could be relative to the other. This is intended
+to allow pretty titles on graphs with times that are easier for non rrdtool
+folks to figure out than "-2weeks".
+
=back
=head2 Pass 3
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdcgi.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdcgi.txt Thu Jul 3 16:26:45 2003
@@ -17,7 +17,7 @@
will printout a web page including the necessary CGI head-
ers.
- rrrrddccggii parses the contents of the template in 2 steps. In
+ rrrrddccggii parses the contents of the template in 3 steps. In
each step it looks only for a subset of tags. This allows
to nest tags.
@@ -86,6 +86,17 @@
time is _s_t_r_f_t_i_m_e-formated with the string speci-
fied in the argument.
+ RRD::TIME::STRFTIME _S_T_A_R_T_|_E_N_D _s_t_a_r_t_-_s_p_e_c _e_n_d_-_s_p_e_c _s_t_r_f_-
+ _t_i_m_e_-_f_o_r_m_a_t
+ This gets replaced by a strftime-formatted time
+ using the format _s_t_r_f_t_i_m_e_-_f_o_r_m_a_t on either _s_t_a_r_t_-
+ _s_p_e_c or _e_n_d_-_s_p_e_c depending on whether _S_T_A_R_T or _E_N_D
+ is specified. Both _s_t_a_r_t_-_s_p_e_c and _e_n_d_-_s_p_e_c must
+ be supplied as either could be relative to the
+ other. This is intended to allow pretty titles on
+ graphs with times that are easier for non rrdtool
+ folks to figure out than "-2weeks".
+
PPaassss 33
@@ -123,13 +134,6 @@
The example below creates a web pages with a single RRD
graph.
-
-
-
-
-
-
-
#!/usr/local/bin/rrdcgi
RRDCGI Demo
@@ -199,3 +203,4 @@
+1.0.43 2003-05-20 RRDCGI(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdcreate.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdcreate.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdcreate.txt Thu Jul 3 16:26:45 2003
@@ -248,4 +248,4 @@
-1.0.42 2002-12-20 RRDCREATE(1)
+1.0.43 2002-12-20 RRDCREATE(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrddump.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrddump.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrddump.txt Thu Jul 3 16:26:45 2003
@@ -24,4 +24,4 @@
-1.0.42 2002-02-26 RRDDUMP(1)
+1.0.43 2002-02-26 RRDDUMP(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.html
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdfetch.html (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.html Thu Jul 3 16:26:45 2003
@@ -251,7 +251,7 @@
931225537 -- 18:45 July 5th, 1999
(yes, seconds since 1970 are valid as well)
19970703 12:45 -- 12:45 July 3th, 1997
-(not quote standard, but I love this ...)
+(my favorite, and its even got an ISO number (8601))
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.pod
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdfetch.pod (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.pod Thu Jul 3 16:26:45 2003
@@ -248,8 +248,7 @@
(yes, seconds since 1970 are valid as well)
I<19970703 12:45> -- 12:45 July 3th, 1997
-(not quote standard, but I love this ...)
-
+(my favorite, and its even got an ISO number (8601))
=head1 AUTHOR
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdfetch.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdfetch.txt Thu Jul 3 16:26:45 2003
@@ -241,12 +241,12 @@
_9_3_1_2_2_5_5_3_7 -- 18:45 July 5th, 1999 (yes, seconds since
1970 are valid as well)
- _1_9_9_7_0_7_0_3 _1_2_:_4_5 -- 12:45 July 3th, 1997 (not quote stan-
- dard, but I love this ...)
+ _1_9_9_7_0_7_0_3 _1_2_:_4_5 -- 12:45 July 3th, 1997 (my favorite, and
+ its even got an ISO number (8601))
AAUUTTHHOORR
Tobias Oetiker
-1.0.42 2002-07-31 RRDFETCH(1)
+1.0.43 2003-04-16 RRDFETCH(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdgraph.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdgraph.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdgraph.txt Thu Jul 3 16:26:45 2003
@@ -639,4 +639,4 @@
-1.0.42 2003-02-19 RRDGRAPH(1)
+1.0.43 2003-02-19 RRDGRAPH(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdinfo.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdinfo.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdinfo.txt Thu Jul 3 16:26:45 2003
@@ -56,4 +56,4 @@
-1.0.42 2002-02-26 RRDINFO(1)
+1.0.43 2002-02-26 RRDINFO(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdlast.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdlast.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdlast.txt Thu Jul 3 16:26:45 2003
@@ -21,4 +21,4 @@
-1.0.42 2002-02-26 RRDLAST(1)
+1.0.43 2002-02-26 RRDLAST(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdresize.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdresize.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdresize.txt Thu Jul 3 16:26:45 2003
@@ -44,4 +44,4 @@
-1.0.42 2002-07-05 RRDRESIZE(1)
+1.0.43 2002-07-05 RRDRESIZE(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdrestore.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdrestore.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdrestore.txt Thu Jul 3 16:26:45 2003
@@ -29,4 +29,4 @@
-1.0.42 2002-02-26 RRDRESTORE(1)
+1.0.43 2002-02-26 RRDRESTORE(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdtool.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdtool.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdtool.txt Thu Jul 3 16:26:45 2003
@@ -202,4 +202,4 @@
-1.0.42 2002-11-29 RRDTOOL(1)
+1.0.43 2002-11-29 RRDTOOL(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdtune.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdtune.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdtune.txt Thu Jul 3 16:26:45 2003
@@ -64,4 +64,4 @@
-1.0.42 2002-02-26 RRDTUNE(1)
+1.0.43 2002-02-26 RRDTUNE(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdtutorial.es.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdtutorial.es.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdtutorial.es.txt Thu Jul 3 16:26:45 2003
@@ -1262,4 +1262,4 @@
-1.0.42 2003-01-20 RRDTUTORIAL.ES(1)
+1.0.43 2003-01-20 RRDTUTORIAL.ES(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdtutorial.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdtutorial.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdtutorial.txt Thu Jul 3 16:26:45 2003
@@ -1241,4 +1241,4 @@
-1.0.42 2003-02-27 RRDTUTORIAL(1)
+1.0.43 2003-02-27 RRDTUTORIAL(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdupdate.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdupdate.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdupdate.txt Thu Jul 3 16:26:45 2003
@@ -72,4 +72,4 @@
-1.0.42 2002-02-26 RRDUPDATE(1)
+1.0.43 2002-02-26 RRDUPDATE(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/doc/rrdxport.txt
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/doc/rrdxport.txt (original)
+++ trunk/orca/packages/rrdtool-1.0.43/doc/rrdxport.txt Thu Jul 3 16:26:45 2003
@@ -125,4 +125,4 @@
-1.0.42 2002-05-29 RRDXPORT(1)
+1.0.43 2002-05-29 RRDXPORT(1)
Modified: trunk/orca/packages/rrdtool-1.0.43/perl-piped/RRDp.pm
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/perl-piped/RRDp.pm (original)
+++ trunk/orca/packages/rrdtool-1.0.43/perl-piped/RRDp.pm Thu Jul 3 16:26:45 2003
@@ -110,7 +110,7 @@
sub end ();
sub read ();
-$VERSION = 1.000421 ;
+$VERSION = 1.000431 ;
sub start ($){
croak "rrdtool is already running"
Modified: trunk/orca/packages/rrdtool-1.0.43/perl-shared/RRDs.pm
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/perl-shared/RRDs.pm (original)
+++ trunk/orca/packages/rrdtool-1.0.43/perl-shared/RRDs.pm Thu Jul 3 16:26:45 2003
@@ -7,7 +7,7 @@
require DynaLoader;
-$VERSION = 1.000421;
+$VERSION = 1.000431;
bootstrap RRDs $VERSION;
Modified: trunk/orca/packages/rrdtool-1.0.43/rrdtool.spec
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/rrdtool.spec (original)
+++ trunk/orca/packages/rrdtool-1.0.43/rrdtool.spec Thu Jul 3 16:26:45 2003
@@ -5,7 +5,7 @@
Summary: RRDtool - round robin database
Name: rrdtool
-Version: 1.0.41
+Version: 1.0.43
Release: 1.%{DISTRO_REL}
Copyright: GPL
Group: Applications/Databases
Modified: trunk/orca/packages/rrdtool-1.0.43/src/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/Makefile.in (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/Makefile.in Thu Jul 3 16:26:45 2003
@@ -384,6 +384,7 @@
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
+diff_test.o: diff_test.c
gdpng.lo gdpng.o : gdpng.c ../libpng-1.0.9/png.h ../zlib-1.1.4/zlib.h \
../zlib-1.1.4/zconf.h ../libpng-1.0.9/pngconf.h ../gd1.3/gd.h
getopt.lo getopt.o : getopt.c ../config/config.h getopt.h
@@ -398,8 +399,7 @@
rrd_format.h ../gd1.3/gd.h ../cgilib-0.4/cgi.h
rrd_create.lo rrd_create.o : rrd_create.c rrd_tool.h ../config/config.h \
rrd.h getopt.h rrd_format.h ../gd1.3/gd.h
-rrd_diff.lo rrd_diff.o : rrd_diff.c rrd_tool.h ../config/config.h rrd.h \
- getopt.h rrd_format.h ../gd1.3/gd.h
+rrd_diff.lo rrd_diff.o : rrd_diff.c
rrd_dump.lo rrd_dump.o : rrd_dump.c rrd_tool.h ../config/config.h rrd.h \
getopt.h rrd_format.h ../gd1.3/gd.h
rrd_error.lo rrd_error.o : rrd_error.c rrd_tool.h ../config/config.h \
Modified: trunk/orca/packages/rrdtool-1.0.43/src/gdpng.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/gdpng.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/gdpng.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* gdpng.c add PNG output routine to gd library
*****************************************************************************/
Modified: trunk/orca/packages/rrdtool-1.0.43/src/gifsize.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/gifsize.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/gifsize.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
****************************************************************************
* gifsize.c provides the function gifsize which determines the size of a gif
****************************************************************************/
@@ -52,7 +52,7 @@
static int DoExtension (FILE *fd, int label, int *Transparent);
static int GetDataBlock (FILE *fd, unsigned char *buf);
-int ZeroDataBlock;
+int gifsize_ZeroDataBlock;
int
GifSize(FILE *fd, long *width, long *height)
@@ -68,7 +68,7 @@
unsigned char ColorMap[3][MAXCOLORMAPSIZE];
int imageCount = 0;
char version[4];
- ZeroDataBlock = FALSE;
+ gifsize_ZeroDataBlock = FALSE;
imageNumber = 1;
if (! ReadOK(fd,buf,6)) {
@@ -185,7 +185,7 @@
return -1;
}
- ZeroDataBlock = count == 0;
+ gifsize_ZeroDataBlock = count == 0;
if ((count != 0) && (! ReadOK(fd, buf, count))) {
return -1;
Modified: trunk/orca/packages/rrdtool-1.0.43/src/pngsize.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/pngsize.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/pngsize.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* pngsize.c determine the size of a PNG image
*****************************************************************************/
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd.h (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd.h Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997,1998, 1999
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997,1998, 1999
*****************************************************************************
* rrdlib.h Public header file for librrd
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_cgi.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_cgi.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_cgi.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_cgi.c RRD Web Page Generator
*****************************************************************************/
@@ -56,6 +56,9 @@
/* for how long is the output of the cgi valid ? */
char* rrdgoodfor(long, char **);
+/* format at-time specified times using strftime */
+char* printstrftime(long, char**);
+
/** http protocol needs special format, and GMT time **/
char *http_time(time_t *);
@@ -160,6 +163,7 @@
i += parse(&buffer,i,"= 1) {
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_create.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_create.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_create.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_create.c creates new rrds
*****************************************************************************/
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_diff.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_diff.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_diff.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1999
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1999
* This code is stolen from rateup (mrtg-2.x) by Dave Rand
*****************************************************************************
* diff calculate the difference between two very long integers available as
@@ -24,8 +24,13 @@
*
*****************************************************************************/
-#include "rrd_tool.h"
-
+/* #include "rrd_tool.h" */
+#define LAST_DS_LEN 100
+#define DNAN 0.0/0;
+#define max(a,b) ((a) > (b) ? (a) : (b))
+#include
+#include
+#include
double
rrd_diff(char *a, char *b)
{
@@ -66,13 +71,11 @@
r1[1] = 0; /* Null terminate result */
c = 0;
for (x=0; x= a && b1 >= b) {
- *r1 = ((*a1 - c) - *b1) + '0';
- } else if (a1 >= a) {
- *r1 = (*a1 - c);
- } else {
- *r1 = ('0' - *b1 - c) + '0';
- }
+ /* we want to avoid reading off the edge of the string */
+ char save_a,save_b;
+ save_a = ( a1 >= a) ? *a1 : '0';
+ save_b = ( b1 >= b) ? *b1 : '0';
+ *r1 = save_a - save_b - c + '0';
if (*r1 < '0') {
*r1 += 10;
c=1;
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_dump.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_dump.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_dump.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_dump Display a RRD
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_error.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_error.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_error.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_error.c Common Header File
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_fetch.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_fetch.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_fetch.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_fetch.c read date from an rrd to use for further processing
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_format.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_format.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_format.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1999
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1999
*****************************************************************************
* rrd_format.c RRD Database Format helper functions
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_format.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_format.h (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_format.h Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997, 1998, 1999
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997, 1998, 1999
*****************************************************************************
* rrd_format.h RRD Database Format header
*****************************************************************************/
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_graph.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_graph.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_graph.c Thu Jul 3 16:26:45 2003
@@ -1,6 +1,6 @@
/****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
****************************************************************************
* rrd__graph.c make creates ne rrds
****************************************************************************/
@@ -175,9 +175,19 @@
}
}
-
-
+/* allocate colors with re-use */
+
+int color_allocate(gdImagePtr im, int r, int g, int b) {
+
+ int color;
+ if ((color = gdImageColorExact(im, r, g, b)) != -1) {
+ return(color);
+ }
+
+ return(gdImageColorAllocate(im, r, g, b));
+}
+
/* conversion function for symbolic entry names */
@@ -2352,9 +2362,9 @@
}
gdImageColorTransparent(brush,
- gdImageColorAllocate(brush, 0, 0, 0));
+ color_allocate(brush, 0, 0, 0));
- pen = gdImageColorAllocate(brush,
+ pen = color_allocate(brush,
im->gdes[cosel].col.red,
im->gdes[cosel].col.green,
im->gdes[cosel].col.blue);
@@ -2395,7 +2405,7 @@
{c2 = gdImageGetPixel(img,i1,i2); /* get pixel */
if (copy_white || img->red[c2] != 255 || img->green[c2] != 255 || img->blue[c2] != 255)
{if ((c1 = gdImageColorExact(gif,img->red[c2],img->green[c2],img->blue[c2])) < 0)
- if ((c1 = gdImageColorAllocate(gif,img->red[c2],img->green[c2],img->blue[c2])) < 0)
+ if ((c1 = color_allocate(gif,img->red[c2],img->green[c2],img->blue[c2])) < 0)
c1 = gdImageColorClosest(gif,img->red[c2],img->green[c2],img->blue[c2]);
gdImageSetPixel(gif,i1,i2,c1);
}
@@ -2517,13 +2527,13 @@
/* check for user override values */
if(im->graph_col[i].red != -1)
graph_col[i].i =
- gdImageColorAllocate( gif,
+ color_allocate( gif,
im->graph_col[i].red,
im->graph_col[i].green,
im->graph_col[i].blue);
else
graph_col[i].i =
- gdImageColorAllocate( gif,
+ color_allocate( gif,
graph_col[i].red,
graph_col[i].green,
graph_col[i].blue);
@@ -2534,7 +2544,7 @@
/* only for elements which have a color defined */
if (im->gdes[i].col.red != -1)
im->gdes[i].col.i =
- gdImageColorAllocate(gif,
+ color_allocate(gif,
im->gdes[i].col.red,
im->gdes[i].col.green,
im->gdes[i].col.blue);
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_graph.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_graph.h (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_graph.h Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
****************************************************************************
* rrd__graph.h
****************************************************************************/
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_info.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_info.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_info.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_info Get Information about the configuration of an RRD
*****************************************************************************/
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_last.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_last.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_last.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_last.c
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_open.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_open.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_open.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_open.c Open an RRD File
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_resize.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_resize.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_resize.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_resize.c Alters size of an RRA
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_restore.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_restore.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_restore.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_restore.c creates new rrd from data dumped by rrd_dump.c
*****************************************************************************/
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_tool.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_tool.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_tool.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2001
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2001
*****************************************************************************
* rrd_tool.c Startup wrapper
*****************************************************************************/
@@ -20,7 +20,7 @@
{
char help_main[] =
- "RRDtool 1.0.42 Copyright 1997-2001 by Tobias Oetiker \n\n"
+ "RRDtool 1.0.43 Copyright 1997-2001 by Tobias Oetiker \n\n"
"Usage: rrdtool [options] command command_options\n\n";
char help_list[] =
@@ -319,7 +319,7 @@
strcmp("v", argv[1]) == 0 ||
strcmp("-v", argv[1]) == 0 ||
strcmp("-version", argv[1]) == 0 )
- printf("RRDtool 1.0.42 Copyright (C) 1997-2001 by Tobias Oetiker \n");
+ printf("RRDtool 1.0.43 Copyright (C) 1997-2001 by Tobias Oetiker \n");
else if (strcmp("restore", argv[1]) == 0)
rrd_restore(argc-1, &argv[1]);
else if (strcmp("resize", argv[1]) == 0)
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_tool.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_tool.h (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_tool.h Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_tool.h Common Header File
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_tune.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_tune.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_tune.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* change header parameters of an rrd
*****************************************************************************
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_update.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_update.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_update.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/*****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
*****************************************************************************
* rrd_update.c RRD Update Function
*****************************************************************************
@@ -32,7 +32,7 @@
main(int argc, char **argv){
rrd_update(argc,argv);
if (rrd_test_error()) {
- printf("RRDtool 1.0.42 Copyright 1997-2000 by Tobias Oetiker \n\n"
+ printf("RRDtool 1.0.43 Copyright 1997-2000 by Tobias Oetiker \n\n"
"Usage: rrdupdate filename\n"
"\t\t\t[--template|-t ds-name:ds-name:...]\n"
"\t\t\ttime|N:value[:value...]\n\n"
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_xport.c
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_xport.c (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_xport.c Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
****************************************************************************
* rrd_xport.c export RRD data
****************************************************************************/
Modified: trunk/orca/packages/rrdtool-1.0.43/src/rrd_xport.h
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/src/rrd_xport.h (original)
+++ trunk/orca/packages/rrdtool-1.0.43/src/rrd_xport.h Thu Jul 3 16:26:45 2003
@@ -1,5 +1,5 @@
/****************************************************************************
- * RRDtool 1.0.42 Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.0.43 Copyright Tobias Oetiker, 1997 - 2000
****************************************************************************
* rrd_xport.h contains XML related constants
****************************************************************************/
Modified: trunk/orca/packages/rrdtool-1.0.43/tcl/Makefile.am
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/tcl/Makefile.am (original)
+++ trunk/orca/packages/rrdtool-1.0.43/tcl/Makefile.am Thu Jul 3 16:26:45 2003
@@ -10,6 +10,7 @@
TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
TCL_PACKAGE_PATH = $(DESTDIR)@TCL_PACKAGE_PATH@
+TCL_LIB_FILE = tclrrd.$(VERSION)$(TCL_SHLIB_SUFFIX)
TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
GD_LIB_DIR = $(top_srcdir)/@GD_LIB_DIR@
@@ -20,20 +21,20 @@
if COMP_TCL
-tclrrd$(TCL_SHLIB_SUFFIX): tclrrd.o
- $(TCL_SHLIB_LD) $(LIBDIRS) $< -o $@ -lrrd_private -lm
+$(TCL_LIB_FILE): tclrrd.o
+ $(TCL_SHLIB_LD) $(LIBDIRS) $< -o $@ -lrrd_private -lm -ltcl
tclrrd.o: tclrrd.c
$(CC) $(CFLAGS) $(TCL_SHLIB_CFLAGS) $(INCLUDES) -c $< -DVERSION=\"$(VERSION)\"
-all-local: tclrrd$(TCL_SHLIB_SUFFIX)
+all-local: $(TCL_LIB_FILE)
-tcl-install: tclrrd$(TCL_SHLIB_SUFFIX)
- cp tclrrd$(TCL_SHLIB_SUFFIX) $(TCL_PACKAGE_PATH)/tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)
- if [ ! -d $(TCL_PACKAGE_PATH)/tclrrd$(VERSION) ] ; then \
- mkdir $(TCL_PACKAGE_PATH)/tclrrd$(VERSION) ; \
+tcl-install: $(TCL_LIB_FILE)
+ cp $(TCL_LIB_FILE) $(TCL_PACKAGE_PATH)/$(TCL_LIB_FILE)
+ if [ ! -d $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION) ] ; then \
+ mkdir $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION) ; \
fi
- echo "package ifneeded Rrd $(VERSION) [list load [file join \$$dir .. tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)]]" > $(TCL_PACKAGE_PATH)/tclrrd$(VERSION)/pkgIndex.tcl
+ echo "package ifneeded Rrd $(VERSION) [list load [file join \$$dir .. $(TCL_LIB_FILE)]]" > $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION)/pkgIndex.tcl
else
Modified: trunk/orca/packages/rrdtool-1.0.43/tcl/Makefile.in
==============================================================================
--- trunk/orca/packages/rrdtool-1.0.42/tcl/Makefile.in (original)
+++ trunk/orca/packages/rrdtool-1.0.43/tcl/Makefile.in Thu Jul 3 16:26:45 2003
@@ -90,6 +90,7 @@
TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
TCL_PACKAGE_PATH = $(DESTDIR)@TCL_PACKAGE_PATH@
+TCL_LIB_FILE = tclrrd.$(VERSION)$(TCL_SHLIB_SUFFIX)
TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
GD_LIB_DIR = $(top_srcdir)/@GD_LIB_DIR@
@@ -200,20 +201,20 @@
mostlyclean distclean maintainer-clean
- at COMP_TCL_TRUE@tclrrd$(TCL_SHLIB_SUFFIX): tclrrd.o
- at COMP_TCL_TRUE@ $(TCL_SHLIB_LD) $(LIBDIRS) $< -o $@ -lrrd_private -lm
+ at COMP_TCL_TRUE@$(TCL_LIB_FILE): tclrrd.o
+ at COMP_TCL_TRUE@ $(TCL_SHLIB_LD) $(LIBDIRS) $< -o $@ -lrrd_private -lm -ltcl
@COMP_TCL_TRUE at tclrrd.o: tclrrd.c
@COMP_TCL_TRUE@ $(CC) $(CFLAGS) $(TCL_SHLIB_CFLAGS) $(INCLUDES) -c $< -DVERSION=\"$(VERSION)\"
- at COMP_TCL_TRUE@all-local: tclrrd$(TCL_SHLIB_SUFFIX)
+ at COMP_TCL_TRUE@all-local: $(TCL_LIB_FILE)
- at COMP_TCL_TRUE@tcl-install: tclrrd$(TCL_SHLIB_SUFFIX)
- at COMP_TCL_TRUE@ cp tclrrd$(TCL_SHLIB_SUFFIX) $(TCL_PACKAGE_PATH)/tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)
- at COMP_TCL_TRUE@ if [ ! -d $(TCL_PACKAGE_PATH)/tclrrd$(VERSION) ] ; then \
- at COMP_TCL_TRUE@ mkdir $(TCL_PACKAGE_PATH)/tclrrd$(VERSION) ; \
+ at COMP_TCL_TRUE@tcl-install: $(TCL_LIB_FILE)
+ at COMP_TCL_TRUE@ cp $(TCL_LIB_FILE) $(TCL_PACKAGE_PATH)/$(TCL_LIB_FILE)
+ at COMP_TCL_TRUE@ if [ ! -d $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION) ] ; then \
+ at COMP_TCL_TRUE@ mkdir $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION) ; \
@COMP_TCL_TRUE@ fi
- at COMP_TCL_TRUE@ echo "package ifneeded Rrd $(VERSION) [list load [file join \$$dir .. tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)]]" > $(TCL_PACKAGE_PATH)/tclrrd$(VERSION)/pkgIndex.tcl
+ at COMP_TCL_TRUE@ echo "package ifneeded Rrd $(VERSION) [list load [file join \$$dir .. $(TCL_LIB_FILE)]]" > $(TCL_PACKAGE_PATH)/tclrrd.$(VERSION)/pkgIndex.tcl
@COMP_TCL_FALSE at all-local:
From blair at orcaware.com Mon Jul 14 21:14:59 2003
From: blair at orcaware.com (Blair Zajac)
Date: Mon, 14 Jul 2003 21:14:59 -0700
Subject: [Orca-checkins] rev 243 - in trunk/orca: . packages/Time-HiRes-1.48
packages/Time-HiRes-1.49
Message-ID: <200307150414.h6F4Exmq025865@orcaware.com>
Author: blair
Date: Mon Jul 14 21:14:56 2003
New Revision: 243
Added:
trunk/orca/packages/Time-HiRes-1.49/
- copied from rev 242, trunk/orca/packages/Time-HiRes-1.48/
Removed:
trunk/orca/packages/Time-HiRes-1.48/
Modified:
trunk/orca/INSTALL
trunk/orca/configure.in
trunk/orca/packages/Time-HiRes-1.49/Changes
trunk/orca/packages/Time-HiRes-1.49/HiRes.pm
trunk/orca/packages/Time-HiRes-1.49/HiRes.xs
trunk/orca/packages/Time-HiRes-1.49/Makefile.PL
Log:
Upgrade Time::HiRes from 1.48 to 1.49.
* INSTALL (Determine which Perl modules need compiling and installing):
Update all references to Time::HiRes's version number from 1.48 to
1.49.
* configure.in:
Bump Time::HiRes's version number to 1.49.
* packages/Time-HiRes-1.49:
Renamed from packages/Time-HiRes-1.48. Directory contents updated
from Time-HiRes-1.49.tar.gz.
Modified: trunk/orca/INSTALL
==============================================================================
--- trunk/orca/INSTALL (original)
+++ trunk/orca/INSTALL Mon Jul 14 21:14:56 2003
@@ -177,7 +177,7 @@
Math::IntervalSearch >= 1.05 >= 1.05 1.05
RRDs >= 1.000431 >= 1.0.43 1.0.43
Storable >= 2.07 >= 2.07 2.07
- Time::HiRes Not required by Orca 1.48
+ Time::HiRes Not required by Orca 1.49
All seven of these modules are included with the Orca distribution
in the packages directory. When you configure Orca in step 3),
@@ -278,10 +278,10 @@
Time::HiRes
- http://www.perl.com/CPAN/authors/id/J/JH/JHI/Time-HiRes-1.48.tar.gz
+ http://www.perl.com/CPAN/authors/id/J/JH/JHI/Time-HiRes-1.49.tar.gz
- % gunzip -c Time-HiRes-1.48.tar.gz | tar xvf -
- % cd Time-HiRes-1.48
+ % gunzip -c Time-HiRes-1.49.tar.gz | tar xvf -
+ % cd Time-HiRes-1.49
% perl Makefile.PL
% make
% make test
Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in (original)
+++ trunk/orca/configure.in Mon Jul 14 21:14:56 2003
@@ -41,8 +41,8 @@
RRDTOOL_VER=1.000431
STORABLE_DIR=Storable-2.07
STORABLE_VER=2.07
-TIME_HIRES_DIR=Time-HiRes-1.48
-TIME_HIRES_VER=1.48
+TIME_HIRES_DIR=Time-HiRes-1.49
+TIME_HIRES_VER=1.49
AC_SUBST(COMPRESS_ZLIB_DIR)
AC_SUBST(DATA_DUMPER_DIR)
Modified: trunk/orca/packages/Time-HiRes-1.49/Changes
==============================================================================
--- trunk/orca/packages/Time-HiRes-1.48/Changes (original)
+++ trunk/orca/packages/Time-HiRes-1.49/Changes Mon Jul 14 21:14:56 2003
@@ -1,5 +1,10 @@
Revision history for Perl extension Time::HiRes.
+1.49
+ - UVuf for non-IVSIZE platforms (from Keiichiro Nagano)
+ - OS/2 can always mix subsecond sleeps with signals
+ (part of perl change #19789)
+
1.48
- workaround for buggy gcc 2.95.3 in openbsd/sparc64
(perl change #19592)
Modified: trunk/orca/packages/Time-HiRes-1.49/HiRes.pm
==============================================================================
--- trunk/orca/packages/Time-HiRes-1.48/HiRes.pm (original)
+++ trunk/orca/packages/Time-HiRes-1.49/HiRes.pm Mon Jul 14 21:14:56 2003
@@ -15,7 +15,7 @@
d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer
d_nanosleep);
-$VERSION = '1.48';
+$VERSION = '1.49';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
Modified: trunk/orca/packages/Time-HiRes-1.49/HiRes.xs
==============================================================================
--- trunk/orca/packages/Time-HiRes-1.48/HiRes.xs (original)
+++ trunk/orca/packages/Time-HiRes-1.49/HiRes.xs Mon Jul 14 21:14:56 2003
@@ -45,6 +45,7 @@
# endif
# else
# define IVdf "ld"
+# define UVuf "lu"
# endif
#endif
Modified: trunk/orca/packages/Time-HiRes-1.49/Makefile.PL
==============================================================================
--- trunk/orca/packages/Time-HiRes-1.48/Makefile.PL (original)
+++ trunk/orca/packages/Time-HiRes-1.49/Makefile.PL Mon Jul 14 21:14:56 2003
@@ -14,6 +14,8 @@
my $LIBS;
my $XSOPT;
+my $ld_exeext = ($^O eq 'os2' and $Config{ldflags} =~ /-Zexe\b/) ? '.exe' : '';
+
unless($ENV{PERL_CORE}) {
$ENV{PERL_CORE} = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV;
}
@@ -139,10 +141,11 @@
}
else
{
+ my $tmp_exe = "$tmp$ld_exeext";
printf "cccmd = $cccmd\n" if $VERBOSE;
- system($cccmd);
- $ok = -s $tmp && -x _;
- unlink("$tmp.c", $tmp);
+ my $res = system($cccmd);
+ $ok = defined($res) && $res==0 && -s $tmp_exe && -x _;
+ unlink("$tmp.c", $tmp_exe);
}
}
@@ -367,7 +370,8 @@
print "You can mix subsecond sleeps with signals.\n";
} else {
print "NOT found.\n";
- print "You cannot mix subsecond sleeps with signals.\n";
+ my $nt = ($^O eq 'os2' ? '' : 'not');
+ print "You can$nt mix subsecond sleeps with signals.\n";
}
if ($DEFINE) {
From blair at orcaware.com Tue Jul 15 22:02:36 2003
From: blair at orcaware.com (Blair Zajac)
Date: Tue, 15 Jul 2003 22:02:36 -0700
Subject: [Orca-checkins] rev 244 - trunk/orca/data_gatherers/orcallator
Message-ID: <200307160502.h6G52aIW022701@orcaware.com>
Author: blair
Date: Tue Jul 15 22:02:17 2003
New Revision: 244
Modified:
trunk/orca/data_gatherers/orcallator/orcallator.se (contents, props changed)
Log:
* data_gatherers/orcallator/orcallator.se:
Only define MAX_RAWDISKS if it is not already defined.
Remove all modification history and use the Subversion revision
number to track versions of this file. Set `svn:keywords' to
`HeadURL LastChangedBy LastChangedDate LastChangedRevision' and
use them.
Modified: trunk/orca/data_gatherers/orcallator/orcallator.se
==============================================================================
--- trunk/orca/data_gatherers/orcallator/orcallator.se (original)
+++ trunk/orca/data_gatherers/orcallator/orcallator.se Tue Jul 15 22:02:17 2003
@@ -8,330 +8,13 @@
//
// Portions copied from percollator.se written by Adrian Cockroft.
//
-// Version 1.40: Feb 23, 2003 John Langner
-// john_langner at ne.3com.com
-// Posted to orca-user list on Oct 25, 2000
-// with Subject "Re: Interest in more disk based
-// statistics"
-// Add disk service time data collection.
+// $HeadURL$
+// $LastChangedDate$
+// $LastChangedBy$
+// $LastChangedRevision$
//
-// Version 1.39: Feb 18, 2003 Burkhardt Schopp
-// B.Schopp at gmx.de
-// Modified struct RawDisk long_name object to
-// 48 characters to handle T3 disks names.
-//
-// Version 1.38: Jan 14, 2003 Additions by Sean O'Neill
-// Added several new variables for Orca to collect
-// and graph including:
-// pgrec/s - page reclaims (include pageout)
-// pgfrec/s - page reclaims from free list
-// pgin/s - pageins
-// pages_in/s - pages paged in
-// pgout/s - pageouts
-// pages_out/s - pages paged out
-// dfree/s - pages freed by daemon or auto
-// min_fault/s - minor page faults
-// (pvm.hat_fault + pvm.as_fault)
-// maj_fault/s - major page faults
-// prot_fault/s - protection faults
-// cow_fault/s - copy-on-write faults
-// zfod/s - zero-fill-on-demand faults
-// interrupts/s - interrupts including clock
-// intrthreads/s - interrupts as threads
-// (below clock)
-// system_calls/s
-// context_switches/s
-// invol_switches/s - involuntary context switches
-// traps/s
-// forks/s
-// vforks/s
-// execs/s
-// namei/s - pathname lookups
-// ufsiget/s - ufs_iget() calls
-// ufsdirblk/s - directory blocks read
-// ufsinopage/s - inodes taken with no attached
-// pages
-//
-// Version 1.37: Dec 28, 2002 Improved algorithm in raw_disk_map() which
-// detects the end of the GLOBAL_disk_info array.
-// To deal with occasions when the first disk is a
-// CD-ROM and the second disk is an unmounted
-// CD-ROM, revise the check in raw_disk_map() to
-// detect both the first and second disk mentioned
-// in GLOBAL_disk_info. Patch contributed by Alan
-// LeGrand .
-// Version 1.36: Dec 17, 2002 Add measurements for tape (st) devices. These
-// tape measurements are only taken when the
-// RAWDISK code is enabled. The new measurements
-// include system wide tape reads and writes per
-// second (tape_rd/s and tape_wr/s), system wide
-// tape transfer rate (tape_rK/s and tape_wK/s),
-// and tape run percent (tape_runp_*). Patch
-// contributed by Liston Bias .
-// Version 1.35: Aug 11, 2002 Add a new measurement, the number of secure web
-// server processes on the system using the
-// column name #httpsds. If the environmental
-// variable WEB_SERVER_SECURE is defined, use its
-// value as the regular expression to match on
-// process names. If WEB_SERVER_SECURE is not
-// defined, then count the number of httpsd's.
-// Increase the maximum number of disks that can
-// be monitored using the RAWDISK code from 512 to
-// 1024 by increasing MAX_RAWDISKS from 512 to
-// 1024. Reformat and modify the usage message to
-// fit the new WEB_SERVER_SECURE environmental
-// variable.
-// Version 1.34: Jul 14, 2002 Support for SE version 3.3. Break
-// compatibility with SE version 3.1, which was
-// released in April 1999, and older SE versions.
-// Solaris 8 removed the pagesio variable and in
-// SE 3.3, kstat.se #ifdef's out ks_system_pages's
-// pagesio variable on Solaris 8 and above, so now
-// orcallator.se only measures pagesio on Solaris
-// 7 or older. Even with older versions of SE and
-// orcallator.se which defined and used pagesio
-// on Solaris 8, pagesio would always measure as
-// 0. SE 3.3 finally removed the compatibility
-// #define from prpsinfo_t to psinfo_t, so now
-// use psinfo_t. This breaks compatibility with
-// SE 3.1 and older SE versions.
-// Version 1.33: Jul 10, 2002 In check_output_log_filename(), stat() was
-// was being passed a stat_t by value, instead of
-// a pointer to a stat_t. Only the return value
-// from stat() was being used, so this bug had
-// no effect upon the logic of the code. Problem
-// noted by Richard Pettit .
-// Version 1.32: Oct 24, 2001 Fix a problem where the web access log file
-// pointer instead of the file descriptor was
-// being passed to fstat(). Fix a problem where
-// the cached web access log stat() information
-// wasn't being erased if the log file was
-// successfully stat()ed but then fopen() failed.
-// Rename variables used to keep track of open
-// file pointers and file stat() information to
-// be clearer: ofile to out_log_fp, www_fd to
-// www_log_fp, www_stat to www_log_stat, www_ino
-// to www_log_ino and www_size to www_log_size.
-// Problem noted by Jeremy McCarty
-// .
-// Version 1.31: Oct 21, 2001 Instead of naming the output files percol-*,
-// name them orcallator-*. Always define
-// USE_RAWDISK to use the new raw disk code.
-// Previously, USE_RAWDISK was defined only if
-// WATCH_OS was defined, but if WATCH_DISK was
-// defined and WATCH_OS was not, then the new raw
-// disk code was not being used. This change
-// makes the behavior consistent.
-// Version 1.30: Oct 19, 2001 Rename the new State_* columns to state_*.
-// Version 1.30b2: Oct 12, 2001 Output eleven new columns named State_* where
-// each column represents numerically the state
-// of one of the system's substates as they appear
-// in the DNnsrkcmdit output. The character * is
-// replaced with the same character that appears
-// in the DNnsrkcmdit string to represent the
-// particular subsystem. This can be used to
-// create a single plot that shows how all of the
-// subsystems are performing. The mapping between
-// successive states is exponential, so that as
-// the subsystems get in worse conditions, the
-// plots will show higher values. Patch
-// contributed by Rusty Carruth
-// . Make all of the
-// live_rule.se live and temporary variable names
-// consistent.
-// Version 1.30b1: Oct 8, 2001 Changed method used by raw_disk_map to detect
-// the end of GLOBAL_disk_info to looking for the
-// first short disk name. This works for SCSI
-// disks and looking for fd or st devices which
-// should work for EIDE devices. Patch
-// contributed by Alan LeGrand
-// .
-// Version 1.29: Oct 5, 2001 In SE 3.2.1 stat.se, mknod is a C-preprocessor
-// define to _xmknod on x86 systems while on SPARC
-// systems stat.se declares mknod as a normal
-// function. When stat.se is included before
-// kstat.se on x86 systems the mknod define
-// causes a compile error on kstat's mknod
-// variables which are part of the ks_rfs_proc_v3
-// and ks_rfs_req_v3 structures. The work around
-// is to include kstat.se before stat.se.
-// Version 1.28: Oct 2, 2001 No changes, bump version number to 1.28.
-// Version 1.28b7: Sep 29, 2001 Change the output log filename format from
-// percol-%Y-%m-%d to percol-%Y-%m-%d-XXX, where
-// XXX is a number starting at 0 that is
-// incremented anytime the number of output
-// columns changes or type of data stored in a
-// column changes. This is in addition to the
-// creation of a new log filename when a new day
-// starts. Whenever the program needs to create
-// a new log file for any reason, it will search
-// for the smallest XXX so that there are no log
-// files named percol-%Y-%m-%d-XXX{,.Z,.gz,.bz2}.
-// If the COMPRESSOR environmental is set and any
-// uncompressed files are found while looking for
-// the smallest XXX, they are compressed with the
-// COMPRESSOR command.
-// Version 1.28b6: Sep 28, 2001 Instead of outputting the number of CPUs only
-// when WATCH_MUTEX is defined, output it when
-// either WATCH_CPU or WATCH_MUTEX is defined.
-// Only declare and update tmp_mutex if
-// WATCH_MUTEX defined.
-// Version 1.28b5: Sep 28, 2001 Add three parameters that vmstat outputs,
-// #runque, vmstat's `r' column, which is the
-// number of processes in the run queue waiting
-// to run on a CPU, #waiting, vmstat's `b' column,
-// which is the number of processes blocked for
-// resources (I/O, paging), and #swpque, vmstat's
-// `w', the number of processes runnable but
-// swapped out. Increase MAX_COLUMNS from 512 to
-// 2048. Check [wr]lentime to see if an EMC disk
-// is using a fake disk for control. EMC disks
-// have a fake disk which commands are run over to
-// configure the disk array or to get stats from;
-// they are not real data transfers. They can
-// cause 1000 MB/sec writes to appear in the
-// stats. I still get them but not as often with
-// this bit of code in. If the I/O which occurred
-// in the last five minutes is not greater than
-// 1/100sec then it is not a valid measurement
-// anyway. What happens is that we can have a
-// small I/O, say 1024 bytes, in a 1/100sec =
-// 1024*100/sec. I am thinking of making it
-// wlentime+rlentime > 2 since I am still getting
-// fake write spikes. Make sure to define
-// HAVE_EMC_DISK_CONTROL to enable this check.
-// Patch contributed by Damon
-// Atkins .
-// Version 1.28b4: Mar 27, 2001 Recoded measure_disk() to access the RAWDISK
-// interface to sys_kstat device information to
-// allow the activity on Sun's A1000 and Clariion
-// Raid controller drives to be seen. Apparently
-// the pseudo drivers do not update the kstat
-// interface. It is also inverts the fix
-// provided by version 1.23 to avoid over-counting
-// md devices. By suppressing stats from slices
-// and metadevices and instead reporting on full
-// devices such as c0t0d0 or sd0. Note: This may
-// have introduced an interaction with the
-// live_rules.se class monitoring of drive
-// performance. Prevent floppy disks and tape
-// drives from RAWDISK. Added wio% to measure
-// wait time since the idle calculation is wrong
-// without this. Prevent filesystems mounted
-// under /snapshots from being seen. Patch
-// contributed by Alan LeGrand
-// .
-// Version 1.27: Mar 27, 2001 Print the portion of time running in idle mode
-// with some process waiting for block I/O as
-// wio% and otherwise completely idle time as
-// idle%.
-// Version 1.26: Feb 5, 2001 Make sure to check the return from stat() on
-// the web server access log in case the file is
-// missing. Use fstat() instead of stat() when a
-// file descriptor is available.
-// Version 1.25: Mar 30, 2000 Fix a typo where nil was misspelled as nik.
-// Version 1.24: Mar 25, 2000 When orcallator.se was running on a system
-// with an older version of SE the p_vmstat.scan
-// variable is an integer and the sprintf to
-// %8.3f fails, resulting in a perceived scan rate
-// of 0 pages per second. Now always add 0.0 to
-// p_vmstat.scan to get a double.
-// Version 1.23: Feb 25, 2000 When orcallator.se was running on a system
-// with DiskSuite, the same physical disk was
-// listed multiple times when it appeared in
-// several metadevices. The solution to the
-// problem is not to build the c0t0d0 name but
-// use the long disk name provided by the
-// long_name string. Patch contributed by Paul
-// Haldane .
-// Version 1.22: Jan 14, 2000 Include code to record NFS v2 and v3 server
-// statistics. The new statistics are:
-// nfss_calls, the number of NFS calls to the NFS
-// server, nfss_bad, the number of bad NFS calls
-// per second, and v{2,3}{reads,writes}, which are
-// nfss_calls broken down into NFS version 2 and
-// NFS version 3 calls. The sum of v{2,3}{reads,
-// writes} will be less than nfss_calls as the
-// other types of NFS calls, such as getattr and
-// lookup, are not included. Contributed by Paul
-// Haldane . This
-// code is enabled by the standard -DWATCH_OS or
-// individually by -DWATCH_NFS_SERVER. The
-// define -DWATCH_NFS has been superseded by
-// -DWATCH_NFS_CLIENT, but to keep backwards
-// compatibility, -DWATCH_NFS_CLIENT will be
-// defined if -DWATCH_NFS is defined.
-// Version 1.21: Jan 12, 2000 Prevent core dumps on extremely long access
-// log lines.
-// Version 1.20: Oct 20, 1999 Update my email address.
-// Version 1.19: Oct 13, 1999 Prevent a division by zero in calculating the
-// mean_disk_busy if the number of disks on the
-// system is 0.
-// Version 1.18: Oct 12, 1999 Rename disk_runp.c?t?d? to disk_runp_c?t?d?
-// to remove the .'s.
-// Version 1.17: Oct 8, 1999 Do not record mount point statistics for
-// locally mounted /cdrom partitions.
-// Version 1.16: Oct 7, 1999 To keep backwards compatibility, define
-// WATCH_WEB if WATCH_HTTPD is defined.
-// If the COMPRESSOR environmental variable
-// is defined, then when a new log file is opened
-// for a new day, the just closed log file is
-// compressed using the COMPRESSOR command in the
-// following manner:
-// system(sprintf("%s %s &", COMPRESSOR, log_file)
-// COMPRESSOR should be set to something like
-// "gzip -9", or "compress", or "bzip2 -9".
-// Version 1.15: Oct 5, 1999 kvm$mpid is a int not a long. This caused
-// problems on Solaris 7 hosts running a 64
-// bit kernel.
-// Version 1.14: Oct 1, 1999 Rename disk.c?t?d? column names to
-// disk_runp.c?t?d? to better reflect the data
-// being recorded and to allow for more per disk
-// information later.
-// Version 1.13: Sep 24, 1999 Fix a bug in the disk_mean calculation where
-// it was being divided by the wrong disk_count.
-// Now it should be much larger and in scale with
-// disk_peak. When WATCH_DISK is defined, now
-// print each disk's run percent. Add a new
-// define WATCH_MOUNTS, which reports each local
-// mount point's disk space and inode capacity,
-// usage, available for non-root users and
-// percent used. This comes from Duncan Lawie
-// tyger at hoopoes.com. Add some smarts so that if
-// the number of interfaces, physical disks, or
-// mounted partitions changes, then a new header
-// is printed. This will prevent column name and
-// data mixups when the system configuration
-// changes.
-// Version 1.12: Sep 14, 1999 Add the page scan rate as scanrate in
-// measure_cpu.
-// Version 1.11: Aug 13, 1999 Add the number of CPUs as ncpus. Move
-// measure_disk and measure_ram sooner in the
-// list of subsystems to handle. Increase the
-// number of characters for each network
-// interface from four to five. Add new disk
-// reads, writes, Kbytes read, and Kbytes
-// written per second. Add number of bytes
-// of free memory in bytes as freememK.
-// Version 1.10: Jul 28, 1999 Measure the process spawn rate if WATCH_CPU
-// is defined and the user is root.
-// Version 1.9: Jun 2, 1999 If WATCH_YAHOO is defined, then process the
-// access log as a Yahoo! style access log.
-// Restructure the code to handle different
-// web server access log formats.
-// Version 1.8: Jun 1, 1999 If the environmental variable WEB_SERVER is
-// defined, use its value of the as the name
-// of the process to count for the number of
-// web servers on the system. If WEB_SERVER
-// is not defined, then count number of httpd's.
-// Version 1.7: Mar 25, 1999 Simplify and speed up count_proc by 20%.
-// Version 1.6: Feb 23, 1999 Print pvm.user_time and system_time correctly.
-// Version 1.5: Feb 23, 1999 Always write header to a new file.
-// Version 1.4: Feb 19, 1999 Handle missing HTTP/1.x in access log.
-// Version 1.3: Feb 18, 1999 On busy machines httpops5 will be enlarged.
-// Version 1.2: Feb 18, 1999 Output data on integral multiples of interval.
-// Version 1.1: Feb 18, 1999 Integrate Squid log processing from SE 3.1.
-// Version 1.0: Sep 9, 1998 Initial version.
+// Revision history for this file can be retrieved by running svn log
+// on the HeadURL listed above.
//
// The default sampling interval in seconds.
@@ -653,7 +336,10 @@
};
// Define global for tracking raw disk data.
+#ifndef MAX_RAWDISKS
#define MAX_RAWDISKS 1024
+#endif
+
RawDisk RAW_disk[MAX_RAWDISKS];
int RAW_disk_map=0;
int RAW_disk_count=0;
From blair at orcaware.com Tue Jul 22 11:35:20 2003
From: blair at orcaware.com (Blair Zajac)
Date: Tue, 22 Jul 2003 11:35:20 -0700
Subject: [Orca-checkins] rev 245 - in trunk/orca: . packages/Digest-MD5-2.24
packages/Digest-MD5-2.26 packages/Digest-MD5-2.26/t
Message-ID: <200307221835.h6MIZKl7002570@orcaware.com>
Author: blair
Date: Tue Jul 22 11:34:45 2003
New Revision: 245
Added:
trunk/orca/packages/Digest-MD5-2.26/
- copied from rev 244, trunk/orca/packages/Digest-MD5-2.24/
Removed:
trunk/orca/packages/Digest-MD5-2.24/
Modified:
trunk/orca/INSTALL
trunk/orca/configure.in
trunk/orca/packages/Digest-MD5-2.26/Changes
trunk/orca/packages/Digest-MD5-2.26/MD5.pm
trunk/orca/packages/Digest-MD5-2.26/MD5.xs
trunk/orca/packages/Digest-MD5-2.26/Makefile.PL
trunk/orca/packages/Digest-MD5-2.26/t/badfile.t
trunk/orca/packages/Digest-MD5-2.26/t/files.t
Log:
Upgrade Digest::MD5 from 2.24 to 2.26 and require the new version for
Orca.
* INSTALL:
Update all references to Digest::MD5's version number from 2.24 to
2.26.
* configure.in:
Bump Digest::MD5's version number to 2.26.
* packages/Digest-MD5-2.26:
Renamed from packages/Digest-MD5-2.24. Directory contents updated
from Digest-MD5-2.26.tar.gz.
Modified: trunk/orca/INSTALL
==============================================================================
--- trunk/orca/INSTALL (original)
+++ trunk/orca/INSTALL Tue Jul 22 11:34:45 2003
@@ -173,7 +173,7 @@
Data::Dumper >= 2.101 >= 2.101 2.101
Date::Parse Not required by Orca 2.24
Devel::DProf Not required by Orca 19990108
- Digest::MD5 >= 2.24 >= 2.24 2.24
+ Digest::MD5 >= 2.26 >= 2.26 2.26
Math::IntervalSearch >= 1.05 >= 1.05 1.05
RRDs >= 1.000431 >= 1.0.43 1.0.43
Storable >= 2.07 >= 2.07 2.07
@@ -227,10 +227,10 @@
Digest::MD5
- http://www.perl.com/CPAN/authors/id/G/GA/GAAS/Digest-MD5-2.24.tar.gz
+ http://www.perl.com/CPAN/authors/id/G/GA/GAAS/Digest-MD5-2.26.tar.gz
- % gunzip -c Digest-MD5-2.24.tar.gz | tar xvf -
- % cd Digest-MD5-2.24
+ % gunzip -c Digest-MD5-2.26.tar.gz | tar xvf -
+ % cd Digest-MD5-2.26
% perl Makefile.PL
% make
% make test
Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in (original)
+++ trunk/orca/configure.in Tue Jul 22 11:34:45 2003
@@ -33,8 +33,8 @@
DATE_PARSE_VER=2.24
DEVEL_DPROF_DIR=DProf-19990108
DEVEL_DPROF_VER=19990108
-DIGEST_MD5_DIR=Digest-MD5-2.24
-DIGEST_MD5_VER=2.24
+DIGEST_MD5_DIR=Digest-MD5-2.26
+DIGEST_MD5_VER=2.26
MATH_INTERVALSEARCH_DIR=Math-Interpolate-1.05
MATH_INTERVALSEARCH_VER=1.05
RRDTOOL_DIR=rrdtool-1.0.43
Modified: trunk/orca/packages/Digest-MD5-2.26/Changes
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.24/Changes (original)
+++ trunk/orca/packages/Digest-MD5-2.26/Changes Tue Jul 22 11:34:45 2003
@@ -1,3 +1,33 @@
+2003-07-21 Gisle Aas
+
+ Release 2.26
+
+ Don't assume PerlIO_read() works like fread() even though
+ it was documented like that for perl 5.6. It returns negative
+ on read failure.
+
+ Kill test #3 in t/badfile.t. I don't know a reliable way
+ to test read failures on a file handle. Seems better not to
+ test than to make many worry.
+
+
+
+2003-07-04 Gisle Aas
+
+ Release 2.25
+
+ The $md5->addfile method now croaks if it discovers
+ errors on the handle after reading from it. This should
+ make it more difficult to end up with the wrong digest
+ just because you are to lazy to check the error status
+ on your file handles after reading from them.
+
+ Improved documentation.
+
+ Sync up with bleadperl; even safer patchlevel include.
+
+
+
2003-03-09 Gisle Aas
Release 2.24
Modified: trunk/orca/packages/Digest-MD5-2.26/MD5.pm
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.24/MD5.pm (original)
+++ trunk/orca/packages/Digest-MD5-2.26/MD5.pm Tue Jul 22 11:34:45 2003
@@ -3,7 +3,7 @@
use strict;
use vars qw($VERSION @ISA @EXPORT_OK);
-$VERSION = '2.24'; # $Date: 2003/03/09 15:23:10 $
+$VERSION = '2.26'; # $Date: 2003/07/22 06:09:50 $
require Exporter;
*import = \&Exporter::import;
@@ -43,7 +43,7 @@
=head1 SYNOPSIS
# Functional style
- use Digest::MD5 qw(md5 md5_hex md5_base64);
+ use Digest::MD5 qw(md5 md5_hex md5_base64);
$digest = md5($data);
$digest = md5_hex($data);
@@ -72,80 +72,111 @@
use, as well as an object oriented interface that can handle messages
of arbitrary length and which can read files directly.
-A binary digest will be 16 bytes long. A hex digest will be 32
-characters long. A base64 digest will be 22 characters long.
-
=head1 FUNCTIONS
-The following functions can be exported from the C
-module. No functions are exported by default.
+The following functions are provided by the C module.
+None of these functions are exported by default.
=over 4
=item md5($data,...)
This function will concatenate all arguments, calculate the MD5 digest
-of this "message", and return it in binary form.
+of this "message", and return it in binary form. The returned string
+will be 16 bytes long.
+
+The result of md5("a", "b", "c") will be exactly the same as the
+result of md5("abc").
=item md5_hex($data,...)
-Same as md5(), but will return the digest in hexadecimal form.
+Same as md5(), but will return the digest in hexadecimal form. The
+length of the returned string will be 32 and it will only contain
+characters from this set: '0'..'9' and 'a'..'f'.
=item md5_base64($data,...)
Same as md5(), but will return the digest as a base64 encoded string.
-
-The base64 encoded string returned is not padded to be a multiple of 4
-bytes long. If you want interoperability with other base64 encoded
-md5 digests you might want to append the string "==" to the result.
+The length of the returned string will be 22 and it will only contain
+characters from this set: 'A'..'Z', 'a'..'z', '0'..'9', '+' and
+'/'.
+
+Note that the base64 encoded string returned is not padded to be a
+multiple of 4 bytes long. If you want interoperability with other
+base64 encoded md5 digests you might want to append the redundant
+string redundant "==" to the result.
=back
=head1 METHODS
-The following methods are available:
+The object oriented interface to C is described in this
+section. After a C object has been created, you will add
+data to it and finally ask for the digest in a suitable format. A
+single object can be used to calculate multiple digests.
+
+The following methods are provided:
=over 4
=item $md5 = Digest::MD5->new
The constructor returns a new C object which encapsulate
-the state of the MD5 message-digest algorithm. You can add data to
-the object and finally ask for the digest.
+the state of the MD5 message-digest algorithm.
If called as an instance method (i.e. $md5->new) it will just reset the
state the object to the state of a newly created object. No new
object is created in this case.
-=item $md5->clone
-
-This is a copy constructor returning a clone of the $md5 object. It is
-useful when you do not want to destroy the digests state, but need an
-intermediate value of the digest, e.g. when calculating digests
-iteratively on a continuous data stream in order to obtain a copy which
-may be destroyed.
-
=item $md5->reset
This is just an alias for $md5->new.
+=item $md5->clone
+
+This a copy of the $md5 object. It is useful when you do not want to
+destroy the digests state, but need an intermediate value of the
+digest, e.g. when calculating digests iteratively on a continuous data
+stream. Example:
+
+ my $md5 = Digest::MD5->new;
+ while (<>) {
+ $md5->add($_);
+ print "Line $.: ", $md5->clone->hexdigest, "\n";
+ }
+
=item $md5->add($data,...)
The $data provided as argument are appended to the message we
calculate the digest for. The return value is the $md5 object itself.
+All these lines will have the same effect on the state of the $md5
+object:
+
+ $md5->add("a"); $md5->add("b"); $md5->add("c");
+ $md5->add("a")->add("b")->add("c");
+ $md5->add("a", "b", "c");
+ $md5->add("abc");
+
=item $md5->addfile($io_handle)
-The $io_handle is read until EOF and the content is appended to the
+The $io_handle will be read until EOF and its content appended to the
message we calculate the digest for. The return value is the $md5
object itself.
-In most cases you want to make sure that the $io_handle is set up to
-be in binmode().
+The addfile() method will croak() if it fails reading data for some
+reason. If it croaks it is unpredictable what the state of the $md5
+object will be in. The addfile() method might have been able to read
+the file partially before it failed. It is probably wise to discard
+or reset the $md5 object if this occurs.
+
+In most cases you want to make sure that the $io_handle is in
+C before you pass it as argument to the addfile() method.
=item $md5->digest
-Return the binary digest for the message.
+Return the binary digest for the message. The returned string will be
+16 bytes long.
Note that the C operation is effectively a destructive,
read-once operation. Once it has been performed, the C
@@ -155,12 +186,17 @@
=item $md5->hexdigest
-Same as $md5->digest, but will return the digest in hexadecimal form.
+Same as $md5->digest, but will return the digest in hexadecimal
+form. The length of the returned string will be 32 and it will only
+contain characters from this set: '0'..'9' and 'a'..'f'.
=item $md5->b64digest
Same as $md5->digest, but will return the digest as a base64 encoded
-string.
+string. The length of the returned string will be 22 and it will only
+contain characters from this set: 'A'..'Z', 'a'..'z', '0'..'9', '+'
+and '/'.
+
The base64 encoded string returned is not padded to be a multiple of 4
bytes long. If you want interoperability with other base64 encoded
@@ -177,12 +213,11 @@
use Digest::MD5 qw(md5_hex);
print "Digest is ", md5_hex("foobarbaz"), "\n";
-The above example would print out the message
+The above example would print out the message:
Digest is 6df23dc03f9b54cc38a0fc1483df6e21
-provided that the implementation is working correctly. The same
-checksum can also be calculated in OO style:
+The same checksum can also be calculated in OO style:
use Digest::MD5;
@@ -266,9 +301,9 @@
Copyright 1995-1996 Neil Winton.
Copyright 1991-1992 RSA Data Security, Inc.
-The MD5 algorithm is defined in RFC 1321. The basic C code
-implementing the algorithm is derived from that in the RFC and is
-covered by the following copyright:
+The MD5 algorithm is defined in RFC 1321. This implementation is
+derived from the reference C code in RFC 1321 which is covered by
+the following copyright statement:
=over 4
@@ -303,9 +338,9 @@
=head1 AUTHORS
-The original MD5 interface was written by Neil Winton
+The original C interface was written by Neil Winton
(C).
-This release was made by Gisle Aas
+The C module is written by Gisle Aas .
=cut
Modified: trunk/orca/packages/Digest-MD5-2.26/MD5.xs
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.24/MD5.xs (original)
+++ trunk/orca/packages/Digest-MD5-2.26/MD5.xs Tue Jul 22 11:34:45 2003
@@ -1,4 +1,4 @@
-/* $Id: MD5.xs,v 1.37 2003/03/09 15:20:43 gisle Exp $ */
+/* $Id: MD5.xs,v 1.40 2003/07/22 05:59:27 gisle Exp $ */
/*
* This library is free software; you can redistribute it and/or
@@ -44,14 +44,17 @@
}
#endif
-#ifndef PATCHLEVEL
+#ifndef PERL_VERSION
# include
# if !(defined(PERL_VERSION) || (SUBVERSION > 0 && defined(PATCHLEVEL)))
# include
# endif
+# define PERL_REVISION 5
+# define PERL_VERSION PATCHLEVEL
+# define PERL_SUBVERSION SUBVERSION
#endif
-#if PATCHLEVEL <= 4 && !defined(PL_dowarn)
+#if PERL_VERSION <= 4 && !defined(PL_dowarn)
#define PL_dowarn dowarn
#endif
@@ -627,16 +630,23 @@
* first.
*/
STRLEN missing = 64 - fill;
- if ( (n = PerlIO_read(fh, buffer, missing)))
+ if ( (n = PerlIO_read(fh, buffer, missing)) > 0)
MD5Update(context, buffer, n);
else
XSRETURN(1); /* self */
}
- /* Process blocks until EOF */
- while ( (n = PerlIO_read(fh, buffer, sizeof(buffer)))) {
+ /* Process blocks until EOF or error */
+ while ( (n = PerlIO_read(fh, buffer, sizeof(buffer))) > 0) {
MD5Update(context, buffer, n);
}
+
+ if (PerlIO_error(fh)) {
+ croak("Reading from filehandle failed");
+ }
+ }
+ else {
+ croak("No filehandle passed");
}
XSRETURN(1); /* self */
Modified: trunk/orca/packages/Digest-MD5-2.26/Makefile.PL
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.24/Makefile.PL (original)
+++ trunk/orca/packages/Digest-MD5-2.26/Makefile.PL Tue Jul 22 11:34:45 2003
@@ -23,7 +23,6 @@
@extra,
'dist' => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
);
-exit;
Modified: trunk/orca/packages/Digest-MD5-2.26/t/badfile.t
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.24/t/badfile.t (original)
+++ trunk/orca/packages/Digest-MD5-2.26/t/badfile.t Tue Jul 22 11:34:45 2003
@@ -1,6 +1,3 @@
-# Digest::MD5 2.07 and older used to trigger a core dump when
-# passed an illegal file handle that failed to open.
-
print "1..2\n";
use Digest::MD5 ();
@@ -11,11 +8,12 @@
use vars qw(*FOO);
$md5->addfile(*FOO);
};
-print "not " unless $@ =~ /^Bad filehandle: FOO/;
+print "not " unless $@ =~ /^Bad filehandle: FOO at/;
print "ok 1\n";
-open(BAR, "none-existing-file.$$");
-$md5->addfile(*BAR);
-
-print "not " unless $md5->hexdigest eq "d41d8cd98f00b204e9800998ecf8427e";
+open(BAR, "no-existing-file.$$");
+eval {
+ $md5->addfile(*BAR);
+};
+print "not " unless $@ =~ /^No filehandle passed at/;
print "ok 2\n";
Modified: trunk/orca/packages/Digest-MD5-2.26/t/files.t
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.24/t/files.t (original)
+++ trunk/orca/packages/Digest-MD5-2.26/t/files.t Tue Jul 22 11:34:45 2003
@@ -20,27 +20,27 @@
my $EXPECT;
if (ord "A" == 193) { # EBCDIC
$EXPECT = <