syslog removed from cacti server

General discussion about Plugins for Cacti

Moderators: Moderators, Developers

Post Reply
Author
Message
dogs1005
Posts: 42
Joined: Tue Jul 15, 2014 3:39 am

syslog removed from cacti server

#1 Post by dogs1005 » Tue Jul 24, 2018 11:25 am

Hi There,
i'm in a bit of a pickle. Someone in teh office thought it wise to uninstall the syslog plugin but also removed all the logs, tables and settings.
I tried re-installing again and it asked to upgrade. i did this but now getting loads of errors in teh log pertaining to this plugin.

Code: Select all

24/07/2018 05:16:17 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"INSERT INTO `syslog`.`syslog` (logtime, priority_id, facility_id, host_id, message) SELECT TIMESTAMP(`date`, `time`), priority_id, facility_id, host_id, message FROM (SELECT date, time, priority_id, facility_id, host_id, message FROM syslog_incoming AS si INNER JOIN syslog_facilities AS sf ON sf.facility=si.facility INNER JOIN syslog_priorities AS sp ON sp.priority=si.priority INNER JOIN syslog_hosts AS sh ON sh.host=si.host WHERE status=51) AS merge'
24/07/2018 05:16:17 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"DELETE FROM `syslog`.`syslog_removed` WHERE logtime < '2018-06-24''
24/07/2018 05:16:17 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"DELETE FROM `syslog`.`syslog` WHERE logtime < '2018-06-24''
24/07/2018 05:16:17 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1105', SQL:"SHOW CREATE TABLE `syslog`.`syslog`"

24/07/2018 05:12:50 PM - SYSTEM SYSLOG NOTE: Background Syslog Database Upgrade Process Completed
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"CREATE TABLE `syslog`.`syslog_removed` LIKE `syslog`.`syslog`'
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1051', SQL:"DROP TABLE `syslog`.`syslog_pre_upgrade`'
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1146', SQL:"SELECT max(seq) FROM (SELECT seq FROM `syslog`.`syslog_pre_upgrade` ORDER BY seq LIMIT 10000) AS preupgrade"
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=9 WHERE priority='other''
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=8 WHERE priority='debug''
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=7 WHERE priority='info''
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=6 WHERE priority='notice''
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=5 WHERE priority='warn''
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=4 WHERE priority='err''
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=3 WHERE priority='alert''
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=2 WHERE priority='crit''
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=1 WHERE priority='emerg''
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET logtime=TIMESTAMP(`date`, `time`)'
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"ALTER TABLE `syslog`.`syslog_pre_upgrade` MODIFY COLUMN message varchar(1024) DEFAULT NULL, ADD COLUMN facility_id int(10) UNSIGNED NULL AFTER facility, ADD COLUMN priority_id int(10) UNSIGNED NULL AFTER facility_id, ADD COLUMN host_id int(10) UNSIGNED NULL AFTER priority_id, ADD COLUMN logtime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER priority, ADD INDEX facility_id (facility_id), ADD INDEX priority_id (priority_id), ADD INDEX host_id (host_id), ADD INDEX logtime(logtime);'
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"INSERT INTO `syslog`.`syslog_host_facilities` (host_id, facility_id) SELECT host_id, facility_id FROM ((SELECT DISTINCT host, facility FROM `syslog`.`syslog_pre_upgrade`) AS s INNER JOIN `syslog`.`syslog_hosts` AS sh ON s.host=sh.host INNER JOIN `syslog`.`syslog_facilities` AS sf ON sf.facility=s.facility)'
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"INSERT INTO `syslog`.`syslog_facilities` (facility) SELECT DISTINCT facility FROM `syslog`.`syslog_pre_upgrade`'
24/07/2018 05:12:50 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"INSERT INTO `syslog`.`syslog_hosts` (host) SELECT DISTINCT host FROM `syslog`.`syslog_pre_upgrade`'
24/07/2018 05:12:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"CREATE TABLE IF NOT EXISTS `syslog`.`syslog_removed` LIKE `syslog`.`syslog`'
24/07/2018 05:12:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1025', SQL:"RENAME TABLE `syslog`.`syslog` TO `syslog`.`syslog_pre_upgrade`'
24/07/2018 05:12:49 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1105', SQL:"SHOW COLUMNS FROM `syslog`.`syslog` LIKE 'time'"
24/07/2018 05:12:49 PM - SYSTEM SYSLOG NOTE: Launching Background Syslog Database Upgrade Process
Any help in trying to get this back up would be greatly appreciated.

