osdir.com
mailing list archive
Mozy Online Backup: 2GB Free. Automatic. Secure.

Subject: Re: Internal server error when running commands (cmd.cgi) - msg#00815

List: network.nagios.user

Date: Prev Next Index Thread: Prev Next Index
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@xxxxxxxxxxxxxxx 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@xxxxxxxxxxxxxxx
mobile: 913-636-5590


-----Original Message-----
From: nagios-users-admin@xxxxxxxxxxxxxxxxxxxxx [mailto:nagios-users-
admin@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Steve Neuharth
Sent: Thursday, September 26, 2002 6:58 PM
To: Steve Neuharth
Cc: nagios-users@xxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/nagios-users






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


Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: feature request

Nagios already does this. I suspect you've put names in the cgi.cfg file that you don't need to... All you need to do is set up your .htaccess files properly, and make sure the .htaccess username fits the nagios username. This will allow them only to see the things that they are in a group for. The cgi.cfg allows you to give more access to certain users for certain things, but you do not need to put every user in there by any means... The documentation explains how to set all of this up... I'd suggest reading about what exactly the cgi.cfg options are for. Hopefully that'll help shed some light on things for you. I hope that helps, - Terry On Saturday, September 28, 2002, at 03:18 AM, Atul Gosain wrote: hi I have nagios installed on my monitoring server and it has 30 hosts and 170 services that are being checked.Whenever someone logs in , he sees all the services of all the hosts in service details. I want that if someone logs in , then only relevant hosts and services to him should be shown and he des not have to browse the whole page to see some specific services. Is this allready provided in Nagios? -- Atul Gosain Mindsw Software and Services Pvt. Ltd. A-50, Sector-39 Noida(UP). ph no: 4500369,4575991 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Nagios-users mailing list Nagios-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/nagios-users ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf

Next Message by Date: click to view message preview

Re: Additional information about services

On Sat, 28 Sep 2002, Atul Gosain wrote: > hi > > I have been trying to send traceroute snapshots with the mails sent when > ping service is critical and ps snapshot when cpu load is critical. I have > made a script for that andcalled that from notify-by-email command. > The difficult part is while sending the ps snapshots of the remote host > from which information is coming through nrpe. > > How do i send ps snapshot of remote host back to nagios host? > > Any ideas or suggestions. > > > if by a ps snapshot you are talking about list of all process - that has to be done outside of the nrpe setup because it is quite a bit of data. you might what to have your notify script call for a ps listing using "check_by_ssh" and wrap the results into the email. -- -sg ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf

Previous Message by Thread: click to view message preview

RE: Internal server error when running commands (cmd.cgi)

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@xxxxxxxxxxxxxxx mobile: 913-636-5590 > -----Original Message----- > From: nagios-users-admin@xxxxxxxxxxxxxxxxxxxxx [mailto:nagios-users- > admin@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Steve Neuharth > Sent: Thursday, September 26, 2002 6:58 PM > To: Steve Neuharth > Cc: nagios-users@xxxxxxxxxxxxxxxxxxxxx > 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@xxxxxxxxxxxxxxxxxxxxx > > 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@xxxxxxxxxxxxxxxxxxxxx > https://lists.sourceforge.net/lists/listinfo/nagios-users ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf

Next Message by Thread: click to view message preview

Re: Internal server error when running commands (cmd.cgi)

Just FYI, when I was experiencing troubles getting Nagios running I found the exact same behavior. I was trying to debug the CGI and while the documentation implied to me I should be using HTTP POST (hence, i set the variables as such) to test, it was segfaulting. Using HTTP get, however, worked just fine. I did manage to get things working via some combination of restarting apache and Nagios, though, so I'm not sure if there was ever really a problem. I'd venture that the segfault on POST from the commandline is "normal", if not what is expected. So that's probably a bit of a red herring for you. Have you tried any other CGI's to see whether GET or POST is working with them? If you have mod_php installed it should be trivial to write up a quick script to see if variables are being passed correctly on POST so hopefully you can eliminate either your httpd or nagios as the culprit. Nicholas Paufler Systems Administrator The Internet Centre ----- Original Message ----- From: "Steve Neuharth" <steveneu@xxxxxxxx> To: <nagios-users@xxxxxxxxxxxxxxxxxxxxx> Cc: "Blaz Zupan" <blaz@xxxxxxxxxxxxxx> Sent: Sunday, September 29, 2002 8:14 AM Subject: Re: [Nagios-users] Internal server error when running commands (cmd.cgi) > 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@xxxxxxxxxxxxxxx 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@xxxxxxxxxxxxxxx > > mobile: 913-636-5590 > > > > > >>-----Original Message----- > >>From: nagios-users-admin@xxxxxxxxxxxxxxxxxxxxx [mailto:nagios-users- > >>admin@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Steve Neuharth > >>Sent: Thursday, September 26, 2002 6:58 PM > >>To: Steve Neuharth > >>Cc: nagios-users@xxxxxxxxxxxxxxxxxxxxx > >>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@xxxxxxxxxxxxxxxxxxxxx > >>>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@xxxxxxxxxxxxxxxxxxxxx > >>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@xxxxxxxxxxxxxxxxxxxxx > > 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@xxxxxxxxxxxxxxxxxxxxx > https://lists.sourceforge.net/lists/listinfo/nagios-users > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by