Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

update data_template_data
set active = ''
where local_data_id in (select `Data Source Id` from archived_bod_request_view);

*** Note that the view archived_bod_request_view is created with the following query:

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 in (select local_graph_id from graph_tree_items where graph_tree_id = 38 and rra_id <> 0 order by local_graph_id)
group by a.local_graph_id;

followed by:

select concat("rm -f /opt/cacti/rra/",SUBSTRING_INDEX(data_source_path,'/',-1)) as 'command'
from data_template_data
where name like '%_BoD_urn_uuid%'
and active <> 'on';

...