Best Regards

EDIT
After repairing the database, i got this error:

Repairing tables
syslog.syslog
Error : Failed to read from the .par file
Error : Incorrect information in file: './syslog/syslog.frm'
error : Corrupt

Anyone know what to do?

netniV
Cacti Guru User
Posts: 2928
Joined: Sun Aug 27, 2017 12:05 am

Re: syslog removed from cacti server

#2 Post by netniV » Thu Aug 16, 2018 8:59 am

If i was you, if would start from scratch. When a plugin is uninstalled, the tables are normally removed. If it was just disabled, it would not remove the tables.

It also seems you have corruption at the MySQL level since it doesnt like something in its files. My advice, remove the raw DB files and the DB from MySQL configuration, then follow the install steps and start over.

dogs1005
Posts: 42
Joined: Tue Jul 15, 2014 3:39 am

Re: syslog removed from cacti server

#3 Post by dogs1005 » Thu Aug 16, 2018 10:15 am

netniV wrote:If i was you, if would start from scratch. When a plugin is uninstalled, the tables are normally removed. If it was just disabled, it would not remove the tables.

It also seems you have corruption at the MySQL level since it doesnt like something in its files. My advice, remove the raw DB files and the DB from MySQL configuration, then follow the install steps and start over.
thanks netinV,
i'm not sure what you mean by remove raw db files but i did a DROP TABLE syslog; and re-nstalled syslog plugin.
i left all the options as default on the upgrade screen, not sure if this is correct or not.
but when the plugin was installed i got these error messages in the log.
any further help greatly appreciated :)
16/08/2018 03:54:15 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"INSERT INTO `syslog`.`syslog` (logtime, priority_id, facility_id, host_id, message) SELECT TIMESTAMP(`date`, `time`), priority_id, facility_id, host_id, message FROM (SELECT date, time, priority_id, facility_id, host_id, message FROM syslog_incoming AS si INNER JOIN syslog_facilities AS sf ON sf.facility=si.facility INNER JOIN syslog_priorities AS sp ON sp.priority=si.priority INNER JOIN syslog_hosts AS sh ON sh.host=si.host WHERE status=120) AS merge'
16/08/2018 03:54:15 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"DELETE FROM `syslog`.`syslog_removed` WHERE logtime < '2018-07-17''
16/08/2018 03:54:15 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"DELETE FROM `syslog`.`syslog` WHERE logtime < '2018-07-17''
16/08/2018 03:54:15 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1105', SQL:"SHOW CREATE TABLE `syslog`.`syslog`"


16/08/2018 03:53:54 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1105', SQL:"SHOW COLUMNS FROM `syslog`.`syslog` LIKE 'time'"
16/08/2018 03:53:54 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1105', SQL:"SHOW COLUMNS FROM `syslog`.`syslog` LIKE 'time'"
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1105', SQL:"SHOW COLUMNS FROM `syslog`.`syslog` LIKE 'time'"
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"CREATE TABLE `syslog`.`syslog_removed` LIKE `syslog`.`syslog`'
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"ALTER TABLE `syslog`.`syslog` DROP COLUMN `date`, DROP COLUMN `time`, DROP COLUMN `host`, DROP COLUMN `facility`, DROP COLUMN `priority`'
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"UPDATE `syslog`.`syslog` SET priority_id=9 WHERE priority='other''
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"UPDATE `syslog`.`syslog` SET priority_id=8 WHERE priority='debug''
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"UPDATE `syslog`.`syslog` SET priority_id=7 WHERE priority='info''
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"UPDATE `syslog`.`syslog` SET priority_id=6 WHERE priority='notice''
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"UPDATE `syslog`.`syslog` SET priority_id=5 WHERE priority='warn''
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"UPDATE `syslog`.`syslog` SET priority_id=4 WHERE priority='err''
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"UPDATE `syslog`.`syslog` SET priority_id=3 WHERE priority='alert''
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"UPDATE `syslog`.`syslog` SET priority_id=2 WHERE priority='crit''
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"UPDATE `syslog`.`syslog` SET priority_id=1 WHERE priority='emerg''
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"UPDATE `syslog`.`syslog` SET logtime=TIMESTAMP(`date`, `time`)'
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"ALTER TABLE `syslog`.`syslog` MODIFY COLUMN message varchar(1024) DEFAULT NULL, ADD COLUMN facility_id int(10) UNSIGNED NULL AFTER facility, ADD COLUMN priority_id int(10) UNSIGNED NULL AFTER facility_id, ADD COLUMN host_id int(10) UNSIGNED NULL AFTER priority_id, ADD COLUMN logtime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER priority, ADD INDEX facility_id (facility_id), ADD INDEX priority_id (priority_id), ADD INDEX host_id (host_id), ADD INDEX logtime(logtime);'
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"INSERT INTO `syslog`.`syslog_host_facilities` (host_id, facility_id) SELECT host_id, facility_id FROM ((SELECT DISTINCT host, facility FROM `syslog`.`syslog`) AS s INNER JOIN `syslog`.`syslog_hosts` AS sh ON s.host=sh.host INNER JOIN `syslog`.`syslog_facilities` AS sf ON sf.facility=s.facility)'
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"INSERT INTO `syslog`.`syslog_facilities` (facility) SELECT DISTINCT facility FROM `syslog`.`syslog`'
16/08/2018 03:53:49 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"INSERT INTO `syslog`.`syslog_hosts` (host) SELECT DISTINCT host FROM `syslog`.`syslog`'
16/08/2018 03:53:48 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"CREATE TABLE IF NOT EXISTS `syslog`.`syslog_removed` LIKE `syslog`.`syslog`'
EDIT:
doing a show tables; in mysql, it showed a number of syslog tables so i dropped them all.
ran the installation again and now getting these errors but it doesn't show any syslog tables anymore in db.
16/08/2018 04:42:15 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"INSERT INTO `syslog`.`syslog` (logtime, priority_id, facility_id, host_id, message) SELECT TIMESTAMP(`date`, `time`), priority_id, facility_id, host_id, message FROM (SELECT date, time, priority_id, facility_id, host_id, message FROM syslog_incoming AS si INNER JOIN syslog_facilities AS sf ON sf.facility=si.facility INNER JOIN syslog_priorities AS sp ON sp.priority=si.priority INNER JOIN syslog_hosts AS sh ON sh.host=si.host WHERE status=91) AS merge'
16/08/2018 04:42:15 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"DELETE FROM `syslog`.`syslog_removed` WHERE logtime < '2018-07-17''
16/08/2018 04:42:15 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"DELETE FROM `syslog`.`syslog` WHERE logtime < '2018-07-17''
16/08/2018 04:42:15 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1105', SQL:"SHOW CREATE TABLE `syslog`.`syslog`"


