Resubmit check results to NRDP outbound transfer

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
truston
Posts: 15
Joined: Wed Oct 01, 2014 7:51 am

Re: Resubmit check results to NRDP outbound transfer

Post by truston »

From both. In this case both servers are running the same Linux distro. We also have some CentOS servers.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Resubmit check results to NRDP outbound transfer

Post by tgriep »

On the server that didn't send the NRDP data, can you go to this folder

Code: Select all

/usr/local/nagiosxi/var/
In that folder, there are log file called perfdataproc.log
Can you post that file here so we can see if there are any errors in it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
truston
Posts: 15
Joined: Wed Oct 01, 2014 7:51 am

Re: Resubmit check results to NRDP outbound transfer

Post by truston »

It seems that the bad XML messages are back.

Sending to NRDP target host: nagiosxi.truston.com
CMDLINE: cat /tmp/NRDPOUTzGAaCu | /usr/local/nrdp/clients/send_nrdp.sh -u https://nagiosxi.truston.com/nrdp/ -t xxxxxxxxxxxxxx
STDOUT: ERROR: The NRDP Server said BAD XML
RETURN CODE: 2

We had implemented a workaround for this problem as described in [Ticket#2015101210000108]. It seems that this workaround no longer works. Ill have to look into the new send_nrdp script and see if I can find a solution. Though I now notice that another XI server which is still running XI 2014R2.7 also reports bad XML, so Im starting to suspect that the problem might be the receiving server.
truston
Posts: 15
Joined: Wed Oct 01, 2014 7:51 am

Re: Resubmit check results to NRDP outbound transfer

Post by truston »

I see the following errors in /var/log/httpd/ssl_error_log

[Mon Jan 11 10:14:09 2016] [error] [client 172.17.1.10] PHP Warning: Unknown: POST Content-Length of 17748991 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

I have increased the max size in /etc/php/ini to 80 Mb and I no longer see any errors. I cannot explain how these files have grown so large though.

Edit: The size is due to the spool.xml file being very large. Still trying to get around the bad XML
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Resubmit check results to NRDP outbound transfer

Post by ssax »

Are you able to see anything in the spool.xml file that may be causing the issue? Making your CDATA changes to the send_nrdp script should stop any service output characters from causing problems, I'm wondering if it's something else.
truston
Posts: 15
Joined: Wed Oct 01, 2014 7:51 am

Re: Resubmit check results to NRDP outbound transfer

Post by truston »

All I see in the spoo.xml file appears to be queued Nagios messages.
truston
Posts: 15
Joined: Wed Oct 01, 2014 7:51 am

Re: Resubmit check results to NRDP outbound transfer

Post by truston »

Well this was one hell of a puzzle but it seems to be resolved. I looked at the differences between a lot of files on the problem server running 5.2.3 and a 5.2.0 server which had no issues. I have copied the perfdataproc.php file from the 5.2.0 to the 5.2.3 server since the newer version uses htmlentities to translate HTML characters.

[root@SRV00448 truston]# diff perfdataproc.php2 perfdataproc.php3
294,295c294,295
< $output = htmlentities(grab_array_var($darr, "SERVICEOUTPUT"));
< $longserviceoutput = htmlentities(grab_array_var($darr, "LONGSERVICEOUTPUT", ""));
---
> $output = grab_array_var($darr, "SERVICEOUTPUT");
> $longserviceoutput = grab_array_var($darr, "LONGSERVICEOUTPUT", "");
308,309c308,309
< $output = htmlentities(grab_array_var($darr, "HOSTOUTPUT"));
< $longhostoutput = htmlentities(grab_array_var($darr, "LONGHOSTOUTPUT", ""));
---
> $output = grab_array_var($darr, "HOSTOUTPUT");
> $longhostoutput = grab_array_var($darr, "LONGHOSTOUTPUT", "");

After this I replaced the send_nrpd.sh script with the resivion 0.3 version which we altered to use CNAME tags to ensure HTML characters would not cause any further issues.

xml=$xml"<hostname>"$host"</hostname>"
xml=$xml"<state>"$State"</state>"
xml=$xml"<output><![CDATA["$output"]]></output>"
xml=$xml"</checkresult>"
checkcount=1


if [ ${#arr[@]} == 4 ]; then
xml=$xml"<checkresult type='service' checktype='"$checktype"'>"
xml=$xml"<servicename>"${arr[1]}"</servicename>"
xml=$xml"<hostname>"${arr[0]}"</hostname>"
xml=$xml"<state>"${arr[2]}"</state>"
xml=$xml"<output><![CDATA["${arr[3]}"]]></output>"
else
xml=$xml"<checkresult type='host' checktype='"$checktype"'>"
xml=$xml"<hostname>"${arr[0]}"</hostname>"
xml=$xml"<state>"${arr[1]}"</state>"
xml=$xml"<output><![CDATA["${arr[2]}"]]></output>"
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Resubmit check results to NRDP outbound transfer

Post by ssax »

Just so I'm clear, are you saying that the working version is not using htmlentitites?
truston
Posts: 15
Joined: Wed Oct 01, 2014 7:51 am

Re: Resubmit check results to NRDP outbound transfer

Post by truston »

That is correct. Had to use the 5.2.0. version in combination with an altered send_nrdp script.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Resubmit check results to NRDP outbound transfer

Post by tgriep »

Do you still have access to the bad XML file?
If so, can you post the first and last 20 lines from it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked