Page 1 of 2
Database Maintenance
Posted: Tue Sep 16, 2014 8:57 am
by btemple
Database Maintenance (dbmaint) stale (596 seconds old)
We receive these notification from time to time and they usually seem to clear themselves up. Unfortunately over the last few days the the issue does not seem to resolve itself.
I have run the posted script from a the support forum but that doesn't seem to resolve the issue.
/usr/local/nagiosxi/cron/dbmaint.php
I also ran the database repair script
stop mysqld
/usr/local/nagiosxi/scripts/repairmysql.sh nagios
start mysqld
Re: Database Maintenance
Posted: Tue Sep 16, 2014 9:25 am
by slansing
What do you have set for the "Optimize Interval" in Admin > Performance Settings > Databases. Also, did you notice any errors while manually executing that php script?
Re: Database Maintenance
Posted: Tue Sep 16, 2014 9:32 am
by btemple
database1.png
database2.png
database3.png
Re: Database Maintenance
Posted: Tue Sep 16, 2014 10:26 am
by slansing
What do you have checking the dbmaint run time? If it is a service check on localhost, you are going to need to bump it's thresholds up as you are currently set to the default of 60 minutes. It was notifying you at roughly 9 minutes.
Re: Database Maintenance
Posted: Wed Sep 17, 2014 10:26 am
by btemple
this check is run from a peer nagios xi server ....
check_xi_nagiosserver
/usr/bin/php $USER1$/check_nagiosxiserver.php $ARG1$
--address=xxxxxxxxx --url=
http://xxxxxxxxxx/nagiosxi/ --username=nagiosadmin --ticket="vj2786cv" --mode=jobs
check interval = 5 min
-----------------------------------------------------------------------------------------------
Testing check from command line...
COMMAND: /usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=xxxxxxxxx --url=
http://xxxxxxxxx/nagiosxi/ --username=nagiosadmin --ticket="vj2786cv" --mode=jobs
OUTPUT: Database Maintenance (dbmaint) stale (478 seconds old)
Re: Database Maintenance
Posted: Wed Sep 17, 2014 2:36 pm
by tmcdonald
Check the performance graphs for that service over the last month or so and see if there is an upward trend in the dbmaint "stale time" reported. If it is on the incline, it could be indicative of problems on the remote machine that might need to be fixed. If that is the case, until it gets fixed all you can really do is keep bumping up the thresholds on the check as slansing suggested.
Re: Database Maintenance
Posted: Thu Sep 25, 2014 12:20 pm
by btemple
Where do I adjust the thresholds for the check in the actual script ?
check_nagiosxiserver.php
Re: Database Maintenance
Posted: Thu Sep 25, 2014 3:00 pm
by lmiltchev
The warning and critical threshold values used only for some modes (iowait, load). You can pass "--warn=<warning>" or "--crit=<critical>" to your command.
Re: Database Maintenance
Posted: Thu Sep 25, 2014 4:27 pm
by Box293
It appears as though these are hard coded in the script.
Lines 204 and 205:
Re: Database Maintenance
Posted: Fri Sep 26, 2014 9:39 am
by btemple
I found those thresholds too, but if you look at my original post the we have been receiving critical notifications at 596 seconds which is obliviously below the 900 threshold.
Am I missing something ?