230
230
This value is also called Primary Data Point \fB(\s-1PDP\s0)\fR. In our example
231
231
mentioned above, a new \s-1PDP\s0 is generated every 300 seconds.
233
Note, that if you do \s-1NOT\s0 supply new datapoints exactly every 300 seconds,
233
Note, that if you do \s-1NOT\s0 supply new data points exactly every 300 seconds,
234
234
this is not a problem, RRDtool will interpolate the data accordingly.
236
236
\&\fB\s-1DST\s0\fR (Data Source Type) defines the type of the \s-1DS\s0. It can be
240
240
the previous value is greater than 0). Traffic counters on a router
241
241
are an ideal candidate for using \s-1COUNTER\s0 as \s-1DST\s0. \s-1DERIVE\s0 is the same as
242
242
\&\s-1COUNTER\s0, but it allows negative values as well. If you want to see the
243
rate of \fIchange\fR in free diskspace on your server, then you might
243
rate of \fIchange\fR in free disk space on your server, then you might
244
244
want to use the \s-1DERIVE\s0 data type. \s-1ABSOLUTE\s0 also saves the rate of
245
245
change, but it assumes that the previous value is set to 0. The
246
246
difference between the current and the previous value is always equal
417
417
\& # calculate the average of the array
418
418
\& my $tot_mem_ave = $tot_mem_sum/($count);
419
419
\& # create the graph
420
\& RRDs::graph ("/images/mem_$count.png", \e
421
\& "\-\-title= Memory Usage", \e
422
\& "\-\-vertical\-label=Memory Consumption (MB)", \e
423
\& "\-\-start=$start_time", \e
424
\& "\-\-end=$end_time", \e
425
\& "\-\-color=BACK#CCCCCC", \e
426
\& "\-\-color=CANVAS#CCFFFF", \e
427
\& "\-\-color=SHADEB#9999CC", \e
428
\& "\-\-height=125", \e
429
\& "\-\-upper\-limit=656", \e
430
\& "\-\-lower\-limit=0", \e
432
\& "\-\-base=1024", \e
433
\& "DEF:tot_mem=target.rrd:mem:AVERAGE", \e
434
\& "CDEF:tot_mem_cor=tot_mem,0,671744,LIMIT,UN,0,tot_mem,IF,1024,/",\e
435
\& "CDEF:machine_mem=tot_mem,656,+,tot_mem,\-",\e
436
\& "COMMENT:Memory Consumption between $start_time",\e
437
\& "COMMENT: and $end_time ",\e
438
\& "HRULE:656#000000:Maximum Available Memory \- 656 MB",\e
439
\& "AREA:machine_mem#CCFFFF:Memory Unused", \e
420
\& RRDs::graph ("/images/mem_$count.png",
421
\& "\-\-title= Memory Usage",
422
\& "\-\-vertical\-label=Memory Consumption (MB)",
423
\& "\-\-start=$start_time",
424
\& "\-\-end=$end_time",
425
\& "\-\-color=BACK#CCCCCC",
426
\& "\-\-color=CANVAS#CCFFFF",
427
\& "\-\-color=SHADEB#9999CC",
429
\& "\-\-upper\-limit=656",
430
\& "\-\-lower\-limit=0",
433
\& "DEF:tot_mem=target.rrd:mem:AVERAGE",
434
\& "CDEF:tot_mem_cor=tot_mem,0,671744,LIMIT,UN,0,tot_mem,IF,1024,/",
435
\& "CDEF:machine_mem=tot_mem,656,+,tot_mem,\-",
436
\& "COMMENT:Memory Consumption between $start_time",
437
\& "COMMENT: and $end_time ",
438
\& "HRULE:656#000000:Maximum Available Memory \- 656 MB",
439
\& "AREA:machine_mem#CCFFFF:Memory Unused",
440
440
\& "AREA:tot_mem_cor#6699CC:Total memory consumed in MB");
441
441
\& my $err=RRDs::error;
442
442
\& if ($err) {print "problem generating the graph: $err\en";}