Hi All,
My install of librenms has been slow over the past couple of weeks so I started to dig into the issue…
First things first, I ran the validate to see if there are any obvious issues and I came across this.
:/opt/librenms# ./validate.php
Component Version LibreNMS 1.38-59-g052b9d1 DB Schema 247 PHP 7.0.28-0ubuntu0.16.04.1 MySQL 5.7.21-0ubuntu0.16.04.1 RRDTool 1.5.5 SNMP NET-SNMP 5.7.3 ==================================== [OK] Composer Version: 1.6.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Database: missing index (config/uniqueindex_configname)
[FAIL] We have detected that your database schema may be wrong, please report the following to us on IRC or the community site (Report database schema issues here - LibreNMS Community):
[FIX] Run the following SQL statements to fix.
SQL Statements:
ALTER TABLEconfig
ADD UNIQUEuniqueindex_configname
(config_name
);
[FAIL] Discovery has not completed in the last 24 hours.
[FIX] Check the cron job to make sure it is running and using discovery-wrapper.py
I’ve tried to execute the SQL statement in my database and this error below…
mysql> ALTER TABLE
config
ADD UNIQUEuniqueindex_configname
(config_name
);
ERROR 1062 (23000): Duplicate entry ‘alert.macros.rule.sensor_port_link’ for key ‘uniqueindex_configname’
And also tailing librenms.log i’m getting these SQL errors
MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘sensors.sensor_limit_low = && sensors.sensor_alert macros.device_up = )’ at line 1 (SELECT * FROM sensors WHERE (sensors.device_id = ‘42’) && (sensors.sensor_current sensors.sensor_limit_low = && sensors.sensor_alert macros.device_up = ))
2018-04-19 16:10:11 MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘= “” && syslog.msg REGEXP “failed login” && = “” )’ at line 1 (SELECT * FROM syslog WHERE (syslog.device_id = ‘42’) && (syslog.timestamp >= (DATE_SUB(NOW(),INTERVAL 5 MINUTE)) && = “” && syslog.msg REGEXP “failed login” && = “” ))
2018-04-19 16:10:11 MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘invalid user name/password. = 0 )’ at line 1 (SELECT * FROM syslog WHERE (syslog.device_id = ‘42’) && (syslog.timestamp = 0 && (DATE_SUB(NOW(),INTERVAL 5 MINUTE)) = 0 && syslog.msg = 0 && .invalid user name/password. = 0 ))
I can’t find anything on google or in this forum, so please any assistance will be highly appreciated.
Thank you.