status_file, locatios.h, and no status file on start

Jared Rhine jared at wordzoo.com
Fri Mar 5 21:28:26 CET 2004


I've installed a fresh nagios 2.0a1 and the infrastructure appears to
be properly installed.  But there's no status_file created when the
nagios daemon starts.  No errors appear in the log_file or syslog.
check_nagios fails, and (most) all the CGIs say "Error: Could not read
host and service status information!", as expected.

I used this particular subject line, because until recently, I had
been assuming that the status_file I put into nagios.cfg would be used
during runtime.  I know think that status_file is sort of irrelevant
and the DEFAULT_STATUS_FILE in location.h is the one the nagios daemon
will really use.  I think this might be the case with some other
*_file parameters, but I'm not sure yet.

So I said fine, put everything back to the locations that Nagios 2.0a1
expects by default and thought that would be the end of it, but
there's still no status.dat/log/sav created when nagios starts.

I'm new to Nagios, but I'm experienced enough to suspect the usual
culprits, typos, permissions, pathnames, etc.  But everything looks
good!

Ideas welcome.  Data follows.  I could provide much more info, of
course, but I wanted to at least show that permissions and locations
seem at least reasonable.

-> uname -a 
SunOS ops 5.8 Generic_108528-15 sun4u sparc SUNW,Ultra-250 

[cd /tmp/nagios-build/build/nagios-cvs && LDFLAGS="-L/usr/local/lib -R/usr/local/lib" ./configure --prefix=/usr/local/nagios_2004-03-03_01 --localstatedir=/usr/local/ops/var/nagios --with-cgiurl=/nagios/bin --with-htmurl=/nagios --with-nagios-user=nagios --with-
nagios-grp=nagios --with-command-grp=nagcmd --enable-embedded-perl --with-perlcache] 

-> grep -i status /tmp/nagios-build/build/nagios-cvs/include/locations.h 
#define DEFAULT_STATUS_FILE                     "/usr/local/ops/var/nagios/status.dat" 

-> ls -alR /usr/local/ops/var/nagios/ 
/usr/local/ops/var/nagios/: 
total 25 
drwxrwxr-x    4 nagios   nagios        512 Mar  5 12:00 . 
drwxrwxr-x   10 root     sysadmin     7168 Mar  3 18:32 .. 
drwxrwxr-x    2 nagios   nagios        512 Mar  5 12:00 archives 
-rw-r--r--    1 nagios   nagios          5 Mar  5 11:10 nagios.lock 
-rw-rw-r--    1 nagios   nagios        451 Mar  5 12:10 nagios.log 
-rw-r--r--    1 nagios   nagios       7849 Mar  5 11:27 objects.cache 
-rw-r--r--    1 nagios   nagios       4910 Mar  5 12:10 retention.dat 
drwxrwsr-x    2 nagios   nagios        512 Mar  5 11:27 rw 
 
/usr/local/ops/var/nagios/archives: 
total 4 
drwxrwxr-x    2 nagios   nagios        512 Mar  5 12:00 . 
drwxrwxr-x    4 nagios   nagios        512 Mar  5 12:00 .. 
-rw-r--r--    1 nagios   nagios        1777 Mar  5 11:40 nagios-03-05-2004-12.log 
 
/usr/local/ops/var/nagios/rw: 
total 2 
drwxrwsr-x    2 nagios   nagios        512 Mar  5 11:27 . 
drwxrwxr-x    4 nagios   nagios        512 Mar  5 12:00 .. 

-> sudo -u nagios id 
uid=65010(nagios) gid=50003(nagios) 

-> ps -ef | grep nagios 
  jrhine 18553 14149  0 12:14:22 pts/32   0:00 grep nagios 
  nagios  2463     1  0 11:10:28 ?        0:00 /usr/local/nagios_2004-03-03_01/bin/nagios -d /usr/local/nagios_2004-03-03_01/e 

-> grep -i status_file /usr/local/nagios/etc/nagios.cfg 
status_file=/usr/local/ops/var/nagios/status.dat 

-> pf httpd 
  jrhine 18785 14149  0 12:17:10 pts/32   0:00 egrep httpd 
  nobody 15325  5595  0 15:11:44 ?        0:08 /usr/local/apache/bin/httpd -DSSL 
  nobody 15326  5595  0 15:11:44 ?        0:10 /usr/local/apache/bin/httpd -DSSL 
  nobody 15327  5595  0 15:11:44 ?        0:06 /usr/local/apache/bin/httpd -DSSL 
  nobody 15328  5595  0 15:11:44 ?        0:07 /usr/local/apache/bin/httpd -DSSL 
  nobody 15329  5595  0 15:11:44 ?        0:09 /usr/local/apache/bin/httpd -DSSL 
  nobody 15330  5595  0 15:11:47 ?        0:05 /usr/local/apache/bin/httpd -DSSL 
  nobody 15331  5595  0 15:11:48 ?        0:09 /usr/local/apache/bin/httpd -DSSL 
  nobody 15332  5595  0 15:11:48 ?        0:06 /usr/local/apache/bin/httpd -DSSL 
  nobody 15526  5595  0 15:13:42 ?        0:05 /usr/local/apache/bin/httpd -DSSL 
    root  5595     1  0   Mar 01 ?        0:02 /usr/local/apache/bin/httpd -DSSL 

-> sudo -u nobody /usr/local/nagios_2004-03-03_01/libexec/check_nagios /usr/local/ops/var/nagios/status.dat 5 nagios
Error: Cannot open status log for reading!

-> sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg | tail -4 
Total Warnings: 0 
Total Errors:   0 
 
Things look okay - No serious problems were detected during the pre-flight check 

-> sudo grep -i nagios /var/log/syslog 
[no results]

-- jared at wordzoo.com

http://www.geekcode.com/geek.html
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/CS/B
d s:++>+ a-
C++(++++)$ ULBSH++++ P+++ L+++ E++(+++) W++++ N- !o !K w !O M V
PS+++(-) PE++(--) Y+ PGP>++
t@ 5 X+ R>+ tv++>-- b>++ DI+ D- G
e++ h- r++>+++ y+++
------END GEEK CODE BLOCK------


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list