Rebuild poller_output datafile?

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

zollarja
Posts: 2
Joined: Mon Dec 01, 2008 5:39 pm

Rebuild poller_output datafile?

Post by zollarja »

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
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

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.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
zollarja
Posts: 2
Joined: Mon Dec 01, 2008 5:39 pm

Post by zollarja »

Cool, I was hoping that was an option.

Thanks for the input,
Jeff
dungnm0802
Posts: 1
Joined: Thu Feb 11, 2010 10:54 am

Can not file poller_output;

Post by dungnm0802 »

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
Plurnay
Posts: 28
Joined: Wed Jun 23, 2010 7:34 am
Location: Moncton

Post by Plurnay »

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?
Plurnay
Posts: 28
Joined: Wed Jun 23, 2010 7:34 am
Location: Moncton

Post by Plurnay »

nervemind that last post...
I just truncate de table and its started working again!!!!


thanks!
eugenevdm
Posts: 8
Joined: Wed Aug 31, 2005 3:40 am

Re: Rebuild poller_output datafile?

Post by eugenevdm »

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.
kjjmiles
Posts: 2
Joined: Wed Oct 29, 2008 4:51 pm

Re: Rebuild poller_output datafile?

Post by kjjmiles »

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
Djiguidjik
Posts: 35
Joined: Tue Sep 29, 2009 4:36 am

Re: Rebuild poller_output datafile?

Post by Djiguidjik »

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!
tfpbl
Posts: 3
Joined: Fri Feb 03, 2012 8:25 am

Re: Rebuild poller_output datafile?

Post by tfpbl »

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/ ... table.html :
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: Select all

--
-- 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
tla2k12
Posts: 2
Joined: Thu Mar 08, 2012 8:29 am

Re: Rebuild poller_output datafile?

Post by tla2k12 »

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: Select all

    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: Select all

    mysql --user=cacti --password=<pwd> cacti
    truncate table poller_output;
    \q
    
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: Rebuild poller_output datafile?

Post by JJX »

I face exactly the same problem but for a different table:
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!
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: Rebuild poller_output datafile?

Post by JJX »

Just after pressing "Submit" here, the table was created again automatically. :o :o
cacti rulez!
T3022
Posts: 11
Joined: Mon May 22, 2017 10:54 am

Re: Rebuild poller_output datafile?

Post by T3022 »

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: Select all

    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: Select all

    mysql --user=cacti --password=<pwd> cacti
    truncate table poller_output;
    \q
    
Nadee1
Posts: 29
Joined: Thu Oct 04, 2018 11:43 pm

Re: Rebuild poller_output datafile?

Post by Nadee1 »

In My case,

It shows Poller_output table in list of tables, but when i try to show table, table doesnt exists

re created table (refer following mysql query),

after 5 minutes traffic graphs were start to update

mysql > 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;
Attachments
fff.PNG
fff.PNG (99.98 KiB) Viewed 4164 times
ff.PNG
ff.PNG (5.43 KiB) Viewed 4164 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest