Page 1 of 1
nvalid argument supplied for foreach nagiosim.inc.php on lin
Posted: Thu Jan 07, 2021 6:19 pm
by scheived
NagiosXI 5.7.4
I'm seeing this error over and over, could you shed some light on this issue?
ssl_error_log
[Thu Jan 07 17:17:53.026971 2021] [:error] [pid 12034] [client 10.10.210.248:41377] PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/components/nagiosim/nagiosim.inc.php on line 491, referer:
https://nagios.gtc.edu/nagiosxi/
ps -ef | grep nagios.cfg
root 5998 8318 0 17:18 pts/0 00:00:00 grep --color=auto nagios.cfg
nagios 65139 1 1 17:15 ? 00:00:02 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 65203 65139 0 17:15 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
Re: nvalid argument supplied for foreach nagiosim.inc.php on
Posted: Fri Jan 08, 2021 10:47 am
by ssax
That's an old component that shouldn't exist on your system (it's not even downloadable anymore), please run this command to remove the command and it will remove that message, it will not impact your system:
Code: Select all
rm -rf /usr/local/nagiosxi/html/includes/components/nagiosim
Let's see if you have the old active_directory or ldapauth components, those shouldn't exist either (it's a single component now called ldap_ad_integration):
Code: Select all
ls -l /usr/local/nagiosxi/html/includes/components/
Re: nvalid argument supplied for foreach nagiosim.inc.php on
Posted: Fri Jan 08, 2021 12:11 pm
by scheived
Shows you how long we've been using nagios.
I removed the nagiosim and no longer see error.
I tried deleting ldap_ad_integration but could no longer log in. We are using ladp and have servers configured under Admin, LDAP/AD Integration.
This has been working fine, but Is there another preferred way we should be doing ldap login?
*edit, I mean to say I could no longer log in after deleting active_directory or ldapauth
Re: nvalid argument supplied for foreach nagiosim.inc.php on
Posted: Fri Jan 08, 2021 5:47 pm
by ssax
You'll need to put the ldapauth and active_directory ones back (see attached for all 3 if you need), you can do this in Admin > Manage Components and upload the zip files there.
Then you'll need to follow this process:
First, set nagiosadmin to a local account (if it isn't already) and logout/log back into the system with it.
Then, disable active directory authentication in Admin > Manage Components > Active Directory > Settings, double check Admin > Manage Components > LDAP Auth > Settings is disabled as well.
Then setup the new component (copying the info from the old) in Admin > LDAP / AD Integration.
-- See below if you have questions
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
See here as well if you have issues:
https://support.nagios.com/kb/article/a ... n-600.html
Once you've done that and tested login functionality you can run these commands to get rid of the old components:
Code: Select all
rm -rf /usr/local/nagiosxi/html/includes/components/active_directory
rm -rf /usr/local/nagiosxi/html/includes/components/ldapauth
Having the old ones and the new ones on the same system can cause slowness issues which is why this needs to be done to clean it up after you get the new one working.
Re: nvalid argument supplied for foreach nagiosim.inc.php on
Posted: Tue Jan 12, 2021 6:10 pm
by scheived
Worked great thanks so much.
Re: nvalid argument supplied for foreach nagiosim.inc.php on
Posted: Wed Jan 13, 2021 5:49 pm
by benjaminsmith
Hi,
Worked great thanks so much.
Great. Did you have any other questions or may we close this thread?
Regards,
Benjamin
Re: nvalid argument supplied for foreach nagiosim.inc.php on
Posted: Wed Jan 13, 2021 6:36 pm
by scheived
Just one question about configurations upgraded over the years, I see there is documentation for converting from PostgreSQL to MariaDB. Is there any preference for Nagios to convert sooner than later or at all?
Re: nvalid argument supplied for foreach nagiosim.inc.php on
Posted: Thu Jan 14, 2021 4:15 pm
by benjaminsmith
Hi
@scheived,
We continue to support both postgres or MySQL for the nagiosxi database, so it's safe to leave it as is.
If you would like to migrate this to MySQL, then I would recommend setting up a test instance and follow the steps in the doc. Most customers are able to migrate this over without much trouble.
Let us know if you have any other questions.
Benjamin