Hi all,
I've been reading through previous posts on this, and almost have what I want working... What I'm after is to add a 5 year graph, so that we can look at much longer term trends. I've picked one specific data source to start with, and it's producing a 5 year graph OK - I can browse to it directly to see it - e.g.
http://myhost/cacti/graph.php?action=vi ... 1&rra_id=6
and the scheduled graph export task correctly picks up everything, showing hourly / day / week / month / year / 5 year. But the "live" page stubbornly refuses to display the 5 year RRA, and for the life of me I can't see why not. So to summarise:
- RRA is correctly produced for 5 years. I can surf to it, view it, export it
- Daily scheduled export of all graphs produces a html file for the host / service in question with the 5 year graph correctly in there
- "Live feed" doesn't display the 5 year graph when looking at http://myhost/cacti/graph.php?action=vi ... rra_id=all
So I'm looking for any clues about how / why this is the case.
The RRAs currently are:
1 = daily
2 = weekly
3 = monthly
4 = yearly
5 = hourly
6 = 5 year
but passing "rra_id=all" only retrieves and displays rras 1 - 5.
The RRA definition is:
Hourly (1 Minute Average) 1 500 14400
Daily (5 Minute Average) 1 600 86400
Weekly (30 Minute Average) 6 700 604800
Monthly (2 Hour Average) 24 775 2678400
Yearly (1 Day Average) 288 797 33053184
5 Year 1440 820 165265920
The Data sources have the 5 Year RRA selected (which makes sense because I can manually browse to RRA#6 and it exports OK).
I've exported the data and graph templates in question and can see the 5 Year component in there (I can attach them here if you want to look at them?). I'll copy out "rrdtool info" below too.
Any hints for where I should be looking? My feeling is that it's a problem with the graph template because the underlying data is there, but I can't see how / why.
Thanks!
=========================================
filename = "/var/www/mrtg/applications/chdstats.rrd"
rrd_version = "0003"
step = 300
last_update = 1476146400
header_size = 3416
ds[ds0].index = 0
ds[ds0].type = "GAUGE"
ds[ds0].minimal_heartbeat = 600
ds[ds0].min = 0.0000000000e+00
ds[ds0].max = 1.0000000000e+03
ds[ds0].last_ds = "25"
ds[ds0].value = 1.9553275000e+01
ds[ds0].unknown_sec = 0
ds[ds1].index = 1
ds[ds1].type = "GAUGE"
ds[ds1].minimal_heartbeat = 600
ds[ds1].min = 0.0000000000e+00
ds[ds1].max = 1.0000000000e+03
ds[ds1].last_ds = "39"
ds[ds1].value = 3.0503109000e+01
ds[ds1].unknown_sec = 0
ds[ds2].index = 2
ds[ds2].type = "GAUGE"
ds[ds2].minimal_heartbeat = 600
ds[ds2].min = 0.0000000000e+00
ds[ds2].max = 1.0000000000e+03
ds[ds2].last_ds = "335"
ds[ds2].value = 2.6201388500e+02
ds[ds2].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 800
rra[0].cur_row = 696
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[0].cdp_prep[2].value = NaN
rra[0].cdp_prep[2].unknown_datapoints = 0
rra[1].cf = "AVERAGE"
rra[1].rows = 800
rra[1].cur_row = 116
rra[1].pdp_per_row = 6
rra[1].xff = 5.0000000000e-01
rra[1].cdp_prep[0].value = 5.0000000000e+01
rra[1].cdp_prep[0].unknown_datapoints = 0
rra[1].cdp_prep[1].value = 7.8000000000e+01
rra[1].cdp_prep[1].unknown_datapoints = 0
rra[1].cdp_prep[2].value = 6.7000000000e+02
rra[1].cdp_prep[2].unknown_datapoints = 0
rra[2].cf = "AVERAGE"
rra[2].rows = 800
rra[2].cur_row = 429
rra[2].pdp_per_row = 24
rra[2].xff = 5.0000000000e-01
rra[2].cdp_prep[0].value = 1.9397820367e+02
rra[2].cdp_prep[0].unknown_datapoints = 0
rra[2].cdp_prep[1].value = 2.9895480400e+02
rra[2].cdp_prep[1].unknown_datapoints = 0
rra[2].cdp_prep[2].value = 2.6880232002e+03
rra[2].cdp_prep[2].unknown_datapoints = 0
rra[3].cf = "AVERAGE"
rra[3].rows = 800
rra[3].cur_row = 636
rra[3].pdp_per_row = 288
rra[3].xff = 5.0000000000e-01
rra[3].cdp_prep[0].value = 1.9397820367e+02
rra[3].cdp_prep[0].unknown_datapoints = 0
rra[3].cdp_prep[1].value = 2.9895480400e+02
rra[3].cdp_prep[1].unknown_datapoints = 0
rra[3].cdp_prep[2].value = 2.6880232002e+03
rra[3].cdp_prep[2].unknown_datapoints = 0
rra[4].cf = "MAX"
rra[4].rows = 800
rra[4].cur_row = 696
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[4].cdp_prep[2].value = NaN
rra[4].cdp_prep[2].unknown_datapoints = 0
rra[5].cf = "MAX"
rra[5].rows = 800
rra[5].cur_row = 429
rra[5].pdp_per_row = 24
rra[5].xff = 5.0000000000e-01
rra[5].cdp_prep[0].value = 2.5000000000e+01
rra[5].cdp_prep[0].unknown_datapoints = 0
rra[5].cdp_prep[1].value = 3.9000000000e+01
rra[5].cdp_prep[1].unknown_datapoints = 0
rra[5].cdp_prep[2].value = 3.3799141739e+02
rra[5].cdp_prep[2].unknown_datapoints = 0
rra[6].cf = "MAX"
rra[6].rows = 800
rra[6].cur_row = 636
rra[6].pdp_per_row = 288
rra[6].xff = 5.0000000000e-01
rra[6].cdp_prep[0].value = 2.5000000000e+01
rra[6].cdp_prep[0].unknown_datapoints = 0
rra[6].cdp_prep[1].value = 3.9000000000e+01
rra[6].cdp_prep[1].unknown_datapoints = 0
rra[6].cdp_prep[2].value = 3.3799141739e+02
rra[6].cdp_prep[2].unknown_datapoints = 0
5 year RRA producing graphs but rra_id=all doesn't display
Moderators: Developers, Moderators
Re: 5 year RRA producing graphs but rra_id=all doesn't displ
Hmm it looks like it's controlled by:
lib/functions.php:/* get_associated_rras - returns a list of all RRAs referenced by a particular graph
Which is:
function get_associated_rras($local_graph_id) {
return db_fetch_assoc("select
rra.id,
rra.steps,
rra.rows,
rra.name,
rra.timespan,
data_template_data.rrd_step
from graph_templates_item
LEFT JOIN data_template_rrd ON (graph_templates_item.task_item_id=data_template_rrd.id)
LEFT JOIN data_template_data ON (data_template_rrd.local_data_id=data_template_data.local_data_id)
LEFT JOIN data_template_data_rra ON (data_template_data.id=data_template_data_rra.data_template_data_id)
LEFT JOIN rra ON (data_template_data_rra.rra_id=rra.id)
where graph_templates_item.local_graph_id=$local_graph_id
AND data_template_rrd.local_data_id != 0
group by rra.id
order by rra.timespan");
so I'm going to have a look now at the DB and see what records it's missing for this to work...
lib/functions.php:/* get_associated_rras - returns a list of all RRAs referenced by a particular graph
Which is:
function get_associated_rras($local_graph_id) {
return db_fetch_assoc("select
rra.id,
rra.steps,
rra.rows,
rra.name,
rra.timespan,
data_template_data.rrd_step
from graph_templates_item
LEFT JOIN data_template_rrd ON (graph_templates_item.task_item_id=data_template_rrd.id)
LEFT JOIN data_template_data ON (data_template_rrd.local_data_id=data_template_data.local_data_id)
LEFT JOIN data_template_data_rra ON (data_template_data.id=data_template_data_rra.data_template_data_id)
LEFT JOIN rra ON (data_template_data_rra.rra_id=rra.id)
where graph_templates_item.local_graph_id=$local_graph_id
AND data_template_rrd.local_data_id != 0
group by rra.id
order by rra.timespan");
so I'm going to have a look now at the DB and see what records it's missing for this to work...
Re: 5 year RRA producing graphs but rra_id=all doesn't displ
Poor form I know, but I've narrowed it down to data in the joining table: data_template_data_rra
Basically it's not getting populated with the records necessary to return all of the new RRAs. So inserting these values:
INSERT INTO `cacti`.`data_template_data_rra` (`data_template_data_id`, `rra_id`) VALUES ('2800', '5');
INSERT INTO `cacti`.`data_template_data_rra` (`data_template_data_id`, `rra_id`) VALUES ('2800', '6');
fixed it.
So I can write a query or manually go and fix it for any datasources that I want this for now... but the underlying question is now why doesn't adding an RRA to a data template automatically add these rows? I would have thought that select the new RRAs in the list and saving should populate through the necessary child tables too? (from data_templates.php?action=template_edit&id=<$data_template_id> )
When you make the change in the GUI it definitely saves "something" because subsequent visits to that record show that you've selected the RRA in question, but it didn't insert those two rows required.
Any tips? Bug? PEBKAC?
Basically it's not getting populated with the records necessary to return all of the new RRAs. So inserting these values:
INSERT INTO `cacti`.`data_template_data_rra` (`data_template_data_id`, `rra_id`) VALUES ('2800', '5');
INSERT INTO `cacti`.`data_template_data_rra` (`data_template_data_id`, `rra_id`) VALUES ('2800', '6');
fixed it.
So I can write a query or manually go and fix it for any datasources that I want this for now... but the underlying question is now why doesn't adding an RRA to a data template automatically add these rows? I would have thought that select the new RRAs in the list and saving should populate through the necessary child tables too? (from data_templates.php?action=template_edit&id=<$data_template_id> )
When you make the change in the GUI it definitely saves "something" because subsequent visits to that record show that you've selected the RRA in question, but it didn't insert those two rows required.
Any tips? Bug? PEBKAC?
Who is online
Users browsing this forum: No registered users and 0 guests