I noticed this morning when logging on to the web ui that it said I had devices unpolled so I checked and sure enough polling had stopped sometime last night. I checked the logs and it showed it could not connect to the MySQL db so I checked validate.php and I had quite a few schema messages:
-bash-4.2$ php validate.php
Component | Version |
---|---|
LibreNMS | 1.32-53-gee5c223 |
DB Schema | 199 |
PHP | 5.4.16 |
MySQL | 5.5.47-MariaDB |
RRDTool | 1.6.0 |
SNMP | NET-SNMP 5.7.2 |
====================================
[OK] Database connection successful
[FAIL] Database: incorrect column (config/config_group_order)
[FAIL] Database: incorrect column (config/config_sub_group_order)
[FAIL] Database: incorrect column (graph_types/graph_subtype)
[FAIL] Database: incorrect column (links/remote_platform)
[FAIL] Database: incorrect column (notifications/datetime)
[FAIL] Database: missing column (notifications/severity)
[FAIL] Database: missing index (notifications/notifications_severity_index)
[FAIL] Database: incorrect column (ports/ifTrunk)
[FAIL] Database: missing column (sensors/entity_link_index)
[FAIL] Database: missing column (sensors/entity_link_type)
[FAIL] Database: incorrect column (session/session_username)
[FAIL] Database: incorrect column (state_translations/state_value)
[FAIL] Database: incorrect column (users/username)
[FAIL] We have detected that your database schema may be wrong, please report t
he following to us on IRC or the community site (https://t.libren.ms/5gscd):
ALTER TABLE config
CHANGE config_group_order
config_group_order
i
nt(11) NOT NULL DEFAULT ‘0’;
ALTER TABLE config
CHANGE config_sub_group_order
config_sub_group_ order
int(11) NOT NULL DEFAULT ‘0’;
ALTER TABLE graph_types
CHANGE graph_subtype
graph_subtype
varcha
r(64) NOT NULL DEFAULT ‘NULL’;
ALTER TABLE links
CHANGE remote_platform
remote_platform
varchar(
256) NULL DEFAULT ‘NULL’;
ALTER TABLE notifications
CHANGE datetime
datetime
timestamp NOT
NULL DEFAULT ‘1970-01-02 00:00:00’;
ALTER TABLE notifications
ADD severity
int(11) NULL DEFAULT ‘0’ AFT
ER notifications_id
;
ALTER TABLE notifications
ADD INDEX notifications_severity_index
(severity
);
ALTER TABLE ports
CHANGE ifTrunk
ifTrunk
varchar(16) NULL DEFAULT
’NULL’;
ALTER TABLE sensors
ADD entity_link_index
int(11) unsigned NOT NULL
DEFAULT ‘0’ AFTER device_id
;
ALTER TABLE sensors
ADD entity_link_type
varchar(32) NULL DEFAULT ‘
NULL’ AFTER entity_link_index
;
ALTER TABLE session
CHANGE session_username
session_username
varc
har(255) NOT NULL DEFAULT ‘NULL’;
ALTER TABLE state_translations
CHANGE state_value
state_value
sma
llint(5) NOT NULL DEFAULT ‘0’;
ALTER TABLE users
CHANGE username
username
varchar(255) NOT NULL
DEFAULT ‘NULL’;
[FAIL] The poller has not run in the last 5 minutes, check the cron job
[FAIL] Discovery has not completed in the last 24 hours, check the cron job
[WARN] Some devices have not been polled in the last 5 minutes.
You may have performance issues. Check your poll log and see: http://doc
s.librenms.org/Support/Performance/
I made the requested changes in the database and it was able to connect, but I’m still seeing a MySQL error in the log:
2017-10-18 10:34:12 MySQL Error: Unknown column ‘storage.used’ in ‘where clause’ (SELECT * FROM storage WHERE (storage.device_id = ‘918’) && (storage.used > 75 ))
/opt/librenms/poller.php 918 2017-10-18 10:34:13 - 1 devices polled in 30.68 secs
2017-10-18 10:34:14 MySQL Error: Unknown column ‘storage.used’ in ‘where clause’ (SELECT * FROM storage WHERE (storage.device_id = ‘726’) && (storage.used > 75 ))
Is there another alteration I need to do on the db schema? Or is this something I can clean up elsewhere?
Thanks!