simplexml_load_string errors

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

simplexml_load_string errors

Post by elinagios »

Hello

i upgraded my Nagioxi devel and test environment and after that im getting a simplexml_load_string errors in apache ssl_error_log in both servers.
Both servers are Centos 7.6 and Nagiosxi 5.6.6. Both of them have few hosts(under 5) and few services to check, so there is no load on them. And is unmoddified configuration also.

First found the problem when i started to get alarms on Nagios Xi daemon/jobs alarms:
Error: Could not parse XML from https://servername/nagiosxi/ (?xml version=1.0 encoding=utf-8?

Devel errors:

[Tue Sep 24 10:09:21.422900 2019] [:error] [pid 29282] [client IP:61336] PHP Warning: simplexml_load_string(): Entity: line 25: parser error : XML declaration allowed only at the start of the document in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://servername/nagiosxi/admin/
[Tue Sep 24 10:09:21.422932 2019] [:error] [pid 29282] [client IP:61336] PHP Warning: simplexml_load_string(): AL;SOFT;1;Error: Could not parse XML from https://servername/ (<?xml in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://servername/nagiosxi/admin/
[Tue Sep 24 10:09:21.422939 2019] [:error] [pid 29282] [client IP:61336] PHP Warning: simplexml_load_string(): ^ in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://servername/nagiosxi/admin/

Test errors:
[Tue Sep 24 10:29:15.227679 2019] [:error] [pid 15538] [client IP:61929] PHP Warning: simplexml_load_string(): Entity: line 25: parser error : StartTag: invalid element name in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://servername/nagiosxi/admin/
[Tue Sep 24 10:29:15.227704 2019] [:error] [pid 15538] [client IP:61929] PHP Warning: simplexml_load_string(): ee;Memory Usage;STOPPED; Service appears to have stopped flapping (3.8% change < in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://servername/nagiosxi/admin/
[Tue Sep 24 10:29:15.227711 2019] [:error] [pid 15538] [client IP:61929] PHP Warning: simplexml_load_string(): ^ in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://servername/nagiosxi/admin/

Dont want to upgrade live environment before these errors are corrected.

Thank you.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: simplexml_load_string errors

Post by benjaminsmith »

Hi @elinagios,

Generally speaking, PHP notices and warnings are advisory messages and are not errors that will break the system. In this case, there's an issue with XML data formatting. Can you go to Admin > System Config > System Settings > General Program Settings and check to make sure you have the correct Program URL and External URL settings for this server.
url-settings.png
You do not have the required permissions to view the files attached to this post.
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!
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

Re: simplexml_load_string errors

Post by elinagios »

The program url is the one i'm accessing NagiosXI web interface with and there is no external URL's defined. All seems good there.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: simplexml_load_string errors

Post by benjaminsmith »

Hello @elinagios,

Thanks for checking the URL settings. Also, is the system status dropdown in the upper right-hand corner of the screen working correctly? Let me know if all the components are showing green.
xi-status-dropdown.png
You do not have the required permissions to view the files attached to this post.
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!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: simplexml_load_string errors

Post by benjaminsmith »

Hello,

Some good news. It turns out there was some extra data on the systemctl output for checking the status of the Nagios services, and this was giving the warning on parsing the XML.

This is going to be patched in the next version 5.6.7 ( going out tomorrow). However, since you have development and test environments setup for Nagios XI, I've provided the patched file for testing. See attachment. Please let us know if the warnings are still present after patching.

Replace the manage_services.sh script with the one provided. It's in the /usr/local/nagiosxi/scripts directory.

Once uploaded, make it executable chmod +x and change the group permissions to chown root:nagios
You do not have the required permissions to view the files attached to this post.
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