Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
I've run into this challenge with running Nagios in Ubuntu. You either have to go completely with Ubuntu's apt packages for Nagios3 (which make all of the official documentation useless, because for some reason they changed the locations for everything), or just remove everything, and go to Nagios.org, and install from source. The official Nagios documentation will actually work if you do it that way.
Here's a script I wrote up the other day to do most of the install steps for you. You're welcome to use it if you want:
##Nagios Core install script for Ubuntu distro
#
##
cd /tmp
echo "Downloading packages..."
wget http://prdownloads.sourceforge.net/sourceforge/nagios/#nagios-3.2.3.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-#plugins-1.4.15.tar.gz
echo "Installing Nagios Core..."
useradd nagios -p nagios
tar zxf nagios-3.2.3.tar.gz
cd /tmp/nagios-3.2.3
./configure
make all
make install
make install-init
make install-commandmode
make install-config
make install-webconf
echo "########Enter password for nagiosadmin user:############"
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
echo "Installing Nagios Plugins\n"
cd /tmp
tar zxf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure
make
make all
make install
Bear with me if you've already tried these, but did you restart apache after installation?
Are you able to get http://localhost to return the default apache webpage?
It's saying it can't read the host and service status information. The critical files for the nagios monitoring engine are:
(on a source install)
/usr/local/nagios/var/status.dat #this has all the status data
/usr/local/nagios/var/objects.cache # this is a compilation of all of your configuration data
These file locations differ if you install with apt, or yum. But they need to be in the /nagios/var/ directory, and they need to have the correct permissions in order to work. Here's an example of what my file permissions look like for that directory.
What I'm doing now is preparing my laptop with several partitions. I moved everything from my spare drive back to the windows partition then erased that partition, split it up, moved everything back, and installed Debian on the extra partition (oh, and I also decrypted my drive which took 10 hours lol).
So in a moment here I'll try it out from Debian which is on it's own dedicated partition (rather than VMWare). You had good tips above but I already removed a lot of Nagios from the Ubuntu VM. I'll keep you posted, thx!
mguthrie wrote:(which make all of the official documentation useless, because for some reason they changed the locations for everything)
That reason is called the Filesystem Hierarchy Standard, which all POSIX systems and software are supposed to comply with. The Debian packaging teams fix things when packaging. When installing from a system package, /usr/local most not be used. When installing manually from source, either /usr/local or /opt must be used. Regardless, /usr/local/var is never a legal directory, which Nagios currently does incorrectly. See Filesystem Hierarchy Standard, v2.3 for all the nitty-gritty details.