Help on Nagios


#1

i’m trying to install nagios on fedora core 4. Follow all that been inform in the doc only that i change the prefix to /var/www/html/nagios since that’s the default path to view html or php. the problem is when i’m doing the pre flight i didn’t get any verification of any error as it suppose to prompt. I already make the hosts, commands etc og *.cfg file by copy and paste from minimal.cfg. Or if you want to suggest me to make the installation from the beginning…it’s fine with me.

jakkedup, hope you can assist me on this…


#2

Your prefix used when you ran ./configure is fine, but not needed, as is evident when you follow the docs. The reason is because you will be making a directory entry for the apache server, that will make /usr/local/nagios/share appear to be localhost/nagios/ to the end user.
So yea, since you have just started, remove all that you have done, and start over. I would make a copy of the files you have made in nagios/etc first, since you have already started to work on them. After you have nagios installed in the default location of /usr/local/nagios, then copy your etc/.cfg files to your new location.

After that, run
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg and see what it complains about. It will complain, I’m sure, so fix what it complains about, and then start making more host/service checks.


#3

The only suggestion that I would make, is to NOT edit your apache httpd.conf file.
I would add a file to
/etc/httpd/conf.d/
if you have that directory, and name it
nagios.conf
In that file, put what the docs suggested. i.e.
ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/
<Directory “/usr/local/nagios/sbin/”>
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all

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

Restart apache, and now you can browse to localhost/nagios/ and you will be presented with authentication, and then the webpage.


#4

yes i have that directory and FYI,

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

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

i’ve already paste that inside httpd.conf. Are you suggesting that i should delete what i’ve already paste in httpd.conf and copy the nagios.conf from nagios folder and paste inside /etc/httpd/conf.d/ if it is then i will that as well. actually before i change the prefix folder…i had already make the install to /usr/local/nagios…but i got problem in viewing the webpage since the default binary path in httpd is point to /var/www/html/ and inside this folder i already setup cacti and can successfully view and login to cacti page. Anyway…i’ll try to change the httpd.conf by deleting what i’ve paste then copy nagios.conf and paste it inside /etc/httpd/conf.d/…am i rite?


#5

Please read what I said again. I am not saying to copy anything, I’m saying create a new file named nagios.conf and place the stuff that you put in your httpd.conf file, into that nagios.conf file. The only reason I suggest this, is that it makes it easier for you to find out what you have changed in the apache setup. Either way will work.


#6

And again, it is NOT neccessary to copy any nagios html files to /var/www/html. You are creating an apache alias. That alias can point to files located anywhere in your filesystem. That’s what alias’ are for.
Alias /nagios/ /usr/local/nagios/share/
Remember to restart apache after changes above are made.


#7

ok now i can run the pre-flight got like 14 error i don’t know either i do it correctly or not all the cfg file as i just copy and paste from the minimal.cfg and divide it to hosts, contacts etc…but at last it run…hehe…one more thing should i suppose can view the html page coz i seems got error…you don’t have permission…?


#8

localhost/nagios
should give you a webpage at least. If not, then follow the docs on how to setup the webinterface again.


#9

Ok so I have nagios installed, tested icmp, but can’t get the web interface to run. I do not have an /etc/httpd/conf.d

nagios:/etc# locate httpd
/etc/apache/httpd.conf
/lib/modules/2.4.27-2-386/kernel/net/khttpd
/lib/modules/2.4.27-2-386/kernel/net/khttpd/khttpd.o
/lib/modules/2.4.27-3-686/kernel/net/khttpd
/lib/modules/2.4.27-3-686/kernel/net/khttpd/khttpd.o
/root/nagios-2.5/sample-config/httpd.conf
/root/nagios-2.5/sample-config/httpd.conf.in
/usr/share/apache/default-configs/apache/httpd.conf
/usr/share/apache/default-configs/apache-perl/httpd.conf
/usr/share/apache/default-configs/apache-ssl/httpd.conf
/usr/share/doc/apache-common/examples/httpd.conf-dist
/usr/share/doc/apache/examples/httpd.conf
/usr/share/doc/HOWTO/en-txt/phhttpd-HOWTO.gz

I was hoping I could just place both alias scripts i the current httpd.conf, but didn’t know where to place them, I had them here, but it didn’t work

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ Alias /nagios/ /usr/local/nagios/share/ Options None AllowOverride AuthConfig Order allow,deny Allow from all

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

I am not too familar with apache, so there is a good chance I placed the script in the wrong place.

I am running debian sarge 2.4.27-3 on an hp proliant dl380 g4. Any and all help is greatly appreciated.


#10

Where in the world did you get this info that you pasted in your httpd.conf file?
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Alias /nagios/ /usr/local/nagios/share/
<Directory “/usr/local/nagios/share”>
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all

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

The above is totally wrong. Raad the doc again on how to setup apache.
nagios.sourceforge.net/docs/2_0/installweb.html