Page 1 of 1
Notifications Issue
Posted: Mon Sep 06, 2021 11:57 am
by omarrrthepirate
I just logged in as Nagios Admin and saw the following error:
SQL Error [ndoutils] : Table './nagios/nagios_contactnotifications' is marked as crashed and last (automatic?) repair failed
How can I fix this? Should I also run a repair of the Nagios Database?
Why would it crash?
I worry about the stability of Nagios XI sometimes. Of course I'm still new to it though.
Re: Notifications Issue
Posted: Tue Sep 07, 2021 3:01 pm
by gsmith
Hi
Please manually perform a database repair as shown in:
https://assets.nagios.com/downloads/nag ... tabase.pdf
Look at the first topic in the Troubleshooting section as it matches your error message, but with a different table:
Troubleshooting
If you receive an error, similar to this one:
SQL: DELETE FROM nagios_logentries WHERE logentry_time < FROM_UNIXTIME(1293570334)
SQL: SQL Error [ndoutils] :</b> Table './nagios/nagios_logentries' is marked as
crashed and last (automatic?) repair failedCLEANING ndoutils TABLE 'notifications'...
You may need to run a force repair on the tables:
service mysqld stop
cd /var/lib/mysql/nagios
myisamchk -r -f nagios_<corrupted_table>
service mysqld start
rm -f /usr/local/nagiosxi/var/dbmaint.lock
php /usr/local/nagiosxi/cron/dbmaint.php
Please read through the whole document before taking any actions, and backing up your database should be
your first action.
You should also check the diskspace of the volume the db resides on.
Let me know how you make out.
Thanks
Re: Notifications Issue
Posted: Wed Sep 08, 2021 3:40 pm
by omarrrthepirate
The repair seemed to work, but now I get this message:
[root@localhost nagios]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Failed to start mysqld.service: Unit not found.
Mysqld.service is not found? How is this product even running LOL? How do I fix this now?
Thank you for all the help; I really appreciate you folks.
Re: Notifications Issue
Posted: Wed Sep 08, 2021 5:01 pm
by gsmith
Hi
You may be running MariaDB (a flavor of MySql).
To find out you can run:
Code: Select all
systemctl status | grep mysql
systemctl status | grep maria
You'll get hits on both if the db is mariadb.
You can also run:
Code: Select all
systemctl list-units --type=service
But you'd have to know that you are looking for mariadb.service
Maybe the best way is:
Code: Select all
systemctl list-units --type=service | grep db.service
Thanks