Nagios cfg_dir problems


#1

I switched from 1.3 to 2.0 recently and now onto 2.1 to see if it’ll fix the problem but here goes.

I install nagiosQL which uses the cfg_dir settings for hosts and services list but when I browse nagios to look at the status of the services (after configuring and restarting it), there’s only around 6 out of the 30.
ATM, i can’t see the pattern except that it appears to read 1 service in each of the files found in the services/ folder.

anyone had this problem?

nagios -v /usr/local/nagios/etc/nagios.cfg returns the following :

Nagios 2.1
Copyright (c) 1999-2006 Ethan Galstad (http://www.nagios.org)
Last Modified: 03-27-2006
License: GPL

Reading configuration data...

Running pre-flight check on configuration data...

Checking services...
        Checked 31 services.
Checking hosts...
        Checked 12 hosts.
Checking host groups...
        Checked 3 host groups.
Checking service groups...
        Checked 0 service groups.
Checking contacts...
        Checked 2 contacts.
Checking contact groups...
        Checked 2 contact groups.
Checking service escalations...
        Checked 0 service escalations.
Checking service dependencies...
        Checked 0 service dependencies.
Checking host escalations...
        Checked 0 host escalations.
Checking host dependencies...
        Checked 0 host dependencies.
Checking commands...
        Checked 37 commands.
Checking time periods...
        Checked 4 time periods.
Checking extended host info definitions...
        Checked 0 extended host info definitions.
Checking extended service info definitions...
        Checked 0 extended service info definitions.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

#2

Sounds like you have multiple nagios’ running.
/etc/rc.d/init.d/nagios stop
ps -ef|grep nagios
make sure they are all dead. If not, kill them. When you are sure, then start nagios up again.


#3

“‘killall -9 nagios’ is a safe bet to kill them…”

Well even though there’s no duplicate running considering it does check it’s own lock file before starting, I don’t see how duplicates could cause only some services listed.

Having a simple look at the problem, it appears as if each of the services cfg files is reading only the first service of the file.

I just noticed another thing this morning, some of the CGI/HTMLs aren’t working (404 of nagios/cgi-bin/___.cgi). yet I compiled and also ran ‘make install-cgis’ and ‘make install-html’ and yet i still get these 404s… weird.


#4

/nagios/cgi-bin/histogram.cgi
/nagios/cgi-bin/trends.cgi

just checked, these are the 2 that don’t exist.

If I got to ‘Scheduling Queue’ I see the whole list of services yet looking at ‘Service Detail’, it’s not complete. wtf.???


#5

FOUND IT…
checked ./var/nagios.log and saw this

[1144104598] LOG VERSION: 2.0
[1144104598] Warning: Could not open object cache file ‘/usr/local/nagios/var/objects.cache’ for writing!

created it and fixed permissions on directory as well as files and it all shows up now :smiley:

for those of you who see something like this… :wink:


#6

It’s not all that uncommon to do:
/etc/rc.d/init.d/nagios stop
and then
ps -ef|grep nagios
and find that there are daemons running.
If you do /etc/rc.d/init.d/nagios stop again, it says no lock file found, but yet, the ps -ef does show process’. So, yes, it can occur, even if the lock file does not exist.

Glad you found the problem. I’ve been away to my home away from home for a couple days.