Closed arno-st closed 6 months ago
Whe I do a test with hostname is
the SQL query is the following:
SELECT * FROM `syslog`.`syslog_incoming` WHERE `host_id` = lslmysp11 AND `status` = 100100
I think the problem is the same a program name, you ask for a NAME but the query is based on an ID And You can't have the ID of the host on the 'Syslog Messages Filter' page,
I got this error when I try to do a rules with mariadb as program name:
12/01/2024 14:00:24 - ERROR PHP ERROR: Uncaught ValueError: PDO::prepare(): Argument #1 ($query) cannot be empty in /usr/share/cacti/lib/database.php:434 Stack trace: #0 /usr/share/cacti/lib/database.php(434): PDO->prepare() #1 /usr/share/cacti/lib/database.php(727): db_execute_prepared() #2 /usr/share/cacti/plugins/syslog/database.php(167): db_fetch_assoc_prepared() #3 /usr/share/cacti/plugins/syslog/syslog_alerts.php(306): syslog_db_fetch_assoc_prepared() #4 /usr/share/cacti/plugins/syslog/syslog_alerts.php(87): api_syslog_alert_save() #5 /usr/share/cacti/plugins/syslog/syslog_alerts.php(46): form_save() #6 {main} thrown in file: /usr/share/cacti/lib/database.php on line: 434
12/01/2024 14:00:24 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
Anyone have any clue ?
Are you running the latest version?
Can you attach a screen shot of the Query Edit page?
I just update the code from the dev repo (still 4.1), and here is the error I get:
29/01/2024 08:26:30 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
--
29/01/2024 08:26:30 - ERROR PHP ERROR: Uncaught ValueError: PDO::prepare(): Argument #1 ($query) cannot be empty in /usr/share/cacti/lib/database.php:434 Stack trace: #0 /usr/share/cacti/lib/database.php(434): PDO->prepare() #1 /usr/share/cacti/lib/database.php(727): db_execute_prepared() #2 /usr/share/cacti/plugins/syslog/database.php(167): db_fetch_assoc_prepared() #3 /usr/share/cacti/plugins/syslog/syslog_alerts.php(306): syslog_db_fetch_assoc_prepared() #4 /usr/share/cacti/plugins/syslog/syslog_alerts.php(87): api_syslog_alert_save() #5 /usr/share/cacti/plugins/syslog/syslog_alerts.php(46): form_save() #6 {main} thrown in file: /usr/share/cacti/lib/database.php on line: 434
That screen shot helps.
@arno-st , this is fixed now.
Describe the bug When creating an Alet Rules, based on a program name, and SQL error it prompted emtpy:
To Reproduce 1: create an Alert Rules 2: select Match type as program name 3: enter a program name as displayed on the 'System Logs' page 4 click save
Expected behavior Not an error, just a OK filter saved!
Plugin (please complete the following information):
Desktop (please complete the following information):