To list the graph and data source properties for a specific Graph Id:
select d.title as 'Graph Name',a.local_graph_id as 'Graph Id',c.name as 'Data Source Name',b.local_data_id as 'Data Source Id',c.active as 'Active',c.data_source_path as 'RRD File'
from graph_templates_item a
left join data_template_rrd b on (b.id = a.task_item_id)
left join graph_templates_graph d on (d.local_graph_id = a.local_graph_id)
left join data_template_data c on (c.local_data_id = b.local_data_id)
where a.local_graph_id = 22093
group by a.local_graph_id;
** Please note the local_graph_id value
To list the graph and data source properties for a specific Data Source Id:
select d.title as 'Graph Name',a.local_graph_id as 'Graph Id',c.name as 'Data Source Name',b.local_data_id as 'Data Source Id',c.active as 'Active',c.data_source_path as 'RRD File'
from graph_templates_item a
left join data_template_rrd b on (b.id = a.task_item_id)
left join graph_templates_graph d on (d.local_graph_id = a.local_graph_id)
left join data_template_data c on (c.local_data_id = b.local_data_id)
where b.local_data_id = 22023
group by b.local_data_id;
** Please note the local_data_id value
To 'turn off' data sources of graphs that have been moved to the Archive_BOD_Requests graph tree
update data_template_data
set active = ''
where local_data_id in (select `Data Source Id` from archived_bod_request_view);
followed by:
select concat("rm -f /opt/cacti/rra",data_source_path) as 'command'
from data_template_data
where name like '%_BoD_urn_uuid%'
and active <> 'on';