librenms / librenms-agent

LibreNMS Agent & Scripts
GNU General Public License v2.0
118 stars 188 forks source link

Alert Rules - SQL Error 1046 - Syntax Error #257

Closed alfie002 closed 4 years ago

alfie002 commented 4 years ago

Dear fellow users,

We have a number of installation of LibreNMS. There work separately and update frequently. Recently a review of the librenms.log file revealed a significant number of the following SQL message.

We have started to investigate this problem . The NMS continues to poll the estate. We will aim to marry up the SQL statements which are executed against the database and update the thread. If anyone has experienced a similar error message, please advise. As far as we are there have been no changes to the ruleset. Thanks,

librenms.log


[2019-10-25 15:17:44] production.ERROR: SQLSTATE[42000]: Syntax error or access violation: 1064 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 '(devices.disabled = 0 && devices.ignore = 0)")") = 1 AND ((devices.sysObjectID R' at line 1 (SQL: SELECT FROM devices WHERE (devices.device_id = 820) AND ("(devices.status = 0 && "(devices.disabled = 0 && devices.ignore = 0)")") = 1 AND ((devices.sysObjectID REGEXP "(.1.3.6.1.4.1.43.)") && (devices.os LIKE "%3Com%")) = 1) (SQL: SELECT FROM devices WHERE (devices.device_id = 820) AND ("(devices.status = 0 && "(devices.disabled = 0 && devices.ignore = 0)")") = 1 AND ((devices.sysObjectID REGEXP "(.1.3.6.1.4.1.43.)") && (devices.os LIKE "%3Com%")) = 1)#0 /opt/librenms/LibreNMS/Alert/AlertRules.php(64): dbFetchRows('SELECT * FROM d...', Array)

murrant commented 4 years ago

This means you have an error in one of your alert rules. You need to correct your alert rule...

Also, you need to ask for help on the community site, or Discord.