I have everything set up properly and all my hosts are being monitored properly etc etc.
I can navigate the cgi’s with no problems except when I come to a form that uses POST.
I have tried using packet sniffer (everything seems ok), running the CGI on the command line (again ok), re-building nagios(no errors, found gd, looks ok), sticking a few printfs here and there in cmd.cgi(and rebuilding it), tried modifying a few apache settings(no difference, no ‘Limit POST’).
The cgi shows up as sleeping when I do ‘ps -ax’, and the browser keeps on waiting. If I stop the transaction in the browser, I notice a vague error in apache logs:
Premature end of script headers: /home/nagios/nagios/sbin/cmd.cgi
Now, does anyone have any idea why when everything seems to work fine EXCEPT when I POST information via form?
I’m led to believe that it must be an Apache configuration problem since after searching everywhere(mailing list archives, here, google) I’m the only one with this problem. This is nagios 2.0b4.
I guess my next step might be to do a quick hack of the cgi and see if I can change all the POST to GET and see if that helps. :x
So with the fread problem, I now have a better idea where to begin.
EDIT:
I have changed from:
if(!fread(cgiinput,content_length,1,stdin)){
to:
if(!fread(cgiinput,1,1,stdin)){
and it still doesn’t go past this point…
EDIT:
I made a simple cgi script and I have determined that it must be an apache setting. This script does not read stdin when its in /home/nagios/nagios/sbin/ (aliased) but works fine when its in /usr/local/cgi-bin/ (apache default). :?
EDIT:
I found out that when I have AllowOverride set to ‘None’ the script I created above works, but when I set it to ‘AuthConfig’ it stops on the fread.