nvalid argument supplied for foreach nagiosim.inc.php on lin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
scheived
Posts: 18
Joined: Tue Jul 16, 2013 9:53 am

nvalid argument supplied for foreach nagiosim.inc.php on lin

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: nvalid argument supplied for foreach nagiosim.inc.php on

Post 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/
scheived
Posts: 18
Joined: Tue Jul 16, 2013 9:53 am

Re: nvalid argument supplied for foreach nagiosim.inc.php on

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: nvalid argument supplied for foreach nagiosim.inc.php on

Post 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.
You do not have the required permissions to view the files attached to this post.
scheived
Posts: 18
Joined: Tue Jul 16, 2013 9:53 am

Re: nvalid argument supplied for foreach nagiosim.inc.php on

Post by scheived »

Worked great thanks so much.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: nvalid argument supplied for foreach nagiosim.inc.php on

Post by benjaminsmith »

Hi,
Worked great thanks so much.
Great. Did you have any other questions or may we close this thread?

Regards,
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
scheived
Posts: 18
Joined: Tue Jul 16, 2013 9:53 am

Re: nvalid argument supplied for foreach nagiosim.inc.php on

Post 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?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: nvalid argument supplied for foreach nagiosim.inc.php on

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked