Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[so] Nagios won't execute CGI but has me download it instead
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 575
Location: Long Island, NY

PostPosted: Sun Mar 15, 2015 12:51 am    Post subject: [so] Nagios won't execute CGI but has me download it instead Reply with quote

I installed Nagios via this article:

http://wiki.gentoo.org/wiki/Nagios

And now every time I go to click on a menu item on the /nagios page, it asks me to download the .cgi script instead of executing it. What could I be missing in the install?
_________________
Michael A. Leonetti
As warm as green tea


Last edited by maiku on Fri Apr 03, 2015 2:55 am; edited 3 times in total
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1764

PostPosted: Sun Mar 15, 2015 9:39 am    Post subject: Reply with quote

I suppose whatever http server you have installed with nagios has cgi module disabled
Back to top
View user's profile Send private message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 575
Location: Long Island, NY

PostPosted: Sun Mar 15, 2015 8:21 pm    Post subject: Reply with quote

I thought so too, but I tested CGI execution. Plus my /etc/conf.d/apache2 says:
Quote:
APACHE2_OPTS="-D INFO -D LANGUAGE -D SSL -D SUEXEC -D PHP -D PERL -D PHP5 -D DAV -D NAGIOS"
So there is definitely something else gone wrong!
_________________
Michael A. Leonetti
As warm as green tea
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 387
Location: Inner Space

PostPosted: Sun Mar 15, 2015 9:02 pm    Post subject: Reply with quote

maiku wrote:
I thought so too, but I tested CGI execution. Plus my /etc/conf.d/apache2 says:
Quote:
APACHE2_OPTS="-D INFO -D LANGUAGE -D SSL -D SUEXEC -D PHP -D PERL -D PHP5 -D DAV -D NAGIOS"
So there is definitely something else gone wrong!

please check if your apache user is in the nagcmd group.
_________________
((O.o))
Back to top
View user's profile Send private message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 575
Location: Long Island, NY

PostPosted: Mon Mar 16, 2015 2:57 am    Post subject: Reply with quote

Thanks for the reply. I don't have a nagcmd group, but the user nagios is a part of the group apache and vice versa:
/etc/group
Quote:
apache:x:81:nagios
nagios:x:1002:apache
But it still doesn't execute the CGI.
_________________
Michael A. Leonetti
As warm as green tea
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 387
Location: Inner Space

PostPosted: Mon Mar 16, 2015 9:29 am    Post subject: Reply with quote

maiku wrote:
Thanks for the reply. I don't have a nagcmd group, but the user nagios is a part of the group apache and vice versa:
/etc/group
Quote:
apache:x:81:nagios
nagios:x:1002:apache
But it still doesn't execute the CGI.

could you please print here the ls -l of the CGIs?
_________________
((O.o))
Back to top
View user's profile Send private message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 575
Location: Long Island, NY

PostPosted: Tue Mar 17, 2015 2:57 pm    Post subject: Reply with quote

e3k wrote:
could you please print here the ls -l of the CGIs?
Do you mean this?
Quote:
# ls -l /usr/lib64/nagios/cgi-bin/
total 4192
-rwxr-xr-x 1 root root 297512 Mar 13 22:02 avail.cgi
-rwxr-xr-x 1 root root 296112 Mar 13 22:02 cmd.cgi
-rwxr-xr-x 1 root root 268768 Mar 13 22:02 config.cgi
-rwxr-xr-x 1 root root 309768 Mar 13 22:02 extinfo.cgi
-rwxr-xr-x 1 root root 260760 Mar 13 22:02 histogram.cgi
-rwxr-xr-x 1 root root 240144 Mar 13 22:02 history.cgi
-rwxr-xr-x 1 root root 236032 Mar 13 22:02 notifications.cgi
-rwxr-xr-x 1 root root 231896 Mar 13 22:02 outages.cgi
-rwxr-xr-x 1 root root 231912 Mar 13 22:02 showlog.cgi
-rwxr-xr-x 1 root root 309792 Mar 13 22:02 status.cgi
-rwxr-xr-x 1 root root 256728 Mar 13 22:02 statusmap.cgi
-rwxr-xr-x 1 root root 252456 Mar 13 22:02 statuswml.cgi
-rwxr-xr-x 1 root root 236040 Mar 13 22:02 statuswrl.cgi
-rwxr-xr-x 1 root root 260656 Mar 13 22:02 summary.cgi
-rwxr-xr-x 1 root root 248368 Mar 13 22:02 tac.cgi
-rwxr-xr-x 1 root root 264864 Mar 13 22:02 trends.cgi

