Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Mar 23, 2019 10:01 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Can't delete data source with no associated graphs
PostPosted: Thu Feb 14, 2019 3:18 pm 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 272
I definitely tried to find the graph attached to it, but I have had no luck. On the "Data Sources" page it says it is not deletable an when I click on the associated template on that page I get this. Clicking the dropdown with the "-" in it just shows another "-". Cacti 1.2.1 and RRDTool 1.7.0

Attachment:
rrdtool.png
rrdtool.png [ 14.62 KiB | Viewed 166 times ]


Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Mon Feb 25, 2019 3:03 pm 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 272
I know you aren't really supposed to delete data sources directly via the database, but I think that is my only option here? Upgraded to Cacti 1.2.2 and the problem still exists. What command should I use to try and remove data source via MySQL?


Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Mon Feb 25, 2019 3:37 pm 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 224
Location: Long Island, New York, USA
I thought I was the only one with that issue... Cannot delete it, even after disabling polling on the host. Not sure how many versions ago this started. I first noticed in the log file when it erred out. Then I realized it wasn't configured to do anything.

Attachment:
datasource.png
datasource.png [ 92.74 KiB | Viewed 144 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: Tue Feb 26, 2019 10:00 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2296
Code:
select * from data_template_data where local_data_id = ?

Replace the question mark with the id of the data source, what comes back?

_________________
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: Tue Feb 26, 2019 10:13 am 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 224
Location: Long Island, New York, USA
MariaDB [cacti]> select * from data_template_data where local_data_id = 234;
+-----+-----------------------------+---------------+------------------+---------------+--------+----------------------+-------------------------+-----------------------+----------+--------+------------+----------+--------------------------+------------------------+
| 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 |
+-----+-----------------------------+---------------+------------------+---------------+--------+----------------------+-------------------------+-----------------------+----------+--------+------------+----------+--------------------------+------------------------+
| 352 | 69 | 234 | 48 | 1 | NULL | |host_description| - | XxxxxxxXxxxx - XXX##X - | <path_rra>/24/234.rrd | | on | | 300 | | 1 |
+-----+-----------------------------+---------------+------------------+---------------+--------+----------------------+-------------------------+-----------------------+----------+--------+------------+----------+--------------------------+------------------------+
1 row in set (0.00 sec)

id: 352
local_data_template_data_id: 69
local_data_id: 234
data_template_id: 48
data_input_id: 1
t_name: NULL
name: |host_description| -
name_cache: XxxxxxxXxxxx - XXX##X - (obfuscated)
data_source_path: <path_rra>/24/234.rrd
t_active: (blank)
active: on
t_rrd_step: (blank)
rrd_step: 300
t_data_source_profile_id: (blank)
data_source_profile_id: 1

_________________
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: Tue Feb 26, 2019 10:21 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 272
mysql> use cacti1x
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from data_template_data where local_data_id = 144851;
Empty set (0.00 sec)


Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Tue Feb 26, 2019 10:32 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2296
Try this query:

Code:
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 = ?

_________________
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: Tue Feb 26, 2019 10:43 am 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 224
Location: Long Island, New York, USA
MariaDB [cacti]> 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 = 234;
+----------------+-----------+-------------+----------------------+-------+-------------+
| local_graph_id | Deletable | graph_local | graph_template_graph | title | title_cache |
+----------------+-----------+-------------+----------------------+-------+-------------+
|.............207 |..........0 | Found.......| Missing...................| NULL | NULL........|
+----------------+-----------+-------------+----------------------+-------+-------------+
1 row in set (0.00 sec)

_________________
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: Tue Feb 26, 2019 10:46 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 272
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 = 144851
-> ;
Empty set (0.00 sec)


Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Tue Feb 26, 2019 3:31 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2296
Well, that's mightly weird because that says you have no got the data source in use at all. Try changing the following lines to see what happens:

Code:
INNER JOIN data_template_rrd AS dtr
ON dl.id=dtr.local_data_id


to

Code:
LEFT JOIN data_template_rrd AS dtr
ON dl.id=dtr.local_data_id

_________________
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: Tue Feb 26, 2019 3:38 pm 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 224
Location: Long Island, New York, USA
MariaDB [cacti]> 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
-> LEFT 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 = 234;

+----------------+-----------+-------------+----------------------+-------+-------------+
| local_graph_id | Deletable | graph_local | graph_template_graph | title | title_cache |
+----------------+-----------+-------------+----------------------+-------+-------------+
| 207 | 0 | Found | Missing | NULL | NULL |
+----------------+-----------+-------------+----------------------+-------+-------------+
1 row in set (0.00 sec)

(ILEFT is a typo...)

_________________
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: Tue Feb 26, 2019 3:53 pm 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 272
Looks like camaerabob's DB is in better shape than mine.

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
    -> LEFT 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 = 144851
    -> ;
Empty set (0.00 sec)


Top
 Profile  
 
 Post subject: Re: Can't delete data source with no associated graphs
PostPosted: Tue Feb 26, 2019 3:56 pm 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 224
Location: Long Island, New York, USA
Are you sure you have the right data source number?

_________________
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: Tue Feb 26, 2019 4:01 pm 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 272
Yep.
Attachment:
snmp.png
snmp.png [ 4.73 KiB | Viewed 128 times ]


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

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2296
Well, that makes no sense unless you are querying the wrong database.

_________________
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  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 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