MySQL messed up and error while trying to restore.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
UTE-COT
Posts: 18
Joined: Tue Jan 28, 2020 8:29 am

MySQL messed up and error while trying to restore.

Post by UTE-COT »

Hi, how are you? I'm using NAgios XI 5.8.3 on a Red Hat 8.4.

I was trying to make a symlink to move the MySQL files /var/lib/mysql/nagios to another partition with more space and somehow I messed it up.

I reverted the symlink but Nagios XI still started with some errors.

Initially I was having issues with file permissions and ownership but it seems I have fixed those.

Then I saw this error on the XI Homepage:

Code: Select all

SQL Error [ndoutils] : Incorrect file format 'nagios_programstatus'
I don't know how but it's gone now. However, I still have lots of errors:

- I don´t see any hostgroup nor service group.
- When I click on a service it says that Object does not exist.
- Hosts don't seem to have any service associated to them.
- And probably many more issues.

I decided to restore my DB to a previous state. To do so I have a daily backup from today at 7:00 AM (and several other days) but I'm having issues while trying to restore it.

Code: Select all

[root@lvwtelcotnagiosprd01 backup]# mysql -uroot -pnagiosxi nagios < nagios_2024-02-07_07h00m.Wednesday.sql
ERROR 1033 (HY000) at line 96: Incorrect information in file: './nagios/nagios_commenthistory.frm'

Code: Select all

