Internal server error when running commands (cmd.cgi)

Steve Neuharth steveneu at tiny.net
Sun Sep 29 16:14:02 CEST 2002


It appears that the cgi's segfault when I POST to them. I can run them 
from a shell everything works fine as long as I GET or HEAD but when I 
POST, it dies. Likewise through the browser. If I use any form in nagios 
to POST to any nagios CGI, I get the error. If I send the same params 
via a GET: 
"https://127.0.0.1/nagios/cgi-bin/cmd.cgi?cmd_typ=55&cmd_mod=2&host=ns.visi.com&com_author=Steve%20Neuharth&start_time=09/27/2002%2021:41:53&end_time=09/27/2002%2023:41:53&hours=2&minutes=0&fixed=1" 
, the scripts run fine, no segfault.

mmcclure at pneservices.com wrote:
> Apache's not giving you enough information to really determine what the
> problem is.
> 
> Try running /usr/local/share/nagios/cgi-bin//cmd.cgi directly from a
> shell.  You'll have to set some environment variables, but you should be
> able to figure those out from the HTML source and other parts of your
> configuration.
> 
> If you still can't figure it out after you have all the enviroment
> variables set up, post the error message, someone will probably know
> what it means.
> 
> ----------
> Mike McClure, CCIE # 5125, CISSP # 30232
> PNE Services, Inc.  http://www.pneservices.com
> mmcclure at pneservices.com
> mobile: 913-636-5590
> 
> 
>>-----Original Message-----
>>From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
>>admin at lists.sourceforge.net] On Behalf Of Steve Neuharth
>>Sent: Thursday, September 26, 2002 6:58 PM
>>To: Steve Neuharth
>>Cc: nagios-users at lists.sourceforge.net
>>Subject: Re: [Nagios-users] Internal server error when running
> 
> commands
> 
>>(cmd.cgi)
>>
>>So... anybody got any suggestions?
>>
>>Steve Neuharth wrote:
>>
>>>    I have nagios up and running (beats the pants off of BigBrother
>>
>>IMHO).
>>
>>>    I'm running FreeBSD 4.7 and I installed nagios straight from the
>>
>>ports
>>
>>>collection. I have done this several times before and the port
>>>maintainer does a great job of scripting the install so that it
>>
> works
> 
>>>"out-of-the-box" as it were.
>>>    All of the cgi's seem to work BUT I get an internal server error
>>
>>when I
>>
>>>try to make cmd.cgi "do stuff" such as adding a comment, scheduling
>>
> a
> 
>>>check. My first thought was file perms on the rw directory but I
>>
> cannot
> 
>>>find anything wrong after reading the netsaint faq (this info is
>>
> missing
> 
>>>from the nagios faq btw).  Here is my var/nagios dir:
>>>
>>>tiny# pwd
>>>/usr/local/var/nagios
>>>tiny# ls -l
>>>total 24502
>>>drwxrwxr-x  2 nagios  nagios      2560 Sep 26 00:00 archives
>>>-rw-rw-r--  1 nagios  nagios         0 Sep 26 00:06 comment.log
>>>-rw-rw-r--  1 nagios  nagios         0 Sep 26 00:06 downtime.log
>>>-rw-rw-r--  1 nagios  nagios   1266212 Sep 26 00:24
>>
> host-perfdata.out
> 
>>>-rw-r--r--  1 root    nagios         6 Sep 26 00:06 nagios.lock
>>>-rw-rw-r--  1 nagios  nagios      1991 Sep 26 00:11 nagios.log
>>>drwxrwxr-x  2 nagios  www          512 Sep 26 00:06 rw
>>>-rw-rw-r--  1 nagios  nagios  23766777 Sep 26 00:24
>>
> service-perfdata.out
> 
>>>-rw-rw-r--  1 nagios  nagios      3456 Sep 26 00:24 status.log
>>>-rw-r--r--  1 nagios  nagios      2563 Sep 26 00:06 status.sav
>>>
>>>another strange thing is the nagios.cmd file:
>>>tiny# pwd
>>>/usr/local/var/nagios/rw
>>>tiny# ls -l
>>>total 0
>>>prw-rw----  1 nagios  www  0 Sep 26 00:06 nagios.cmd
>>>
>>>why is it a pipe? should it be? maybe, but I thought it was strange.
>>>
>>>When I "submit" something I get "Internal Server Error" and in the
>>>apache log I get:
>>>[Thu Sep 26 00:27:30 2002] [error] [client 192.168.0.1] Premature
>>
> end of
> 
>>>script headers: /usr/local/share/nagios/cgi-bin//cmd.cgi
>>>
>>>
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This sf.net email is sponsored by:ThinkGeek
>>>Welcome to geek heaven.
>>>http://thinkgeek.com/sf
>>>_______________________________________________
>>>Nagios-users mailing list
>>>Nagios-users at lists.sourceforge.net
>>>https://lists.sourceforge.net/lists/listinfo/nagios-users
>>>
>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>This sf.net email is sponsored by:ThinkGeek
>>Welcome to geek heaven.
>>http://thinkgeek.com/sf
>>_______________________________________________
>>Nagios-users mailing list
>>Nagios-users at lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/nagios-users
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> 





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list