Page 1 of 1

simplexml_load_string errors

Posted: Tue Sep 24, 2019 2:36 am
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.

Re: simplexml_load_string errors

Posted: Tue Sep 24, 2019 10:56 am
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

Re: simplexml_load_string errors

Posted: Wed Sep 25, 2019 1:18 am
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.

Re: simplexml_load_string errors

Posted: Wed Sep 25, 2019 10:11 am
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

Re: simplexml_load_string errors

Posted: Wed Sep 25, 2019 11:55 am
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