From: Gili L. <Gi...@so...> - 2004-12-02 16:23:46
|
Hi All, I'm trying to use the perfgraph (0.104.1), but I got "Error 500". Only if a parameter is passed to the script... If I execute this cgi by command prompt I get the HTML. And if I export the "QUERY_STRING" it works goes as well... But if I do this thing by the browser I get the Error 500. This occurs in ver 0.103.2. the only version I tried this didn't occurs is ver 0.100.1. I inserted a line in the perfgraph.c to debug this (as I read in this list). ------ fprintf(stderr, "%s:%d\n", __FILE__,__LINE__); ----- this is the output from the error_log <---snip---> [Thu Dec 02 17:47:15 2004] [error] [client 10.1.1.1] malformed header from script. Bad header=perfgraph.cgi: perfparse.cgi, referer: http://10.1.1.1/nagios/side.html [Thu Dec 02 17:47:15 2004] [error] [client 10.1.1.1] perfgraph.c:67, referer: http://10.1.1.1/nagios/side.html <---snap---> Line num 67 is the first line in the mail() function. I use Apache 2, MySQL 4.1.7, gcc 3.2. What I did wrong? Gili |
From: Ben C. <BCl...@pe...> - 2004-12-02 17:16:35
|
Hi Gili, Please remember that the program name changed from perfgraph.cgi to perfparse.cgi. There have been two users before you who had the same effect. The menu would show but none of the calls which accessed the database. I know one user reported 'it just started working'. I am not sure how this was resolved with other user. If one of them is reading, please let us know :) If you use your debug, please fflush(stderr) after calling. A crash can destroy the buffer. Also if you use this debug, add it *only* after the initial header: printf("Expires: Sun, 02 Jan 2000 01:01:01 GMT\n"); printf("content-type: text/html\n\n"); Or you will get 'malformed header from script'. or 'Premature end of script header'. You can populate the QUERY_STRING from the command line, but ensure you 'su' to what ever user your http server is using to execute the scripts. You may try setting the SUID bit on the script: # chown root.root perfparse.cgi # chmod ug+s perfparse.cgi This is *not* a good way to run, but might help you find your error. Please also ensure your database details are correct in etc/perfparse.cgi and the etc directory this is located in was compiled into the program using: --prefix=/usr/local/nagios And this file (perfparse.cfg) is entirely readable by the http server user. Please let us know... Ben Gili Lapid wrote: > Hi All, > > I'm trying to use the perfgraph (0.104.1), but I got "Error 500". Only if a > parameter is passed to the script... > If I execute this cgi by command prompt I get the HTML. And if I export the > "QUERY_STRING" it works goes as well... > But if I do this thing by the browser I get the Error 500. > > This occurs in ver 0.103.2. the only version I tried this didn't occurs is > ver 0.100.1. > > I inserted a line in the perfgraph.c to debug this (as I read in this list). > ------ > fprintf(stderr, "%s:%d\n", __FILE__,__LINE__); > ----- > this is the output from the error_log > > <---snip---> > > [Thu Dec 02 17:47:15 2004] [error] [client 10.1.1.1] malformed header from > script. Bad header=perfgraph.cgi: perfparse.cgi, referer: > http://10.1.1.1/nagios/side.html > [Thu Dec 02 17:47:15 2004] [error] [client 10.1.1.1] perfgraph.c:67, > referer: http://10.1.1.1/nagios/side.html > <---snap---> > Line num 67 is the first line in the mail() function. > I use Apache 2, MySQL 4.1.7, gcc 3.2. > > What I did wrong? > > Gili > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Perfparse-users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perfparse-users > |
From: Ben C. <BCl...@pe...> - 2004-12-02 17:22:07
|
Sorry, error. "Please also ensure your database details are correct in etc/perfparse.cgi and the etc directory this is located in was compiled into the program using:" Should read: "Please also ensure your database details are correct in etc/perfparse.cfg and the etc directory this is located in was compiled into the program using:" Ben Ben Clewett wrote: > Hi Gili, > > Please remember that the program name changed from perfgraph.cgi to > perfparse.cgi. > > There have been two users before you who had the same effect. The menu > would show but none of the calls which accessed the database. > > I know one user reported 'it just started working'. I am not sure how > this was resolved with other user. If one of them is reading, please > let us know :) > > If you use your debug, please fflush(stderr) after calling. A crash can > destroy the buffer. Also if you use this debug, add it *only* after the > initial header: > > printf("Expires: Sun, 02 Jan 2000 01:01:01 GMT\n"); > printf("content-type: text/html\n\n"); > > Or you will get 'malformed header from script'. or 'Premature end of > script header'. > > You can populate the QUERY_STRING from the command line, but ensure you > 'su' to what ever user your http server is using to execute the scripts. > > You may try setting the SUID bit on the script: > > # chown root.root perfparse.cgi > # chmod ug+s perfparse.cgi > > This is *not* a good way to run, but might help you find your error. > > Please also ensure your database details are correct in > etc/perfparse.cgi and the etc directory this is located in was compiled > into the program using: > > --prefix=/usr/local/nagios > > And this file (perfparse.cfg) is entirely readable by the http server user. > > Please let us know... > > Ben > > > Gili Lapid wrote: > >> Hi All, >> >> I'm trying to use the perfgraph (0.104.1), but I got "Error 500". Only >> if a >> parameter is passed to the script... >> If I execute this cgi by command prompt I get the HTML. And if I >> export the >> "QUERY_STRING" it works goes as well... >> But if I do this thing by the browser I get the Error 500. >> >> This occurs in ver 0.103.2. the only version I tried this didn't >> occurs is >> ver 0.100.1. >> >> I inserted a line in the perfgraph.c to debug this (as I read in this >> list). >> ------ >> fprintf(stderr, "%s:%d\n", __FILE__,__LINE__); >> ----- >> this is the output from the error_log >> >> <---snip---> >> >> [Thu Dec 02 17:47:15 2004] [error] [client 10.1.1.1] malformed header >> from >> script. Bad header=perfgraph.cgi: perfparse.cgi, referer: >> http://10.1.1.1/nagios/side.html >> [Thu Dec 02 17:47:15 2004] [error] [client 10.1.1.1] perfgraph.c:67, >> referer: http://10.1.1.1/nagios/side.html >> <---snap---> >> Line num 67 is the first line in the mail() function. >> I use Apache 2, MySQL 4.1.7, gcc 3.2. >> >> What I did wrong? >> >> Gili >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real users. >> Discover which products truly live up to the hype. Start reading now. >> http://productguide.itmanagersjournal.com/ >> _______________________________________________ >> Perfparse-users mailing list >> Per...@li... >> https://lists.sourceforge.net/lists/listinfo/perfparse-users >> > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Perfparse-users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perfparse-users > |
From: Ben C. <BCl...@pe...> - 2004-12-03 16:31:23
|
Dear PerfParse Users, Important news about new PP version 0.104.2 and new PP web site wiki.perfparse.org is now available on our perfparse-announce new group: http://sourceforge.net/mail/?group_id=109355 Please subscribe to this low traffic group get latest information on development of PP. Regards, Ben |
From: Yves M. <yme...@li...> - 2004-12-06 09:47:34
|
Ben answered to this mail but I'm not sure. I would like to add that you can also add your own debug log easily : FILE*logfh; logfh =3D fopen ("/tmp/my_own_error.log", "w+"); fpritnf(logfh, "%s:%d\n", __FILE__, __LINE__); fclose(logfh); With this, you have easier access to a log file, and you can put debug ma= rks before the CGI header. Please try on 0.104.2 and perfparse.cgi instead of perfgraph.cgi that was= renamed. Yves > Hi All, > > I'm trying to use the perfgraph (0.104.1), but I got "Error 500". Only = if a > parameter is passed to the script... > If I execute this cgi by command prompt I get the HTML. And if I export= the > "QUERY_STRING" it works goes as well... > But if I do this thing by the browser I get the Error 500. > > This occurs in ver 0.103.2. the only version I tried this didn't occurs= is > ver 0.100.1. > > I inserted a line in the perfgraph.c to debug this (as I read in this l= ist). > ------ > fprintf(stderr, "%s:%d\n", __FILE__,__LINE__); > ----- > this is the output from the error_log > > <---snip---> > > [Thu Dec 02 17:47:15 2004] [error] [client 10.1.1.1] malformed header f= rom > script. Bad header=3Dperfgraph.cgi: perfparse.cgi, referer: > http://10.1.1.1/nagios/side.html > [Thu Dec 02 17:47:15 2004] [error] [client 10.1.1.1] perfgraph.c:67, > referer: http://10.1.1.1/nagios/side.html > <---snap---> > Line num 67 is the first line in the mail() function. > I use Apache 2, MySQL 4.1.7, gcc 3.2. > > What I did wrong? > > Gili > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users= . > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Perfparse-users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perfparse-users > > --=20 - Homepage - http://ymettier.free.fr - http://www.logicacmg.com - - GPG key - http://ymettier.free.fr/gpg.txt - - Maitretarot - http://www.nongnu.org/maitretarot/ - - Perfparse - http://perfparse.sf.net/ - |