16/08/2018 04:40:19 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1105', SQL:"SELECT count(*) FROM `syslog`.`syslog` WHERE host_id IN('1') AND logtime BETWEEN '2018-08-16 16:10' AND '2018-08-16 16:40'"
16/08/2018 04:40:19 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1105', SQL:"SELECT *, 'main' AS mtype FROM `syslog`.`syslog` WHERE host_id IN('1') AND logtime BETWEEN '2018-08-16 16:10' AND '2018-08-16 16:40' ORDER BY logtime DESC LIMIT 0,30"
16/08/2018 04:40:19 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1105', SQL:"SHOW COLUMNS FROM `syslog`.`syslog` LIKE 'time'"
16/08/2018 04:40:18 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1105', SQL:"SELECT count(*) FROM `syslog`.`syslog` WHERE logtime BETWEEN '2018-08-16 16:10' AND '2018-08-16 16:40'"
16/08/2018 04:40:18 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1105', SQL:"SELECT *, 'main' AS mtype FROM `syslog`.`syslog` WHERE logtime BETWEEN '2018-08-16 16:10' AND '2018-08-16 16:40' ORDER BY logtime DESC LIMIT 0,30"
16/08/2018 04:40:18 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1105', SQL:"SHOW COLUMNS FROM `syslog`.`syslog` LIKE 'time'"
16/08/2018 04:40:16 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1105', SQL:"SELECT count(*) FROM `syslog`.`syslog` WHERE host_id IN('1') AND logtime BETWEEN '2018-08-16 16:10' AND '2018-08-16 16:40'"
16/08/2018 04:40:16 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1105', SQL:"SELECT *, 'main' AS mtype FROM `syslog`.`syslog` WHERE host_id IN('1') AND logtime BETWEEN '2018-08-16 16:10' AND '2018-08-16 16:40' ORDER BY logtime DESC LIMIT 0,30"
16/08/2018 04:40:16 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1105', SQL:"SHOW COLUMNS FROM `syslog`.`syslog` LIKE 'time'"
mysql> show tables;
+---------------------------------------+
| Tables_in_cacti |
+---------------------------------------+
| cdef |
| cdef_items |
| colors |
| data_input |
| data_input_data |
| data_input_fields |
| data_local |
| data_source_stats_daily |
| data_source_stats_hourly |
| data_source_stats_hourly_cache |
| data_source_stats_hourly_last |
| data_source_stats_monthly |
| data_source_stats_weekly |
| data_source_stats_yearly |
| data_template |
| data_template_data |
| data_template_data_rra |
| data_template_rrd |
| graph_local |
| graph_template_input |
| graph_template_input_defs |
| graph_templates |
| graph_templates_gprint |
| graph_templates_graph |
| graph_templates_item |
| graph_tree |
| graph_tree_items |
| host |
| host_graph |
| host_snmp_cache |
| host_snmp_query |
| host_template |
| host_template_graph |
| host_template_snmp_query |
| hostgroup |
| hostgroup_host |
| mac_track_aggregated_ports |
| mac_track_approved_macs |
| mac_track_device_types |
| mac_track_devices |
| mac_track_interface_graphs |
| mac_track_interfaces |
| mac_track_ip_ranges |
| mac_track_ips |
| mac_track_macauth |
| mac_track_macwatch |
| mac_track_oui_database |
| mac_track_ports |
| mac_track_processes |
| mac_track_scan_dates |
| mac_track_scanning_functions |
| mac_track_sites |
| mac_track_snmp |
| mac_track_snmp_items |
| mac_track_temp_ports |
| mac_track_vlans |
| plugin_aggregate_color_template_items |
| plugin_aggregate_color_templates |
| plugin_aggregate_graph_templates |
| plugin_aggregate_graph_templates_item |
| plugin_aggregate_graphs |
| plugin_aggregate_graphs_graph_item |
| plugin_aggregate_graphs_items |
| plugin_autom8_graph_rule_items |
| plugin_autom8_graph_rules |
| plugin_autom8_match_rule_items |
| plugin_autom8_report_rule_items |
| plugin_autom8_report_rules |
| plugin_autom8_thold_rule_items |
| plugin_autom8_thold_rules |
| plugin_autom8_tree_rule_items |
| plugin_autom8_tree_rules |
| plugin_cfgmng |
| plugin_cfgmng_basis |
| plugin_cfgmng_data |
| plugin_cfgmng_trap |
| plugin_config |
| plugin_configstore_accounts |
| plugin_configstore_archive |
| plugin_configstore_backups |
| plugin_configstore_device_types |
| plugin_configstore_devices |
| plugin_configstore_sites |
| plugin_configstore_templates |
| plugin_db_changes |
| plugin_discover_hosts |
| plugin_discover_template |
| plugin_dpdiscover_hosts |
| plugin_dpdiscover_template |
| plugin_flowview_devices |
| plugin_flowview_dnscache |
| plugin_flowview_ports |
| plugin_flowview_queries |
| plugin_flowview_schedules |
| plugin_hmib_hrDevices |
| plugin_hmib_hrProcessor |
| plugin_hmib_hrSWInstalled |
| plugin_hmib_hrSWRun |
| plugin_hmib_hrSWRun_ignore |
| plugin_hmib_hrSWRun_last_seen |
| plugin_hmib_hrStorage |
| plugin_hmib_hrSystem |
| plugin_hmib_hrSystemTypes |
| plugin_hmib_processes |
| plugin_hmib_types |
| plugin_hooks |
| plugin_mURLin_cache |
| plugin_mURLin_index |
| plugin_maint_hosts |
| plugin_maint_schedules |
| plugin_nectar |
| plugin_nectar_items |
| plugin_notification_lists |
| plugin_realms |
| plugin_routerconfigs_accounts |
| plugin_routerconfigs_backups |
| plugin_routerconfigs_devices |
| plugin_routerconfigs_devicetypes |
| plugin_thold_contacts |
| plugin_thold_host_failed |
| plugin_thold_log |
| plugin_thold_template_contact |
| plugin_thold_threshold_contact |
| poller |
| poller_command |
| poller_item |
| poller_output |
| poller_output_boost |
| poller_output_boost_processes |
| poller_output_rt |
| poller_reindex |
| poller_time |
| reportit_cache_measurands |
| reportit_cache_reports |
| reportit_cache_variables |
| reportit_data_items |
| reportit_data_source_items |
| reportit_measurands |
| reportit_presets |
| reportit_recipients |
| reportit_reports |
| reportit_results_1 |
| reportit_results_2 |
| reportit_results_4 |
| reportit_rvars |
| reportit_templates |
| reportit_variables |
| rra |
| rra_cf |
| settings |
| settings_graphs |
| settings_tree |
| snmp_query |
| snmp_query_graph |
| snmp_query_graph_rrd |
| snmp_query_graph_rrd_sv |
| snmp_query_graph_sv |
| superlinks_auth |
| superlinks_pages |
| thold_data |
| thold_template |
| user_auth |
| user_auth_perms |
| user_auth_realm |
| user_log |
| version |
| weathermap_auth |
| weathermap_data |
| weathermap_groups |
| weathermap_maps |
| weathermap_settings |
+---------------------------------------+
171 rows in set (0.00 sec)

