Issue with cacti giving me SQL error.

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
DownloadFilms
Posts: 5
Joined: Fri Apr 29, 2016 12:34 am

Issue with cacti giving me SQL error.

Post by DownloadFilms »

Hello,

I am getting some errors in cacti where my equipment is not getting logs from a few weeks back. So far i searched a bit around the site and I tried to find a solution. Please find the log from cacti.log at the bottom. As you can see it is a SQL error so I ran a mysqlcheck repair command and it gave me solved, however it is still not displaying the correct date logs.

Code: Select all

04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU fcfa.f716.8a20 is deregistered on EPON10/9:1. %'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU fcfa.f716.8a20 is registered on EPON10/9:1. %'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%4]Alarm DYING_GASP from ONU fcfa.f716.8a20 port EPON10/9:1%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%POWER IS OK%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%POWER IS WRONG%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%POWER IS OK%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%POWER IS WRONG%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%POWER IS WRONG%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%POWER IS OK%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%POWER IS WRONG%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%POWER IS OK%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU fcfa.f716.8a32 is registered onEPON4/15:5%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%4]Alarm DYING_GASP from ONU fcfa.f716.8a32 port EPON4/15:5%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU 94d7.2385.7c7e is registered on EPON2/12:1%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU 94d7.2385.7c7e is deregistered on EPON2/12:1%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU fcfa.f716.8a32 is deregistered onEPON4/15:5%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU 94d7.2385.6ade is registered on EPON3/6:4. %'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU 94d7.2385.6ade is deregistered on EPON3/6:4. %'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%4]Alarm DYING_GASP from ONU 94d7.2385.6ade port EPON3/6:4. %'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU 0015.2020.8f70 is deregistered on EPON4/12:60%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU 0015.2020.8f70 is registered on EPON4/12:60%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE 'ONU fcfa.f716.8a1e is registered on EPON3/16:40.%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE 'ONU fcfa.f716.8a1e is deregistered on EPON3/16:40.%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '9]Alarm DYING_GASP from ONU fcfa.f716.8a1e port EPON3/16:40%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%a0c6.ec04.16b0%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%a0c6.ec04.a2da%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU a0c6.ec04.a2da is registered%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ONU a0c6.ec04.a2da is deregistered%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%Alarm DYING_GASP from ONU a0c6.ec04.a2da%'  AND status=16"
04/22/2016 07:36:00 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"SELECT * FROM `syslog`.`syslog_incoming`  WHERE message  LIKE '%ALARM!!!, POWER A IS WRONG%'  AND status=16"
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Issue with cacti giving me SQL error.

Post by phalek »

In General:

Error:'145' -> Table crashed and should be repaired.
Within mysql do this:

Code: Select all

CHECK TABLE syslog
then

Code: Select all

REPAIR TABLE syslog
In your case:

You probably need to dump the table and re-create it. (restore from backup?)
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
DownloadFilms
Posts: 5
Joined: Fri Apr 29, 2016 12:34 am

Re: Issue with cacti giving me SQL error.

Post by DownloadFilms »

phalek wrote:In General:

Error:'145' -> Table crashed and should be repaired.
Within mysql do this:

Code: Select all

CHECK TABLE syslog
then

Code: Select all

REPAIR TABLE syslog
In your case:

You probably need to dump the table and re-create it. (restore from backup?)

Hello Phalek, thanks for your response. I would like to ask you one more question in the case that there is no backup so I won't be able to do a restore after I dump it. What can be done?
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Issue with cacti giving me SQL error.

Post by phalek »

You could try to create a backup with mysqldump dropping ( that what I actually meant), then trying to import it again.

Or you can try the repair_database.php cli command from the cli sub-dir of cacti. Maybe this helps.

Other then that, I guess someone with deeper MySQL skills may have another idea.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
DownloadFilms
Posts: 5
Joined: Fri Apr 29, 2016 12:34 am

Re: Issue with cacti giving me SQL error.

Post by DownloadFilms »

Hello,

sorry for late replies I had other issues to attend to, why am I getting this command error on repair_database.php:

Code: Select all

[root@cacti ~]# cd /var/www/html/cli/
[root@cacti cli]# ./repair_database.php 
./repair_database.php: line 1: ?php: No such file or directory
./repair_database.php: line 2: /bin: is a directory
./repair_database.php: line 3: +-------------------------------------------------------------------------+: command not found
./repair_database.php: line 4: syntax error near unexpected token `|'
./repair_database.php: line 4: ` | Copyright (C) 2004-2013 The Cacti Group                                 |'
[root@cacti cli]# cat repair_database.php
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Issue with cacti giving me SQL error.

Post by phalek »

Add a "php" in front of the command ...

Code: Select all

php repair_database.php
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
DownloadFilms
Posts: 5
Joined: Fri Apr 29, 2016 12:34 am

Re: Issue with cacti giving me SQL error.

Post by DownloadFilms »

[root@cacti cli]# php repair_database.php
Repairing All Cacti Database Tables
Repairing Table -> 'cdef' Successful
Repairing Table -> 'cdef_items' Successful
Repairing Table -> 'colors' Successful
Repairing Table -> 'data_input' Successful
Repairing Table -> 'data_input_data' Successful
Repairing Table -> 'data_input_fields' Successful
Repairing Table -> 'data_local' Successful
Repairing Table -> 'data_source_stats_daily' Successful
Repairing Table -> 'data_source_stats_hourly' Successful
Repairing Table -> 'data_source_stats_hourly_cache' Successful
Repairing Table -> 'data_source_stats_hourly_last' Successful
Repairing Table -> 'data_source_stats_monthly' Successful
Repairing Table -> 'data_source_stats_weekly' Successful
Repairing Table -> 'data_source_stats_yearly' Successful
Repairing Table -> 'data_template' Successful
Repairing Table -> 'data_template_data' Successful
Repairing Table -> 'data_template_data_rra' Successful
Repairing Table -> 'data_template_rrd' Successful
Repairing Table -> 'graph_local' Successful
Repairing Table -> 'graph_template_input' Successful
Repairing Table -> 'graph_template_input_defs' Successful
Repairing Table -> 'graph_templates' Successful
Repairing Table -> 'graph_templates_gprint' Successful
Repairing Table -> 'graph_templates_graph' Successful
Repairing Table -> 'graph_templates_item' Successful
Repairing Table -> 'graph_tree' Successful
Repairing Table -> 'graph_tree_items' Successful
Repairing Table -> 'host' Successful
Repairing Table -> 'host_graph' Successful
Repairing Table -> 'host_snmp_cache' Successful
Repairing Table -> 'host_snmp_query' Successful
Repairing Table -> 'host_template' Successful
Repairing Table -> 'host_template_graph' Successful
Repairing Table -> 'host_template_snmp_query' Successful
Repairing Table -> 'mac_track_aggregated_ports' Successful
Repairing Table -> 'mac_track_approved_macs' Successful
Repairing Table -> 'mac_track_device_types' Successful
Repairing Table -> 'mac_track_devices' Successful
Repairing Table -> 'mac_track_interface_graphs' Successful
Repairing Table -> 'mac_track_interfaces' Successful
Repairing Table -> 'mac_track_ip_ranges' Successful
Repairing Table -> 'mac_track_ips' Successful
Repairing Table -> 'mac_track_macauth' Successful
Repairing Table -> 'mac_track_macwatch' Successful
Repairing Table -> 'mac_track_oui_database' Successful
Repairing Table -> 'mac_track_ports' Successful
Repairing Table -> 'mac_track_processes' Successful
Repairing Table -> 'mac_track_scan_dates' Successful
Repairing Table -> 'mac_track_scanning_functions' Successful
Repairing Table -> 'mac_track_sites' Successful
Repairing Table -> 'mac_track_snmp' Successful
Repairing Table -> 'mac_track_snmp_items' Successful
Repairing Table -> 'mac_track_temp_ports' Successful
Repairing Table -> 'mac_track_vlans' Successful
Repairing Table -> 'plugin_aggregate_color_template_items' Successful
Repairing Table -> 'plugin_aggregate_color_templates' Successful
Repairing Table -> 'plugin_aggregate_graph_templates' Successful
Repairing Table -> 'plugin_aggregate_graph_templates_item' Successful
Repairing Table -> 'plugin_aggregate_graphs' Successful
Repairing Table -> 'plugin_aggregate_graphs_graph_item' Successful
Repairing Table -> 'plugin_aggregate_graphs_items' Successful
Repairing Table -> 'plugin_autom8_graph_rule_items' Successful
Repairing Table -> 'plugin_autom8_graph_rules' Successful
Repairing Table -> 'plugin_autom8_match_rule_items' Successful
Repairing Table -> 'plugin_autom8_tree_rule_items' Successful
Repairing Table -> 'plugin_autom8_tree_rules' Successful
Repairing Table -> 'plugin_config' Successful
Repairing Table -> 'plugin_db_changes' Successful
Repairing Table -> 'plugin_discover_hosts' Successful
Repairing Table -> 'plugin_discover_template' Successful
Repairing Table -> 'plugin_flowview_devices' Successful
Repairing Table -> 'plugin_flowview_dnscache' Successful
Repairing Table -> 'plugin_flowview_ports' Successful
Repairing Table -> 'plugin_flowview_queries' Successful
Repairing Table -> 'plugin_flowview_schedules' Successful
Repairing Table -> 'plugin_hmib_hrDevices' Successful
Repairing Table -> 'plugin_hmib_hrProcessor' Successful
Repairing Table -> 'plugin_hmib_hrSWInstalled' Successful
Repairing Table -> 'plugin_hmib_hrSWRun' Successful
Repairing Table -> 'plugin_hmib_hrSWRun_ignore' Successful
Repairing Table -> 'plugin_hmib_hrSWRun_last_seen' Successful
Repairing Table -> 'plugin_hmib_hrStorage' Successful
Repairing Table -> 'plugin_hmib_hrSystem' Successful
Repairing Table -> 'plugin_hmib_hrSystemTypes' Successful
Repairing Table -> 'plugin_hmib_processes' Successful
Repairing Table -> 'plugin_hmib_types' Successful
Repairing Table -> 'plugin_hooks' Successful
Repairing Table -> 'plugin_maint_hosts' Successful
Repairing Table -> 'plugin_maint_schedules' Successful
Repairing Table -> 'plugin_nectar' Successful
Repairing Table -> 'plugin_nectar_items' Successful
Repairing Table -> 'plugin_notification_lists' Successful
Repairing Table -> 'plugin_realms' Successful
Repairing Table -> 'plugin_thold_contacts' Successful
Repairing Table -> 'plugin_thold_host_failed' Successful
Repairing Table -> 'plugin_thold_log' Successful
Repairing Table -> 'plugin_thold_template_contact' Successful
Repairing Table -> 'plugin_thold_threshold_contact' Successful
Repairing Table -> 'poller' Successful
Repairing Table -> 'poller_command' Successful
Repairing Table -> 'poller_item' Successful
Repairing Table -> 'poller_output' Successful
Repairing Table -> 'poller_output_boost' Successful
Repairing Table -> 'poller_output_boost_processes' Successful
Repairing Table -> 'poller_output_rt' Successful
Repairing Table -> 'poller_reindex' Successful
Repairing Table -> 'poller_time' Successful
Repairing Table -> 'rra' Successful
Repairing Table -> 'rra_cf' Successful
Repairing Table -> 'settings' Successful
Repairing Table -> 'settings_graphs' Successful
Repairing Table -> 'settings_tree' Successful
Repairing Table -> 'snmp_query' Successful
Repairing Table -> 'snmp_query_graph' Successful
Repairing Table -> 'snmp_query_graph_rrd' Successful
Repairing Table -> 'snmp_query_graph_rrd_sv' Successful
Repairing Table -> 'snmp_query_graph_sv' Successful
Repairing Table -> 'thold_data' Successful
Repairing Table -> 'thold_template' Successful
Repairing Table -> 'user_auth' Successful
Repairing Table -> 'user_auth_perms' Successful
Repairing Table -> 'user_auth_realm' Successful
Repairing Table -> 'user_log' Successful
Repairing Table -> 'version' Successful
Repairing Table -> 'weathermap_auth' Successful
Repairing Table -> 'weathermap_data' Successful
Repairing Table -> 'weathermap_groups' Successful
Repairing Table -> 'weathermap_maps' Successful
Repairing Table -> 'weathermap_settings' Successful

NOTE: Checking for Invalid Cacti Templates
NOTE: No Invalid Cacti Template Records found in your Database

[root@cacti cli]#
Done I will monitor it.
DownloadFilms
Posts: 5
Joined: Fri Apr 29, 2016 12:34 am

Re: Issue with cacti giving me SQL error.

Post by DownloadFilms »

I still get errors and I did an snmpwalk but I do not get anything, I think the problem might be related to my MIB I contacted the vendor but still isn't the error 145 a mistake ?

[root@cacti mibs]# snmpwalk -c zenossreporting -v2c x.x.x.x 1.3.6.1.2.1.1.3
Timeout: No Response from x.x.x.x
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests