poller_output table problem?

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

poller_output table problem?

Post by mahuani »

This is going to more informational than problem related.

I made the mistake of going on vacation for about a week. When I get back "My cacti broke" I was getting no error messages when I tried to run cacti by hand in DEBUG mode. It would just hang. This particular cacti install only polls about 30 hosts.

I re-compilied cacitd and even re-installed cacti with no luck. I disabled all but one host, and I was still getting nowhere, so I was pretty sure this was a mysql thing. I checked, double-checked, and rechecked the host,db,username info for cactid and cacti, still nothing.

When I dumped the mysql table when I re-installed cacti, I noticed it was really big ~218MB. I don't know how big it should be, but I thought this was TOO big. So I looked to see what table it was... poller_output. Since I've been working on this problem on and off for about 3 days now, I was willing to try anything. I killed everything in the table...

Code: Select all

mysql> delete from poller_output where time<NOW();
Query OK, 2214999 rows affected (1 min 25.19 sec)
That's right 2.2 million rows... I ran the poller again and it worked.

Does anyone have any idea what happened and why.


MySQL - 5.0.18
PHP 5.1.2
Cacti - 0.8.6h patched
Cactid - 0.8.6g patched
Net-SNMP - 5.3.0.1
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

It shouldn't be happening...

If it continues to happen, I would be curious to see you debug log during one polling cycle.
[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]
User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

Post by mahuani »

I'm going to be keeping a closer eye on it from now on, and I'll be sure to post the log files it it happens again.

Thanks
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Email the log to me, don't filter out anything other than IP addresses if you are really concerned.

I suspect that you will not have the problem again. ;) But we will see.
[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]
User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

Post by mahuani »

Guess what!!!, It happened again!!!

Code: Select all

mysql> select count(*) from poller_output;
+----------+
| count(*) |
+----------+
|   484303 |
+----------+
1 row in set (0.00 sec)
Image

rony, do you want me to e-mail you the log to the e-mail from your profile? It is not too large ~4.9Mb. :-? Let me know if you have a limit, otherwise, I can e-mail you a link, so you can download it.

Thanks,
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

It is likely that PHP ran out of memory attempting to process output records from the database. This will oftentime cause issues retrieving records. Once it starts, it's all downhill from there.

I am considering a patch to limit the number or rows returned. It will likely cause some degredation in performance, but it will minimize this risk. Until then, please increase the memory you make available to PHP.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

Post by mahuani »

Any suggestion on the limit. There is 2Gb of memory on this box, Cacti + Nagios are the only things running on it. Along w/ any dependencies those may include
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

256MBytes should be more than sufficient..

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

Post by mahuani »

I'll try that and see how it goes. Thanks for all your help, it is greatly appericated. :)
brammator
Posts: 3
Joined: Sun Oct 02, 2005 5:17 am
Contact:

Post by brammator »

the same thing:

poller doesn't drop data from sql/poller_output to .rrd files

Debian 3.1 sarge

cacti 0.8.6c-7sarge2
cacti-cactid 0.8.6d-5
mysql-server 4.0.24-10sarge1
php4 4.3.10-16

cel 1.7GHz, 796MB RAM

and "grep rrdtool /var/log/cacti/cacti.log" == zero even with "DEBUG" level

actually, it is like

03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: In Poller, About to Start Polling of Host
03/01/2006 12:27:33 PM - CACTID: Poller[0] MYSQL: Connecting to MySQL database 'cacti' on 'localhost'...
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: Valid Thread to be Created
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 1
03/01/2006 12:27:33 PM - CACTID: Poller[0] Host[259] SNMP Result: Host responded to SNMP
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: SQLCMD: update host set status='3',status_event_count='0', status_fail_date='0000-00-00 00:00:00',status_rec_date='0000-00-00 00:00:00',status_last_error='',min_time='5.198960',max_time='668.390040',cur_time='167.399880',avg_time='159.701520',total_polls='433',failed_polls='0',availability='100.0000' where id='259'

03/01/2006 12:27:33 PM - CACTID: Poller[0] Host[259] RECACHE: Processing 1 items in the auto reindex cache for '10.62.17.234'
03/01/2006 12:27:33 PM - CACTID: Poller[0] Host[259] SNMP: v1: 10.62.17.234, dsname: snmp_oid, oid: 1.3.6.1.4.1.3942.1.1.1.5.1.7.1, value: 4
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (2665,'snmp_oid','2006-03-01 12:25:01','4')
03/01/2006 12:27:33 PM - CACTID: Poller[0] Host[259] SNMP: v1: 10.62.17.234, dsname: snmp_oid, oid: 1.3.6.1.4.1.3942.1.1.3.6.0, value: 2
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (2666,'snmp_oid','2006-03-01 12:25:01','2')
03/01/2006 12:27:33 PM - CACTID: Poller[0] Host[259] SNMP: v1: 10.62.17.234, dsname: snmp_oid, oid: 1.3.6.1.4.1.3942.1.1.1.5.1.11.1, value: 4
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (2667,'snmp_oid','2006-03-01 12:25:01','4')
03/01/2006 12:27:33 PM - CACTID: Poller[0] Host[259] SNMP: v1: 10.62.17.234, dsname: snmp_oid, oid: 1.3.6.1.4.1.3942.1.1.1.5.1.10.1, value: 3
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (2668,'snmp_oid','2006-03-01 12:25:01','3')
03/01/2006 12:27:33 PM - CACTID: Poller[0] Host[259] SNMP: v1: 10.62.17.234, dsname: snmp_oid, oid: 1.3.6.1.4.1.3942.1.1.1.5.1.6.1, value: 7
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (2669,'snmp_oid','2006-03-01 12:25:01','7')
03/01/2006 12:27:33 PM - CACTID: Poller[0] Host[259] SNMP: v1: 10.62.17.234, dsname: snmp_oid, oid: 1.3.6.1.4.1.3942.1.1.1.5.1.8.1, value: 148
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (2670,'snmp_oid','2006-03-01 12:25:01','148')
03/01/2006 12:27:33 PM - CACTID: Poller[0] Host[259] SNMP: v1: 10.62.17.234, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.5, value: 164405
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (2671,'traffic_in','2006-03-01 12:25:01','164405')
03/01/2006 12:27:33 PM - CACTID: Poller[0] Host[259] SNMP: v1: 10.62.17.234, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.5, value: 88872
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (2671,'traffic_out','2006-03-01 12:25:01','88872')
03/01/2006 12:27:33 PM - CACTID: Poller[0] Host[259] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 0
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: SQLCMD: replace into settings (name,value) values ('date',NOW())
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: Thread Cleanup Complete
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: PHP Script Server Shutdown Started
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: PHP Script Server Pipes Closed
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: Allocated Variable Memory Freed
03/01/2006 12:27:33 PM - CACTID: Poller[0] DEBUG: MYSQL Free & Close Completed
03/01/2006 12:27:33 PM - CACTID: Poller[0] Time: 152.4660 s, Threads: 1, Hosts: 207
03/01/2006 12:27:33 PM - PHPSVR: Poller[0] DEBUG: PHP Script Server Shutdown request received, exiting
User avatar
MagnaChef
Cacti User
Posts: 164
Joined: Tue Nov 25, 2003 3:58 pm
Location: Buffalo, NY

Post by MagnaChef »

Has there been any solution to this? I am running cactid-0.8.6e and cacti 8.6e on FC4 and I am having the same problem. The poller is completing in under 300 seconds, but the RRDs are not being updated. I've tried all of this to no avail.

Thoughts?

P.S - This system has been running flawlessly since September.

Thanks!
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Magna,

Hit me on MSIM, AIM, or YIM. I am online now. You can also get by via Skype at TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
MagnaChef
Cacti User
Posts: 164
Joined: Tue Nov 25, 2003 3:58 pm
Location: Buffalo, NY

Post by MagnaChef »

Hey...I just missed you. Let me know when I can get a hold of you.

