Well, I found the time to debug this. I added trace messages into plugins.php as suggested (see
my changes on GitHub). And after spending some time adding and adding trace messages, I finally got to this (which comes to confirm there is no problem with permissions):
Code: Select all
2018-03-14 22:40:30.46520:DEBUG: Enter plugins.php
2018-03-14 22:40:30.47262:DEBUG: Enter retrieve_plugin_list()
2018-03-14 22:40:30.47399:DEBUG: Plugin dir: thold2018-03-14 22:40:30.47416:DEBUG: Exit retrieve_plugin_list()
2018-03-14 22:40:30.52617:DEBUG: Enter update_show_current()
2018-03-14 22:40:30.52688:DEBUG: Enter plugins_load_temp_table()
2018-03-14 22:40:30.52701:DEBUG: table = plugin_temp_table_359531876
2018-03-14 22:40:30.53951:DEBUG: path = /var/www/htdocs/stats/cacti/plugins/
2018-03-14 22:40:30.53978:DEBUG: Reading '/var/www/htdocs/stats/cacti/plugins/'
2018-03-14 22:40:30.53994:DEBUG: Reading '/var/www/htdocs/stats/cacti/plugins/..'
2018-03-14 22:40:30.54009:DEBUG: Reading '/var/www/htdocs/stats/cacti/plugins/thold'
2018-03-14 22:40:30.54028:DEBUG: Is directory '/var/www/htdocs/stats/cacti/plugins/thold'
2018-03-14 22:40:30.54040:DEBUG: Found /var/www/htdocs/stats/cacti/plugins/thold/INFO
2018-03-14 22:40:30.54117:DEBUG: status = 0
2018-03-14 22:40:30.54310:DEBUG: exists = false
2018-03-14 22:40:30.54328:DEBUG: INSERT INTO plugin_temp_table_359531876 (directory, name, status, author, webpage, version, requires, infoname) VALUES (thold, Thresholds, 0, The Cacti Group, http://www.cacti.net, 1.0.4, , thold)
2018-03-14 22:40:30.54514:DEBUG: Reading '/var/www/htdocs/stats/cacti/plugins/index.php'
2018-03-14 22:40:30.54532:DEBUG: Reading '/var/www/htdocs/stats/cacti/plugins/.'
2018-03-14 22:40:30.54546:DEBUG: Closing '/var/www/htdocs/stats/cacti/plugins/'
2018-03-14 22:40:30.54557:DEBUG: Exit plugins_load_temp_table()
2018-03-14 22:40:30.54567:DEBUG: table = plugin_temp_table_359531876
2018-03-14 22:40:30.54682:DEBUG: SELECT count(*) FROM plugin_temp_table_359531876
2018-03-14 22:40:30.54857:DEBUG: total_rows =
2018-03-14 22:40:30.54888:DEBUG: SELECT * FROM plugin_temp_table_359531876 ORDER BY `name` ASC LIMIT 0,50
2018-03-14 22:40:30.55181:DEBUG: Plugins count = 0
2018-03-14 22:40:30.55210:DEBUG: Exit update_show_current()
2018-03-14 22:40:30.56745:DEBUG: Exit plugins.php
Hint: Notice the values of total_rows and Plugins count above.
This puzzled me for a few minutes until I realized that the temporary table is just not created. Which made me check cacti user's permissions into the database (I'm using MySQL 5.7.21 BTW) and
bingo CREATE TEMPORARY TABLES permission was not granted. I do not remember and cannot say why so, but I'm using this installation for about 10 years and as I mentioned already apparently by now I haven't used any plugins (shame on me).
Conclusion: Cacti plugins cannot be loaded from /plugins/ folder unless cacti's database user has CREATE TEMPORARY TABLES privilege granted (see
CREATE TEMPORARY TABLE Syntax). Thus, in my case the solution was to execute the following:
Code: Select all
GRANT CREATE TEMPORARY TABLES ON cacti.* TO 'cacti'@'localhost';
Note: If PHP is configured to use persistent connections then this won't take effect until new connection is used (or httpd or mysql are restarted).
So this was my problem. However, I think this could be better handled into plugins.php, because CREATE TEMPORARY TABLE would raise
Code: Select all
ERROR 1044 (42000): Access denied for user 'cacti'@'localhost' to database 'cacti'
if CREATE TEMPORARY TABLES privilege is not granted. I'm not that familiar with Cacti's sources, but I think plugins.php doesn't write any debug even this is enabled in Settings.