[root@lvwtelcotnagiosprd01 backup]# mysqlcheck -r -f -u root -pnagiosxi --use_frm --all-databases
mysql.columns_priv                                 OK
mysql.db
warning  : Number of rows changed from 0 to 5
status   : OK
mysql.event                                        OK
mysql.func                                         OK
mysql.help_category
warning  : Number of rows changed from 0 to 39
status   : OK
mysql.help_keyword
warning  : Number of rows changed from 0 to 464
status   : OK
mysql.help_relation
warning  : Number of rows changed from 0 to 1028
status   : OK
mysql.help_topic
warning  : Number of rows changed from 0 to 508
status   : OK
mysql.host                                         OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv
warning  : Number of rows changed from 0 to 2
status   : OK
mysql.servers                                      OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user
warning  : Number of rows changed from 0 to 9
status   : OK
nagios.nagios_acknowledgements
warning  : Number of rows changed from 0 to 1
status   : OK
nagios.nagios_commands
warning  : Number of rows changed from 0 to 154
status   : OK
nagios.nagios_commenthistory
Error    : Incorrect information in file: './nagios/nagios_commenthistory.frm'
error    : Corrupt
nagios.nagios_comments                             OK
nagios.nagios_configfiles
Error    : Incorrect information in file: './nagios/nagios_configfiles.frm'
error    : Corrupt
nagios.nagios_configfilevariables
Error    : Incorrect information in file: './nagios/nagios_configfilevariables.frm'
error    : Corrupt
nagios.nagios_conninfo
warning  : Number of rows changed from 0 to 64
status   : OK
nagios.nagios_contact_addresses
Error    : Incorrect information in file: './nagios/nagios_contact_addresses.frm'
error    : Corrupt
nagios.nagios_contact_notificationcommands
Error    : Incorrect information in file: './nagios/nagios_contact_notificationcommands.frm'
error    : Corrupt
nagios.nagios_contactgroup_members                 OK
nagios.nagios_contactgroups                        OK
nagios.nagios_contactnotificationmethods           OK
nagios.nagios_contactnotifications
warning  : Number of rows changed from 0 to 705
status   : OK
nagios.nagios_contacts
warning  : Number of rows changed from 0 to 34
status   : OK
nagios.nagios_contactstatus
warning  : Number of rows changed from 0 to 34
status   : OK
nagios.nagios_customvariables
Error    : Incorrect information in file: './nagios/nagios_customvariables.frm'
error    : Corrupt
nagios.nagios_customvariablestatus                 OK
nagios.nagios_dbversion
warning  : Number of rows changed from 0 to 1
status   : OK
nagios.nagios_downtimehistory                      OK
nagios.nagios_eventhandlers                        OK
nagios.nagios_externalcommands                     OK
nagios.nagios_flappinghistory
warning  : Number of rows changed from 0 to 51582
status   : OK
nagios.nagios_host_contactgroups                   OK
nagios.nagios_host_contacts                        OK
nagios.nagios_host_parenthosts                     OK
nagios.nagios_hostchecks                           OK
nagios.nagios_hostdependencies                     OK
nagios.nagios_hostescalation_contactgroups         OK
nagios.nagios_hostescalation_contacts              OK
nagios.nagios_hostescalations                      OK
nagios.nagios_hostgroup_members                    OK
nagios.nagios_hostgroups                           OK
nagios.nagios_hosts
warning  : Number of rows changed from 0 to 417
status   : OK
nagios.nagios_hoststatus
warning  : Number of rows changed from 0 to 417
status   : OK
nagios.nagios_instances
warning  : Number of rows changed from 0 to 1
status   : OK
nagios.nagios_logentries
warning  : Number of rows changed from 0 to 518580
status   : OK
nagios.nagios_notifications
warning  : Number of rows changed from 0 to 2335242
status   : OK
nagios.nagios_objects
warning  : Number of rows changed from 0 to 2320
status   : OK
nagios.nagios_processevents
warning  : Number of rows changed from 0 to 651
status   : OK
nagios.nagios_programstatus                        OK
nagios.nagios_runtimevariables
Error    : Incorrect information in file: './nagios/nagios_runtimevariables.frm'
error    : Corrupt
nagios.nagios_scheduleddowntime                    OK
nagios.nagios_service_contactgroups                OK
nagios.nagios_service_contacts                     OK
nagios.nagios_service_parentservices               OK
nagios.nagios_servicechecks
Error    : Incorrect information in file: './nagios/nagios_servicechecks.frm'
error    : Corrupt
nagios.nagios_servicedependencies                  OK
nagios.nagios_serviceescalation_contactgroups      OK
nagios.nagios_serviceescalation_contacts           OK
nagios.nagios_serviceescalations                   OK
nagios.nagios_servicegroup_members                 OK
nagios.nagios_servicegroups                        OK
nagios.nagios_services
warning  : Number of rows changed from 0 to 1036
status   : OK
nagios.nagios_servicestatus
warning  : Number of rows changed from 0 to 1036
status   : OK
nagios.nagios_statehistory
warning  : Number of rows changed from 0 to 888242
status   : OK
nagios.nagios_systemcommands                       OK
nagios.nagios_timedeventqueue
Error    : Incorrect information in file: './nagios/nagios_timedeventqueue.frm'
error    : Corrupt
nagios.nagios_timedevents
Error    : Incorrect information in file: './nagios/nagios_timedevents.frm'
error    : Corrupt
nagios.nagios_timeperiod_timeranges
Error    : Incorrect information in file: './nagios/nagios_timeperiod_timeranges.frm'
error    : Corrupt
nagios.nagios_timeperiods
Error    : Incorrect information in file: './nagios/nagios_timeperiods.frm'
error    : Corrupt
nagiosql.tbl_command
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_contact
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_contactgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_contacttemplate
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_domain
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_host
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_hostdependency
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_hostescalation
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_hostextinfo
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_hostgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_hosttemplate
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_info
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContactToCommandHost
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContactToCommandService
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContactToContactgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContactToContacttemplate
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContactToVariabledefinition
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContactgroupToContact
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContactgroupToContactgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContacttemplateToCommandHost
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContacttemplateToCommandService
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContacttemplateToContactgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContacttemplateToContacttemplate
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkContacttemplateToVariabledefinition
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostToContact
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostToContactgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostToHost
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostToHostgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostToHosttemplate
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostToVariabledefinition
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostdependencyToHost_DH
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostdependencyToHost_H
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostdependencyToHostgroup_DH
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostdependencyToHostgroup_H
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostescalationToContact
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostescalationToContactgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostescalationToHost
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostescalationToHostgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostgroupToHost
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHostgroupToHostgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHosttemplateToContact
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHosttemplateToContactgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHosttemplateToHost
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHosttemplateToHostgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHosttemplateToHosttemplate
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkHosttemplateToVariabledefinition
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceToContact
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceToContactgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceToHost
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceToHostgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceToServicegroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceToServicetemplate
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceToVariabledefinition
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicedependencyToHost_DH
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicedependencyToHost_H
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicedependencyToHostgroup_DH
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicedependencyToHostgroup_H
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicedependencyToService_DS
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicedependencyToService_S
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicedependencyToServicegroup_DS
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicedependencyToServicegroup_S
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceescalationToContact
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceescalationToContactgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceescalationToHost
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceescalationToHostgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceescalationToService
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServiceescalationToServicegroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicegroupToService
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicegroupToServicegroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicetemplateToContact
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicetemplateToContactgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicetemplateToHost
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicetemplateToHostgroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicetemplateToServicegroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicetemplateToServicetemplate
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkServicetemplateToVariabledefinition
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_lnkTimeperiodToTimeperiod
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_logbook
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_mainmenu
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_permission
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_permission_inactive
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_service
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_servicedependency
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_serviceescalation
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_serviceextinfo
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_servicegroup
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_servicetemplate
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_session
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_session_locks
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_settings
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_submenu
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_timedefinition
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_timeperiod
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_user
note     : The storage engine for the table doesn't support repair
nagiosql.tbl_variabledefinition
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_auditlog
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_auth_tokens
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_cmp_ccm_backups
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_cmp_favorites
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_cmp_nagiosbpi_backups
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_cmp_trapdata
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_cmp_trapdata_log
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_commands
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_deploy_agents
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_deploy_jobs
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_eventqueue
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_events
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_meta
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_mibs
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_options
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_sessions
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_sysstat
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_usermeta
note     : The storage engine for the table doesn't support repair
nagiosxi.xi_users
note     : The storage engine for the table doesn't support repair
My mariadb.log has lots of this lines:

