Cacti / plugin_npc

Nagios Plugin for Cacti is a complete UI replacement for Nagios fully integrated into Cacti.
GNU General Public License v3.0
4 stars 3 forks source link

Just install the develop version, has problem to active plugin #1

Closed zhouleon closed 5 years ago

zhouleon commented 5 years ago

Here is the error message:

2019.02.01 19:40:20 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'npc'

2019.02.01 19:40:20 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler()) 2019.02.01 19:40:20 - ERROR PHP ERROR in Plugin 'npc': Uncaught Doctrine_Connection_Mysql_Exception: SQLSTATE[HY000]: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column 'cacti.n10.instance_name' which is not in SELECT list; this is incompatible with DISTINCT in /usr/share/cacti/site/plugins/npc/lib/Doctrine/Connection.php:1086 Stack trace: #0 /usr/share/cacti/site/plugins/npc/lib/Doctrine/Connection.php(1034): Doctrine_Connection->rethrowException(Object(PDOException), Object(Doctrine_Connection_Mysql)) #1 /usr/share/cacti/site/plugins/npc/lib/Doctrine/Query.php(1133): Doctrine_Connection->execute('SELECT DISTINCT...', Array) #2 /usr/share/cacti/site/plugins/npc/lib/Doctrine/Query/Abstract.php(971): Doctrine_Query->getSqlQuery(Array) #3 /usr/share/cacti/site/plugins/npc/lib/Doctrine/Query/Abstract.php(1030): Doctrine_Query_Abstract->_execute(Array) #4 /usr/share/cacti/site/plugins/npc/lib/Doctrine/Pager.php(573): Doctrine_Query_Abstract->execute(Array, 3) #5 /usr/share/cacti/site/plugins/npc/controllers/hosts.php(217): D in file: /usr/share/cacti/site/plugins/npc/lib/Doctrine/Connection.php on line: 1086

2019.02.01 19:40:20 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'npc' 2019.02.01 19:40:20 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler()) 2019.02.01 19:40:20 - ERROR PHP ERROR in Plugin 'npc': Uncaught Doctrine_Connection_Mysql_Exception: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'cacti.n.processevent_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by in /usr/share/cacti/site/plugins/npc/lib/Doctrine/Connection.php:1086 Stack trace: #0 /usr/share/cacti/site/plugins/npc/lib/Doctrine/Connection/Statement.php(253): Doctrine_Connection->rethrowException(Object(PDOException), Object(Doctrine_Connection_Statement)) #1 /usr/share/cacti/site/plugins/npc/lib/Doctrine/Connection.php(1014): Doctrine_Connection_Statement->execute(Array) #2 /usr/share/cacti/site/plugins/npc/lib/Doctrine/Query/Abstract.php(986): Doctrine_Connection->execute('SELECT n.proces...', Array) #3 /usr/share/cacti/site/plugins/npc/lib/Doctrine/Query/Abstract.php(1030): Doctrine_Query_Abstract->_execute(Array) #4 /usr/share/cacti/site/plugins/npc/controllers/nagios in file: /usr/share/cacti/site/plugins/npc/lib/Doctrine/Connection.php on line: 1086

Version Info: Linux: Ubuntu 18.01 LST Apache 2.4.29 MySQL 5.7.25-0ubuntu0.18.04.2 PHP 7.2.10-0ubuntu0.18.04.1 Nagios Core 4.4.3 Cacti 1.2.1 ndoutils 2.1.3

Please help to check, thanks!

cigamit commented 5 years ago

I think the solution here is to rip out doctrine. It's a fair bit of work as it makes swiss cheese of the queries. There are close to 100 entries. It'll take a while.

cigamit commented 5 years ago

As a near term workaround, edit your my.cnf or your /etc/my.cnf.d/server.cnf and add the following:

sql_mode=NO_ENGINE_SUBSTITUTION

Then, restart MySQL/MariaDB. That should remove the error until such time Doctrine can be extricated. It's a lot of work.

cigamit commented 5 years ago

After restart, run the following command to ensure that it was set properly:

SHOW GLOBAL VARIABLES LIKE 'sql_mode';

zhouleon commented 5 years ago

thanks, this problem should be OK according to your solution: sql_mode=NO_ENGINE_SUBSTITUTION But, next error shows up and I will create another issues. thanks!