Cacti / plugin_reportit

ReportIt Plugin for Cacti
GNU General Public License v2.0
7 stars 9 forks source link

ReportIT plugin + Cacti1.1.28 #20

Closed Kallyx closed 6 years ago

Kallyx commented 6 years ago

Hi there,

A little help on this will be very appreciated;

I have installed ReportIT plugin on Cacti 1.1.28(MariaDB-server-10.1.22-1.el7); The following error has occurred and seems to be related to a MariaDB wrong syntax used; Any idea on this matter? Error:1064, SQL:'SHOW TABLE STATUS WHERE Name LIKE 'reportittmp%' AND (UNIX_TIMESTAMP(Update_time) + )

22/May/2018 10:15:23 - CMDPHP SQL Backtrace: (/poller.php: 722 api_plugin_hook)(/lib/plugins.php: 73 api_plugin_run_plugin_hook)(/lib/plugins.php: 170 reportit_poller_bottom)(/plugins/reportit/setup.php: 761 db_fetch_assoc)(/lib/database.php: 360 db_fetch_assoc_prepared)(/lib/database.php: 401 cacti_debug_backtrace) 22/May/2018 10:15:23 - DBCALL ERROR: SQL Assoc Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') <= UNIX_TIMESTAMP()' at line 1 22/May/2018 10:15:23 - DBCALL ERROR: SQL Assoc Failed!, Error:1064, SQL:'SHOW TABLE STATUS WHERE Name LIKE 'reportittmp%' AND (UNIX_TIMESTAMP(Update_time) + ) <= UNIX_TIMESTAMP()'

Kallyx commented 6 years ago

Thank you in advance!

Kallyx commented 6 years ago

Short notice: the issue seems to be related to reportit/setup.php

-current syntax $sql = "SHOW TABLE STATUS WHERE 'Name' LIKE 'reportittmp%' AND (UNIX_TIMESTAMP(Update_time) + $lifecycle) <= UNIX_TIMESTAMP()";

-modified MariaDB syntax $sql = "SHOW TABLE STATUS WHERE 'Tables_in_cacti' LIKE 'reportittmp%' AND (UNIX_TIMESTAMP(Update_time) + $lifecycle) <= UNIX_TIMESTAMP()";

Even though I have modified it and no errors are returned, I cannot find a way to define any report. Not any button available.

image

Kallyx commented 6 years ago

There is not any table with such format "reportittmp"

MariaDB [cacti]> SHOW TABLE STATUS WHERE 'Tables_in_cacti' LIKE 'reportittmp%'; Empty set (0.00 sec)

MariaDB [cacti]> MariaDB [cacti]>

Kallyx commented 6 years ago

MariaDB [cacti]> SHOW TABLES WHERE Tables_in_cacti LIKE '%reportit%'; +--------------------------------------+ | Tables_in_cacti | +--------------------------------------+ | plugin_reportit_cache_measurands | | plugin_reportit_cache_reports | | plugin_reportit_cache_variables | | plugin_reportit_data_items | | plugin_reportit_data_source_items | | plugin_reportit_data_template_groups | | plugin_reportit_measurands | | plugin_reportit_presets | | plugin_reportit_recipients | | plugin_reportit_reports | | plugin_reportit_rvars | | plugin_reportit_templates | | plugin_reportit_variables | +--------------------------------------+ 13 rows in set (0.00 sec)

MariaDB [cacti]> MariaDB [cacti]> MariaDB [cacti]> MariaDB [cacti]> SHOW TABLES WHERE Tables_in_cacti LIKE 'reportit%'; Empty set (0.00 sec)

MariaDB [cacti]>

Kallyx commented 6 years ago

MariaDB [cacti]> SHOW TABLE STATUS; +--------------------------------------+--------+---------+------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+--------------+----------+----------------+--------------------------------------------------------------------------------------------------------------------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Checksum | Create_options | Comment | +--------------------------------------+--------+---------+------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+--------------+----------+----------------+--------------------------------------------------------------------------------------------------------------------+ | aggregate_graph_templates | InnoDB | 10 | Compact | 0 | 0 | 16384 | 0 | 32768 | 12582912 | 1 | 2017-11-28 15:20:51 | NULL i | NULL | | Template Definitions for Aggregate Graphs | | aggregate_graph_templates_graph | InnoDB | 10 | Compact | 0 | 0 | 16384 | 0 | 0 | 12582912 | NULL | 2017-11-28 15:20:51 | NULL i | NULL | | Aggregate Template Graph Data

Kallyx commented 6 years ago

MariaDB-query.txt

Kallyx commented 6 years ago

MariaDB [cacti]> show global variables like '%mode%'; +--------------------------+--------------------------------------------+ | Variable_name | Value | +--------------------------+--------------------------------------------+ | gtid_strict_mode | OFF | | innodb_autoinc_lock_mode | 1 | | innodb_strict_mode | OFF | | old_mode | | | slave_ddl_exec_mode | IDEMPOTENT | | slave_exec_mode | STRICT | | slave_parallel_mode | conservative | | sql_mode | NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | | wsrep_gtid_mode | OFF | +--------------------------+--------------------------------------------+ 9 rows in set (0.00 sec)

MariaDB [cacti]>

browniebraun commented 6 years ago

fixed