The Database Maintenance is red light.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
axvaster
Posts: 21
Joined: Tue Jan 08, 2019 11:54 am

The Database Maintenance is red light.

Post 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)
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: The Database Maintenance is red light.

Post 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
axvaster
Posts: 21
Joined: Tue Jan 08, 2019 11:54 am

Re: The Database Maintenance is red light.

Post 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!!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: The Database Maintenance is red light.

Post by ssax »

Sounds good, we'll keep an eye out for your updates. Let us know when we're okay to close this ticket.
axvaster
Posts: 21
Joined: Tue Jan 08, 2019 11:54 am

Re: The Database Maintenance is red light.

Post by axvaster »

I think it is okay to close this now.

We'll open another ticket if there's issue

Thanks!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: The Database Maintenance is red light.

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked