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.
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.
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.
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?
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.
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.
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…?
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