A.Walid
A.Walid

Reputation: 37

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

I followed the instructions at this link which I found here on EE...http://nagios.sourceforge.net/docs/3_0/quickstart-fedora.html Well after trying to stop nagios with command service nagios stop and after that to see its status with service nagios status the following message appears: "No lock file found in /usr/local/nagios/var/nagios.lock". How do I resolve it.

Thanks.

Upvotes: 1

Views: 5263

Answers (2)

AceGod
AceGod

Reputation: 11

Just run:

/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

UPDATE:

The error: "No lock file found in /usr/local/nagios/var/nagios.lock" simply means that nagios is not running.

Running the command above simply starts the nagios daemon and points it to a specific config file. The advantage to running this command manually over systemd is that when you run "service nagios start" this typically calls the /etc/rc.d/init.d/nagios script which contains a line with parametrized environment variables:

$NagiosBin -d $NagiosCfgFile

Because every system is different, not specifying either the bin nor config directories could lead to nagios breaking (stopping) when it tries to start using the default installation directory paths

Upvotes: 1

Nagios Support
Nagios Support

Reputation: 561

This is not a bug. "No lock file found in /usr/local/nagios/var/nagios.lock" means that it isn't running.

If you run an echo $? directly after service nagios status while it isn't running, you'll notice that the exit code is 3.

3 is the correct value return code for that status as documented in the Linux Standard Base.

Some Sources: https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/iniscrptact.html http://ftp.novell.hu/pub/mirrors/ftp.novell.com/forge/library/SUSE%20Package%20Conventions/spc_init_scripts.html

Upvotes: 1

Related Questions