NRDP http headers for POST

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bob.davis
Posts: 4
Joined: Thu Jun 30, 2016 10:09 am

NRDP http headers for POST

Post 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...!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: NRDP http headers for POST

Post 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
Former Nagios employee
https://www.mcapra.com/
bob.davis
Posts: 4
Joined: Thu Jun 30, 2016 10:09 am

Re: NRDP http headers for POST

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NRDP http headers for POST

Post 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
bob.davis
Posts: 4
Joined: Thu Jun 30, 2016 10:09 am

Re: NRDP http headers for POST

Post 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
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: NRDP http headers for POST

Post by mcapra »

Is it ok if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
bob.davis
Posts: 4
Joined: Thu Jun 30, 2016 10:09 am

Re: NRDP http headers for POST

Post by bob.davis »

Sure ... Thanks a lot ..
Locked