Page 1 of 1

Not able to stop nagios service

Posted: Wed Jun 26, 2013 7:11 am
by lafargeuser
Not able to stop nagios service. It says....
Stopping nagios: No lock file found in /usr/local/nagios/var/nagios.lock

However, I am able to restart the service. checked configuration file looks okay.


pasting nagios.log

[1372246944] Local time is Wed Jun 26 17:12:24 IST 2013
[1372246944] LOG VERSION: 2.0
[1372246944] ndomod: NDOMOD 1.5.1 (05-15-2012) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1372246944] ndomod: Successfully connected to data sink. 0 queued items to flush.
[1372246944] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1372246944] Finished daemonizing... (New PID=4233)
[1372246948] Caught SIGTERM, shutting down...
[1372246948] Successfully shutdown... (PID=4233)
[1372246948] ndomod: Shutdown complete.
[1372246948] Event broker module '/usr/local/nagios/bin/ndomod.o' deinitialized successfully.

Re: Not able to stop nagios service

Posted: Wed Jun 26, 2013 9:38 am
by slansing
If you are getting that error, nagios is likely not running due to a awkward shutdown or configuration issue, you need to resolve configuration problems before shutting down nagios, did you say you were able to apply configuration?? Lets run through the following:

Please navigate to Configure > CCM > Tools > Write config files, then click the buttons from top to bottom, output all of the text that they show you back here so we can help.

Re: Not able to stop nagios service

Posted: Thu Jun 27, 2013 12:55 am
by lafargeuser
Checked, all configuraton files. Seems to be okay.


Write host configurations ...
Configuration file successfully written!

Write service configurations ...
Configuration file successfully written!

Write hostgroups.cfg ...
Configuration file successfully written!
Write servicegroups.cfg ...
Configuration file successfully written!
Write hosttemplates.cfg ...
Configuration file successfully written!
Write servicetemplates.cfg ...
Configuration file successfully written!

Re: Not able to stop nagios service

Posted: Thu Jun 27, 2013 8:12 am
by scottwilkerson
This log fragment makes it look like it is already stopped...
No lock file found in /usr/local/nagios/var/nagios.lock
This looks like the lock file is missing.

Can you run the following after you see this message.

Code: Select all

ps -ef| grep bin/nagios
ll /usr/local/nagios/var
ls -ld /usr/local/nagios/var
ls -ld /usr/local/nagios

Re: Not able to stop nagios service

Posted: Mon Jul 01, 2013 2:17 am
by lafargeuser
Able to run these commands. Pasting output.

ps -ef| grep bin/nagios
nagios 3720 1 0 Jun28 ? 00:01:58 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

ll /usr/local/nagios/var
total 332
drwxrwxr-x 2 nagios nagios 12288 Jul 1 00:00 archives
-rw-rw-r-- 1 nagios nagios 0 Jul 1 12:38 host-perfdata
-rw-r--r-- 1 nagios nagios 5 Jun 28 11:22 nagios.lock
-rw-r--r-- 1 nagios nagios 84416 Jul 1 12:36 nagios.log
-rw-r--r-- 1 nagios nagios 5 Jun 28 11:20 ndo2db.lock
srwxr-xr-x 1 nagios nagios 0 Jun 28 11:20 ndo.sock
-rw-r--r-- 1 nagios nagios 49635 Jul 1 04:05 npcd.log
-rw-r--r-- 1 nagios nagios 42804 Jun 28 11:22 objects.cache
-rw-rw-rw- 1 nagios nagios 14924 May 17 16:09 perfdata.log
-rw------- 1 nagios nagios 48507 Jul 1 12:22 retention.dat
drwxrwsr-x 2 nagios nagcmd 4096 Jun 28 11:22 rw
-rw-rw-r-- 1 nagios nagios 0 Jul 1 12:38 service-perfdata
drwxrwxr-x 5 nagios nagios 4096 Oct 30 2012 spool
drwxr-xr-x 2 nagios nagios 4096 Jul 1 12:37 stats
-rw-rw-r-- 1 nagios nagios 49057 Jul 1 12:38 status.dat

ls -ld /usr/local/nagios/var
drwxrwxr-x 6 nagios nagios 4096 Jul 1 12:38 /usr/local/nagios/var


ls -ld /usr/local/nagios
drwxr-xr-x 8 root root 4096 Oct 30 2012 /usr/local/nagios

Re: Not able to stop nagios service

Posted: Mon Jul 01, 2013 10:51 am
by abrist
Lets check your hard drive space:

Code: Select all

df -h
df -i
Now lets restart nagios:

Code: Select all

service nagios start
If it does not work, run a verification:

Code: Select all

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