A little help plz... external rrd files to CACTI

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

Moderators: Developers, Moderators

rolling
Posts: 23
Joined: Tue Jul 01, 2008 9:14 am

A little help plz... external rrd files to CACTI

Post by rolling »

hi, first, i would like to thanks everyone who reads this threat.

I just started working on this company that have been using MRTG for like 2 years, i mean, they have statistics records of all their network devices for about 2 years, they algo use rrdtool add-on, they did this cause of the mass 5 mins re-generation statistics of the MRTg was affecting the server perfomance, i found that an intelligent thing to do.

However, they now decided to move from this monitor traffic tool (mrtg) to Cacti, a new network graphic solution. So far everything cool. They wish to keep all of their statistics records collected by the mrtg and migrate them all to Cacti... Ok, this is when i say: Not bad, doesnt sound that crazy, i mean, they both make use of RRDTool's data storage and graphing functionality.

Ok, this is when the thing gets a little bit confusing, first of all, the MRTG server is using and old version of rrdtool (1.0.49), the cacti server is using a newer version of rrdtool (1.2.27).

==============> BOTH SERVERS USING Linux Mandriva <=================

So far, not a boundarie, i can dump the old .rrd file and then recover the .xml. Having updated the old .rrd file to the newest rrdtool version.

Lets keep moving, so... How do i create a new graph on cacti using an old .rrd file as data source? i gotta tell you guys, that i found a solution, but it wasnt easy...

http://docs.cacti.net/node/358 <--- here is the answer...

i followed EACH AND EVERY step of this guide http://docs.cacti.net/node/358 without achieving my goals, the graph dont display the statistics..

lets take this as a example


rrdtool info xxx.rrd
filename = "xxx.rrd"
rrd_version = "0003"
step = 300
last_update = 1214573101
ds[ds0].type = "COUNTER"
ds[ds0].minimal_heartbeat = 600
ds[ds0].min = 0.0000000000e+00
ds[ds0].max = 2.5600000000e+05
ds[ds0].last_ds = "1092528755"
ds[ds0].value = 1.4708154362e+03
ds[ds0].unknown_sec = 0
ds[ds1].type = "COUNTER"
ds[ds1].minimal_heartbeat = 600
ds[ds1].min = 0.0000000000e+00
ds[ds1].max = 2.5600000000e+05
ds[ds1].last_ds = "2512555500"
ds[ds1].value = 7.5348053691e+03
ds[ds1].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 599
rra[0].pdp_per_row = 1



I changed the data template according to the info gathered from the rrdtool info... i mean, i changed the internal Data Source Name, Maximum Value, Data Source Type on each of the "data source item" created... and i cant get the graph to display the statistics...and i dont know what else to do...

Can anyone help.... Plz...


PD: sorry if any of you people see any error on my english writting... aint my main lenguage...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please show us the data template first (a screenshot, please)
Reinhard
rolling
Posts: 23
Joined: Tue Jul 01, 2008 9:14 am

Post by rolling »

Is this what you were asking for?...



Let me know what else you need....





Thanks for answering gandalf...
Attachments
Screenshot4.jpg
Screenshot4.jpg (132.71 KiB) Viewed 3337 times
rolling
Posts: 23
Joined: Tue Jul 01, 2008 9:14 am

Post by rolling »

Oh, btw, i dont know if you can make any use of this information...

$> rrdtool info xxx.rrd

filename = "xxx.rrd"
rrd_version = "0003"
step = 300
last_update = 1214573101
ds[ds0].type = "COUNTER"
ds[ds0].minimal_heartbeat = 600
ds[ds0].min = 0.0000000000e+00
ds[ds0].max = 2.5600000000e+05
ds[ds0].last_ds = "1092528755"
ds[ds0].value = 1.4708154362e+03
ds[ds0].unknown_sec = 0
ds[ds1].type = "COUNTER"
ds[ds1].minimal_heartbeat = 600
ds[ds1].min = 0.0000000000e+00
ds[ds1].max = 2.5600000000e+05
ds[ds1].last_ds = "2512555500"
ds[ds1].value = 7.5348053691e+03
ds[ds1].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 599
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0
rra[0].cdp_prep[1].value = NaN
rra[0].cdp_prep[1].unknown_datapoints = 0
rra[1].cf = "AVERAGE"
rra[1].rows = 700
rra[1].pdp_per_row = 6
rra[1].xff = 5.0000000000e-01
rra[1].cdp_prep[0].value = 8.7871863041e+03
rra[1].cdp_prep[0].unknown_datapoints = 0
rra[1].cdp_prep[1].value = 5.1377001338e+04
rra[1].cdp_prep[1].unknown_datapoints = 0
rra[2].cf = "AVERAGE"
rra[2].rows = 775
rra[2].pdp_per_row = 24
rra[2].xff = 5.0000000000e-01
rra[2].cdp_prep[0].value = 7.2243418245e+04
rra[2].cdp_prep[0].unknown_datapoints = 0
rra[2].cdp_prep[1].value = 1.6019043281e+05
rra[2].cdp_prep[1].unknown_datapoints = 0
rra[3].cf = "AVERAGE"
rra[3].rows = 795
rra[3].pdp_per_row = 288
rra[3].xff = 5.0000000000e-01
rra[3].cdp_prep[0].value = 4.7511672653e+05
rra[3].cdp_prep[0].unknown_datapoints = 7
rra[3].cdp_prep[1].value = 5.3232822212e+05
rra[3].cdp_prep[1].unknown_datapoints = 7
rra[4].cf = "MAX"
rra[4].rows = 600
rra[4].pdp_per_row = 1
rra[4].xff = 5.0000000000e-01
rra[4].cdp_prep[0].value = NaN
rra[4].cdp_prep[0].unknown_datapoints = 0
rra[4].cdp_prep[1].value = NaN
rra[4].cdp_prep[1].unknown_datapoints = 0
rra[5].cf = "MAX"
rra[5].rows = 700
rra[5].pdp_per_row = 6
rra[5].xff = 5.0000000000e-01
rra[5].cdp_prep[0].value = 3.5361943957e+03
rra[5].cdp_prep[0].unknown_datapoints = 0
rra[5].cdp_prep[1].value = 1.4487316363e+04
rra[5].cdp_prep[1].unknown_datapoints = 0
rra[6].cf = "MAX"
rra[6].rows = 775
rra[6].pdp_per_row = 24
rra[6].xff = 5.0000000000e-01
rra[6].cdp_prep[0].value = 2.3680145956e+04
rra[6].cdp_prep[0].unknown_datapoints = 0
rra[6].cdp_prep[1].value = 1.7114242745e+04
rra[6].cdp_prep[1].unknown_datapoints = 0
rra[7].cf = "MAX"
rra[7].rows = 795
rra[7].pdp_per_row = 288
rra[7].xff = 5.0000000000e-01
rra[7].cdp_prep[0].value = 2.3680145956e+04
rra[7].cdp_prep[0].unknown_datapoints = 7
rra[7].cdp_prep[1].value = 2.2599973420e+04
rra[7].cdp_prep[1].unknown_datapoints = 7


thx again...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I don't know why this is set
rra[0].rows = 599
instead of
rra[0].rows = 600
But this seems to be a minor issue. As the MIN/MAX is nor verified by cacti's poller. it's ok to leave it as is.
Teh data sources names match thise of rrdtool info, that's fine.

Now, let's switch to Graph Management. Select the failing graph and switch to debug. Post a screenshot, then
Reinhard
rolling
Posts: 23
Joined: Tue Jul 01, 2008 9:14 am

Post by rolling »

Thanks for the answer Gandalf...

it this what you were asking for?

Well... thats all i get... i dont get any statistics...i dont know what im a i doing wrong...

Do you need any snapshots ? maybe of Devices configuration or graph templates? what else you need.... ?
Attachments
snapshottest.jpg
snapshottest.jpg (102.53 KiB) Viewed 3323 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please run

Code: Select all

rrdtool fetch <rrd file> AVERAGE
against the rrd file mentioned in the graph debug. The rrd file should be the same that you are populating from remote, isn't it?
Reinhard
rolling
Posts: 23
Joined: Tue Jul 01, 2008 9:14 am

Post by rolling »

Thanks for the answer Gandalf,

Gandalf, im now feeling kinda stupid, i mean, i just did a copy of the xxx.rrd file of the mrtg server to the cacti server... but it looks, that when i copy the xxx.rrd file... the timestamp of the xxx.rrd file changes automatically as soon as it get to the cactiserver...



