Not able to stop nagios service

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Not able to stop nagios service

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Not able to stop nagios service

Post 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.
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Re: Not able to stop nagios service

Post 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!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Not able to stop nagios service

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Re: Not able to stop nagios service

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Not able to stop nagios service

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked