We have been having issues with Alerts being transported for some time now. The device is polled correctly, if it triggers a rule an alert appears under Alerts | Notifications. However, we don’t get anything transported.
We primarily use Email for transport. We have tested the transport using the test function and the email is delivered correctly.
If I run a debug on alerts for a device that is currently down I get the following error.
SQL Error! SQLSTATE[42000]: Syntax error or access violation: 1139 Got error ‘range out of order in character class at offset 7’ from regexp (SQL: SELECT * FROM devices,storage WHERE (devices.device_id = 209 AND devices.device_id = storage.device_id) AND storage.storage_descr REGEXP “’(’^[a-Z]:’)’” AND storage.storage_perc > 95 AND devices.type LIKE ‘%Server%’ AND (devices.status = 1 && (devices.disabled = 0 && devices.ignore = 0)) = 1) (SQL: SELECT * FROM devices,storage WHERE (devices.device_id = 209 AND devices.device_id = storage.device_id) AND storage.storage_descr REGEXP “’(’^[a-Z]:’)’” AND storage.storage_perc > 95 AND devices.type LIKE ‘%Server%’ AND (devices.status = 1 && (devices.disabled = 0 && devices.ignore = 0)) = 1)
/opt/librenms/html/includes/output/query.inc.php:50
/opt/librenms/html/ajax_output.php:35
SQL 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 ‘~ “^cisco.*State$” && sensors.sensor_alert = “1”) = 1 AND (devices.status = 1 &&’ at line 1 (SQL: SELECT * FROM devices,sensors WHERE (devices.device_id = 209 AND devices.device_id = sensors.device_id) AND (sensors.sensor_current != “1” && sensors.sensor_current != “5” && sensors.sensor_type ~ “^cisco.*State$” && sensors.sensor_alert = “1”) = 1 AND (devices.status = 1 && (devices.disabled = 0 && devices.ignore = 0)) = 1) (SQL: SELECT * FROM devices,sensors WHERE (devices.device_id = 209 AND devices.device_id = sensors.device_id) AND (sensors.sensor_current != “1” && sensors.sensor_current != “5” && sensors.sensor_type ~ “^cisco.*State$” && sensors.sensor_alert = “1”) = 1 AND (devices.status = 1 && (devices.disabled = 0 && devices.ignore = 0)) = 1)
/opt/librenms/html/includes/output/query.inc.php:50
/opt/librenms/html/ajax_output.php:35
Rule name: P3 - Warning - Global - Device Rebooted
Alert rule: devices.uptime < 300 AND macros.device = 1
Alert query: SELECT * FROM devices WHERE (devices.device_id = ?) AND devices.uptime < 300 AND (devices.disabled = 0 && devices.ignore = 0) = 1
Rule match: no match
Rule name: P3 - Warning - Network - Port Utilisation Over Threshold
Alert rule: macros.port_usage_perc >= 95 AND macros.port_up = 1 AND macros.port = 1
Alert query: SELECT * FROM devices,ports WHERE (devices.device_id = ? AND devices.device_id = ports.device_id) AND (((ports.ifInOctets_rate*8) / ports.ifSpeed)*100) >= 95 AND (ports.ifOperStatus = “up” && ports.ifAdminStatus = “up” && (ports.deleted = 0 && ports.ignore = 0 && ports.disabled = 0)) = 1 AND (ports.deleted = 0 && ports.ignore = 0 && ports.disabled = 0) = 1
Rule match: no match
The appliance is upto date. We had some problems updating the apliance when the transports changed.
root@netmon00:/opt/librenms# ./validate.php
Component | Version |
---|---|
LibreNMS | 1.46-4-g2061d74 |
DB Schema | 273 |
PHP | 7.0.32-0ubuntu0.16.04.1 |
MySQL | 10.0.36-MariaDB-0ubuntu0.16.04.1 |
RRDTool | 1.5.5 |
SNMP | NET-SNMP 5.7.3 |
====================================
[OK] Composer Version: 1.8.0
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[FAIL] Some devices have not completed their polling run in 5 minutes, this will create gaps in data.