DB error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
pnewlon
Posts: 86
Joined: Mon May 16, 2011 2:19 pm

Re: DB error

Post by pnewlon »

OK - but it is still happening even after changing to SERIAL and rerunning database repair. I have to cat /dev/null to my messages file every four hours or it fills my drive.
pnewlon
Posts: 86
Joined: Mon May 16, 2011 2:19 pm

Re: DB error

Post by pnewlon »

*** I found this thread. Tried that, still no good
http://support.nagios.com/forum/viewtop ... 41&p=21916
If you continue to have problems with the table lets run
mysql -u root -pnagiosxi nagios
REPAIR TABLE nagios_timedeventqueue USE_FRM;

*** I found several references to truncating the nagios_timedeventqueue table including
http://marc.info/?l=nagios-devel&m=126295926808951

*** Still getting errors! How can there possibly be a duplicate entry for key 1 when there is no data in the table?
Aug 5 10:44:06 lpnagv01 ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_timedeventqueue SET instance_id='1', event_type='0', queued_time=FROM_UNIXTIME(1375713627), queued_time_usec='492085', scheduled_time=FROM_UNIXTIME(1375713798), recurring_event='0', object_id='3414''
Aug 5 10:44:06 lpnagv01 ndo2db: mysql_error: 'Duplicate entry '2147483647' for key 1'

[root@lpnagv01 pnewl01]# echo "select * from nagios_servicechecks;"|mysql -pnagiosxi nagios
[root@lpnagv01 pnewl01]# echo "select * from nagios_systemcommands;"|mysql -pnagiosxi nagios
[root@lpnagv01 pnewl01]# echo "select * from nagios_timedeventqueue;"|mysql -pnagiosxi nagios
[root@lpnagv01 pnewl01]# echo "select * from nagios_timedevents;"|mysql -pnagiosxi nagios
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: DB error

Post by scottwilkerson »

Again, as requested before, can you send the following
scottwilkerson wrote:So the error is still in nagios_timedeventqueue..

Can you run

Code: Select all

echo "DESCRIBE nagios_timedeventqueue;"|mysql -pnagiosxi nagios
the reason it is the same number is because that is the max size of the INT field you would have had before making the change
Also, can you post the output of

Code: Select all

tail /var/log/mysqld.log
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
pnewlon
Posts: 86
Joined: Mon May 16, 2011 2:19 pm

Re: DB error

Post by pnewlon »

scottwilkerson wrote:Again, as requested before, can you send the following]
Sorry Scott - this post didn't show until I closed / reopened my browser. Odd.

[root@lpnagv01 pnewl01]# echo "DESCRIBE nagios_timedeventqueue;"|mysql -pnagiosxi nagios
Field Type Null Key Default Extra
timedeventqueue_id bigint(20) unsigned NO PRI NULL auto_increment
instance_id smallint(6) NO MUL 0
event_type smallint(6) NO MUL 0
queued_time datetime NO MUL 0000-00-00 00:00:00
queued_time_usec int(11) NO 0
scheduled_time datetime NO MUL 0000-00-00 00:00:00
recurring_event smallint(6) NO 0
object_id int(11) NO MUL 0


Also, can you post the output of /var/log/mysqld.log


130805 10:40:21 mysqld started
130805 10:40:21 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
130805 10:40:21 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
130805 10:40:21 InnoDB: Started; log sequence number 0 43655
130805 10:40:21 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.77' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: DB error

Post by scottwilkerson »

No errors reporting for MySQL on this machine, is your MySQL database offloaded? If so you will need to run the command on the remote DB not the local one...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
pnewlon
Posts: 86
Joined: Mon May 16, 2011 2:19 pm

Re: DB error

Post by pnewlon »

scottwilkerson wrote:No errors reporting for MySQL on this machine, is your MySQL database offloaded? If so you will need to run the command on the remote DB not the local one...
BINGO! I forgot that this Nagios server has the DB offloaded. Once I ran the 'alter table' on the remote DB server it fixed the problem. Thanks Scott!
Locked