automatic creation of pids

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

Re: automatic creation of pids

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
shivangi
Posts: 32
Joined: Mon Mar 25, 2019 2:01 am

Re: automatic creation of pids

Post by shivangi »

Should i execute these commands after stopping nagios ?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: automatic creation of pids

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
shivangi
Posts: 32
Joined: Mon Mar 25, 2019 2:01 am

Re: automatic creation of pids

Post by shivangi »

please find the output of the commands in the below attached attachment .

Thanks .
Attachments
naagios.JPG
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: automatic creation of pids

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
shivangi
Posts: 32
Joined: Mon Mar 25, 2019 2:01 am

Re: automatic creation of pids

Post 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 .
Attachments
nagios processes.JPG
User avatar
tgriep
Madmin
Posts: 9181
Joined: Thu Oct 30, 2014 9:02 am

Re: automatic creation of pids

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
shivangi
Posts: 32
Joined: Mon Mar 25, 2019 2:01 am

Re: automatic creation of pids

Post by shivangi »

Hi ,

Approx 248 servers are under monitoring

Below attached is the Nagios init script .

Thanks.
Attachments
nagios init script.txt
(9.7 KiB) Downloaded 165 times
shivangi
Posts: 32
Joined: Mon Mar 25, 2019 2:01 am

Re: automatic creation of pids

Post 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.
User avatar
tgriep
Madmin
Posts: 9181
Joined: Thu Oct 30, 2014 9:02 am

Re: automatic creation of pids

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked