MYSQL error: Duplicate key when polling

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

Moderators: Developers, Moderators

joshh
Posts: 40
Joined: Wed May 17, 2006 2:35 pm
Location: Seattle, WA - USA

MYSQL error: Duplicate key when polling

Post by joshh »

I am seeing a lot of errors:

...

07/12/2006 10:45:02 AM - CACTID: Poller[0] ERROR: Problem with MySQL: 'Duplicate entry '3-mem_buffers-2006-07-12 10:45:01' for key 1'
07/12/2006 10:45:02 AM - CACTID: Poller[0] ERROR: Problem with MySQL: 'Duplicate entry '17-traffic_in-2006-07-12 10:45:01' for key 1'
07/12/2006 10:45:03 AM - CACTID: Poller[0] ERROR: Problem with MySQL: 'Duplicate entry '28-traffic_in-2006-07-12 10:45:01' for key 1'

...

more that 100. I don't know what table the error is coming from.
Anyone have any thoughts on this?

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

Post by rony »

Wait for a polling cycle to complete.

When the poller is not running, run the following query on you Cacti database:

Code: Select all

truncate poller_output;
It seems a poller crashed in the past leaving items in the poller_output table. Under normal operation, when the poller is not running, this table will have not items in it.
[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]
joshh
Posts: 40
Joined: Wed May 17, 2006 2:35 pm
Location: Seattle, WA - USA

ahh

Post by joshh »

looking at this table there are no left over entries.
I did just notice that my poller frequency seems to be too short. polling is taking longer than 5 minutes. The previous poller is not done by the time the next one is launched.

I am already using CACTID so I will have to look into why this is taking so long. I did increase snmp timeouts as well as ping timeout so this may be a factor.

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

Post by rony »

How many devices and data source do you have?

How much memory does the server have? You might help you polling time buy just adding more memory to increase the OS disk cache.
[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]
joshh
Posts: 40
Joined: Wed May 17, 2006 2:35 pm
Location: Seattle, WA - USA

Post by joshh »

the server has 3GB of ram. slightly more that 1GB is currently free.

I am polling more than 160 devices and it looks like 1825 data sources.
This will be growing by at least a factor of 2-3 once everything is in there. there will be 400-500 devices.

thanks for the help!
Josh
joshh
Posts: 40
Joined: Wed May 17, 2006 2:35 pm
Location: Seattle, WA - USA

Post by joshh »

I pulled the DS number (1825) from the poller_item table.
Not sure if this is correct.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Look at the SYSTEM STATS line in the Cacti log and it will tell me all I need to know.
[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]
joshh
Posts: 40
Joined: Wed May 17, 2006 2:35 pm
Location: Seattle, WA - USA

Post by joshh »

here is what I am seeing now. pretty much the same:

Code: Select all

07/12/2006 04:45:17 PM - CACTID: Poller[0] ERROR: Problem with MySQL: 'Duplicate entry '1572-traffic_in-2006-07-12 16:45:09' for key 1'
07/12/2006 04:49:54 PM - POLLER: Poller[0] Maximum runtime of 292 seconds exceeded. Exiting.
07/12/2006 04:49:54 PM - SYSTEM STATS: Time:292.4031 Method:cactid Processes:10 Threads:12 Hosts:126 HostsPerProcess:13 DataSources:1533 RRDsProcessed:1358
07/12/2006 04:49:54 PM - POLLER: Poller[0] Maximum runtime of 292 seconds exceeded. Exiting.
07/12/2006 04:49:54 PM - SYSTEM STATS: Time:292.4074 Method:cactid Processes:10 Threads:12 Hosts:126 HostsPerProcess:13 DataSources:1533 RRDsProcessed:1304
07/12/2006 04:49:54 PM - PCOMMAND: Poller[0] Host[11] WARNING: Recache Event Detected for Host
07/12/2006 04:49:54 PM - PCOMMAND: Poller[0] Host[11] WARNING: Recache Event Detected for Host
07/12/2006 04:49:54 PM - THOLD: Poller[0] Checking Thresholds
07/12/2006 04:49:54 PM - THOLD: Poller[0] Checking Thresholds
07/12/2006 04:49:55 PM - PCOMMAND: Poller[0] Host[15] WARNING: Recache Event Detected for Host
07/12/2006 04:49:55 PM - PCOMMAND: Poller[0] Host[15] WARNING: Recache Event Detected for Host
07/12/2006 04:49:56 PM - PCOMMAND: Poller[0] Host[17] WARNING: Recache Event Detected for Host
07/12/2006 04:49:56 PM - PCOMMAND: Poller[0] Host[17] WARNING: Recache Event Detected for Host
07/12/2006 04:49:57 PM - PCOMMAND: Poller[0] Host[20] WARNING: Recache Event Detected for Host
07/12/2006 04:49:57 PM - PCOMMAND: Poller[0] Host[20] WARNING: Recache Event Detected for Host
07/12/2006 04:50:02 PM - CACTID: Poller[0] ERROR: Problem with MySQL: 'Duplicate entry '3-mem_buffers-2006-07-12 16:50:01' for key 1'
07/12/2006 04:50:02 PM - CACTID: Poller[0] ERROR: Problem with MySQL: 'Duplicate entry '17-traffic_in-2006-07-12 16:50:01' for key 1'
07/12/2006 04:50:03 PM - CACTID: Poller[0] ERROR: Problem with MySQL: 'Duplicate entry '28-traffic_in-2006-07-12 16:50:01' for key 1'
07/12/2006 04:50:03 PM - CACTID: Poller[0] ERROR: Problem with MySQL: 'Duplicate entry '149-traffic_in-2006-07-12 16:50:02' for key 1'
joshh
Posts: 40
Joined: Wed May 17, 2006 2:35 pm
Location: Seattle, WA - USA

Post by joshh »

ok got it:

Code: Select all

07/13/2006 02:55:15 PM - SYSTEM STATS: Time:13.8235 Method:cactid Processes:10 Threads:12 Hosts:126 HostsPerProcess:13 DataSources:1533 RRDsProcessed:1280
07/13/2006 02:55:15 PM - SYSTEM STATS: Time:13.8333 Method:cactid Processes:10 Threads:12 Hosts:126 HostsPerProcess:13 DataSources:1533 RRDsProcessed:1197
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

What OS? Distro?

I would suggest you take the poller offline and run a check/repair on the database.
[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]
joshh
Posts: 40
Joined: Wed May 17, 2006 2:35 pm
Location: Seattle, WA - USA

Post by joshh »

bummer.
running Red Hat 4
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Can you please update to the SVN version of Cactid? BRANCH_0_8_6. This problem is caused by a data query.

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?
joshh
Posts: 40
Joined: Wed May 17, 2006 2:35 pm
Location: Seattle, WA - USA

Post by joshh »

there is no configure script in cactid under that branch.

am I missing something?
joshh
Posts: 40
Joined: Wed May 17, 2006 2:35 pm
Location: Seattle, WA - USA

Post by joshh »

never mind. got it figured out.
joshh
Posts: 40
Joined: Wed May 17, 2006 2:35 pm
Location: Seattle, WA - USA

Post by joshh »

got the new cactid built but am still seeing this problem.

do I need to update my cacti installation as well?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests