Page 2 of 2
Re: Invalid argument supplied for foreach()
Posted: Mon Jun 22, 2020 7:49 am
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
Re: Invalid argument supplied for foreach()
Posted: Mon Jun 22, 2020 5:47 pm
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.
Re: Invalid argument supplied for foreach()
Posted: Tue Jun 23, 2020 11:42 am
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
Re: Invalid argument supplied for foreach()
Posted: Wed Jun 24, 2020 1:16 pm
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!
Re: Invalid argument supplied for foreach()
Posted: Thu Jun 25, 2020 8:37 am
by blhaney
Please see the 2 attached files. I ran the commands on each of the servers for each other.
Thanks, Blake
Re: Invalid argument supplied for foreach()
Posted: Thu Jun 25, 2020 4:50 pm
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.
Re: Invalid argument supplied for foreach()
Posted: Fri Jun 26, 2020 7:50 am
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
Re: Invalid argument supplied for foreach()
Posted: Fri Jun 26, 2020 4:52 pm
by cdienger
Glad to hear!