_________________
Michael A. Leonetti
As warm as green tea
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 387
Location: Inner Space

PostPosted: Tue Mar 17, 2015 6:07 pm    Post subject: Reply with quote

maiku wrote:
e3k wrote:
could you please print here the ls -l of the CGIs?
Do you mean this?
Quote:
# ls -l /usr/lib64/nagios/cgi-bin/
total 4192
-rwxr-xr-x 1 root root 297512 Mar 13 22:02 avail.cgi
-rwxr-xr-x 1 root root 296112 Mar 13 22:02 cmd.cgi
-rwxr-xr-x 1 root root 268768 Mar 13 22:02 config.cgi
-rwxr-xr-x 1 root root 309768 Mar 13 22:02 extinfo.cgi
-rwxr-xr-x 1 root root 260760 Mar 13 22:02 histogram.cgi
-rwxr-xr-x 1 root root 240144 Mar 13 22:02 history.cgi
-rwxr-xr-x 1 root root 236032 Mar 13 22:02 notifications.cgi
-rwxr-xr-x 1 root root 231896 Mar 13 22:02 outages.cgi
-rwxr-xr-x 1 root root 231912 Mar 13 22:02 showlog.cgi
-rwxr-xr-x 1 root root 309792 Mar 13 22:02 status.cgi
-rwxr-xr-x 1 root root 256728 Mar 13 22:02 statusmap.cgi
-rwxr-xr-x 1 root root 252456 Mar 13 22:02 statuswml.cgi
-rwxr-xr-x 1 root root 236040 Mar 13 22:02 statuswrl.cgi
-rwxr-xr-x 1 root root 260656 Mar 13 22:02 summary.cgi
-rwxr-xr-x 1 root root 248368 Mar 13 22:02 tac.cgi
-rwxr-xr-x 1 root root 264864 Mar 13 22:02 trends.cgi


others have rx seems fine for me.. next i would check the nagios/apache config file maybe the path here: http://nagiosbook.org/html/ch05s03.html is the same on gentoo.
_________________
((O.o))
Back to top
View user's profile Send private message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 575
Location: Long Island, NY

PostPosted: Wed Apr 01, 2015 7:55 pm    Post subject: Reply with quote

e3k wrote:
others have rx seems fine for me.. next i would check the nagios/apache config file maybe the path here: http://nagiosbook.org/html/ch05s03.html is the same on gentoo.
The config file seems okay:
Quote:
<IfDefine NAGIOS>
ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi-bin/
<Directory "/usr/lib/nagios/cgi-bin/">
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
Alias /nagios /usr/share/nagios/htdocs
<Directory "/usr/share/nagios/htdocs">
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
</IfDefine>
It is defined as you can see in my /etc/conf.d/apache2:
Quote:
APACHE2_OPTS="-D INFO -D LANGUAGE -D SSL -D SUEXEC -D PHP -D PERL -D PHP5 -D DAV -D NAGIOS"

_________________
Michael A. Leonetti
As warm as green tea
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 387
Location: Inner Space

PostPosted: Thu Apr 02, 2015 8:35 am    Post subject: Reply with quote

maiku wrote:
It is defined as you can see in my /etc/conf.d/apache2:
Quote:
APACHE2_OPTS="-D INFO -D LANGUAGE -D SSL -D SUEXEC -D PHP -D PERL -D PHP5 -D DAV -D NAGIOS"

according to this thread: https://forums.gentoo.org/viewtopic-t-977636-view-previous.html?sid=145597f17ecc2e11762621b4d38f5e44

you need to define -D CGI in APACHE2_OPTS and also please make sure that apache was compiled with APACHE2_MODULES="cgi" in make.conf
_________________
((O.o))
Back to top
View user's profile Send private message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 575
Location: Long Island, NY

PostPosted: Fri Apr 03, 2015 2:54 am    Post subject: Reply with quote

That was it! That fixed it. I had to reinstall apache with CGI support and enable it. Thank you!
_________________
Michael A. Leonetti
As warm as green tea
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum