external rrd create and update

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

chefchanyu
Cacti User
Posts: 153
Joined: Wed Aug 25, 2010 11:07 pm

external rrd create and update

Post by chefchanyu »

Hi all:

cacti itself can't do per second graph update. is it rrdtool possible to make every second count update to the rrd file?
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: external rrd create and update

Post by noname »

>> is it rrdtool possible to make every second count update to the rrd file?

Set step value to 1.

For example:

Code: Select all

%rrdtool create test_per_second.rrd     \
        --step 1                        \
        DS:testvalue:GAUGE:3:U:U        \
        RRA:AVERAGE:0.5:1:86400         \
        RRA:MAX:0.5:1:86400
This RRD keeps data for 1 day. (=86400sec)

Here is a sample graph for the above RRD on Cacti.
I followed this guidance: Externally Updated RRDs - Cacti Docs

Image
(Timespan is 120sec in this RRA)
chefchanyu
Cacti User
Posts: 153
Joined: Wed Aug 25, 2010 11:07 pm

Re: external rrd create and update

Post by chefchanyu »

thanks you. that is really good help me.
chefchanyu
Cacti User
Posts: 153
Joined: Wed Aug 25, 2010 11:07 pm

Re: external rrd create and update

Post by chefchanyu »

Hi:

look like working, but doesn't looks right for me.
I copy the code from you.....

Code: Select all

rrdtool create test_per_second.rrd     \
        --step 1                        \
        DS:testvalue:GAUGE:3:U:U        \
        RRA:AVERAGE:0.5:1:86400         \
        RRA:MAX:0.5:1:86400
and follow the steps to import the rrd file to cacti.

and I run my randon number perl script to do the test

Code: Select all

#!/usr/bin/perl -w
use strict;
use warnings;

$| = 1;
while (1)
{
        my $range = 100;
        my $number = int(rand($range));
        print $number . "\n";
        my $time = time();
        print $time . "\n";
        my $update = `rrdtool update test.rrd $time:$number`;
        print $update;
        sleep 1;
      
}
:o where went wrong?
Attachments
2011-06-02_130640.png
2011-06-02_130640.png (19.87 KiB) Viewed 4086 times
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: external rrd create and update

Post by noname »

Did you use 'Hourly' RRA for the graph?
I created new RRA for this test, and used it in new Data Template.

Image

BTW, typo in your graph title..
|host_descriptition| -> |host_description|
chefchanyu
Cacti User
Posts: 153
Joined: Wed Aug 25, 2010 11:07 pm

Re: external rrd create and update

Post by chefchanyu »

Hi:

the graph is working now. I have to using Zoon in to see the every "second" count. I did create "minutely (1 Second Aver)" data temp.
Attachments
1.png
1.png (6.09 KiB) Viewed 4072 times
2.png
2.png (56.55 KiB) Viewed 4072 times
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: external rrd create and update

Post by noname »

That is depend on "Default Graph View Timespan". (not "Default RRA", unfortunately)

Image
(If you changed these default settings, please re-login to take effect)
chefchanyu wrote:I have to using Zoon in to see the every "second" count.
Not necessary to zoom. Just click the graph.
chefchanyu
Cacti User
Posts: 153
Joined: Wed Aug 25, 2010 11:07 pm

Re: external rrd create and update

Post by chefchanyu »

I did click on the graph and just show like img 1.png.
also "Default Graph View Timespan" same as my current setting. :(
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: external rrd create and update

Post by noname »

chefchanyu wrote:I did click on the graph and just show like img 1.png.
If you modified data template after creating graph (= RRD file),
please delete the graph and datasource, then re-create it.
chefchanyu
Cacti User
Posts: 153
Joined: Wed Aug 25, 2010 11:07 pm

Re: external rrd create and update

Post by chefchanyu »

yes, I did created the temp first and then create the rrd file.
And here are my steps:

Create Temp
1. DATA Soure >> RRAS
2. Add
3. As your graph

- Mintely (1 Second Average)
- MAX
- 0.5
- 1
- 86400
- 120

4. Save

Add Exterrnal

1. Data Temp
2. add

- temp name: test
- name: |host_description| - external RRD
- select Minutely (1 Second Average)

- uncheck data Soure Active

- internal data soure name: testing

- data source type: GAUGE
- Hearbeat: 600

3. Save

Add Graph Temp
- name: External RRD
- Title: |host_description| - external RRD

- add graph item

- Save

Add Devices
- description : test host
- host name: test host
- disable snmp
- Save

Add Data source
- selectecd Data Temp: test
- host: test host (test host)
- Data source Path: /var/www/cacti:/rra/test/test.rrd

Add graph
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: external rrd create and update

Post by noname »

I followed the procedure you did (on Cacti 0.8.7g and 0.8.7e).
But I can see the graph successfully when I entered "Viewing Graph".
Image

I suspect..
chefchanyu wrote:1. Data Temp
2. add

- temp name: test
- name: |host_description| - external RRD
- select Minutely (1 Second Average)

- uncheck data Soure Active

- internal data soure name: testing

- data source type: GAUGE
- Hearbeat: 600
What did you set for "Step" value in Data Template?
chefchanyu
Cacti User
Posts: 153
Joined: Wed Aug 25, 2010 11:07 pm

Re: external rrd create and update

Post by chefchanyu »

unchecked 300
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: external rrd create and update

Post by noname »

chefchanyu wrote:>> What did you set for "Step" value in Data Template?

unchecked 300
Bingo! 8)
noname wrote:>> is it rrdtool possible to make every second count update to the rrd file?

Set step value to 1.
chefchanyu
Cacti User
Posts: 153
Joined: Wed Aug 25, 2010 11:07 pm

Re: external rrd create and update

Post by chefchanyu »

ye!!!!!!!! it work:)
Thanks you.
chefchanyu
Cacti User
Posts: 153
Joined: Wed Aug 25, 2010 11:07 pm

Re: external rrd create and update

Post by chefchanyu »

second question.

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:

Code: Select all

rrdtool create test_per_second.rrd     \
        --step 1                        \
        DS:testvalue:GAUGE:3:U:U        \
        RRA:AVERAGE:0.5:1:94608000         \
        RRA:MAX:0.5:1:94608000
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest