I just ran an auto-discovery wizard, but I'm just getting Waiting for the status and have been for at least 15 minutes. It looks like the last time it worked was May 3rd, I have a Finished status from a job I ran then . I checked /var/log/httpd/error_log and I'm seeing this kind of error:
[Wed Jun 05 10:51:13 2019] [error] [client xxx.xxx.xxx.xxx] PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/components/nagiosim/nagiosim.inc.php on line 491, referer: http://monitor.testing.edu/nagiosxi/inc ... discovery/
Checking the nagiosim.inc.php file for line 491 shows me this:
function nagiosim_db_init($im_current_version)
{
global $cfg;
if ($cfg['db_info']['nagiosxi']['dbtype'] == 'pgsql') {
$sql = "SELECT COUNT(relname) FROM pg_class WHERE relname = 'xi_incidents'";
$rs = exec_sql_query(DB_NAGIOSXI, $sql, true);
foreach ($rs as $row) {
if ($row['count'] == 0) {
// Create sequence
$sql = "
CREATE SEQUENCE xi_incidents_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1";
exec_sql_query(DB_NAGIOSXI, $sql, true);
Specifically the "foreach ($rs as $row) {" line
I've never changed anything with that file, but I have done two upgrades since the last successful auto-discovery, one to 5.6.1 and one to 5.6.2. Anyone else running in to any trouble?
Auto-Discovery stuck on Waiting
Re: Auto-Discovery stuck on Waiting
I wonder if there are some permissions issues that are causing the auto-discovery to fail (get "stuck")... Can you run the following command?
After this, remove the old auto-discovery jobs, and start a new one. Is it working now?
Code: Select all
chmod 775 /usr/local/nagiosxi/html/includes/components/autodiscovery/jobs
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Auto-Discovery stuck on Waiting
That was exactly it! Auto-discovery jobs are running, and completing in a timely fashion now. Thanks.
Re: Auto-Discovery stuck on Waiting
Great! I am glad I was able to help!
Let us know if it is OK to close this topic and mark it as resolved.
Thank you!
Let us know if it is OK to close this topic and mark it as resolved.
Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Auto-Discovery stuck on Waiting
Absolutely! Thanks again.
Re: Auto-Discovery stuck on Waiting
Sure, no problem.
Be sure to check out our Knowledgebase for helpful articles and solutions!