Page 1 of 1

NRDP http headers for POST

Posted: Thu Jun 30, 2016 10:37 am
by bob.davis
I have a script that generates a large number of service check results. I am trying to POST these results as one large xml doc to Nagios NRDP. The results are too large to be used as part of the url (http:// server/nrdp/?token=xxxxxx&cmd=submitcheck&XMLDATA=<checkresults> .. etc ..</checkresults> ) as the server returns an error 'Request too large'.

Is there a way to put the xml doc in the http headers .. and use POST to send the results in one call, as opposed to sending each result separately?

Thanks for any help...!

Re: NRDP http headers for POST

Posted: Thu Jun 30, 2016 11:18 am
by mcapra
By what method are your sending this payload to NRDP?

If you're sending the payload via CURL, it should be fairly straight forward:
http://superuser.com/questions/149329/w ... st-request

The main concern would be the post_max_size directive (on the XI server) if the payload is fairly large:
http://php.net/manual/en/ini.core.php#ini.post-max-size

And, in general, sending massive payloads to scripts can cause time-out issues (on the XI server) in some cases:
http://php.net/manual/en/info.configura ... ution-time

Re: NRDP http headers for POST

Posted: Thu Jun 30, 2016 11:38 am
by bob.davis
The payload is being sent using Windows XMLHTTP object. The errors are from Apache/Red Hat server , stating the request is too large. The server admin has made changes to the server configuration ..

Changed in the php.ini file:
upload_max_filesize = 2M to upload_max_filesize = 4M
post_max_size = 8M to post_max_size = 16M

But these do not seem to solve the problem.
I was hoping there would be a way to push the xml data as part of an http header ... which seems to handle this type of volume.
Using it as part of the url seems to cause problems.

Re: NRDP http headers for POST

Posted: Thu Jun 30, 2016 11:56 am
by ssax
I don't think you can put it in the header.

He may have to adjust these:

http://httpd.apache.org/docs/2.2/mod/co ... equestline
http://httpd.apache.org/docs/2.2/mod/co ... equestbody

Make sure to restart HTTPD afterwards:

Code: Select all

service httpd restart
Let us know the results.

Thank you

Re: NRDP http headers for POST

Posted: Fri Jul 01, 2016 8:06 am
by bob.davis
Thank you for that!

It was the LimitRequestLine parameter in Apache that fixed it.

We have adjusted that upward to accommodate the sizes needed,
and can now send the entire result set in one request.

Again, Thanks a Lot ssax

Re: NRDP http headers for POST

Posted: Tue Jul 05, 2016 9:24 am
by mcapra
Is it ok if we lock this thread and mark the issue as resolved?

Re: NRDP http headers for POST

Posted: Tue Jul 05, 2016 9:43 am
by bob.davis
Sure ... Thanks a lot ..