Invalid argument supplied for foreach()

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
blhaney
Posts: 9
Joined: Tue Jun 30, 2015 10:35 am

Re: Invalid argument supplied for foreach()

Post by blhaney »

Thank you for your reply, I have copied the attached file to my system and I ran diff and did a checksum on them both, they are identical.

Blake
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Invalid argument supplied for foreach()

Post by ssax »

I see you have multiple XI servers, which system specifically is reporting this error?

Is it the KDC XI server saying the DDC XI server jobs are failing? Are both KDC and DDC XI 5.7.1?

It's either the KDC that's failing or the DDC that's failing, I may need the profile/API output from the other system.
blhaney
Posts: 9
Joined: Tue Jun 30, 2015 10:35 am

Re: Invalid argument supplied for foreach()

Post by blhaney »

The KDC server was my first upgrade as it is our DR server for monitoring. It was immediately after I upgraded the KDC server that it started to show an alert for the XI Daemons and XI Jobs. I still had not upgraded DDC and that service check was still working fine from that server.

Just prior to me sending this response I did upgrade the primary server, DDC, and now it is alerting on the XI Daemons and XI Jobs. So it is showing the same symptoms as the DR server KDC. So at this time both DDC and KDC are running 5.7.1 and both are having the same warning for the XI Daemons and XI Jobs.

Let me know if you would like any additional information from the now upgraded DDC server.

Thanks, Blake
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Invalid argument supplied for foreach()

Post by ssax »

Please run these commands from the command line of each XI server:
- Change the X.X.X.X (2 places in each command) to the other XI server that you're running the command from
- Change YYYYYYYYYYYYYYYYY to the API

Code: Select all

/usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=X.X.X.X --url='http://X.X.X.X/nagiosxi/' --apikey='YYYYYYYYYYYYYYYYY' --mode=daemons --debug=1

/usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=X.X.X.X --url='http://X.X.X.X/nagiosxi/' --apikey='YYYYYYYYYYYYYYYYY' --mode=jobs --debug=1
If using HTTPS, use these instead:

Code: Select all

/usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=X.X.X.X --url='https://X.X.X.X/nagiosxi/' --apikey='YYYYYYYYYYYYYYYYY' --mode=daemons --debug=1

/usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=X.X.X.X --url='https://X.X.X.X/nagiosxi/' --apikey='YYYYYYYYYYYYYYYYY' --mode=jobs --debug=1
Send us the entire output of all commands.

Thank you!
blhaney
Posts: 9
Joined: Tue Jun 30, 2015 10:35 am

Re: Invalid argument supplied for foreach()

Post by blhaney »

Please see the 2 attached files. I ran the commands on each of the servers for each other.

Thanks, Blake
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Invalid argument supplied for foreach()

Post by ssax »

That's why it's failing, you're using the old backend API, that's failing on mine as well when I enable it.

Please re-run Configure > Config Wizards > Nagios XI wizard on both systems and use the API key from the nagiosadmin user and see if that resolves it for you.

The old backend API URL is deprecated so dev will no longer be updating it.
blhaney
Posts: 9
Joined: Tue Jun 30, 2015 10:35 am

Re: Invalid argument supplied for foreach()

Post by blhaney »

Thank you! That was it, I reconfigured per your instructions and everything is running as it should.

This thread may be closed.

Thanks, Blake
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Invalid argument supplied for foreach()

Post by cdienger »

Glad to hear!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked