Thursday, April 10, 2014

Cacti Graph does not display

Problem :

Suddenly cacti has stopped drawing graph.

Analysis :

Log into the server and checked the cacti log.
Cacti has generated errors in /usr/share/cacti/log/cacti.log


Error log in cacti.

04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (128, 'mem_free', '2014-04-09 16:40:03', '2554360')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (127, 'load_5min', '2014-04-09 16:40:03', '0.00')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (126, 'load_15min', '2014-04-09 16:40:03', '0.00')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (123, 'cpu_system', '2014-04-09 16:40:03', '34305')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (122, 'cpu_nice', '2014-04-09 16:40:03', '19')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (58, 'traffic_out', '2014-04-09 16:40:03', '348607')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (58, 'traffic_in', '2014-04-09 16:40:03', '3948566')'

Root cause & Resolution :

The table “poller_output” in cacti database has corrupted. I've logged into the database and try to repair the table. Issue below commands.

Mysql > use cacti;
mysql > truncate table poller_ouput;

Then restarted the services apache and mysql. After a while graph is displayed and draw accordingly.