The syslog table in the mysql database is missing

I ran a validate and the syslog table is missing. I may have done this to myself and I’m not worried about losing the data.

How can I add back the table? Is there a script to restore the table in the database?

If it is empty of data that is ok just to restore the table.

librenms@jcy-librenms-01:~$ ./validate.php

Component Version
LibreNMS 21.11.0-82-gdc73154ae
DB Schema 2021_11_29_165436_improve_ports_search_index (229)
PHP 7.4.26
Python 3.6.9
MySQL 10.5.13-MariaDB-1:10.5.13+maria~bionic-log
RRDTool 1.7.0
SNMP 5.7.3

====================================

[OK] Composer Version: 2.1.14
[OK] Dependencies up-to-date.

In Connection.php line 703:

SQLSTATE[42S02]: Base table or view not found: 1932 Table ‘librenms.syslog’ doesn’t exist in engine (SQL: SHOW INDEX FROM syslog)

In Exception.php line 18:

SQLSTATE[42S02]: Base table or view not found: 1932 Table ‘librenms.syslog’ doesn’t exist in engine

In PDOStatement.php line 117:

SQLSTATE[42S02]: Base table or view not found: 1932 Table ‘librenms.syslog’ doesn’t exist in engine

Can I use 001.sql in the schema folder under /opt/librenms?

Any help is appreciated.
Thanks,
CB

This will get you that table re-created:

 CREATE TABLE `syslog` (
  `device_id` int(11) DEFAULT NULL,
  `facility` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `priority` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `level` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `tag` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `timestamp` timestamp /* mariadb-5.3 */ NOT NULL DEFAULT current_timestamp(),
  `program` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
  `msg` text COLLATE utf8_unicode_ci DEFAULT NULL,
  `seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`seq`),
  KEY `datetime` (`timestamp`),
  KEY `device_id` (`device_id`),
  KEY `program` (`program`),
  KEY `priority_level` (`priority`,`level`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

Thank you, sir. Table is restored.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.