Page 1 of 2
Error with upgrading to 5.2.0
Posted: Mon Nov 02, 2015 4:18 pm
by jimhoffmann
Attempting to upgrade our Nagios server from 2014R2.7 to 5.2.0. During the backup of MYSQL I get the following message:
Backing up MySQL databases...
mysqldump: Got error: 130: Incorrect file format 'nagios_statehistory' when using LOCK TABLES
Error backing up MySQL database 'nagios' - check the password in this script!
I have twice already ran the script to repair the database but that did not seem to resolve the issue.
Re: Error with upgrading to 5.2.0
Posted: Mon Nov 02, 2015 4:26 pm
by rkennedy
Can you run the following command and post the output?
tail -n 100 /var/log/mysqld.log
Also, please verify the SQL password in a couple files. (it should be nagiosxi)
grep "mysqlpass=" /usr/local/nagiosxi/scripts/restore_xi.sh
grep "PASSWORD=" /root/scripts/automysqlbackup
Re: Error with upgrading to 5.2.0
Posted: Tue Nov 03, 2015 9:10 am
by jimhoffmann
Here is the output from the tail:
Code: Select all
150919 15:59:06 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:06 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:06 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:06 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:10 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:10 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:10 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:12 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:12 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:14 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:14 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:15 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:15 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:15 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:15 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:15 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:16 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:16 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:16 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:16 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:16 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:18 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:18 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:18 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:18 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:18 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:19 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:19 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:22 [Note] /usr/libexec/mysqld: Normal shutdown
150919 15:59:22 [Note] Event Scheduler: Purging the queue. 0 events
150919 15:59:24 InnoDB: Starting shutdown...
150919 15:59:28 InnoDB: Shutdown completed; log sequence number 0 44253
150919 15:59:28 [Note] /usr/libexec/mysqld: Shutdown complete
150919 15:59:28 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
150919 15:59:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150919 15:59:32 InnoDB: Initializing buffer pool, size = 8.0M
150919 15:59:32 InnoDB: Completed initialization of buffer pool
150919 15:59:32 InnoDB: Started; log sequence number 0 44253
150919 15:59:32 [Note] Event Scheduler: Loaded 0 events
150919 15:59:32 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
151030 12:03:08 [Note] /usr/libexec/mysqld: Normal shutdown
151030 12:03:08 [Note] Event Scheduler: Purging the queue. 0 events
151030 12:03:08 InnoDB: Starting shutdown...
151030 12:03:13 InnoDB: Shutdown completed; log sequence number 0 44253
151030 12:03:13 [Note] /usr/libexec/mysqld: Shutdown complete
151030 12:03:14 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
151030 12:03:50 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
151030 12:03:50 InnoDB: Initializing buffer pool, size = 8.0M
151030 12:03:50 InnoDB: Completed initialization of buffer pool
151030 12:03:50 InnoDB: Started; log sequence number 0 44253
151030 12:03:50 [Note] Event Scheduler: Loaded 0 events
151030 12:03:50 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source dis[root@nagios01 ~]# tail -n 100 /var/log/mysqld.log
150919 15:59:06 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:06 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:06 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:06 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:09 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:10 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:10 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:10 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:12 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:12 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:14 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:14 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:15 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:15 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:15 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:15 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:15 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:16 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:16 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:16 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:16 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:16 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:18 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:18 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:18 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:18 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:18 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:19 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:19 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
150919 15:59:22 [Note] /usr/libexec/mysqld: Normal shutdown
150919 15:59:22 [Note] Event Scheduler: Purging the queue. 0 events
150919 15:59:24 InnoDB: Starting shutdown...
150919 15:59:28 InnoDB: Shutdown completed; log sequence number 0 44253
150919 15:59:28 [Note] /usr/libexec/mysqld: Shutdown complete
150919 15:59:28 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
150919 15:59:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150919 15:59:32 InnoDB: Initializing buffer pool, size = 8.0M
150919 15:59:32 InnoDB: Completed initialization of buffer pool
150919 15:59:32 InnoDB: Started; log sequence number 0 44253
150919 15:59:32 [Note] Event Scheduler: Loaded 0 events
150919 15:59:32 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
151030 12:03:08 [Note] /usr/libexec/mysqld: Normal shutdown
151030 12:03:08 [Note] Event Scheduler: Purging the queue. 0 events
151030 12:03:08 InnoDB: Starting shutdown...
151030 12:03:13 InnoDB: Shutdown completed; log sequence number 0 44253
151030 12:03:13 [Note] /usr/libexec/mysqld: Shutdown complete
151030 12:03:14 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
151030 12:03:50 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
151030 12:03:50 InnoDB: Initializing buffer pool, size = 8.0M
151030 12:03:50 InnoDB: Completed initialization of buffer pool
151030 12:03:50 InnoDB: Started; log sequence number 0 44253
151030 12:03:50 [Note] Event Scheduler: Loaded 0 events
151030 12:03:50 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
151030 15:23:41 [Note] /usr/libexec/mysqld: Normal shutdown
151030 15:23:41 [Note] Event Scheduler: Purging the queue. 0 events
151030 15:23:41 InnoDB: Starting shutdown...
151030 15:23:42 InnoDB: Shutdown completed; log sequence number 0 44253
151030 15:23:42 [Note] /usr/libexec/mysqld: Shutdown complete
151030 15:23:42 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
151030 15:24:17 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
151030 15:24:17 InnoDB: Initializing buffer pool, size = 8.0M
151030 15:24:17 InnoDB: Completed initialization of buffer pool
151030 15:24:18 InnoDB: Started; log sequence number 0 44253
151030 15:24:18 [Note] Event Scheduler: Loaded 0 events
151030 15:24:18 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
[root@nagios01 ~]#
Re: Error with upgrading to 5.2.0
Posted: Tue Nov 03, 2015 11:18 am
by rkennedy
Can you please verify the password as well by running the following two commands?
Code: Select all
grep "mysqlpass=" /usr/local/nagiosxi/scripts/restore_xi.sh
grep "PASSWORD=" /root/scripts/automysqlbackup
Re: Error with upgrading to 5.2.0
Posted: Tue Nov 03, 2015 11:52 am
by jimhoffmann
I verified that when I ran the commands both are nagiosxi.
Re: Error with upgrading to 5.2.0
Posted: Tue Nov 03, 2015 12:28 pm
by rkennedy
Ah - didn't know if you did or not. Thanks for verifying. Try running the following commands to see if this fixes the table in question. Let me know the output.
Code: Select all
service mysqld stop
cd /var/lib/mysql/nagios
myisamchk -r -f nagios_statehistory
myisamchk -r -f nagios_hoststatus
service mysqld start
rm -f /usr/local/nagiosxi/var/dbmaint.lock
/usr/local/nagiosxi/cron/dbmaint.php
Re: Error with upgrading to 5.2.0
Posted: Tue Nov 03, 2015 1:07 pm
by jimhoffmann
Here are the outputs from the commands you gave:
[root@nagios01 ~]# service mysqld stop
Stopping mysqld: [ OK ]
[root@nagios01 ~]# cd /var/lib/mysql/nagios
[root@nagios01 nagios]# myisamchk -r -f nagios_statehistory
myisamchk: error: 'nagios_statehistory' is not a MyISAM-table
[root@nagios01 nagios]# myisamchk -r -f nagios_hoststatus
- recovering (with sort) MyISAM-table 'nagios_hoststatus'
Data records: 160
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5
- Fixing index 6
- Fixing index 7
- Fixing index 8
- Fixing index 9
- Fixing index 10
- Fixing index 11
- Fixing index 12
- Fixing index 13
- Fixing index 14
- Fixing index 15
- Fixing index 16
- Fixing index 17
- Fixing index 18
- Fixing index 19
[root@nagios01 nagios]#
[root@nagios01 nagios]# rm -f /usr/local/nagiosxi/var/dbmaint.lock
[root@nagios01 nagios]# /usr/local/nagiosxi/cron/dbmaint.php
/bin/env: php -q: No such file or directory
[root@nagios01 nagios]#
Re: Error with upgrading to 5.2.0
Posted: Tue Nov 03, 2015 4:52 pm
by scottwilkerson
sorry, please run
Code: Select all
php /usr/local/nagiosxi/cron/dbmaint.php
Re: Error with upgrading to 5.2.0
Posted: Wed Nov 04, 2015 9:38 am
by jimhoffmann
I went through the list of commands again and here is what the Output shows:
Code: Select all
[root@nagios01 ~]# service mysqld start
Starting mysqld: [ OK ]
[root@nagios01 ~]# service mysqld stop
Stopping mysqld: [ OK ]
[root@nagios01 ~]# cd /var/lib/mysql/nagios
[root@nagios01 nagios]# myisamchk -r -f nagios_statehistory
myisamchk: error: 'nagios_statehistory' is not a MyISAM-table
[root@nagios01 nagios]# myisamchk -r -f nagios_hoststatus
- recovering (with sort) MyISAM-table 'nagios_hoststatus'
Data records: 160
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5
- Fixing index 6
- Fixing index 7
- Fixing index 8
- Fixing index 9
- Fixing index 10
- Fixing index 11
- Fixing index 12
- Fixing index 13
- Fixing index 14
- Fixing index 15
- Fixing index 16
- Fixing index 17
- Fixing index 18
- Fixing index 19
[root@nagios01 nagios]# service mysqld start
Starting mysqld: [ OK ]
[root@nagios01 nagios]# rm -f /usr/local/nagiosxi/var/dbmaint.lock
[root@nagios01 nagios]# php /usr/local/nagiosxi/cron/dbmaint.php
CREATING: /usr/local/nagiosxi/var/dbmaint.lock
CLEANING ndoutils TABLE 'commenthistory'...
SQL: DELETE FROM nagios_commenthistory WHERE entry_time < FROM_UNIXTIME(1415111410)
CLEANING ndoutils TABLE 'processevents'...
SQL: DELETE FROM nagios_processevents WHERE event_time < FROM_UNIXTIME(1415111410)
CLEANING ndoutils TABLE 'externalcommands'...
SQL: DELETE FROM nagios_externalcommands WHERE entry_time < FROM_UNIXTIME(1446042610)
CLEANING ndoutils TABLE 'logentries'...
SQL: DELETE FROM nagios_logentries WHERE logentry_time < FROM_UNIXTIME(1438871410)
CLEANING ndoutils TABLE 'notifications'...
SQL: DELETE FROM nagios_notifications WHERE start_time < FROM_UNIXTIME(1438871410)
CLEANING ndoutils TABLE 'contactnotifications'...
SQL: DELETE FROM nagios_contactnotifications WHERE start_time < FROM_UNIXTIME(1438871410)
CLEANING ndoutils TABLE 'contactnotificationmethods'...
SQL: DELETE FROM nagios_contactnotificationmethods WHERE start_time < FROM_UNIXTIME(1438871410)
CLEANING ndoutils TABLE 'statehistory'...
SQL: DELETE FROM nagios_statehistory WHERE state_time < FROM_UNIXTIME(1383575410)
SQL: SQL Error [ndoutils] :</b> Incorrect file format 'nagios_statehistory'CLEANING ndoutils TABLE 'timedevents'...
SQL: DELETE FROM nagios_timedevents WHERE event_time < FROM_UNIXTIME(1446647110)
CLEANING ndoutils TABLE 'systemcommands'...
SQL: DELETE FROM nagios_systemcommands WHERE start_time < FROM_UNIXTIME(1446647110)
SQL: SQL Error [ndoutils] :</b> Incorrect file format 'nagios_systemcommands'CLEANING ndoutils TABLE 'servicechecks'...
SQL: DELETE FROM nagios_servicechecks WHERE start_time < FROM_UNIXTIME(1446647110)
CLEANING ndoutils TABLE 'hostchecks'...
SQL: DELETE FROM nagios_hostchecks WHERE start_time < FROM_UNIXTIME(1446647110)
CLEANING ndoutils TABLE 'eventhandlers'...
SQL: DELETE FROM nagios_eventhandlers WHERE start_time < FROM_UNIXTIME(1446647110)
TIME TO OPTIMIZE
LASTOPT: 1446643802
INTERVAL: 60
NOW: 1446647410
OPTTIME: 1446647402
OPTIMIZING NDOUTILS TABLE: nagios_acknowledgements
SQL: OPTIMIZE TABLE nagios_acknowledgements
OPTIMIZING NDOUTILS TABLE: nagios_commands
SQL: OPTIMIZE TABLE nagios_commands
OPTIMIZING NDOUTILS TABLE: nagios_commenthistory
SQL: OPTIMIZE TABLE nagios_commenthistory
OPTIMIZING NDOUTILS TABLE: nagios_comments
SQL: OPTIMIZE TABLE nagios_comments
OPTIMIZING NDOUTILS TABLE: nagios_configfiles
SQL: OPTIMIZE TABLE nagios_configfiles
OPTIMIZING NDOUTILS TABLE: nagios_configfilevariables
SQL: OPTIMIZE TABLE nagios_configfilevariables
OPTIMIZING NDOUTILS TABLE: nagios_conninfo
SQL: OPTIMIZE TABLE nagios_conninfo
OPTIMIZING NDOUTILS TABLE: nagios_contact_addresses
SQL: OPTIMIZE TABLE nagios_contact_addresses
OPTIMIZING NDOUTILS TABLE: nagios_contact_notificationcommands
SQL: OPTIMIZE TABLE nagios_contact_notificationcommands
OPTIMIZING NDOUTILS TABLE: nagios_contactgroup_members
SQL: OPTIMIZE TABLE nagios_contactgroup_members
OPTIMIZING NDOUTILS TABLE: nagios_contactgroups
SQL: OPTIMIZE TABLE nagios_contactgroups
OPTIMIZING NDOUTILS TABLE: nagios_contactnotificationmethods
SQL: OPTIMIZE TABLE nagios_contactnotificationmethods
OPTIMIZING NDOUTILS TABLE: nagios_contactnotifications
SQL: OPTIMIZE TABLE nagios_contactnotifications
OPTIMIZING NDOUTILS TABLE: nagios_contacts
SQL: OPTIMIZE TABLE nagios_contacts
OPTIMIZING NDOUTILS TABLE: nagios_contactstatus
SQL: OPTIMIZE TABLE nagios_contactstatus
OPTIMIZING NDOUTILS TABLE: nagios_customvariables
SQL: OPTIMIZE TABLE nagios_customvariables
OPTIMIZING NDOUTILS TABLE: nagios_customvariablestatus
SQL: OPTIMIZE TABLE nagios_customvariablestatus
OPTIMIZING NDOUTILS TABLE: nagios_dbversion
SQL: OPTIMIZE TABLE nagios_dbversion
OPTIMIZING NDOUTILS TABLE: nagios_downtimehistory
SQL: OPTIMIZE TABLE nagios_downtimehistory
OPTIMIZING NDOUTILS TABLE: nagios_eventhandlers
SQL: OPTIMIZE TABLE nagios_eventhandlers
OPTIMIZING NDOUTILS TABLE: nagios_externalcommands
SQL: OPTIMIZE TABLE nagios_externalcommands
OPTIMIZING NDOUTILS TABLE: nagios_flappinghistory
SQL: OPTIMIZE TABLE nagios_flappinghistory
OPTIMIZING NDOUTILS TABLE: nagios_host_contactgroups
SQL: OPTIMIZE TABLE nagios_host_contactgroups
OPTIMIZING NDOUTILS TABLE: nagios_host_contacts
SQL: OPTIMIZE TABLE nagios_host_contacts
OPTIMIZING NDOUTILS TABLE: nagios_host_parenthosts
SQL: OPTIMIZE TABLE nagios_host_parenthosts
OPTIMIZING NDOUTILS TABLE: nagios_hostchecks
SQL: OPTIMIZE TABLE nagios_hostchecks
OPTIMIZING NDOUTILS TABLE: nagios_hostdependencies
SQL: OPTIMIZE TABLE nagios_hostdependencies
OPTIMIZING NDOUTILS TABLE: nagios_hostescalation_contactgroups
SQL: OPTIMIZE TABLE nagios_hostescalation_contactgroups
OPTIMIZING NDOUTILS TABLE: nagios_hostescalation_contacts
SQL: OPTIMIZE TABLE nagios_hostescalation_contacts
OPTIMIZING NDOUTILS TABLE: nagios_hostescalations
SQL: OPTIMIZE TABLE nagios_hostescalations
OPTIMIZING NDOUTILS TABLE: nagios_hostgroup_members
SQL: OPTIMIZE TABLE nagios_hostgroup_members
OPTIMIZING NDOUTILS TABLE: nagios_hostgroups
SQL: OPTIMIZE TABLE nagios_hostgroups
OPTIMIZING NDOUTILS TABLE: nagios_hosts
SQL: OPTIMIZE TABLE nagios_hosts
OPTIMIZING NDOUTILS TABLE: nagios_hoststatus
SQL: OPTIMIZE TABLE nagios_hoststatus
OPTIMIZING NDOUTILS TABLE: nagios_instances
SQL: OPTIMIZE TABLE nagios_instances
OPTIMIZING NDOUTILS TABLE: nagios_logentries
SQL: OPTIMIZE TABLE nagios_logentries
OPTIMIZING NDOUTILS TABLE: nagios_notifications
SQL: OPTIMIZE TABLE nagios_notifications
OPTIMIZING NDOUTILS TABLE: nagios_objects
SQL: OPTIMIZE TABLE nagios_objects
OPTIMIZING NDOUTILS TABLE: nagios_processevents
SQL: OPTIMIZE TABLE nagios_processevents
OPTIMIZING NDOUTILS TABLE: nagios_programstatus
SQL: OPTIMIZE TABLE nagios_programstatus
OPTIMIZING NDOUTILS TABLE: nagios_runtimevariables
SQL: OPTIMIZE TABLE nagios_runtimevariables
OPTIMIZING NDOUTILS TABLE: nagios_scheduleddowntime
SQL: OPTIMIZE TABLE nagios_scheduleddowntime
OPTIMIZING NDOUTILS TABLE: nagios_service_contactgroups
SQL: OPTIMIZE TABLE nagios_service_contactgroups
OPTIMIZING NDOUTILS TABLE: nagios_service_contacts
SQL: OPTIMIZE TABLE nagios_service_contacts
OPTIMIZING NDOUTILS TABLE: nagios_servicechecks
SQL: OPTIMIZE TABLE nagios_servicechecks
OPTIMIZING NDOUTILS TABLE: nagios_servicedependencies
SQL: OPTIMIZE TABLE nagios_servicedependencies
OPTIMIZING NDOUTILS TABLE: nagios_serviceescalation_contactgroups
SQL: OPTIMIZE TABLE nagios_serviceescalation_contactgroups
OPTIMIZING NDOUTILS TABLE: nagios_serviceescalation_contacts
SQL: OPTIMIZE TABLE nagios_serviceescalation_contacts
OPTIMIZING NDOUTILS TABLE: nagios_serviceescalations
SQL: OPTIMIZE TABLE nagios_serviceescalations
OPTIMIZING NDOUTILS TABLE: nagios_servicegroup_members
SQL: OPTIMIZE TABLE nagios_servicegroup_members
OPTIMIZING NDOUTILS TABLE: nagios_servicegroups
SQL: OPTIMIZE TABLE nagios_servicegroups
OPTIMIZING NDOUTILS TABLE: nagios_services
SQL: OPTIMIZE TABLE nagios_services
OPTIMIZING NDOUTILS TABLE: nagios_servicestatus
SQL: OPTIMIZE TABLE nagios_servicestatus
OPTIMIZING NDOUTILS TABLE: nagios_statehistory
SQL: OPTIMIZE TABLE nagios_statehistory
OPTIMIZING NDOUTILS TABLE: nagios_systemcommands
SQL: OPTIMIZE TABLE nagios_systemcommands
OPTIMIZING NDOUTILS TABLE: nagios_timedeventqueue
SQL: OPTIMIZE TABLE nagios_timedeventqueue
OPTIMIZING NDOUTILS TABLE: nagios_timedevents
SQL: OPTIMIZE TABLE nagios_timedevents
OPTIMIZING NDOUTILS TABLE: nagios_timeperiod_timeranges
SQL: OPTIMIZE TABLE nagios_timeperiod_timeranges
OPTIMIZING NDOUTILS TABLE: nagios_timeperiods
SQL: OPTIMIZE TABLE nagios_timeperiods
CLEANING nagiosxi TABLE 'commands'...
SQL: DELETE FROM xi_commands WHERE processing_time < 1446618610::abstime::timestamp without time zone
CLEANING nagiosxi TABLE 'events'...
SQL: DELETE FROM xi_events WHERE processing_time < 1446618610::abstime::timestamp without time zone
SQL1: SELECT xi_meta.meta_id FROM xi_meta LEFT JOIN xi_events ON xi_meta.metaobj_id=xi_events.event_id WHERE metatype_id='1' AND event_id IS NULL
SQL2: DELETE FROM xi_meta WHERE meta_id IN (SELECT xi_meta.meta_id FROM xi_meta LEFT JOIN xi_events ON xi_meta.metaobj_id=xi_events.event_id WHERE metatype_id='1' AND event_id IS NULL)
CLEANING nagiosxi TABLE 'auditlog'...
SQL: DELETE FROM xi_auditlog WHERE log_time < 1444055410::abstime::timestamp without time zone
OPTIMIZING NAGIOSXI TABLE: xi_auditlog
SQL: VACUUM ANALYZE xi_auditlog;
OPTIMIZING NAGIOSXI TABLE: xi_commands
SQL: VACUUM ANALYZE xi_commands;
OPTIMIZING NAGIOSXI TABLE: xi_events
SQL: VACUUM ANALYZE xi_events;
OPTIMIZING NAGIOSXI TABLE: xi_notifications
SQL: VACUUM ANALYZE xi_notifications;
SQL: SQL Error [nagiosxi] :</b> ERROR: relation "xi_notifications" does not existOPTIMIZING NAGIOSXI TABLE: xi_meta
SQL: VACUUM ANALYZE xi_meta;
OPTIMIZING NAGIOSXI TABLE: xi_options
SQL: VACUUM ANALYZE xi_options;
OPTIMIZING NAGIOSXI TABLE: xi_sysstat
SQL: VACUUM ANALYZE xi_sysstat;
OPTIMIZING NAGIOSXI TABLE: xi_usermeta
SQL: VACUUM ANALYZE xi_usermeta;
OPTIMIZING NAGIOSXI TABLE: xi_users
SQL: VACUUM ANALYZE xi_users;
CLEANING nagiosql TABLE 'logbook'...
SQL: DELETE FROM tbl_logbook WHERE time < FROM_UNIXTIME(1446618610)
OPTIMIZING NAGIOSQL TABLE: tbl_contact
SQL: OPTIMIZE TABLE tbl_contact
OPTIMIZING NAGIOSQL TABLE: tbl_host
SQL: OPTIMIZE TABLE tbl_host
OPTIMIZING NAGIOSQL TABLE: tbl_hostgroup
SQL: OPTIMIZE TABLE tbl_hostgroup
OPTIMIZING NAGIOSQL TABLE: tbl_lnkHostgroupToHost
SQL: OPTIMIZE TABLE tbl_lnkHostgroupToHost
OPTIMIZING NAGIOSQL TABLE: tbl_lnkHostToHost
SQL: OPTIMIZE TABLE tbl_lnkHostToHost
OPTIMIZING NAGIOSQL TABLE: tbl_lnkHostToHostgroup
SQL: OPTIMIZE TABLE tbl_lnkHostToHostgroup
OPTIMIZING NAGIOSQL TABLE: tbl_lnkHostdependencyToHost_DH
SQL: OPTIMIZE TABLE tbl_lnkHostdependencyToHost_DH
OPTIMIZING NAGIOSQL TABLE: tbl_lnkHostdependencyToHost_H
SQL: OPTIMIZE TABLE tbl_lnkHostdependencyToHost_H
OPTIMIZING NAGIOSQL TABLE: tbl_lnkServiceToHost
SQL: OPTIMIZE TABLE tbl_lnkServiceToHost
OPTIMIZING NAGIOSQL TABLE: tbl_lnkServicedependencyToService_DS
SQL: OPTIMIZE TABLE tbl_lnkServicedependencyToService_DS
OPTIMIZING NAGIOSQL TABLE: tbl_lnkServicedependencyToService_S
SQL: OPTIMIZE TABLE tbl_lnkServicedependencyToService_S
OPTIMIZING NAGIOSQL TABLE: tbl_lnkServiceToHostgroup
SQL: OPTIMIZE TABLE tbl_lnkServiceToHostgroup
OPTIMIZING NAGIOSQL TABLE: tbl_lnkServiceToServicegroup
SQL: OPTIMIZE TABLE tbl_lnkServiceToServicegroup
OPTIMIZING NAGIOSQL TABLE: tbl_logbook
SQL: OPTIMIZE TABLE tbl_logbook
OPTIMIZING NAGIOSQL TABLE: tbl_service
SQL: OPTIMIZE TABLE tbl_service
OPTIMIZING NAGIOSQL TABLE: tbl_servicegroup
SQL: OPTIMIZE TABLE tbl_servicegroup
OPTIMIZING NAGIOSQL TABLE: tbl_timeperiod
SQL: OPTIMIZE TABLE tbl_timeperiod
OPTIMIZING NAGIOSQL TABLE: tbl_timedefinition
SQL: OPTIMIZE TABLE tbl_timedefinition
OPTIMIZING NAGIOSQL TABLE: tbl_user
SQL: OPTIMIZE TABLE tbl_user
Repair Complete: Removing Lock File
I ran the Upgrade again and still get the same error:
---- Starting Nagios XI Backup ----
No entry for terminal type "unknown";
using dumb terminal settings.
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
tar: /usr/local/nagios/var/ndo.sock: socket ignored
tar: /usr/local/nagios/var: file changed as we read it
tar: /usr/local/nagios/share/perfdata/ucsattendcon01.sfmic.local: file changed as we read it
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: Got error: 130: Incorrect file format 'nagios_statehistory' when using LOCK TABLES
Error backing up MySQL database 'nagios' - check the password in this script!
Re: Error with upgrading to 5.2.0
Posted: Wed Nov 04, 2015 12:35 pm
by jimhoffmann
I followed the Repairing the Database documentation and found the following output:
myisamchk: error: 'nagios_statehistory.MYI' is not a MyISAM-table
---------
myisamchk: error: 'nagios_systemcommands.MYI' is not a MyISAM-table
I see the nagios_statehistory come up when it is attempting to backup the database and fails.