Code: Select all

240207 17:44:01 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_runtimevariables.frm'
240207 17:55:02 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_commenthistory.frm'
240207 17:55:02 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_timedevents.frm'
240207 17:55:02 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_servicechecks.frm'
240207 17:55:02 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_commenthistory.frm'
240207 17:55:02 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_configfiles.frm'
240207 17:55:02 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_configfilevariables.frm'
240207 17:55:02 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_contact_addresses.frm'
240207 17:55:02 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_contact_notificationcommands.frm'
240207 17:55:02 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_customvariables.frm'
240207 17:55:19 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_runtimevariables.frm'
240207 17:55:19 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_servicechecks.frm'
240207 17:55:22 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_timedeventqueue.frm'
240207 17:55:22 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_timedevents.frm'
240207 17:55:22 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_timeperiod_timeranges.frm'
240207 17:55:22 [ERROR] mysqld: Incorrect information in file: './nagios/nagios_timeperiods.frm'
Does this backup contain everything I need to have my installation working again?

Please any help is greatly appreciated.

Thanks in advance!
User avatar
danderson
Posts: 111
Joined: Wed Aug 09, 2023 10:05 am

Re: MySQL messed up and error while trying to restore.

Post by danderson »

Thanks for reaching out @UTE-COT,

I would first try the /usr/local/nagiosxi/scripts/repair_databases.sh script.
Then, I would look into using something like the REPAIR command in mysql. Info here:
https://dev.mysql.com/doc/refman/8.0/en ... table.html

Otherwise, this looks like a complicated issue so I would contact our support team directly, they can help you get to the bottom of this issue quickly. To contact support, open a ticket (case) at the Nagios Answer Hub.
UTE-COT
Posts: 18
Joined: Tue Jan 28, 2020 8:29 am

Re: MySQL messed up and error while trying to restore.

Post by UTE-COT »

Hi, thanks for your reply!

I already tried that with no success.

Code: Select all

[root@lvwtelcotnagiosprd01 backup]# /usr/local/nagiosxi/scripts/repair_databases.sh
DATABASE: nagios
TABLE:
/var/lib/mysql/nagios /nagios/backup
- recovering (with sort) MyISAM-table 'nagios_acknowledgements'
Data records: 1
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_commands'
Data records: 154
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_commenthistory'
Data records: 22283
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_comments'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_configfiles'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_configfilevariables'
Data records: 0
- Fixing index 1

---------

- recovering (with sort) MyISAM-table 'nagios_conninfo'
Data records: 64
- Fixing index 1

---------

- recovering (with sort) MyISAM-table 'nagios_contact_addresses'
Data records: 35
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_contactgroup_members'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_contactgroups'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_contact_notificationcommands'
Data records: 68
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_contactnotificationmethods'
Data records: 0
- Fixing index 1
- Fixing index 2
- Fixing index 3

---------

- recovering (with sort) MyISAM-table 'nagios_contactnotifications'
Data records: 704
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4

---------

- recovering (with sort) MyISAM-table 'nagios_contacts'
Data records: 34
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_contactstatus'
Data records: 34
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_customvariables'
Data records: 1057
- Fixing index 1
- Fixing index 2
- Fixing index 3

---------

- recovering (with sort) MyISAM-table 'nagios_customvariablestatus'
Data records: 0
- Fixing index 1
- Fixing index 2
- Fixing index 3

---------

- recovering (with keycache) MyISAM-table 'nagios_dbversion'
Data records: 1

