Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
I want to keep the data over record for 3 years. so is it mean i just need to increase the 86400 to 86400 * 365 * 3?
and create the rrd file like this:
I got this testing Perl script collecting all the data form my log file. It has no error when I run the script. and RRD file seen been updated (I use "rrdtool info test.rrd" checked)
but my graph is empty.
#!/usr/bin/perl
use strict;
use Switch;
use Time::Local;
open(FILE, "/home/d353202/RRDScript/mm_21_sec_count201106150000");
while(my $record = <FILE>)
{
my %count = ();
while ($record =~ /((\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d))\s(\w+)/ig)
{
# my $time = $1;
my $MO_count = $8;
my $year = $2;
my $mon = $3;
my $mday = $4;
my $hou = $5;
my $min = $6;
my $sec = $7;
my $time = timelocal($sec,$min,$hou,$mday,$mon,$year);
$count{$time} = $MO_count;
my $update = `rrdtool update /var/www/cacti/rra/test/mm21.rrd $time:$MO_count`;
print $update;
}
}
the month is the number of months since January (0..11)
chefchanyu wrote:I got this testing Perl script collecting all the data form my log file. It has no error when I run the script. and RRD file seen been updated (I use "rrdtool info test.rrd" checked)
but my graph is empty.
#!/usr/bin/perl
use strict;
use Switch;
use Time::Local;
open(FILE, "/home/d353202/RRDScript/mms_21_sec_count201106150000");
while(my $record = <FILE>)
{
my %count = ();
while ($record =~ /((\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d))\s(\w+)/ig)
{
# my $time = $1;
my $MO_count = $8;
my $year = $2;
my $mon = $3 -1;
my $mday = $4;
my $hou = $5;
my $min = $6;
my $sec = $7;
my $time = timelocal($sec,$min,$hou,$mday,$mon,$year);
# print $time . "=> ". $MO_count . "\n";
# print $year . "\n";
$count{$time} = $MO_count;
my $update = `rrdtool update /var/www/cacti/rra/test/mms21.rrd $time:$MO_count`;
print $update;
}
}
And I remove the rrd file and recreate new one with follow command. which going to keep the data less 3 years. (the manager wants keep the data for 10 years)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060071 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060072 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060074 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060079 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060082 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060084 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060087 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060088 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060095 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060097 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060102 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060107 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060108 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060117 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060119 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060120 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060121 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060124 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060129 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060131 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060132 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060133 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060137 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060138 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060139 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060144 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060145 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060148 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060170 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060174 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060181 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060182 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060184 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060195 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060197 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060206 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060208 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060209 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060211 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060213 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060215 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060216 when last update time is 1308271101 (minimum one second step)
ERROR: /var/www/cacti/rra/test/mms21.rrd: illegal attempt to update using time 1308060218 when last update time is 1308271101 (minimum one second step)
..............
^C
I had tried many time. all data in rrd graph are broken. I am really don't know where went wrong. I had follow all step are same as test.rrd on earlier time.
is there possible that Perl script running too quick the rrdtool update did not keep up?
chefchanyu wrote:I had tried many time. all data in rrd graph are broken. I am really don't know where went wrong. I had follow all step are same as test.rrd on earlier time.
is there possible that Perl script running too quick the rrdtool update did not keep up?
I think that the above graph seems good. Where is that "broken"?
Please perform "rrdtool dump" and verify its result.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd">
<!-- Round Robin Database Dump --><rrd> <version> 0003 </version>
<step> 1 </step> <!-- Seconds -->
<lastupdate> 1308146398 </lastupdate> <!-- 2011-06-15 23:59:58 EST -->
<ds>
<name> testing </name>
<type> GAUGE </type>
<minimal_heartbeat> 3 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+02 </max>
<!-- PDP Status -->
<last_ds> 1 </last_ds>
<value> 0.0000000000e+00 </value>
<unknown_sec> 0 </unknown_sec>
</ds>
<!-- Round Robin Archives --> <rra>
<cf> AVERAGE </cf>
<pdp_per_row> 1 </pdp_per_row> <!-- 1 seconds -->
<params>
<xff> 5.0000000000e-01 </xff>
</params>
<cdp_prep>
<ds>
<primary_value> 1.0000000000e+00 </primary_value>
<secondary_value> 1.0000000000e+00 </secondary_value>
<value> NaN </value>
<unknown_datapoints> 0 </unknown_datapoints>
</ds>
</cdp_prep>
<database>
<!-- 2008-06-15 23:59:59 EST / 1213538399 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:00 EST / 1213538400 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:01 EST / 1213538401 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:02 EST / 1213538402 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:03 EST / 1213538403 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:04 EST / 1213538404 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:05 EST / 1213538405 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:06 EST / 1213538406 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:07 EST / 1213538407 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:08 EST / 1213538408 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:09 EST / 1213538409 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:10 EST / 1213538410 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:11 EST / 1213538411 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:12 EST / 1213538412 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:13 EST / 1213538413 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:14 EST / 1213538414 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:15 EST / 1213538415 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:16 EST / 1213538416 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:17 EST / 1213538417 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:18 EST / 1213538418 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:19 EST / 1213538419 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:20 EST / 1213538420 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:21 EST / 1213538421 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:22 EST / 1213538422 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:23 EST / 1213538423 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:24 EST / 1213538424 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:25 EST / 1213538425 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:26 EST / 1213538426 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:27 EST / 1213538427 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:28 EST / 1213538428 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:29 EST / 1213538429 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:30 EST / 1213538430 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:31 EST / 1213538431 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:32 EST / 1213538432 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:33 EST / 1213538433 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:34 EST / 1213538434 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:35 EST / 1213538435 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:36 EST / 1213538436 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:37 EST / 1213538437 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:38 EST / 1213538438 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:39 EST / 1213538439 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:40 EST / 1213538440 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:41 EST / 1213538441 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:42 EST / 1213538442 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:43 EST / 1213538443 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:44 EST / 1213538444 --> <row><v> NaN </v></row>
<!-- 2008-06-16 00:00:45 EST / 1213538445 --> <row><v> NaN </v></row>
here is out put from the command.
my input data at less 2 or 3 second has a input. when I see the graph between 3 to 4 am is empty for 2 hours. <!-- 2008-06-16 00:00:45 <== looks not right
chefchanyu wrote:my input data at less 2 or 3 second has a input. when I see the graph between 3 to 4 am is empty for 2 hours.
Probably it is "30 Minute Average".. Please look the graph in more detailed resolution.
Or, try to replace AVERAGE with MAX for graph items in Graph Template.
>> don't know why start print out form 2008 to 2011.
Probably you specified that timestamp (3 years ago) by "--start" option when creating this rrd.
And from your post,
chefchanyu wrote:And I remove the rrd file and recreate new one with follow command. which going to keep the data less 3 years. (the manager wants keep the data for 10 years)
rrdtool create mms21.rrd --step 1 DS:testing:GAUGE:60:0:100 RRA:AVERAGE:0.5:1:94608000 RRA:MAX:0.5:1:94608000
so is it mean I increase the heartbeat will fix that problem?