mysql>

netniV
Cacti Guru User
Posts: 2928
Joined: Sun Aug 27, 2017 12:05 am

Re: syslog removed from cacti server

#4 Post by netniV » Thu Aug 16, 2018 3:05 pm

plugin syslog can use it's own database separate to cacti. Check what your configuration is using as I didn't notice it above. If it is using it's own databs, just drop the entire database and recreate.

dogs1005
Posts: 42
Joined: Tue Jul 15, 2014 3:39 am

Re: syslog removed from cacti server

#5 Post by dogs1005 » Wed Sep 05, 2018 8:38 am

netniV wrote:plugin syslog can use it's own database separate to cacti. Check what your configuration is using as I didn't notice it above. If it is using it's own databs, just drop the entire database and recreate.
Thanks for your help so far in this NetniV

This what the show and drop commands do.

Code: Select all

mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cacti              |
| mysql              |
| syslog             |
+--------------------+
4 rows in set (0.01 sec)

mysql> DROP DATABASE syslog;
ERROR 1051 (42S02): Unknown table 'syslog'
mysql>
Any reason why I can't drop the database?

EDIT
Changed teh database in mysql to syslog and tried to drop the table but it says table is unknown but it shows it is there in the show tables command.

Code: Select all

mysql> use syslog
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+------------------+
| Tables_in_syslog |
+------------------+
| syslog           |
+------------------+
1 row in set (0.01 sec)

