Nagios Install Trouble

Hello,

I am new to Nagios, and Linux as well. I am trying to do an installation but I’m coming up with nothing. I am following the step by step guide given in the book “Apress Pro Nagios 2.0 By James Turnbull.” Yes, an old version of Nagios, but I thought it would work. I’m trying to just do a quick install and followed everything in the book verbatim just about with no errors. Until I tested the Web interface and it doesn’t work. I did the install on a Suse 11.1 box. Here’s what I did:

Installed Dependecies via Yast2:
installed C compiler
installed Apache2
installed gd lib’s

Nagios install process:
unzipped source package
cd nagios-3*
groupadd nagios
useradd -g nagios -M nagios (as told in the book)

Then created/added command group to appropriate users:
groupadd ncmd
usermod -G ncmd nagios
usermod -G ncmd wwwrun

compileing Nagios:
./configure --prefix=/usr/local/nagios --with-htmlurl=/nagios/ --with-cgiurl=/nagios/cgi-bin --with-nagios-user=nagios --with-nagios-group=nagios --with-command-group=ncmd

then installed binaries, CGI, and HTML files etc…:
make install && make install-init
make install-commandmode
ls -al /usr/local/nagios/var/rw
make install-config

then the plugins after unzipping:
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios --with-cgiurl=/nagios/cgi-bin

install binaries, CGI, etc…
make
make install

THEN, after all that is done I have to config the web interface like so by editing the httpd.conf file. I found this file here: /etc/apache2/httpd.conf . IS this right? There isn’t an apache folder in /usr/local/apache and no directory for httpd here: /etc/httpd/conf* There is no httpd.conf or directory just the one I mentioned. Here’s what I modified the script. I JUST ADDED TO IT I DIDN’T MODIFIY THE INITIAL CONTENTS. I dont know if this is right, but I tried to also delete the initial configuration with the Directory directive and used the one in the book. Here is what it tole me to add to the httpd.conf file:

ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
<Directory “/usr/local/nagios/sbin”>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all

Alias /nagios/ /usr/local/nagios/share
<Directory “/usr/local/nagios/share”>
AllowOverride None
Options None
Order allow,deny
Allow from all

do I delete the other stuff before this this stuff:

AllowOverride None Options None Order deny,allow Deny from all

Ok, after doing so I restarted apache2 service and as for Nagios. I type “service nagios start” and I get this: Starting nagios:su: warning: cannot change directory to /home/nagios: No such file or directory

it seems like its trying to get at the nagios user and the home directory that I didn’t create for it because the BOOK told me not to. Anyway, I manually start it by this:
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

It shows up under process when I type ps -A as nagios. So idk what to do. I need help. I read through the forums and google… With no avail. This book lied to me. OR i’m doing somthing stupid. I try to get to my web interface by typing in the url:http://localhost/nagios/ and get Access forbidden! You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

This help is much appreciated. Thank you so much!

bump* and just an FYI I’m using nagios 3.2.0. Much help is needed. I don’t want to have to reinstall EVERYTHING lol, please help.

you followed a book… ask the books author :wink:
Try following the official docs and see if it works better :slight_smile:

It’ not that much work…

Oh wow! Now thats a reliable source lol. Great book by the way! So when you say “official docs” are you referring to a particular section in your book? Or are you referring to some sort of online documentation. I’ve checked a few places like here: nagios.sourceforge.net/docs/2_0/installing.html. It looks pretty similar to what you have in the book though. Aside from using the config files for apache from the nagios install. Would I have to redo everything that I did then? Like uninstall nagios, apache etc… then reinstall everything. I knew the config would be difficult but I didn’t think the install would be that bad. If you have any sources that I could use then that would be great. Thanks for the help.

nagios.sourceforge.net/docs/3_0/quickstart.html
and i wasn’t joking.

Most problems I’ve seen in years related to installations trhrough RPM, or done in differnt ways.
If you don’t want to reinstal it’s your choice… simply don’t count on any help from me :slight_smile:

Have a nice sunday.

Well, wasn’t trying to be rude. I just thought it would be nice to fix the existing installation. No worries though, I’ll uninstall and reinstall everything and then follow this new documentaion. Thanks.

Alright, uninstalled my installation of Nagios 3.2.0 and finished reinstalling it again. Now, I followed that quickstart guide you gave me verbatim and… no errors during compilation and installation. BUT, nagios web interface still won’t come up. I get that same apache error: "Access forbidden!

You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403"

I’m not sure what I’m doing wrong here. If you would know, please get back with me. Thanks guys.

what configure options did you use? how has the webserver been configured for the nagios website? which page are you effectively accessing (check your apache log)?

I used this guide found here: nagios.sourceforge.net/docs/3_0/ … nsuse.html. I used the default configuration options along with the addition of a command group. As for the web interface I used the : make install --webconf which created the apache configuration file (nagios.conf) which looks like this:

ScriptAlias /nagios/cgi-bin “/usr/local/nagios/sbin”

<Directory “/usr/local/nagios/sbin”>

SSLRequireSSL

Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all

Order deny,allow

Deny from all

Allow from 127.0.0.1

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

Alias /nagios “/usr/local/nagios/share”

<Directory “/usr/local/nagios/share”>

SSLRequireSSL

Options None
AllowOverride None
Order allow,deny
Allow from all

Order deny,allow

Deny from all

Allow from 127.0.0.1

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

I have the nagiosadmin created and password set and I am prompted when I try to access the site. The error log is as follows:

