Cacti / plugin_flowview

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

Schedules don't work #46

Closed darvin2000 closed 3 years ago

darvin2000 commented 4 years ago

My setup:

When I create a schedule with the desired filter, I get an error during its execution.

2020/04/26 13:53:59 - MAILER ERROR: Could not access file:
2020/04/26 13:53:59 - CMDPHP SQL Backtrace:   (/plugins/flowview/flowview_schedules.php[109]:actions_schedules(),  /plugins/flowview/flowview_schedules.php[151]:plugin_flowview_run_schedule(),  /plugins/flowview/functions.php[1143]:load_data_for_filter(),  /plugins/flowview/functions.php[1245]:run_flow_query(),  /plugins/flowview/functions.php[1921]:db_fetch_assoc(),  /lib/database.php[473]:db_fetch_assoc_prepared(),  /lib/database.php[487]:db_execute_prepared())
2020/04/26 13:53:59 - CMDPHP ERROR: A DB Row Failed!, Error: You  have an error in your SQL syntax; check the manual that corresponds to  your MySQL server version for the right syntax to use near ') AS rs  GROUP BY INET6_NTOA(src_addr) HAVING bytes < 1024000 ORDER BY  INET6_NTOA' at line 1

Test mail works fine.

netniV commented 4 years ago

This suggests there is a problem with the query and as it's not pulling up the correct detail, it's attempting then to add an attachment to an email with a blank name.

netniV commented 4 years ago

Unfortunately, without the full SQL statement, it will be hard for me to work out what the issue is. My first hunch is that it's to do with the order by clause using INET6_NTOA but I don't know if that is simply cut off by the error message, so it could actually be that the bracket at the start is misplaced.

Disclaimer, I never really work on flowview

TheWitness commented 4 years ago

I'm not surprised. It was at a point where it needed to be put out to the wild, though not fully tested.

TheWitness commented 4 years ago

What version of MariaDB/MySQL. The function mentioned by @netniV is fairly recent.

TheWitness commented 3 years ago

This is fixed now.