---------

- recovering (with sort) MyISAM-table 'nagios_downtimehistory'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_eventhandlers'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_externalcommands'
Data records: 0
- Fixing index 1

---------

- recovering (with sort) MyISAM-table 'nagios_flappinghistory'
Data records: 51582
- Fixing index 1

---------

- recovering (with sort) MyISAM-table 'nagios_hostchecks'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_host_contactgroups'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_host_contacts'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_hostdependencies'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_hostescalation_contactgroups'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_hostescalation_contacts'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_hostescalations'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_hostgroup_members'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_hostgroups'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_host_parenthosts'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_hosts'
Data records: 417
- Fixing index 1
- Fixing index 2
- Fixing index 3

---------

- recovering (with sort) MyISAM-table 'nagios_hoststatus'
Data records: 417
- 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

---------

- recovering (with sort) MyISAM-table 'nagios_instances'
Data records: 1
- Fixing index 1

---------

- recovering (with sort) MyISAM-table 'nagios_logentries'
Data records: 515529
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4

---------

- recovering (with sort) MyISAM-table 'nagios_notifications'
Data records: 2326758
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4

---------

- recovering (with sort) MyISAM-table 'nagios_objects'
Data records: 2320
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5

---------

- recovering (with sort) MyISAM-table 'nagios_processevents'
Data records: 653
- Fixing index 1

---------

- recovering (with sort) MyISAM-table 'nagios_programstatus'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

myisamchk: error: 'nagios_runtimevariables' is not a MyISAM-table

---------

- recovering (with sort) MyISAM-table 'nagios_scheduleddowntime'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_servicechecks'
Data records: 897
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4

---------

- recovering (with sort) MyISAM-table 'nagios_service_contactgroups'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_service_contacts'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_servicedependencies'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_serviceescalation_contactgroups'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_serviceescalation_contacts'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_serviceescalations'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_servicegroup_members'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_servicegroups'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_service_parentservices'
Data records: 0
- Fixing index 1
- Fixing index 2

---------

- recovering (with sort) MyISAM-table 'nagios_services'
Data records: 1036
- Fixing index 1
- Fixing index 2
- Fixing index 3

---------

- recovering (with sort) MyISAM-table 'nagios_servicestatus'
Data records: 1036
- 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

---------

- recovering (with sort) MyISAM-table 'nagios_statehistory'
Data records: 886713
- Fixing index 1
- Fixing index 2
- Fixing index 3

---------

- recovering (with sort) MyISAM-table 'nagios_systemcommands'
Data records: 0
- Fixing index 1
- Fixing index 2
- Fixing index 3

---------

- recovering (with sort) MyISAM-table 'nagios_timedeventqueue'
Data records: 0
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5
- Fixing index 6

---------

- recovering (with sort) MyISAM-table 'nagios_timedevents'
Data records: 0
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5
- Fixing index 6

---------

- recovering (with sort) MyISAM-table 'nagios_timeperiods'
Data records: 39
- Fixing index 1
- Fixing index 2

---------

myisamchk: error: 'nagios_timeperiod_timeranges' is not a MyISAM-table
/nagios/backup

===============
REPAIR COMPLETE
===============
DATABASE: nagiosql
TABLE:
/var/lib/mysql/nagiosql /nagios/backup
DATABASE: nagiosxi
TABLE:
/var/lib/mysql/nagiosxi /nagios/backup

=======================
nagios database repair FAILED, please check output above!

You have new mail in /var/spool/mail/root
sgardil
Posts: 143
Joined: Wed Aug 09, 2023 9:58 am

Re: MySQL messed up and error while trying to restore.

Post by sgardil »

Do you happen to have a snapshot of your vm before making the changes that messed things up? If so and there isnt an issue with reverting to the snapshot isnt an issue I would give that a shot. Can always take another snapshot and revert back if things dont work out. Other than that like Dylan mentioned this one is a bit complicated and it might be best to open up a support ticket at Nagios Answer Hub.
UTE-COT
Posts: 18
Joined: Tue Jan 28, 2020 8:29 am

Re: MySQL messed up and error while trying to restore.

Post by UTE-COT »

Unfortunately I don't have a snapshot. I already opened a ticket and i'm waiting for an engineer.

Thanks!
sgardil
Posts: 143
Joined: Wed Aug 09, 2023 9:58 am

Re: MySQL messed up and error while trying to restore.

Post by sgardil »

Hey @UTE-COT

Checking in to see if you were able to get a solution for this issue?
Post Reply