This is the xxx.rrd from the mrtg server running live...
__________________________________________
rrdtool fetch xxx.rrd AVERAGE
timestamp ds0 ds1

1214925900: 2.0564810067e+04 2.8442605901e+05
1214926200: 1.9495980666e+04 4.4091589302e+05
1214926500: 2.1829739834e+04 5.0026678544e+05
1214926800: 2.4646728477e+04 4.7104315894e+05
1214927100: 4.7159526127e+04 4.6167099408e+05
1214927400: 5.6337881575e+04 4.7992669722e+05
1214927700: 4.6645594865e+04 4.9489952905e+05
1214928000: 3.2143065622e+04 4.7685526738e+05

_____________________________________________

________________________________________________



This is the one i copied 5 seconds ago..




rrdtool fetch xxx.rrd AVERAGE
ds0 ds1

1215028200: nan nan
1215028500: nan nan
1215028800: nan nan
1215029100: nan nan
1215029400: nan nan
1215029700: nan nan
1215030000: nan nan
1215030300: nan nan


( i dont know why the timestamp isnt no longer identifying the column)

Mmmmm, sorry for all the inconveniencie, but, i imagine that if i synchronize my cactiserver against the same ntp server of the mrtg server, it will fix this issue? it just an idea... im actually kinda noob on this cacti-mrtg-rrdtool thing...



...waiting for your answer.


Thanks for everything...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Yep, there seems to be a time lag. You'll have to fix this first (e.g. using same ntp setup). Please take care, if both systems are running different rrdtool versions (e.g. 1.0 mixed with 1.2)
Reinhard
rolling
Posts: 23
Joined: Tue Jul 01, 2008 9:14 am

Post by rolling »

ill let you know how it goes tomorrow .... i had to leave the office...


we Talk tomorrow! thanks for all
rolling
Posts: 23
Joined: Tue Jul 01, 2008 9:14 am

Post by rolling »

Man, it worked gandalf, thanks thanks thanks... i really appreciate that, whenever you want to come to venezuela let me know... lol...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Oh, that would turn out to be kinda HUGE bike tour, won't it :o
Reinhard
rolling
Posts: 23
Joined: Tue Jul 01, 2008 9:14 am

Post by rolling »

Hey Gandalf, sorry to bother again...


After the statistics were displayed on the graph i realized that there was a missmatch when it comes to the max, avarage, current values on both server graphs.

As you can see the max, average, current values are different in the cacti graph.... It has something to do with how the information is displayed? maybe one is using bits and the other graph is using bytes?. if i am right... is there a way to fix this issue?


Sorry for the inconvenience again...

Thanks...
Attachments
snapshot.jpg
snapshot.jpg (82.29 KiB) Viewed 3234 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Yep, I suppose the bits/bytes issue is the correct approach. From cacti, you will visit Graph Management, select the Graph and switch to DEBUg to find the "rrdtool graph" statement. You will find any CDEF used there. BTB: which kind of data is stored in the external rrd file? Is it bytes or bits (I suppose it's bytes)? If it is bytes, you will require a CDEF to calculate bits
Reinhard
rolling
Posts: 23
Joined: Tue Jul 01, 2008 9:14 am

Post by rolling »

Sorry Gandalf i think im not following you.

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="rrd external" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="xxx/xxx.rrd":ds0:AVERAGE \
DEF:b="xxx/xxx.rrd":ds0:MAX \
DEF:c="xxx/xxx.rrd":ds1:AVERAGE \
DEF:d="xxx/xxx.rrd":ds1:MAX \
AREA:a#B90054FF:"ds0" \
GPRINT:a:LAST:"Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" \
AREA:c#008A6DFF:"ds1":STACK \
GPRINT:c:LAST:"Current\:%8.2lf %s" \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:d:MAX:"Maximum\:%8.2lf %s\n"


those all are the statements use while the debug thing on graph management...

Maybe this question seems a little stupid but, how do i know whick kind of data is stored in a rrd file?!... and in case it is bytes.... how does a CDEF works?? i mean, i know the theory, its uses the DEF to retrive data of the rrd file but, when u say that ill requiere a CDEF to calculate bits, u mean like a need to apply a patch or something to the RRD file?



Sorry for the inconvencience.


Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests