Cacti / plugin_syslog

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

Syslog can not deal with with single quotation #82

Closed yingbaiibm closed 5 years ago

yingbaiibm commented 5 years ago

1)Add a syslog alert rule with key words Unknown column 'facility' 2) Trigger alert rule, error exist in log

2019/05/22 17:10:23 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[339]:syslog_db_fetch_assoc(), /plugins/syslog/database.php[106]:db_fetch_assoc(), /lib/database.php[452]:db_fetch_assoc_prepared(), /lib/database.php[466]:db_execute_prepared()) 2019/05/22 17:10:23 - CMDPHP ERROR: A DB Row Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'facility'%' AND status=22' at line 1 2019/05/22 17:10:23 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[255]:syslog_remove_items(), /plugins/syslog/functions.php[474]:syslog_db_execute(), /plugins/syslog/database.php[57]:db_execute(), /lib/database.php[191]:db_execute_prepared()) 2019/05/22 17:10:23 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'action 9'%' AND status='22'' at line 1 2019/05/22 17:10:22 - SYSTEM THOLD STATS: Time:0.0060 Tholds:0 TotalDevices:16 DownDevices:0 NewDownDevices:0

Screen Shot 2019-05-22 at 5 15 01 PM

cacti 1.2.3 syslog develop code of May 20

yingbaiibm commented 5 years ago

@cigamit The remove rule also has this problem. Please have a look.

remove rule error: 2019/05/23 16:55:03 - SYSLOG WARNING: The Syslog Alert 'New Alert Rule' with Severity 'Warning', has been Triggered on Host 'IP9-111-250-165', and Sequence '6' 2019/05/23 16:55:03 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[255]:syslog_remove_items(), /plugins/syslog/functions.php[474]:syslog_db_execute(), /plugins/syslog/database.php[57]:db_execute(), /lib/database.php[191]:db_execute_prepared()) 2019/05/23 16:55:03 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'action 9' %' AND status='115'' at line 1

cigamit commented 5 years ago

This should be corrected now.

yingbaiibm commented 5 years ago

passed retest