Hello all,
We are experiencing the following error message when alerts run. Consequently, the NMS is monitoring but not alerting. We spotted this error message recently. on one instance of the NMS. Other instances of NMS’s are behaving correctly.
I have used the nySQL logging features to record the SQL statements presented to the database. I am unable to spot any “syntax” errors in the code. In fact, I can copy and paste and using an SQL client, I can run the code without errors. Where there is matching data, it is returned to the client, where there isn’t, clearly no data will be returned.
I am going to investigate “access violation” part of the error message. The may reveal something. I have pasted a sample into this subject.
Anyone with any ideas, please update this subject.
[2019-10-28 13:43:47] 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 = 335) 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 = 335) 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)