[Mon Aug 17 14:50:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 14:55:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:00:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:05:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:10:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:15:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:20:38 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Mon Aug 17 15:23:40 2009] [notice] caught SIGTERM, shutting down
[Tue Aug 18 06:33:52 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Aug 18 06:33:53 2009] [notice] Apache/2.2.10 (Linux/SUSE) mod_ssl/2.2.10 OpenSSL/0.9.8h configured-- resuming normal operations
[Tue Aug 18 06:35:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 06:40:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 06:45:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 06:50:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 06:55:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 07:00:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 07:05:03 2009] [error] [client 127.0.0.2] Directory index forbidden by Options directive: /usr/local/nagios/share/
[Tue Aug 18 07:05:03 2009] [error] [client 127.0.0.2] File does not exist: /srv/www/htdocs/favicon.ico
[Tue Aug 18 07:05:06 2009] [error] [client 127.0.0.2] File does not exist: /srv/www/htdocs/favicon.ico
[Tue Aug 18 07:05:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/
[Tue Aug 18 07:10:37 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /srv/www/htdocs/

Thats what shows up… Any suggestions? Thanks

your nagios files should be here: /usr/local/nagios/share and that’s what he apache configuration says.

But your requests are being served by: /srv/www/htdocs/ which is the wrong directory… somehow your apache configuration hasn’t been correctly setup.

well isn’t that odd given the fact that I have this inserted into the Directory derective “<Directory “/usr/local/nagios/share”>” . That should point to the right location right? I’m modifying the file in /etc/apache2/conf.d/nagios.conf. Shoud I also modify the file located here: /etc/apache2/httpd.conf? Is my syntax wrong in the config file? The httpd.conf file reads like this:

Options None AllowOverride None Order deny,allow Deny from all

I don’t know which config file its using. The nagios.conf or the httpd.conf. If it’s using the one I used in the install doc (nagios.conf) shouldn’t this be working?

not sure how your config files work…
the latest versions have a /etc/apache/available-sites directory where you should put your nagios.conf and link it in /etc/apache/sites-enabled.

Checked my apache version and config I get this:

httpd2 -V
Server version: Apache/2.2.10 (Linux/SUSE)
Server built: Dec 3 2008 10:04:51
Server’s Module Magic Number: 20051115:18
Server loaded: APR 1.3.3, APR-Util 1.3.4
Compiled using: APR 1.3.3, APR-Util 1.3.4
Architecture: 32-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with…
-D APACHE_MPM_DIR=“server/mpm/prefork”
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/srv/www"
-D SUEXEC_BIN="/usr/sbin/suexec2"
-D DEFAULT_PIDLOG="/var/run/httpd2.pid"
-D DEFAULT_SCOREBOARD=“logs/apache_runtime_status”
-D DEFAULT_LOCKFILE="/var/run/accept.lock"
-D DEFAULT_ERRORLOG="/var/log/apache2/error_log"
-D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"

So removed my nagios.conf file and replaced it in the location where you see SERVER_CONFIG_FILE="/etc/apache2/httpd.conf" I just copied all contents in that file and put it here (in httpd.conf file)… I now get this message after logging into the apache server:

Forbidden

You don’t have permission to access /nagios/ on this server.

the error log shows this entry:
Directory index forbidden by Options directive: /usr/local/nagios/share/

Any suggestions? Thanks

bump*

Alright… I’m redoing everything. Reinstalling Suse 11.1, installing Apache from source, Nagios from source, everything… I have found nothing in the forums nor on google that could help me. I’ll keep you posted.

it’s an apache config problem, not nagios…

I am having an issue similar to this. I have installed the software on Ubuntu and everything worked great I used this link to follow the directions. nagios.sourceforge.net/docs/3_0/ … buntu.html

I started the service and tried to get in the app using the web browser and I am having no luck. I get the NOT FOUND error. I can tell you that when I just go to localhost it my apache comes up with “it works” so i know apache is working.

I am new to Linux and this application. Any help would be great.

Thanks
Derek

ALRIGHT!!! Finally! I tried something different here. This may help you out as well pablodonkerous. I found this site: susegeek.com/monitoring/inst … 5-minutes/ and it worked perfectly. I know this isn’t the same distro but you may want to try SUSE for this. I went through the old apache config and found out that everything is the same… I found an extra file though. in the /etc/apache2/conf.d/ directory there was a file called php5.conf. Could not haveing this file of been my problem? Other than this and the new installation structure… I was all set.

I am also feel the Nagio Installation in a trouble manner. It makes me to go in a trouble.

Thanks for the hint about php5.conf in /etc/apache2/conf.d.

I ran into the exact same problem on SLES 10 SP2.

FIX: I Installed the PHP packages and the other web packages via Yast, Software, Software managment, Filter, Patterns,Web and LAMP Server and restarted apache and the web page came up fine.

Yast ended up installing all of the below packages. I really doubt you need mysql. I think the php5 and related packages are the important ones that made the difference. The php5 rpm also puts php5.conf in /etc/apache2/conf.d.
I think the Nagios quick start for Open Suse needs to say that php5 is a required package.

php5-xmlreader-5.2.5-9.5
php5-tokenizer-5.2.5-9.5
php5-sqlite-5.2.5-9.5
php5-pdo-5.2.5-9.5
php5-json-5.2.5-9.5
php5-iconv-5.2.5-9.5
php5-dom-5.2.5-9.5
php5-ctype-5.2.5-9.5
mysql-5.0.26-12.18
php5-5.2.5-9.5
apache2-mod_php5-5.2.5-9.5
php5-timezonedb-2008.2-0.3
perl-DBD-mysql-3.0002-15.2
perl-Data-ShowTable-3.3-584.2
mysql-shared-5.0.26-12.18
mysql-client-5.0.26-12.18
mm-1.4.0-13.2
apache2-mod_python-3.1.3-60.9
apache2-example-pages-2.2.3-16.18
apache2-doc-2.2.3-16.18