mysql> drop table syslog;
ERROR 1051 (42S02): Unknown table 'syslog'
mysql>
I'm confused.... will carry on looking in google bit if anyone knows teh answer to this would greatly appreciate a heads up please :)

netniV
Cacti Guru User
Posts: 2928
Joined: Sun Aug 27, 2017 12:05 am

Re: syslog removed from cacti server

#6 Post by netniV » Wed Sep 05, 2018 3:25 pm

It should be drop database to drop the entire database. If you want to drop each table manually, you will need to show tables to see all the tables, then drop each table individually.

dogs1005
Posts: 42
Joined: Tue Jul 15, 2014 3:39 am

Re: syslog removed from cacti server

#7 Post by dogs1005 » Thu Sep 06, 2018 4:52 am

netniV wrote:It should be drop database to drop the entire database. If you want to drop each table manually, you will need to show tables to see all the tables, then drop each table individually.
That's what i did in my previous post but it is complaining that when dropping the syslog database, it comes up with the error of unknown table.

EDIT
These are the errors in the cacti log when syslog plugin is first installed.

Code: Select all

06/09/2018 11:14:37 AM - SYSTEM SYSLOG NOTE: Background Syslog Database Upgrade Process Completed
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"CREATE TABLE `syslog`.`syslog_removed` LIKE `syslog`.`syslog`'
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1051', SQL:"DROP TABLE `syslog`.`syslog_pre_upgrade`'
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1146', SQL:"SELECT max(seq) FROM (SELECT seq FROM `syslog`.`syslog_pre_upgrade` ORDER BY seq LIMIT 10000) AS preupgrade"
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=9 WHERE priority='other''
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=8 WHERE priority='debug''
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=7 WHERE priority='info''
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=6 WHERE priority='notice''
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=5 WHERE priority='warn''
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=4 WHERE priority='err''
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=3 WHERE priority='alert''
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=2 WHERE priority='crit''
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET priority_id=1 WHERE priority='emerg''
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE `syslog`.`syslog_pre_upgrade` SET logtime=TIMESTAMP(`date`, `time`)'
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"ALTER TABLE `syslog`.`syslog_pre_upgrade` MODIFY COLUMN message varchar(1024) DEFAULT NULL, ADD COLUMN facility_id int(10) UNSIGNED NULL AFTER facility, ADD COLUMN priority_id int(10) UNSIGNED NULL AFTER facility_id, ADD COLUMN host_id int(10) UNSIGNED NULL AFTER priority_id, ADD COLUMN logtime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER priority, ADD INDEX facility_id (facility_id), ADD INDEX priority_id (priority_id), ADD INDEX host_id (host_id), ADD INDEX logtime(logtime);'
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"INSERT INTO `syslog`.`syslog_host_facilities` (host_id, facility_id) SELECT host_id, facility_id FROM ((SELECT DISTINCT host, facility FROM `syslog`.`syslog_pre_upgrade`) AS s INNER JOIN `syslog`.`syslog_hosts` AS sh ON s.host=sh.host INNER JOIN `syslog`.`syslog_facilities` AS sf ON sf.facility=s.facility)'
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"INSERT INTO `syslog`.`syslog_facilities` (facility) SELECT DISTINCT facility FROM `syslog`.`syslog_pre_upgrade`'
06/09/2018 11:14:37 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"INSERT INTO `syslog`.`syslog_hosts` (host) SELECT DISTINCT host FROM `syslog`.`syslog_pre_upgrade`'
06/09/2018 11:14:33 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1105', SQL:"CREATE TABLE IF NOT EXISTS `syslog`.`syslog_removed` LIKE `syslog`.`syslog`'
06/09/2018 11:14:32 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1025', SQL:"RENAME TABLE `syslog`.`syslog` TO `syslog`.`syslog_pre_upgrade`'
06/09/2018 11:14:32 AM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1105', SQL:"SHOW COLUMNS FROM `syslog`.`syslog` LIKE 'time'"
06/09/2018 11:14:32 AM - SYSTEM SYSLOG NOTE: Launching Background Syslog Database Upgrade Process
These are the tables in the syslog database.

