Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Mar 22, 2019 12:23 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Wed Feb 27, 2019 8:58 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 272
No, just one DB. Figured out why none of my SQL worked; I was reading the "1" in the "Poller Interval" column as part of the data source ID, duh.

Here is the requested SQL when using the correct ID.
Code:
mysql> select * from data_template_data where local_data_id = 14485;
+-------+-----------------------------+---------------+------------------+---------------+--------+-----------------------------+----------------+-------------------------------------+----------+--------+------------+----------+--------------------------+------------------------+
| id    | local_data_template_data_id | local_data_id | data_template_id | data_input_id | t_name | name                        | name_cache     | data_source_path                    | t_active | active | t_rrd_step | rrd_step | t_data_source_profile_id | data_source_profile_id |
+-------+-----------------------------+---------------+------------------+---------------+--------+-----------------------------+----------------+-------------------------------------+----------+--------+------------+----------+--------------------------+------------------------+
| 14661 |                          69 |         14485 |               48 |             1 |        | |host_description| - apache | app02 - apache | <path_rra>/app02_snmp_oid_14485.rrd |          |        |            |       60 |                          |                      3 |
+-------+-----------------------------+---------------+------------------+---------------+--------+-----------------------------+----------------+-------------------------------------+----------+--------+------------+----------+--------------------------+------------------------+
1 row in set (0.00 sec)

mysql> SELECT DISTINCT
    ->    gti.local_graph_id,
    ->       (CASE WHEN gti.id IS NOT NULL THEN 0 ELSE 1 END) AS Deletable,
    ->     (CASE WHEN gl.id IS NOT NULL THEN 'Found' ELSE 'Missing' END) AS graph_local,
    ->     (CASE WHEN gtg.id IS NOT NULL THEN 'Found' ELSE 'Missing' END) AS graph_template_graph,
    ->     gtg.title, gtg.title_cache
    -> FROM data_local AS dl
    -> INNER JOIN data_template_rrd AS dtr
    -> ON dl.id=dtr.local_data_id
    -> LEFT JOIN graph_templates_item AS gti
    -> ON gti.task_item_id=dtr.id
    -> LEFT JOIN graph_local AS gl
    -> ON gl.id = gti.local_graph_id
    -> LEFT JOIN graph_templates_graph as gtg
    -> ON gtg.local_graph_id = gti.local_graph_id
    -> WHERE dl.id = 14485;
+----------------+-----------+-------------+----------------------+-------+-------------+
| local_graph_id | Deletable | graph_local | graph_template_graph | title | title_cache |
+----------------+-----------+-------------+----------------------+-------+-------------+
|          10983 |         0 | Found       | Missing              | NULL  | NULL        |
+----------------+-----------+-------------+----------------------+-------+-------------+
1 row in set (0.00 sec)


Attachments:
snmp.png
snmp.png [ 4.73 KiB | Viewed 89 times ]
Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Wed Feb 27, 2019 9:27 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2286
I think this means you still have a template that references that data source in some way. Either way, if you add gl.id to the list of fields being shown, that will be the local graph id that uses this data source.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Wed Feb 27, 2019 9:39 am 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 223
Location: Long Island, New York, USA
With respect to mine, I HAVE no graph 207...
Attachment:
graphs.png
graphs.png [ 133.36 KiB | Viewed 87 times ]

_________________
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.2 @ CentOS 7-6.1810.2.el7
Test: Cacti 1.2.2 @ CentOS 7-6.1810.2.el7


Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Wed Feb 27, 2019 9:44 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 272
Same deal for me. No graph 10983

Code:
mysql> SELECT DISTINCT
    -> gti.local_graph_id,
    -> (CASE WHEN gti.id IS NOT NULL THEN 0 ELSE 1 END) AS Deletable,
    -> (CASE WHEN gl.id IS NOT NULL THEN 'Found' ELSE 'Missing' END) AS graph_local,
    -> (CASE WHEN gtg.id IS NOT NULL THEN 'Found' ELSE 'Missing' END) AS graph_template_graph,
    -> gtg.title, gtg.title_cache
    -> FROM data_local AS dl
    -> INNER JOIN data_template_rrd AS dtr
    -> ON dl.id=dtr.local_data_id
    -> LEFT JOIN graph_templates_item AS gti
    -> ON gti.task_item_id=dtr.id
    -> LEFT JOIN graph_local AS gl
    -> ON gl.id = gti.local_graph_id
    -> LEFT JOIN graph_templates_graph as gtg
    -> ON gtg.local_graph_id = gti.local_graph_id
    -> WHERE dl.id = 14485;
+----------------+-----------+-------------+----------------------+-------+-------------+
| local_graph_id | Deletable | graph_local | graph_template_graph | title | title_cache |
+----------------+-----------+-------------+----------------------+-------+-------------+
|          10983 |         0 | Found       | Missing              | NULL  | NULL        |
+----------------+-----------+-------------+----------------------+-------+-------------+
1 row in set (0.00 sec)

Attachment:
graphs.png
graphs.png [ 10.43 KiB | Viewed 87 times ]


Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Wed Feb 27, 2019 11:34 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2286
OK so somehow, you have a graph but no graph... I think this needs to be an issue over on Github so we can properly track and fix this. If one of you would create it, and we can transfer over the tests we have done from here too.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Wed Feb 27, 2019 12:07 pm 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 223
Location: Long Island, New York, USA
Done

https://github.com/Cacti/cacti/issues/2463

Tests transferred with screen shots and link here as well.

_________________
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.2 @ CentOS 7-6.1810.2.el7
Test: Cacti 1.2.2 @ CentOS 7-6.1810.2.el7


Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Wed Feb 27, 2019 10:23 pm 
Offline
Cacti Pro User
User avatar

Joined: Mon Jan 05, 2015 10:10 am
Posts: 753
This looks like a bug that was created by an recent update to the thold plugin. That issue has now been resolved.

_________________
Before history, there was a paradise, now dust.


Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Thu Feb 28, 2019 8:03 am 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 223
Location: Long Island, New York, USA
That may be true, but how do we get rid of the zombie data sources?

_________________
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.2 @ CentOS 7-6.1810.2.el7
Test: Cacti 1.2.2 @ CentOS 7-6.1810.2.el7


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot] and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group