I apologize if this is something that’s already been resolved or if I’m doing something wrong, I did a search and didn’t find anything really similar, but if I missed something please let me know.
I’m trying to pull up a history of alerts this year which triggered with a specific word (“Commercial”) in the output of the check. Icingaweb2 gives me the option of filtering by “Output”, which should do what I want, but when I select it it gives me an error and a huge SQL statement, as seen in screenshots. This is done on the History > Event Overview page.
For reference, I can find the info I want from MySQL with the following query:
select * from icinga_statehistory where long_output like '%Commercial%' AND state_time > "2018-12-31 23:59:59";
Then when I click the “Apply” button:
And the specific stack trace:
SQLSTATE[HY000]: General error: 1111 Invalid use of group function
#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement/Pdo.php(219): PDOStatement->execute(Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array)
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(String, Array)
#4 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(744): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
#5 /usr/share/php/Icinga/Data/Db/DbConnection.php(332): Zend_Db_Adapter_Abstract->fetchRow(Object(Zend_Db_Select))
#6 /usr/share/php/Icinga/Data/SimpleQuery.php(579): Icinga\Data\Db\DbConnection->fetchRow(Object(Icinga\Module\Monitoring\Backend\Ido\Query\EventhistoryQuery))
#7 /usr/share/php/Icinga/Data/SimpleQuery.php(455): Icinga\Data\SimpleQuery->fetchRow()
#8 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/DataView/DataView.php(538): Icinga\Data\SimpleQuery->hasResult()
#9 zend.view:///usr/share/icingaweb2/modules/monitoring/application/views/scripts/partials/event-history.phtml(32): Icinga\Module\Monitoring\DataView\DataView->hasResult()
#10 /usr/share/php/Icinga/Web/View.php(259): include(String)
#11 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#12 /usr/share/icingaweb2/library/vendor/Zend/View/Helper/Partial.php(106): Zend_View_Abstract->render()
#13 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(345): Zend_View_Helper_Partial->partial(String, Array)
#14 /usr/share/php/Icinga/Web/View.php(278): Zend_View_Abstract->__call(String, Array)
#15 zend.view:///usr/share/icingaweb2/modules/monitoring/application/views/scripts/list/eventhistory.phtml(19): Icinga\Web\View->__call(String, Array)
#16 /usr/share/php/Icinga/Web/View.php(259): include(String)
#17 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#18 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render()
#19 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript(String, NULL)
#20 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#21 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#22 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#23 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#24 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#25 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#26 /usr/share/php/Icinga/Application/webrouter.php(104): Icinga\Application\Web->dispatch()
#27 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#28 {main}