No lock file found in /usr/local/nagios/var/nagios.lock

Hi,

I noticed that several users have encountered the similar problem that I am encounteriing. Base on the previous solutions, I have have changed the access rights in the var folder and changed most of the folders user and group the nagios but I am still hitting the same error .

These are the owners and rights @ /usr/local

[root@localhost etc]# cd /usr/local
[root@localhost local]# ls -l
drwxr-xr-x 17 nagios nagios 4096 Feb 8 17:04 nagios

These are the owners and rights inside my Nagios folder

[root@localhost local]# cd /usr/local/nagios
[root@localhost nagios]# ls -l
total 548
drwxr-xr-x 2 root root 4096 Feb 8 16:45 base
drwxrwxr-x 2 nagios nagios 4096 Feb 8 16:53 bin
drwxr-xr-x 2 nagios nagios 4096 Feb 8 16:52 cgi
-rw-rw-r-- 1 nagios nagios 5276 Nov 18 06:44 Changelog
drwxr-xr-x 2 root root 4096 Feb 8 16:42 common
-rw-r–r-- 1 nagios nagios 3424 Feb 8 16:42 config.cache
-rw-r–r-- 1 nagios nagios 7222 Feb 8 16:42 config.log
-rwxr-xr-x 1 root root 18754 Feb 8 16:42 config.status
-rwxrwxr-x 1 nagios nagios 104651 Nov 18 06:49 configure
-rw-rw-r-- 1 nagios nagios 28224 Nov 18 06:49 configure.in
drwxr-xr-x 4 root root 4096 Feb 8 16:42 contrib
-rw-r–r-- 1 nagios nagios 3656 Feb 8 16:42 daemon-init
-rw-rw-r-- 1 nagios nagios 3632 Oct 3 2002 daemon-init.in
drwxrwxr-x 2 nagios nagios 4096 Feb 10 12:01 etc
-rwxrwxr-x 1 nagios nagios 7025 Feb 26 2002 functions
drwxr-xr-x 7 root root 4096 Feb 8 16:42 html
-rw-rw-r-- 1 nagios nagios 3895 Jul 9 2002 INSTALLING
-rwxrwxr-x 1 nagios nagios 5585 Feb 26 2002 install-sh
-rw-rw-r-- 1 nagios nagios 449 Jun 30 2002 LEGAL
drwxr-xr-x 2 nagios nagios 4096 Feb 8 17:04 libexec
-rw-rw-r-- 1 nagios nagios 18002 Feb 26 2002 LICENSE
-rw-r–r-- 1 root root 12600 Feb 8 16:42 Makefile
-rw-rw-r-- 1 nagios nagios 12579 Mar 24 2004 Makefile.in
-rwxrwxr-x 1 nagios nagios 461 Aug 13 2002 make-tarball
-rwxrwxr-x 1 nagios nagios 818 Feb 26 2002 mkpackage
-rw-rw-r-- 1 nagios nagios 14665 Nov 18 06:49 nagios.spec
-rw-rw-r-- 1 nagios nagios 745 Feb 26 2002 OutputTrap.pm
-rw-rw-r-- 1 nagios nagios 3839 Oct 25 2002 p1.pl
drwxr-xr-x 3 root root 4096 Feb 8 16:40 pkg
-rw-r–r-- 1 root root 192 Feb 8 16:42 pkginfo
-rw-rw-r-- 1 nagios nagios 210 Feb 26 2002 pkginfo.in
drwxr-xr-x 11 root root 4096 Feb 8 17:02 plugin
-rw-rw-r-- 1 nagios nagios 1308 Feb 3 2004 README
drwxr-xr-x 5 root root 4096 Feb 8 16:42 sample-config
drwxrwxr-x 2 nagios nagios 4096 Feb 8 16:53 sbin
drwxrwxr-x 9 nagios nagios 4096 Feb 8 17:04 share
-rw-r–r-- 1 root root 1167 Feb 8 16:42 subst
-rwxrwxr-x 1 nagios nagios 1125 Feb 26 2002 subst.in
-rwxrwxr-x 1 nagios nagios 1265 Feb 26 2002 update-version
-rw-rw-r-- 1 nagios nagios 1513 Feb 3 2004 UPGRADING
drwxrwxr-x 3 nagios nagios 4096 Feb 8 17:49 var
drwxr-xr-x 2 root root 4096 Feb 8 16:42 xdata

Are there anymore suggestions to remedy this issue? Any help or suggestion is greatly appreciated…

first you have the src and the compiled files mixed up…
if you run /etc/init.d/nagios start you shouldn’t get that error… you should have some other sort of porblem…
does the config check run correctly?

Luca

first you have the src and the compiled files mixed up…
Sorry I’m pretty new at this thingy. What are src files? And how could the compiled files got mixed up if I follow closely to the documentation??? Hmm…probably must try Nagios 2.x instead of 1.x?? (Any enlightenment will be greatly appreciated) :evil:

if you run /etc/init.d/nagios
If I run the above statement, I will get: “No lock file found in /usr/local/nagios/var/nagios.lock” Anyway, in the init script I have changed 'su -l ’ to ‘su --login’ (As I am using redhat fedora core 4)

*does the config check run correctly? *
For the config check, it prompts me error on dependencies and escalations.cfg. Which I don’t have the intention to configure these files, however if I use ‘touch xx.cfg’ on these two files it wouldn’t work too…Any suggestions??? :x

I know its tough but it will be very rewarding also…just hope to get this running soon…

src files are the source files from which you should compile the binaries and config files.
I’d recommend you get that directory off the server. go to /usr/src or /tmp (not /usr/local/ where you are going to install) and download the main file then follow the instructions to compile from source.

Luca

whoops. double posted.

Luca

Edited Fri Feb 10 2006, 05:49PM ]

[quote=“apoc.feuer”]*
For the config check, it prompts me error on dependencies and escalations.cfg. Which I don’t have the intention to configure these files, however if I use ‘touch xx.cfg’ on these two files it wouldn’t work too…*
You have no lock file due to nagios not running and it will not run, until you fix the problem with the config files.
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Running the above will tell you what is wrong. If you don’t fix them, then it’s never going to start. When you created the files with touch, the files created most likely don’t have the proper permissions.[/quote]

If you don’t want to configure those two files, you need to comment them out in the nagios.cfg file. Nagios is returning that error because by default it expects to find some configuration in those files, so comment them out and Nagios will ignore them on the startup.

Btw, why did you change anything in the init-script? I’m running FC4 as well and I had to do no such thing to get it working properly. It might not have hurt, but there’s no need to mess with things that don’t need messing with, esp. if you’re new at this.
Edited Fri Feb 10 2006, 06:16PM ]

su -l
su --login
are the same option, so I don’t know either. Either way, it looks like he made no change at all since they are the same option.

Thanks guys! Let me do the necessary changes and update you guys again. Anyway I did su -l to su --login as the former command gives me the login issue… :smiley:

Anyway thanks alot people.

Thanks alot people. I finally got my naigos to monitor one of the test machine. (My web interface is not up and I go other problems which I am going to post at on a new thread haha)

Heart felt appreciation goes to you guys here who have given me suggestions on how to work on it…thanks people.