You can contact me via AIM or Email (preferrably email during the workday, as I don't have AIM at work).
User avatar
MagnaChef
Cacti User
Posts: 164
Joined: Tue Nov 25, 2003 3:58 pm
Location: Buffalo, NY

Post by MagnaChef »

Sorry for the double post, but I figured I'd put a little more info about my situation, incase anyone else has run into this or knows a solution.

What started all of this was that I was reaching the 5 minute polling limit and added about 7 devices and crossed the 5 minute threshold. This caused the polling to not finish and the graphs to stop updating. When I noticed that this had occurred I abruptly removed those devices assuming that the polling time would go back down and everything would be fine - that wasn't the case.

After this I began to do everything from increasing the amount of memory that php has access to (from 8MB to 256MB), stopping the poller and running "truncate table poller_output;" followed by "mysqlcheck --auto-repair --databases cacti", then clicking on "Clear Poller Cache", and even doing "delete from poller_output where time<NOW();" (as mentioned above).

I am currently output in DEBUG mode and everything seems to be correct (I even manually ran the displayed rrd update commands with the parameters, via command line, with the cactiuser, and it worked). Is there any reason why I can update via command line, with the same command shown, but cactid is not updating it? Is this a problem with my database? I'm just unsure where to look.

Code: Select all

03/15/2006 11:36:49 AM - CACTID: Poller[0] DEBUG: Valid Thread to be Created
03/15/2006 11:36:49 AM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 20
03/15/2006 11:36:49 AM - CACTID: Poller[0] DEBUG: In Poller, About to Start Polling of Host
03/15/2006 11:36:49 AM - CACTID: Poller[0] MYSQL: Connecting to MySQL database 'cacti' on 'localhost'...
03/15/2006 11:36:49 AM - CACTID: Poller[0] MYSQL: Connected to MySQL database 'cacti' on 'localhost'...
03/15/2006 11:36:49 AM - CACTID: Poller[0] DEBUG: Falling back to UDP Ping due to inability to set asroot permissions
03/15/2006 11:36:49 AM - CACTID: Poller[0] Host[509] SNMP Result: Host responded to SNMP

--- snip ---

03/15/2006 11:16:47 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti-0.8.6e/rra/servername_vol_total_4569.rrd --template vol_total:vol_freeable:vol_free 1142439302:4096:0:4096
03/15/2006 11:16:47 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti-0.8.6e/rra/servername_vol_total_4568.rrd --template vol_total:vol_freeable:vol_free 1142439302:4187840:33536:2579200
03/15/2006 11:16:47 AM - CACTID: Poller[0] Host[484] DS[4258] SCRIPT: /usr/bin/php -q /var/www/html/cacti-0.8.6e/scripts/query_host_partitions.php 10.0.15.111 public 1 get used 3, output: 508047360
03/15/2006 11:16:47 AM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (4258,'hdd_used','2006-03-15 11:15:02','508047360')
03/15/2006 11:28:56 AM - CACTID: Poller[0] Host[1017] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
03/15/2006 11:28:56 AM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 0
03/15/2006 11:28:57 AM - CACTID: Poller[0] DEBUG: SQLCMD: replace into settings (name,value) values ('date',NOW())
03/15/2006 11:28:57 AM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())
03/15/2006 11:28:57 AM - CACTID: Poller[0] DEBUG: Thread Cleanup Complete
03/15/2006 11:28:57 AM - CACTID: Poller[0] DEBUG: PHP Script Server Pipes Closed
03/15/2006 11:28:57 AM - CACTID: Poller[0] DEBUG: Allocated Variable Memory Freed
03/15/2006 11:28:57 AM - CACTID: Poller[0] CACTID: Shutting down Net-SNMP API
03/15/2006 11:28:57 AM - CACTID: Poller[0] DEBUG: MYSQL Free & Close Completed
03/15/2006 11:28:57 AM - CACTID: Poller[0] Time: 234.5224 s, Threads: 20, Hosts: 858
03/15/2006 11:28:57 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti-0.8.6e/rra/servername_hdd_total_9984.rrd --template hdd_total:hdd_used 1142439902:3925147648:587923456
03/15/2006 11:28:57 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti-0.8.6e/rra/servername_traffic_in_9994.rrd --template traffic_out:traffic_in 1142439902:1663216611:2424542305
03/15/2006 11:28:57 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti-0.8.6e/rra/servername_users_9979.rrd --template users 1142439902:30
03/15/2006 11:28:57 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti-0.8.6e/rra/servername_traffic_in_9993.rrd --template traffic_out:traffic_in 1142439902:2730062037:2730062037
03/15/2006 11:28:57 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti-0.8.6e/rra/servername_proc_9980.rrd --template proc 1142439902:41
03/15/2006 11:28:57 AM - SYSTEM STATS: Time: 235.4369 s, Method: cactid, Processes: 1, Threads: 20, Hosts: 858, Hosts/Process: 858, Data Sources 13599, RRDs Processed 6985
Also, all the tests are graphing and working correctly for localhost. Why would only some graph correctly?

Thanks!
Last edited by MagnaChef on Wed Mar 15, 2006 4:35 pm, edited 2 times in total.
signine
Posts: 1
Joined: Wed Mar 15, 2006 3:01 pm

Post by signine »

I've been having the same problem. The weird part is that it looks like any data at all left over in the poller_output table when the poller starts running will cause the poller to not output any data to the RRDs. I'm not sure exactly why this is, but it's obviously causing quite a bit of data loss. Hours, days, etc.

Is there any way to take the contents of the poller_output table and output the data into the RRDs manually? Additionally, is it possible to seperate that process from the one that does the polling? That sounds like it might be a more efficient way of doing things.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest