Cacti / plugin_syslog

Syslog Plugin for Cacti
GNU General Public License v2.0
21 stars 16 forks source link

Filter on program name is not correct, same about hostname #228

Open arno-st opened 1 month ago

arno-st commented 1 month ago

Hi, latest dev version and cacti 1.2.27.

On console -> syslog Settings -> Alert Rules. I try to make a filter for an alert based on a program id, who actually is a name But the syntax of the SQL query is expecting a number not a string, and this give me this error:

Note, we could not process all your actions. Details are below.

The SQL Syntax Entered is invalid. Please correct your SQL.

The Pre-processed SQL is:

SELECT * FROM `syslog_test`.`syslog_incoming` WHERE `program` = mariadbd AND `status` = 100100

The issue is the missing quote on mariadb (who is my filter name).

It's the same about the hostname, where you expect a host_id, instead of the hostname (hostname or description will be better, than a host_id).

Note, we could not process all your actions. Details are below.

The SQL Syntax Entered is invalid. Please correct your SQL.

The Pre-processed SQL is:

SELECT * FROM `syslog_test`.`syslog_incoming` WHERE `host_id` = lslmysp11 AND `status` = 100100
jdcoats commented 1 month ago

there is no host_id in syslog_incoming use host column

arno-st commented 1 month ago

Good catch So it has to be review, because the table syslog is with program_id and host_id should be the same to avoid any confusion.