Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Oct 17, 2018 11:09 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Rebuild poller_output datafile?
PostPosted: Mon Dec 01, 2008 6:00 pm 
Offline

Joined: Mon Dec 01, 2008 5:39 pm
Posts: 2
Hi all, I'm new to mySql, Cacti and am trying to recover a table datafile for the poller_output table.

The table's datafile was apparently deleted. When I show the tables in the database, the table name does show up. The poller_output.FRM file still exists in the /var/lib/mysql/cacti directory. However, the poller_output.MYD file does not exist in the standard location. I've searched the entire /var mount point w/o finding it.

A query against that table gives ...

mysql> select * from poller_output;
ERROR 1017 (HY000): Can't find file: 'poller_output' (errno: 2)

I tried to repair the table with the repair table command ...
mysql> repair table poller_output use_frm;

and got the message ...
Can't find file: 'poller_output' (errno: 2)

I believe that we can drop/recreate the table w/o any serious loss at this point (Cacti has been down since 5Nov, I just took over.) Does someone have the data definition commands to rebuild the poller_output table? Is there another option?

The background info is - Cacti version is 0.8.7b, mySql db version is 5.0.22 on Linux Redhat, 2.6.18-53.el5, physical server - hardware unknown right now.

Any assistance would be appreciated.

Thanks,
Jeff


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 01, 2008 7:43 pm 
Offline
Developer/Forum Admin
User avatar

Joined: Mon Nov 17, 2003 6:35 pm
Posts: 6011
Location: Michigan, USA
Just drop and recreate the table, it's a table that only stores data temporarly before it's written to the RRDtool files.

You can find the create table syntax in the cacti.sql file located in your Cacti installation.

_________________
Tony Roman
Experience is what causes a person to make new mistakes instead of old ones.
There are only 3 way to complete a project: Good, Fast or Cheap, pick two.
With age comes wisdom, what you choose to do with it determines whether or not you are wise.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 01, 2008 7:48 pm 
Offline

Joined: Mon Dec 01, 2008 5:39 pm
Posts: 2
Cool, I was hoping that was an option.

Thanks for the input,
Jeff


Top
 Profile  
 
 Post subject: Can not file poller_output;
PostPosted: Thu Feb 11, 2010 10:59 am 
Offline

Joined: Thu Feb 11, 2010 10:54 am
Posts: 1
Hi all,

If you can not fix the error with poller_output table not show:

Just run mysql, use database "cacti" and
+ mySQL>select count(*) from poller_output;

If too much data, run query:
+ mysql> truncate table poller_output;

And it worked for my issue.
Good luck,
Manh Dung


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 06, 2010 11:39 am 
Offline

Joined: Wed Jun 23, 2010 7:34 am
Posts: 28
Location: Moncton
rony wrote:
Just drop and recreate the table, it's a table that only stores data temporarly before it's written to the RRDtool files.

You can find the create table syntax in the cacti.sql file located in your Cacti installation.



I got the exact same problem... where is the cacti.sql file?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 06, 2010 12:42 pm 
Offline

Joined: Wed Jun 23, 2010 7:34 am
Posts: 28
Location: Moncton
nervemind that last post...
I just truncate de table and its started working again!!!!


thanks!


Top
 Profile  
 
 Post subject: Re: Rebuild poller_output datafile?
PostPosted: Mon Apr 04, 2011 1:16 pm 
Offline

Joined: Wed Aug 31, 2005 3:40 am
Posts: 8
Quote:
If too much data, run query:
+ mysql> truncate table poller_output;


I only had the .frm file, no .myd, and I ran the command and my file came back Cacti is online again after being off-line for very long.


Top
 Profile  
 
 Post subject: Re: Rebuild poller_output datafile?
PostPosted: Wed Aug 03, 2011 4:22 pm 
Offline

Joined: Wed Oct 29, 2008 4:51 pm
Posts: 1
Thanks guys. I had run out of disk space and the Poller_output file got corrupted. For the past two days I have had no graphing. With your instruction I was able to get it working again. :D


Top
 Profile  
 
 Post subject: Re: Rebuild poller_output datafile?
PostPosted: Fri Sep 30, 2011 4:50 am 
Offline

Joined: Tue Sep 29, 2009 4:36 am
Posts: 35
It worked for me also to trunk the table.

I had the same issue as "kjjmiles" and after using the truncate method everything's fine!


Top
 Profile  
 
 Post subject: Re: Rebuild poller_output datafile?
PostPosted: Fri Feb 03, 2012 8:31 am 
Offline

Joined: Fri Feb 03, 2012 8:25 am
Posts: 3
Thanks!

It's indeed the problem here: when running out of space on the device, the temporary table poller_output may be deleted but not re-created.

Running MyIsam, if you're missing the MYD and MYI files, you have to recreate the table, the good thing is that the frm file contains the definition of the TABLE, and using the command TRUNCATE does the table creation for you.
poller_output.frm
poller_output.MYD
poller_output.MYI

Using InnoDB (I don't know if it's an option), you may have manually DROP and CREATE the table, I have dumped the table structure just in case (Version 0.8.7i)

http://dev.mysql.com/doc/refman/4.1/en/truncate-table.html :
Quote:
As long as the table format file tbl_name.frm is valid, the table can be re-created as an empty table with TRUNCATE TABLE, even if the data or index files have become corrupted.



Code:
--
-- Table structure for table `poller_output`
--

DROP TABLE IF EXISTS `poller_output`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poller_output` (
  `local_data_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `rrd_name` varchar(19) NOT NULL DEFAULT '',
  `time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `output` text NOT NULL,
  PRIMARY KEY (`local_data_id`,`rrd_name`,`time`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;


Thomas


Top
 Profile  
 
 Post subject: Re: Rebuild poller_output datafile?
PostPosted: Thu Mar 08, 2012 8:41 am 
Offline

Joined: Thu Mar 08, 2012 8:29 am
Posts: 2
Dropping the table worked for me too (Cacti 0.8.7b). My scenario was disk full and mysql database corruption. Moved /var to separate disk and mysqld was reporting poller_output was missing in /var/log/daemon.log.

To recover:

    1: Determine the password (<pwd>) for the cacti user to access the cacti mysql database.
    Code:
    less /usr/share/cacti/site/include/config.php
    less /etc/cacti/debian.php

    Note: the second file above is included by thje first.

    2: Open the database and drop the table. Dropping the table causes the table to be rebuilt if it is missing.
    Code:
    mysql --user=cacti --password=<pwd> cacti
    truncate table poller_output;
    \q



Top
 Profile  
 
 Post subject: Re: Rebuild poller_output datafile?
PostPosted: Fri Apr 12, 2013 2:48 am 
Offline
Cacti User

Joined: Thu Oct 06, 2005 5:03 am
Posts: 401
I face exactly the same problem but for a different table:

Quote:
ERROR 1017 (HY000) at line 1: Can't find file: 'plugin_thold_host_failed' (errno: 2)


Does anybody knows if I can delete / empty the table?
The data stored in this table are temporary ?

_________________
cacti rulez!


Top
 Profile  
 
 Post subject: Re: Rebuild poller_output datafile?
PostPosted: Fri Apr 12, 2013 2:51 am 
Offline
Cacti User

Joined: Thu Oct 06, 2005 5:03 am
Posts: 401
Just after pressing "Submit" here, the table was created again automatically. :o :o

_________________
cacti rulez!


Top
 Profile  
 
 Post subject: Re: Rebuild poller_output datafile?
PostPosted: Tue Apr 24, 2018 12:19 pm 
Offline

Joined: Mon May 22, 2017 10:54 am
Posts: 9
This worked for me too. Instantly fixed. Thanks!

tla2k12 wrote:
Dropping the table worked for me too (Cacti 0.8.7b). My scenario was disk full and mysql database corruption. Moved /var to separate disk and mysqld was reporting poller_output was missing in /var/log/daemon.log.

To recover:

    1: Determine the password (<pwd>) for the cacti user to access the cacti mysql database.
    Code:
    less /usr/share/cacti/site/include/config.php
    less /etc/cacti/debian.php

    Note: the second file above is included by thje first.

    2: Open the database and drop the table. Dropping the table causes the table to be rebuilt if it is missing.
    Code:
    mysql --user=cacti --password=<pwd> cacti
    truncate table poller_output;
    \q



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group