Database Maintenance

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
btemple
Posts: 183
Joined: Fri Nov 08, 2013 9:30 am

Database Maintenance

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Database Maintenance

Post 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?
btemple
Posts: 183
Joined: Fri Nov 08, 2013 9:30 am

Re: Database Maintenance

Post by btemple »

database1.png
database2.png
database3.png
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Database Maintenance

Post 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.
btemple
Posts: 183
Joined: Fri Nov 08, 2013 9:30 am

Re: Database Maintenance

Post 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)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Database Maintenance

Post 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.
Former Nagios employee
btemple
Posts: 183
Joined: Fri Nov 08, 2013 9:30 am

Re: Database Maintenance

Post by btemple »

Where do I adjust the thresholds for the check in the actual script ?

check_nagiosxiserver.php
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Database Maintenance

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Database Maintenance

Post by Box293 »

It appears as though these are hard coded in the script.

Lines 204 and 205:

Code: Select all

$warn=360;
$crit=900;
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
btemple
Posts: 183
Joined: Fri Nov 08, 2013 9:30 am

Re: Database Maintenance

Post 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 ?
Locked