Whoops! Error - Can't Monitor

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.
Locked
bascotie
Posts: 4
Joined: Wed Oct 20, 2010 10:51 pm

Whoops! Error - Can't Monitor

Post by bascotie »

Hey guys,

I've tried a bunch of things I found online to no avail. Nagios is running (I also have Nagios3 which does not work either).

I get this in my log:

Code: Select all

Caught SIGSEGV, shutting down...
Whenever I try to go to any section it says:

Code: Select all

Whoops!

Error: Could not read host and service status information!

I'm in a virtual machine, I tried turning off all my firewalls and that didn't work. Any advice?


Running Ubuntu 10.04
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Whoops! Error - Can't Monitor

Post by mguthrie »

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:

Code: Select all

##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

bascotie
Posts: 4
Joined: Wed Oct 20, 2010 10:51 pm

Re: Whoops! Error - Can't Monitor

Post by bascotie »

Thanks for the help.

Your name reminds me of the old Chair at our CIS department :)

Anyway.. even when I had nagios3 installed, going to http://localhost/nagios3 would return the same error when I try to monitor the services.

I tried following the documentation on the nagios website twice, once exactly, and once using the latest packages -- no luck =(
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Whoops! Error - Can't Monitor

Post by mguthrie »

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.

Code: Select all

drwxrwxr-x 2 nagios nagios   4096 Oct 22 00:00 archives
-rw-rw-r-- 1 nagios users     200 Oct 22 11:51 host-perfdata
-rw-r--r-- 1 nagios nagios      6 Oct 22 10:42 nagios.lock
-rw-r--r-- 1 nagios nagios  80648 Oct 22 11:47 nagios.log
-rw-r--r-- 1 nagios nagios      5 Sep 22 09:17 ndo2db.lock
-rw-rw-r-- 1 nagios nagios      0 Oct 22 10:16 ndomod.tmp
srwxr-xr-x 1 nagios nagios      0 Sep 22 09:17 ndo.sock
-rw-r--r-- 1 nagios nagios 102156 Oct 22 10:42 objects.cache
-rw------- 1 nagios users  125420 Oct 22 11:42 retention.dat
drwxrwsr-x 2 nagios nagcmd   4096 Oct 22 10:42 rw
-rw-rw-r-- 1 nagios users     765 Oct 22 11:51 service-perfdata
drwxrwxr-x 4 nagios nagios   4096 Jan 11  2010 spool
-rw-rw-r-- 1 nagios users  123306 Oct 22 11:51 status.dat
bascotie
Posts: 4
Joined: Wed Oct 20, 2010 10:51 pm

Re: Whoops! Error - Can't Monitor

Post by bascotie »

Thanks mguthrie :)

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!
bascotie
Posts: 4
Joined: Wed Oct 20, 2010 10:51 pm

Re: Whoops! Error - Can't Monitor

Post by bascotie »

I installed Mint on a separate partition and it worked like a charm for some reason :) Maybe the virtual machine had something to do with it.. I dunno.

Thanks for your help, though. I'll try that out sometime, GOD willing.
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Whoops! Error - Can't Monitor

Post by tonyyarusso »

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.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
Locked