Page 1 of 1

The Database Maintenance is red light.

Posted: Sun Nov 01, 2020 11:08 pm
by axvaster
Hi suuport,

The Database Maintenance is red light after I fix the open-files-limits problem.

It first complained about number of files it can open,

and I changed the mariadb systemctl conf:

Code: Select all

$ systemctl edit mariadb

[Service]
LimitNOFILE=100000
then I run the `repair_database.sh`.

finally problem solved; except the Database Maintenance is stuck at RED light.

I have checked:
- crontab config ok
- crond ok
- disk ok


Not Sure how to get it back.

These are what I've tried:

- Directly run the `dbmaint.php` written in crontab with mariadb goes down

Code: Select all

$ /usr/bin/php -q /usr/local/nagiosxi/cron/dbmaint.php
CREATING: /usr/local/nagiosxi/var/dbmaint.lock
PHP Warning:  mysqli_real_connect(): (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php on line 125
PHP Warning:  mysqli_real_connect(): (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php on line 125
PHP Warning:  mysqli_real_connect(): (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php on line 125

- run the `dbmaint.php` written in crontab with mariadb back

Code: Select all

 $ systemctl restart mariadb
$ usr/bin/php -q /usr/local/nagiosxi/cron/dbmaint.php
LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' EXISTS - EXITING!
Please advise!

Thank you!

(I would send system profile in PM)

Re: The Database Maintenance is red light.

Posted: Mon Nov 02, 2020 12:06 pm
by ssax
Please PM me a copy of your profile, you can download it from Admin > System Profile by clicking the Download Profile button.

Send the output of this command:

Code: Select all

tail -n30 /var/log/cron
Try deleting the lock file:

Code: Select all

\rm -f /usr/local/nagiosxi/var/dbmaint.lock
Additionally, please send the output of these commands (as root):
- NOTE: You may need to adjust the -h 127.0.0.1, the -uroot, and -pnagiosxi in the first command if your DB is offloaded to another server and/or you've changed the root mysql password

Code: Select all

echo "SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES WHERE table_schema IN ('nagios', 'nagiosql', 'nagiosxi');" | mysql -h 127.0.0.1 -uroot -pnagiosxi --table
This next command may fail, that's okay, not all systems run postgresql, send the output anyways:

Code: Select all

echo "SELECT relname as Table, pg_size_pretty(pg_total_relation_size(relid)) As Size, pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as ExternalSize FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC;" | psql nagiosxi nagiosxi

Re: The Database Maintenance is red light.

Posted: Wed Nov 04, 2020 9:39 pm
by axvaster
The red light turned to Green after about 2 hours later with doing nothing.

Not sure why.

I will try these command you posted if we encounter same problem next time.

Thanks for help!!

Re: The Database Maintenance is red light.

Posted: Thu Nov 05, 2020 5:21 pm
by ssax
Sounds good, we'll keep an eye out for your updates. Let us know when we're okay to close this ticket.

Re: The Database Maintenance is red light.

Posted: Mon Nov 16, 2020 2:06 am
by axvaster
I think it is okay to close this now.

We'll open another ticket if there's issue

Thanks!

Re: The Database Maintenance is red light.

Posted: Mon Nov 16, 2020 8:02 am
by scottwilkerson
axvaster wrote:I think it is okay to close this now.

We'll open another ticket if there's issue

Thanks!
Locking thread