Database Maintenance is working or not

This support forum board is for questions relating to Nagios Fusion.
Locked
ereut
Posts: 9
Joined: Mon Sep 13, 2021 3:26 pm
Location: Louisville, CO

Database Maintenance is working or not

Post by ereut »

Hello,

Running dbmaint_subsys.php gives output:
'PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/local/nagiosfusion/html/includes/components/fusioncore/fusioncore.inc.php on line 259'

head -n 3 dberrors.log
7: exec(): SQLSTATE[08S01]: Communication link failure: 1053 Server shutdown in progressSQL: [120] SELECT * FROM commands WHERE status_code = :status_code AND scheduled_time <= NOW() ORDER BY submission_time ASC LIMIT 1
Sent SQL: [109] SELECT * FROM commands WHERE status_code = 0 AND scheduled_time <= NOW() ORDER BY submission_time ASC LIMIT 1

Not sure the dbmaint_subsys.php output is okay or not, but disk space constantly increased by 1G per day (df -h, / used 39G now), which I assume script is not clean up the Fusion database. Fusion is polling 5 Cores, 1 XI, with totals of 186 hosts and 1190 services.

So, I'm wondering is database maintenance working or not?
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Database Maintenance is working or not

Post by pbroste »

Hello @ereut

Thanks for reaching out, want to take at the 'Fusion logs' so we can see what is going on.

Code: Select all

tar -cvzf /tmp/fusionlogs.tar.gz /usr/local/nagiosfusion/var/log/
Please [PM] these over to us when you get a chance.

Thanks,
Perry
ereut
Posts: 9
Joined: Mon Sep 13, 2021 3:26 pm
Location: Louisville, CO

Re: Database Maintenance is working or not

Post by ereut »

Hi Perry,

Sorry, can't compose [PM], I'm - '... just registered here and may need to participate more to be able to use this feature.'

I'm in touch with Greg Smith, Tech Support Engineer, I'll email zip file to him.

Thanks,
Eugene
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Database Maintenance is working or not

Post by pbroste »

Hello Eugene

Thanks for getting the logs over to me. After review, I see the database errors that you are referring to and want to have you run through the database repair and then follow up with the updated logs.

Code: Select all

/usr/local/nagiosfusion/scripts/repair_databases.sh
Please let us know how things look.

Thanks,
Perry
ereut
Posts: 9
Joined: Mon Sep 13, 2021 3:26 pm
Location: Louisville, CO

Re: Database Maintenance is working or not

Post by ereut »

Hi Perry,

The output from ./repair_databases.sh is pretty scary:)
//--------------------------------------------------------------------------
Nagios Fusion
Repair Databases
****************

AUTOMATIC REPAIR UNAVAILABLE!

PLEASE CONTACT NAGIOS SUPPORT STAFF IMMEDIATELY!

Stopping the database...

Stopping the database succeeded.

It is suggested you leave the database in this state until you contact Nagios Support
//--------------------------------------------------------------------------

I remember that after installing Fusion, I ran the MySQL security script (mysql_secure_installation) and changed the root password, could this cause any problems?
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Database Maintenance is working or not

Post by pbroste »

Hello @ereut

Yeah, I see that let's go ahead and run the database repair from command and let us know how things look after you bounce the services.

Code: Select all

 mysqlcheck -u root -pfusion --databases fusion mysql nagiosna
Thanks,
Perry
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Database Maintenance is working or not

Post by pbroste »

Hello @ereut

Thanks for following up, with the increase in disk space seems like 'crond' is running through rotation.

Let's restart:

Code: Select all

service crond restart
after that please run:

Code: Select all

service crond status
*Wait a few minutes for data to start updating.

Also, please upload your httpd log from:

Code: Select all

 /var/log/httpd/error_log
Let's increase set memory limit in:

Code: Select all

/etc/php.ini
Look for the line that saysmemory_limit = and double the number. For example; if you have 128M change it to 256M, if you have 256M change it to 512M.

After that restart apache

Code: Select all

service httpd restart
ereut wrote:Hi Perry,

So the good news is the disk space has decreased by 2G, now it is 37G. Still wondering why size is so big, or is 37G the norm for 1194 services in total?

The rest of news remains the same
dbmaint_subsys.php and and repair_databases.sh scripts works with same warning and scary message

/usr/local/nagiosfusion/cron# ./dbmaint_subsys.php
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/local/nagiosfusion/html/includes/components/fusioncore/fusioncore.inc.php on line 259

/usr/local/nagiosfusion/scripts# ./repair_databases.sh
....
AUTOMATIC REPAIR UNAVAILABLE! PLEASE CONTACT NAGIOS SUPPORT STAFF IMMEDIATELY!


Thanks,
Thanks,
Perry
Locked