Page 1 of 1

nagiosXI custom API doesn't work after upgrade to latest ver

Posted: Tue Jul 24, 2018 8:23 am
by salami
Hi
I Upgrade my nagios XI server from 5.4.13 to 5.5.1 successfully but when I check my custom APIs, that's not working after upgrade.
I checked HTTP error logs and found that xml2json class is missing and web server cannot found it. below is error log:

[Tue Jul 24 11:27:24.682535 2018] [:error] [pid 2460] [client 172.16.12.183:57674] PHP Fatal error: Class 'xml2json' not found in /usr/local/nagiosxi/html/includes/components/nagiosxicustomendpoints/nagiosxicustomendpoints.inc.php on line 51

I install old version (5.4.13) on other server as clean installation and move my component to it and everything is working fine. would you please let me know is there any bug in new version about custom APIs?
also, please let me know how can I downgrade to my old version (5.4.13).

additional info:
OS CentOS 7
number of hosts: 12094
include mod gearman with 2 external worker

please let me know if more additional info needed.

thanks

Re: nagiosXI custom API doesn't work after upgrade to latest

Posted: Tue Jul 24, 2018 10:03 am
by scottwilkerson
I believe this class was removed and the Help not updated

If you modify your component to replace this

Code: Select all

return xml2json::transformXmlStringToJson($xml);
with this

Code: Select all

return json_encode(simplexml_load_string($xml));
it should work.

Developers have been notified.

Re: nagiosXI custom API doesn't work after upgrade to latest

Posted: Wed Jul 25, 2018 12:51 am
by salami
Thumbs up. it's working now. thank you so much.

Re: nagiosXI custom API doesn't work after upgrade to latest

Posted: Wed Jul 25, 2018 8:02 am
by scottwilkerson
salami wrote:Thumbs up. it's working now. thank you so much.
excellent.

Locking