Hello,
I tried restarting the nagios service and it gave me lockfile not found
[root@cgl-fdum-1a etc]# service nagios status
No lock file found in /usr/local/nagios/var/nagios.lock
everything seems to be running properly with No errors or Warnings but the lock file seems to be missing. This is very weird.
Any help would be appreciated. Thanks
The fact that the nagios.lock file is missing usually just indicates that nagios isn’t running, as that file is created when Nagios starts and deleted when it stops, to prevent multiple instances of Nagios being run, methinks. This is why, if Nagios is stopped and you try to restart it with the startup script provided, it will give you that error, but it should then go on to start Nagios for you.
Now that Nagios is running, go to your nagios/var/ directory, where the lock file is by default installed, and confirm whether or not it is there. If it’s not, check your config files to see where Nagios is configured to create that lock file, and then go there. Let us know what you find out.
The nagios.cfg file indicates that the lock file is located in lock_file=/var/run/nagios.pid
I can see the nagios.pid file in that folder.
But when i try and restart the process it does not.
Nagios.pid? How did you install Nagios? Doesn’t seem you installed it from source, which is what I would recommend. By default, the lock file is set to /usr/local/nagios/var/nagios.lock. You got something funky going on there.
[quote=“himohit”]…
[root@cgl-fdum-1a etc]# service nagios status
No lock file found in /usr/local/nagios/var/nagios.lock
…[/quote]
This indicates that the init script, wherever it came from, thinks the lock file should be in /usr/local/nagios/var
and your last reply states that nagios.cfg thinks it’s in /var/run/ or something.
So, get your stuff together. Where is it supposed to be? Did you install the init scripts from source (which is what it looks like) but then your nagios.cfg looks like a rpm install. So, you tell us. Where/what/why is it broke? You have a mixed bag for an install by the looks of it.
I’d suggest to remove the rpm install, and start over with a source install.
[quote=“himohit”]…
[root@cgl-fdum-1a etc]# service nagios status
No lock file found in /usr/local/nagios/var/nagios.lock
…[/quote]
This indicates that the init script, wherever it came from, thinks the lock file should be in /usr/local/nagios/var
and your last reply states that nagios.cfg thinks it’s in /var/run/ or something.
So, get your stuff together. Where is it supposed to be? Did you install the init scripts from source (which is what it looks like) but then your nagios.cfg looks like a rpm install. So, you tell us. Where/what/why is it broke? You have a mixed bag for an install by the looks of it.
I’d suggest to remove the rpm install, and start over with a source install.
Thank you all for your advice. That is exactly what i thought when i saw this funky nagios box. someone else did this installation and left without updating anyone. But the funny thing is that nagios has been running and giving all the alerts and notifications perfectly. Anyways, i am getting all set to install this box again. Thanks once again
I just loaded a system with Fedora Core 4 and used KYum to install Nagios and the plugins.
I get the exact same error “No lock file found in /var/run/nagios.pid” when trying to start Nagios and it DOES NOT START. Also, it does not create this file at all.
I’ve had this running on an earlier load so it is something with the rpm that Yum picked up. I’ve even removed Nagios and tried another download with the exact same results.
Hey rvicker, now that makes me think about my nagios box again. A similar thing is happening here, nagios does not seem to create a lock file and its still running giving all the alerts. I even tried to add some more services to an already existing system but the updates did not happen. Well, i may redo the box again if it doesnt work out.
You guys have nagios in 2 different places or something like that.
Try this:
slocate nagios | more
if you have a source install of nagios you might have:
/etc/rc.d/rc2.d/K01nagios
/etc/rc.d/rc0.d/K01nagios
/etc/rc.d/rc5.d/S99nagios
/etc/rc.d/rc6.d/K01nagios
/etc/rc.d/rc1.d/K01nagios
/etc/rc.d/rc4.d/S99nagios
/etc/rc.d/init.d/nagios ###Please VIEW this file and see what is in it. It should have prefix=/usr/local/nagios NagiosRun=${prefix}/var/nagios.lock for a source install
/etc/rc.d/rc3.d/S99nagios
/var/lock/subsys/nagios
/var/spool/cron/nagios
/var/spool/mail/nagios
/usr/local/nagios
And that is about it. Edited Sun Jan 15 2006, 01:48AM ]
And this is why we recommend to only install from source. Seriously, do yourself a favor, remove your current Nagios install, go download from one of the servers on the nagios website, and install it. That way, all of your nagios info is pretty much all under one directory: /usr/local/nagios. It’ll be a lot easier on you, trust me…and the most helpful people around here (such as luca and jakkedup), are more familiar with the recommended install.
Yeah, while that [probably] didn’t do any harm, I doubt it did any good, either. Nagios does not execute Apache, so adding the Nagios user to that group won’t get you any closer to solving your problem.
I don’t know why that doc says to make apache user part of nagios group. But, according to your slocate, it looks like you have only the rpm install on your system. Make sure that nagios is not running, ps -ef|grep nagios. Then make sure that the file /var/run/nagios.pid and /var/lock/subsys/nagios does not exist.
Now that you have done that, make sure that there is nothing wrong with your config files by using the -v and then try to start nagios. If you get the same error, then this is not a lock file problem, but it’s due to nagios not starting for some reason. Bad config, syntax, selinux enabled??