How do I shutdown Nagios?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
prostak
Posts: 4
Joined: Wed Feb 25, 2015 2:37 pm

How do I shutdown Nagios?

Post by prostak »

Nagios XI is purchases by our company, however, I wasn't able to create topic under Customer Support > Nagios XI, therefore I am submitting my question here...

We have Nagios XI installed Red Hat 5.7.
I need to shut Nagios down on that server temporally. How do I do it?

I tried:

Code: Select all

[YYYY@XXXX ~]$ ps -efa | grep nagios
nagios    3953     1  0 Feb16 ?        00:00:20 /usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg
nagios    4105     1  0 Feb16 ?        00:00:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
YYYY     16887  8219  0 15:50 pts/1    00:00:00 grep nagios
[YYYY@XXXX ~]$ sudo killall nagios
nagios: no process killed
I do have sudo access. Killing didn't do anything. How do I shut Nagios down? thanks!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How do I shutdown Nagios?

Post by Box293 »

Code: Select all

service nagios stop
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
prostak
Posts: 4
Joined: Wed Feb 25, 2015 2:37 pm

Re: How do I shutdown Nagios?

Post by prostak »

It doesn't work:

Code: Select all

[XXXX@YYYY ~]$ service nagios stop
-bash: service: command not found
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How do I shutdown Nagios?

Post by Box293 »

How about:

Code: Select all

sudo /sbin/service nagios stop
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
prostak
Posts: 4
Joined: Wed Feb 25, 2015 2:37 pm

Re: How do I shutdown Nagios?

Post by prostak »

Sorry for late reply.
I get this:

Code: Select all

[YYYY@XXXX ~]$ sudo /sbin/service nagios stop
Stopping nagios: No lock file found in /usr/local/nagios/var/nagios.lock
P.S. Do you know how do I get a permission to post under Customer Support > Nagios XI?

Thanks
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How do I shutdown Nagios?

Post by Box293 »

So that command is working.

Not sure why you are getting the lock file.

After stopping nagios, are there any other nagios processes running?

Code: Select all

ps -aef | grep nagios.cfg
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
prostak
Posts: 4
Joined: Wed Feb 25, 2015 2:37 pm

Re: How do I shutdown Nagios?

Post by prostak »

I get this:

Code: Select all

[YYYY@XXXX ~]$ ps -aef | grep nagios.cfg
YYYY   22295 22258  0 14:13 pts/0    00:00:00 grep nagios.cfg
Is the above good or bad?

What does hitting lock indicate to you?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How do I shutdown Nagios?

Post by Box293 »

prostak wrote:P.S. Do you know how do I get a permission to post under Customer Support > Nagios XI?
Send an email to [email protected]
prostak wrote:I get this:

Code: Select all
[YYYY@XXXX ~]$ ps -aef | grep nagios.cfg
YYYY 22295 22258 0 14:13 pts/0 00:00:00 grep nagios.cfg

Is the above good or bad?
This is good. It shows that nagios is not running.
prostak wrote:What does hitting lock indicate to you?
The lock file is a file created when Nagios starts which includes the PID of the nagios process. When Nagios is stopped this file is deleted. You should not normally get the message No lock file found.

When Nagios is running, this will confirm the file exists:

Code: Select all

cat /usr/local/nagios/var/nagios.lock
If this doesn't produce output then something else is wrong.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
lsazzad
Posts: 72
Joined: Tue Apr 07, 2015 6:52 am
Location: ​Osnabrück, Deutschland
Contact:

Re: How do I shutdown Nagios?

Post by lsazzad »

It seems your lock file needs to be unlocked! I was having same problem. If there is already a lock file then please increase your lock files's permission.

chmod 664 nagios.lock
chown root:nagiosops nagios.lock

If its not there please create one & then increase permission:

Location of file:
cd /usr/local/nagios/var
touch nagios.lock
chmod 664 nagios.lock
chown root:nagiosops nagios.lock

I hope it could solve your problem!
Regards
Sazzad
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: How do I shutdown Nagios?

Post by jdalrymple »

prostak wrote:I tried:

Code: Select all

[YYYY@XXXX ~]$ ps -efa | grep nagios
nagios    3953     1  0 Feb16 ?        00:00:20 /usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg
nagios    4105     1  0 Feb16 ?        00:00:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
YYYY     16887  8219  0 15:50 pts/1    00:00:00 grep nagios
[YYYY@XXXX ~]$ sudo killall nagios
nagios: no process killed
It wasn't running when you started.

If you don't have `/sbin/service` - `/etc/init.d/nagios stop` should work just fine.
Locked