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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
salami
Posts: 30
Joined: Tue Jun 26, 2018 4:36 am

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
salami
Posts: 30
Joined: Tue Jun 26, 2018 4:36 am

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

Post by salami »

Thumbs up. it's working now. thank you so much.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

salami wrote:Thumbs up. it's working now. thank you so much.
excellent.

Locking
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked