Hello,
I was doing some cleanup on one of my systems and I deleted some devices and their data sources when prompted. The data source template is no longer needed but I cannot delete it, it says there are two data sources using it. When you look for data sources using that template, there are none. I have run the mysqlcheck on the DB and cacti's repair_database and repair_templates, no change, no error when running the utilities. Any ideas?
Cannot delete data template, says data sources using it
Moderators: Developers, Moderators
Re: Cannot delete data template, says data sources using it
Did you click on the number 2 under the data sources column ? You may get the same results but it does specifically filter to the template's own sources. If it does, you'll have to do some mysql level querying to see what local data id is using that template.
Edit your data template, grab the ID from the URL
run
Replace the question mark with the template id and this will give you a list of data sources. What you can then do is edit a data source, then change the ID on the end to the one from the SQL list.
Edit your data template, grab the ID from the URL
run
Code: Select all
SELECT id, data_template_id, host_id, snmp_query_id, snmp_index, orphan
FROM
cacti_develop.data_local l where data_template_id = ?
Cacti Developer & Release Manager
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Re: Cannot delete data template, says data sources using it
Thanks.
Yes, when I click on the "2" there are no data sources even when I look for orphaned. Looks like I've got some corruption going on in the database; I have 3 host IDs showing with that SELECT that do not appear in the GUI. I suspect this might be related to a php-fpm hang or crash I had the other day while I was working on things.
Yes, when I click on the "2" there are no data sources even when I look for orphaned. Looks like I've got some corruption going on in the database; I have 3 host IDs showing with that SELECT that do not appear in the GUI. I suspect this might be related to a php-fpm hang or crash I had the other day while I was working on things.
Re: Cannot delete data template, says data sources using it
Code: Select all
SELECT l.id data_local_id, l.data_template_id, l.snmp_query_id, l.snmp_index, l.orphan, l.host_id, h.id as linked_host_id, h.hostname, h.description
FROM data_local l
LEFT JOIN host h on h.id = l.host_id
where data_template_id = ?
Cacti Developer & Release Manager
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Re: Cannot delete data template, says data sources using it
That came up empty on the problem template. To be sure, I tested against a template known to have hosts and received expected results.
Re: Cannot delete data template, says data sources using it
Then it sounds like you will have some issues with those orphaned sources. You could just remove those entries from data_local but then you'd likely have others referring to it from other tables too.
Cacti Developer & Release Manager
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
The Cacti Group
Director
BV IT Solutions Ltd
+--------------------------------------------------------------------------+
Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Who is online
Users browsing this forum: No registered users and 5 guests