topic:linux_repare_nagios_db
This is an old revision of the document!
Ремонит
Описание проблемы
Сломались таблицы в mysql базе в которую писались данные системы мониторинга Nagios.
Сам nagios работал, но в лог огромными количествами сыпались подобные сообщения:
С помощью awk ищем сломашиеся таблицы.
[root@msk-02-noc log]# grep 'crashed and should be repaired' mysqld.log | awk '{print $6}' | sort | uniq './nagios_db/nagios_hoststatus' './nagios_db/nagios_servicechecks' './nagios_db/nagios_systemcommands' './nagios_db/nagios_timedeventqueue'
Решение - останавливаем nagios и с помощью mysqlcheck чиним таблицы.
[root@msk-02-noc nagios]# mysqlcheck -unagios_user -p --repair --extended nagios_db Enter password: nagios_db.nagios_acknowledgements OK nagios_db.nagios_commands OK nagios_db.nagios_commenthistory OK nagios_db.nagios_comments OK nagios_db.nagios_configfiles OK nagios_db.nagios_configfilevariables OK nagios_db.nagios_conninfo OK nagios_db.nagios_contact_addresses OK nagios_db.nagios_contact_notificationcommands OK nagios_db.nagios_contactgroup_members OK nagios_db.nagios_contactgroups OK nagios_db.nagios_contactnotificationmethods OK nagios_db.nagios_contactnotifications OK nagios_db.nagios_contacts OK nagios_db.nagios_contactstatus OK nagios_db.nagios_customvariables OK nagios_db.nagios_customvariablestatus OK nagios_db.nagios_dbversion OK nagios_db.nagios_downtimehistory OK nagios_db.nagios_eventhandlers OK nagios_db.nagios_externalcommands OK nagios_db.nagios_flappinghistory OK nagios_db.nagios_host_contactgroups OK nagios_db.nagios_host_contacts OK nagios_db.nagios_host_parenthosts OK nagios_db.nagios_hostchecks OK nagios_db.nagios_hostdependencies OK nagios_db.nagios_hostescalation_contactgroups OK nagios_db.nagios_hostescalation_contacts OK nagios_db.nagios_hostescalations OK nagios_db.nagios_hostgroup_members OK nagios_db.nagios_hostgroups OK nagios_db.nagios_hosts OK nagios_db.nagios_hoststatus info : Duplicate key 2 for record at 13480 against new record at 0 warning : Number of rows changed from 268 to 267 status : OK nagios_db.nagios_instances OK nagios_db.nagios_logentries OK nagios_db.nagios_notifications OK nagios_db.nagios_objects OK nagios_db.nagios_processevents OK nagios_db.nagios_programstatus OK nagios_db.nagios_runtimevariables OK nagios_db.nagios_scheduleddowntime OK nagios_db.nagios_service_contactgroups OK nagios_db.nagios_service_contacts OK nagios_db.nagios_servicechecks warning : Number of rows changed from 1095125 to 1094998 status : OK nagios_db.nagios_servicedependencies OK nagios_db.nagios_serviceescalation_contactgroups OK nagios_db.nagios_serviceescalation_contacts OK nagios_db.nagios_serviceescalations OK nagios_db.nagios_servicegroup_members OK nagios_db.nagios_servicegroups OK nagios_db.nagios_services OK nagios_db.nagios_servicestatus OK nagios_db.nagios_statehistory OK nagios_db.nagios_systemcommands info : Wrong bytesec: 23- 92-183 at 92223440; Skipped info : Wrong bytesec: 108-105- 98 at 395057336; Skipped info : Wrong block with wrong total length starting at 91145760 info : Found block with too small length at 91146520; Skipped info : Found block with too small length at 91430372; Skipped info : Found block with too small length at 91430380; Skipped info : Wrong bytesec: 117-115-114 at 91648060; Skipped info : Wrong bytesec: 112-108- 15 at 485197884; Skipped info : Found block with too small length at 399791272; Skipped info : Wrong bytesec: 111-115- 47 at 91647448; Skipped warning : Number of rows changed from 3876808 to 3871726 status : OK nagios_db.nagios_timedeventqueue warning : Number of rows changed from 1009 to 948 status : OK nagios_db.nagios_timedevents OK nagios_db.nagios_timeperiod_timeranges OK nagios_db.nagios_timeperiods OK
topic/linux_repare_nagios_db.1497216663.txt.gz · Last modified: (external edit)