Code: Select all

mysql> show tables;
+------------------------+
| Tables_in_syslog       |
+------------------------+
| syslog                 |
| syslog_alert           |
| syslog_facilities      |
| syslog_host_facilities |
| syslog_hosts           |
| syslog_incoming        |
| syslog_logs            |
| syslog_priorities      |
| syslog_remove          |
| syslog_reports         |
| syslog_statistics      |
+------------------------+
11 rows in set (0.00 sec)

mysql>
When uninstalling the syslog plugin, there is 1 table left in the syslog database.

Code: Select all

mysql> show tables;
+------------------+
| Tables_in_syslog |
+------------------+
| syslog           |
+------------------+
1 row in set (0.00 sec)

mysql>
When trying to delete this table I get the error below.

Code: Select all

mysql> drop table syslog;
ERROR 1051 (42S02): Unknown table 'syslog'
mysql>

netniV
Cacti Guru User
Posts: 2928
Joined: Sun Aug 27, 2017 12:05 am

Re: syslog removed from cacti server

#8 Post by netniV » Thu Sep 06, 2018 5:50 am

There maybe a special character or some other issue going on there. Try the following instead:

Code: Select all

sudo /etc/init.d/mysql restart
mysqladmin drop YOURDATABASE

dogs1005
Posts: 42
Joined: Tue Jul 15, 2014 3:39 am

Re: syslog removed from cacti server

#9 Post by dogs1005 » Thu Sep 06, 2018 8:21 am

netniV wrote:There maybe a special character or some other issue going on there. Try the following instead:

Code: Select all

sudo /etc/init.d/mysql restart
mysqladmin drop YOURDATABASE
I really appreciate all your help with this NetniV.
This is the output of that command.

Code: Select all

[[email protected]_CactiServer routerconfigs]# mysqladmin -u root -p drop syslog
Enter password:
Dropping the database is potentially a very bad thing to do.
Any data stored in the database will be destroyed.

Do you really want to drop the 'syslog' database [y/N] y
mysqladmin: DROP DATABASE syslog failed;
error: 'Unknown table 'syslog''
[[email protected]_CactiServer routerconfigs]#

netniV
Cacti Guru User
Posts: 2928
Joined: Sun Aug 27, 2017 12:05 am

Re: syslog removed from cacti server

#10 Post by netniV » Thu Sep 06, 2018 12:56 pm

Sounds like a corrupted database for sure now.

Try following this article, see where that gets you:
https://www.a2hosting.co.uk/kb/develope ... and-tables

dogs1005
Posts: 42
Joined: Tue Jul 15, 2014 3:39 am

Re: syslog removed from cacti server

#11 Post by dogs1005 » Tue Sep 11, 2018 5:35 am

netniV wrote:Sounds like a corrupted database for sure now.

Try following this article, see where that gets you:
https://www.a2hosting.co.uk/kb/develope ... and-tables
Thank you so much for your help in this netniV.
No matter what i did I always got this error message back.

Code: Select all

Error    : Failed to read from the .par file
Error    : Incorrect information in file: './syslog/syslog.frm'
error    : Corrupt
Nothing seemed to work for me but what i did to get it back up and running was to move the syslog directory to say the home directory:

Code: Select all

mv /var/lib/mysql/syslog /home/cacti/syslog
Then login to mysql:

Code: Select all

mysql -u root -p
Then create the syslog database:

Code: Select all

create database syslog;
Then install the plugin and it now works again phew.

User avatar
Osiris
Cacti Pro User
Posts: 863
Joined: Mon Jan 05, 2015 10:10 am

Re: syslog removed from cacti server

#12 Post by Osiris » Mon Oct 08, 2018 6:31 am

Many users create a their syslog database separately from Cacti as the resulting syslog database can get big, which would block a rapid backup of the Cacti database, for disaster recovery. In your case, your database likely became corrupted when you either did some MySQL/MariaDB tuning or as a result of a MySQL/MariaDB crash. Glad you figured it out though.
Before history, there was a paradise, now dust.

Post Reply