Newbie Question Which Should be Easy

Hello,
The Linux-gifted admin before me installed Nagios 2.0b2 in non-default folders of /etc/nagios. I have installed Nagios on the default /usr/local/nagios path. I am up to the point where I enter the two Aliases in the httpd.conf file… I am still getting the old Nagos default home page and have to use his login and password to access it. Now, the wierd part about this is that I searched through the httpdconf file for any references to the old location and version…there were none. Could there be another location of this conf file? I appreciate any guidance you can give me. Thanks.

check if you are including a directory in the httpd.conf for virtualhosts :slight_smile: i do…

Luca

Also check /etc/httpd/conf/httpd.conf for an Include. This is what I have in mine:
Include conf.d/*.conf
So, apache will include all *.conf files in the folder /etc/httpd/conf.d/
In that folder I have one named nagios.conf that has all the nagios stuff. Perhaps you made changes to the /etc/httpd/conf/httpd.conf file but your partner has changes in the conf.d/ folder.

This sounds like there is another config, kill the apache process if you can, then run apache from the directory in which the httpd.conf you edited resides… (usr/local/apache2) ?

Jakke got this one good,

There is a conf.d directory with the nagios.conf file… would I be negatively impacted if I were to take out the nagios.conf file and use the same thing withing httpd.conf? Or should I change the path in the conf.d and delete the entries made in the httpd.conf. I guess I am not understanding the purpose of the redirection of going to conf.d.

Thanks guys for your help.

The purpose of the conf.d directory is to make it easy to modify your apache. For example: When I modified my apache setup for nagios, all I did was create a file name nagios.conf in the conf.d directory and placed this in it:
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

If I didn’t do that, I would have to modify the /etc/httpd/conf/httpd.conf file and that file is huge.

This way, it’s much more organized and easier for you to manage.

So remove the nagios entries from the /etc/httpd/conf/httpd.conf file and place them like I did, in the conf.d directory. Restart apache and life should be good.

It seems after a few hours with re-pointing re-starting service, it still doesn’t want to work. I get the new version home page,but every other link get this:

Error: Could not read host and service status information

For kicks I ran a find on Nagios and came back with this many instances:
/home/nagios
/usr/local/nagios
/usr/local/nagios/base/nagios
/usr/local/nagios/bin/nagios
/usr/share/nagios
/usr/bin/nagios
/usr/include/nagios
/usr/lib/nagios
/var/log/nagios
/var/lock/subsys/nagios
/var/run/nagios
/var/spool/mail/nagios
/var/www/garfield.covitechnologies.com/Intranet/nagios
/etc/rc.d/init.d/nagios
/etc/nagios

Should I look to delete all of these exept for the host, services, and any other custom cfg file and start out fresh? Or shoudl I work with what I have? Any tips? Thanks again for your guidance.

From those directories, we can get an idea of what you have.
/home/nagios and /var/spool/mail/nagios is nothing more that the home directory for the user nagiosand the mail file for the user nagios. Look inside it and you should be able to tell. I would keep this.
/usr/local/nagios looks to be a nagios install from source, which is the best way to install nagios. Look inside it and you should see several other directories like etc, share, var, bin…
/usr/share/nagios /usr/bin/nagios /usr/include/nagios /usr/lib/nagios /var/log/nagios /var/lock/subsys/nagios /var/run/nagios and /etc/nagios appear to be from a RPM install of nagios. Run:
rpm -qf /usr/include/nagios
from a command line to see what rpm created that folder.
Then I would remove the rpm install if it was me and then I would perform a complete and precise install using the nagios install documentation from source. The source install will not overwrite any live config files, but it will overwrite the startup scripts in the init.d directory, which might be your problem.
/var/www/garfield.covitechnologies.com/Intranet/nagios I have no idea what that is, but it could be another nagios install. Look inside the directory and see what is in it. If it looks like the source nagios install to a non standard location, i.e. /usr/local/nagios (is the standard location) then all you have to do is remove the whole directory. Of course, you might want to keep the config files just in case they have some good stuff in them. Also, you might want to keep the /etc/nagios files too, since someone may have created .cfgs for your network that you can simply move to your brand new source install folder of /usr/local/nagios/etc.
That is what I would do.

/var/www/garfield.covitechnologies.com/Intranet/nagios looks much like the web directory for nagios… which puts it ina completely different position than default, OTOH it permits to use the default machines httpd.conf… I’d go for a reinstall too…
Even if RPM installs look easiear they take lots more time to troubleshoot.

Luca