Page 3 of 4

Re: automatic creation of pids

Posted: Wed Jun 19, 2019 11:04 am
by scottwilkerson
Can you show the output of the following

Code: Select all

grep lock /etc/init.d/nagios
grep lock /usr/local/nagios/etc/nagios.cfg

Re: automatic creation of pids

Posted: Thu Jun 20, 2019 3:25 am
by shivangi
Should i execute these commands after stopping nagios ?

Re: automatic creation of pids

Posted: Thu Jun 20, 2019 6:35 am
by scottwilkerson
shivangi wrote:Should i execute these commands after stopping nagios ?
Either way, they are just going to show is it the lock file location is the same in both locations like it should be

Re: automatic creation of pids

Posted: Fri Jun 21, 2019 5:36 am
by shivangi
please find the output of the commands in the below attached attachment .

Thanks .

Re: automatic creation of pids

Posted: Fri Jun 21, 2019 2:30 pm
by scottwilkerson
Do you get any errors when you stop nagios?

Code: Select all

service nagios stop
After the stop is complete does this still show processes?

Code: Select all

ps -ef|grep nagios.cfg

Re: automatic creation of pids

Posted: Mon Jun 24, 2019 2:58 am
by shivangi
Hi,

No i donot find any issues while stopping Nagios and yes even after stopping Nagios after running the command ps -ef | grep Nagios .cfg some processes can stiil be seen as running .

please find the attachment .

Processes running when Nagios service is in on state is 16 and after stopping it is 8 when it should be 0 .sometimes processes running is more than 8 .

Re: automatic creation of pids

Posted: Mon Jun 24, 2019 3:29 pm
by tgriep
How many Hosts and Services is the server monitoring?

Can you post the nagios init script here so we can view it's settings?

Code: Select all

/etc/init.d/nagios
Try this to stop all of the nagios processes.
Run this as root

Code: Select all

service nagios stop
killall -9 nagios
Check to see if all of the Nagios processes are stopped and then start it up.

Re: automatic creation of pids

Posted: Wed Jun 26, 2019 2:49 am
by shivangi
Hi ,

Approx 248 servers are under monitoring

Below attached is the Nagios init script .

Thanks.

Re: automatic creation of pids

Posted: Wed Jun 26, 2019 3:24 am
by shivangi
Hi ,

Whenever I stop the Nagios process do I have to manually create the lock file ( nagios.lock , which is available in /usr/local/nagios/var )
because after executing the start command it shows no lock file found .

Thanks.

Re: automatic creation of pids

Posted: Wed Jun 26, 2019 8:24 am
by tgriep
You said earlier that you have a cron job that is making changes and restarting nagios. Show us what that job is doing and running.

You should not have to create the lock file as the nagios init script should create it when you issue a nagios start.

Run the following commands and post the full output.

Code: Select all

service nagios stop
killall -9 nagios
ps -ef |grep nagios.cfg
service nagios start
service nagios status
tail -50 /usr/local/nagios/var/nagios.log
ps -ef |grep nagios.cfg