Auto-Discovery stuck on Waiting
Posted: Wed Jun 05, 2019 10:06 am
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?
[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?