Showing posts with label zabbix-server. Show all posts
Showing posts with label zabbix-server. Show all posts

Monday, June 17, 2013

Zabbix mysql blocked by bin_log errors

Zabbix never fails to find new and unusual ways to break. The most recent breakage occured because the housekeeper is running "unsafe" sql. You'll find this repeated a thousand times in the mysql-error.logs:

130617 17:30:35 [Note] The following warning was suppressed 50 times during the last 38 seconds in the error log
130617 17:30:35 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Statement: delete from history_uint where itemid=2506343 limit 500

I just decided to disable the housekeeper. It slows performance of the database down anyway. In /etc/zabbix/zabbix_server.conf uncomment the following line:

DisableHousekeeping=1

And then restart Zabbix. You should be good to go. You can also vote on my bug report here.

Tuesday, December 11, 2012

Zabbix Server - query failed duplicate entry solution

After backing up and restoring one of my Zabbix servers, I was getting the following error that was preventing all of my auto-registration from working:

18317:20121211:224348.314 [Z3005] query failed: [1062] Duplicate entry '296101' for key 'PRIMARY' [insert into events (eventid,source,object,objectid,clock,ns,value,value_changed) values (296101,2,3,606,1355265828,0,1,0)]

The Zabbix server worked perfectly fine otherwise, but auto-registration was completely broken. It turns out that the eventid table needs to be cleared if it's full of old hosts, which is very possible if you did a dump and restore. It's pretty simple to clear.

Warning, this should only be done on new servers which you are restoring. You would not want to run this command on an established Zabbix server:

mysql -e zabbix 'delete from events'

Let it purge the events table. This allowed auto-registration to work again properly. Hope that helps somebody else out there.