Cacti / plugin_flowview

FlowView Plugin for Cacti
GNU General Public License v2.0
18 stars 10 forks source link

some queries are using the local cacti DB instead of a set remote DB #158

Closed bmfmancini closed 4 days ago

bmfmancini commented 5 days ago

So far the following tables are being queried by flowview on the local cactidb

plugin_flowview_devices this one saves to the local db but does a select on the remote if you manually insert the expected details it works plugin_flowview_queries plugin_flowview_filters

the tables are created on the remote db but you will get an error saying that the table does not exist if you create the table on the local cacti db it will be populated I have not found a reason as of yet

Some relevant errors

2024-07-05 21:47:33 - CMDPHP SQL Backtrace: (/plugins/flowview/flowview_filters.php[49]:save_filter(), /plugins/flowview/functions.php[414]:flowview_sql_save(), /plugins/flowview/database.php[228]:sql_save())
2024-07-05 21:47:33 - DBCALL ERROR: SQL Save on table 'plugin_flowview_queries': Table does not exist, unable to save!
2024-07-05 21:47:18 - CMDPHP SQL Backtrace: (/plugins/flowview/flowview_filters.php[59]:edit_filter(), /plugins/flowview/functions.php[176]:draw_edit_form(), /lib/html_form.php[132]:draw_edit_control(), /lib/html_form.php[302]:db_fetch_assoc(), /lib/database.php[707]:db_fetch_assoc_prepared(), /lib/database.php[727]:db_execute_prepared())
2024-07-05 21:47:18 - CMDPHP ERROR: A DB Row Failed!, Error: Table 'cacti.plugin_flowview_device_streams' doesn't exist
2024-07-05 21:47:18 - CMDPHP SQL Backtrace: (/plugins/flowview/flowview_filters.php[59]:edit_filter(), /plugins/flowview/functions.php[176]:draw_edit_form(), /lib/html_form.php[132]:draw_edit_control(), /lib/html_form.php[302]:db_fetch_assoc(), /lib/database.php[707]:db_fetch_assoc_prepared(), /lib/database.php[727]:db_execute_prepared())
2024-07-05 21:47:18 - CMDPHP ERROR: A DB Row Failed!, Error: Table 'cacti.plugin_flowview_device_templates' doesn't exist 

Remote DB tables

ariaDB [flowview]> show tables;
+-------------------------------------+
| Tables_in_flowview                  |
+-------------------------------------+
| parallel_database_query             |
| parallel_database_query_shard       |
| parallel_database_query_shard_cache |
| plugin_flowview_arin_information    |
| plugin_flowview_device_streams      |
| plugin_flowview_device_templates    |
| plugin_flowview_devices             |
| plugin_flowview_dnscache            |
| plugin_flowview_ports               |
| plugin_flowview_queries             |
| plugin_flowview_raw_2024186         |
| plugin_flowview_schedules           |
+-------------------------------------+
12 rows in set (0.000 sec)
TheWitness commented 5 days ago

What version of Cacti?

bmfmancini commented 5 days ago

1.2.27

TheWitness commented 5 days ago

This should be fixed now.

bmfmancini commented 5 days ago

this is still ongoing

024-07-06 00:49:47 - CMDPHP SQL Backtrace: (/plugins/flowview/flowview_devices.php[97]:save_devices(), /plugins/flowview/flowview_devices.php[251]:flowview_sql_save(), /plugins/flowview/database.php[228]:sql_save())
2024-07-06 00:49:47 - DBCALL ERROR: SQL Save on table 'plugin_flowview_devices': Table does not exist, unable to save! 
bmfmancini commented 5 days ago

I confirm the db is connected to the remote

2024-07-06 01:55:02 - CMDPHP flowview
2024-07-06 01:55:02 - CMDPHP 192.168.2.27
2024-07-06 01:55:02 - CMDPHP flowview
2024-07-06 01:55:02 - CMDPHP 192.168.2.27 

dbconnect_real and flowview_db connect seem to be pointing correctly need to do more digging