Nagios xi Database Error

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
preethu.d
Posts: 109
Joined: Wed Nov 25, 2020 11:32 pm

Nagios xi Database Error

Post by preethu.d »

Hi,

I am unable to launch Nagios console , getting the below error

"Database Error
A database connection error has been detected, please follow the repair prompt below. If the issue persists, please contact Nagios support.
Run the following from the CLI as root to attempt to repair the DB:

/usr/local/nagiosxi/scripts/repair_databases.sh"

I have executed the command "/usr/local/nagiosxi/scripts/repair_databases.sh", but it got failed with the below is the output.


Please help to fix the issue.


touch: cannot touch ‘/usr/local/nagiosxi/scripts/repair_databases.lock’: Read-only file system
DATABASE: nagios
TABLE:
rm: cannot remove ‘/var/lib/mysql/mysql.sock’: Read-only file system
/var/lib/mysql/nagios ~
myisamchk: error: 30 when opening MyISAM-table 'nagios_acknowledgements'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_commands'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_commenthistory'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_comments'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_configfiles'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_configfilevariables'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_contact_addresses'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_contactgroup_members'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_contactgroups'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_contact_notificationcommands'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_contactnotificationmethods'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_contactnotifications'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_contacts'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_contactstatus'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_customvariables'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_customvariablestatus'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_dbversion'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_downtimehistory'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_eventhandlers'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_externalcommands'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_flappinghistory'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_hostchecks'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_host_contactgroups'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_host_contacts'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_hostdependencies'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_hostescalation_contactgroups'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_hostescalation_contacts'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_hostescalations'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_hostgroup_members'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_hostgroups'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_host_parenthosts'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_hosts'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_hoststatus'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_instances'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_logentries'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_notifications'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_objects'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_processevents'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_programstatus'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_runtimevariables'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_scheduleddowntime'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_servicechecks'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_service_contactgroups'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_service_contacts'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_servicedependencies'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_serviceescalation_contactgroups'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_serviceescalation_contacts'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_serviceescalations'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_servicegroup_members'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_servicegroups'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_service_parentservices'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_services'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_servicestatus'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_statehistory'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_systemcommands'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_timedeventqueue'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_timedevents'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_timeperiods'

---------

myisamchk: error: 30 when opening MyISAM-table 'nagios_timeperiod_timeranges'
Job for mariadb.service failed because a configured resource limit was exceeded. See "systemctl status mariadb.service" and "journalctl -xe" for details.
~

===============
REPAIR COMPLETE
===============
DATABASE: nagiosql
TABLE:
rm: cannot remove ‘/var/lib/mysql/mysql.sock’: Read-only file system
/var/lib/mysql/nagiosql ~
DATABASE: nagiosxi
TABLE:
rm: cannot remove ‘/var/lib/mysql/mysql.sock’: Read-only file system
/var/lib/mysql/nagiosxi ~
Job for nagios.service failed because the control process exited with error code. See "systemctl status nagios.service" and "journalctl -xe" for details.

=======================
nagios database repair FAILED, please check output above!
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

Re: Nagios xi Database Error

Post by elinagios »

I think your main problem is not the database but something has happened to your file system, your errors give: Read-only file system
preethu.d
Posts: 109
Joined: Wed Nov 25, 2020 11:32 pm

Re: Nagios xi Database Error

Post by preethu.d »

hi

please let me know how to resolve this issue ?

Regards,
Preethu
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

Re: Nagios xi Database Error

Post by elinagios »

Its hard to say, you need to check your server for logs and see what may have caused read-only file system. There could be different reasons, faulty drive, raid issues, if virtual guest - datastore could be full, connection between host and storage broke at some point. Depending on your OS check dmesg, syslog, messages. If virtual, check virtual machine logs, if physical machine checks remote management idrac/ilo etc logs. Check if you have free space in your drive (also inodes)
preethu.d
Posts: 109
Joined: Wed Nov 25, 2020 11:32 pm

Re: Nagios xi Database Error

Post by preethu.d »

we have rebooted the server and the console is launching now. I checked the system component status and everything looks normal.
Do we need to re-run anything on the nagios server ?
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Nagios xi Database Error

Post by vtrac »

Hi preethu.d,
Your system might have ran into some type of issue where its locked itself up to "read-only" to prevent corruption.
I think after the system rebooted, it might have cleared up the issue.

Please check the database log and see if there is any DB crashed.

Code: Select all

/var/log/mariadb/mariadb.log
If you do see DB crashed, which needed repair then please run the following command to fix it:

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh
Regards,
Vinh