Page 1 of 1

Multiple process - Nagios.cfg

Posted: Wed Sep 19, 2018 1:58 am
by nms
Hi,

I'm observing that the nagios.cfg process running is more than 2 times (i.e. more than one parent with its child process).
I had killed the presumed "old" process, but it seems after a while it a new process is started while the previous stay running.
What can be the cause of this and how can we rectify the issue?

Code: Select all

 ps -ef | grep nagios.cfg
nagios    8447     1  0 Sep18 ?        00:00:01 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios    8545  8447  0 Sep18 ?        00:00:08 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios   20802     1  3 08:50 ?        00:00:13 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios   20899 20802  0 08:50 ?        00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
Rgds,

Re: Multiple process - Nagios.cfg

Posted: Wed Sep 19, 2018 9:26 am
by jforcier
Hello nms, what version of Nagios XI do you have? What OS?

Re: Multiple process - Nagios.cfg

Posted: Wed Sep 19, 2018 3:42 pm
by tgriep
In the nagios init script is a timeout setting that starts the nagios service.
By default, it is set to 10 seconds. If for any reason, it takes longer than 10 seconds to fully shutdown, it will start up a new process.

That timeout value can be adjusted and here is how to do that.

Edit the file of /etc/init.d/nagios and find this line:

Code: Select all

for i in 1 2 3 4 5 6 7 8 9 10 ; do
Change it to:

Code: Select all

for i in {1..30} ; do
Save the file and that will set the timeout t0 30 seconds.

On larger systems with a lot of checks and the system was busy and could not finish in 10 seconds processing all of the checks, writing files, etc. could be some of the reasons for the duplicated process.

Re: Multiple process - Nagios.cfg

Posted: Thu Sep 20, 2018 4:19 am
by nms
Hi

The current XI version is 5.4.13 running on a VM with centos 6.9.

In the meantime, I have set /etc/init.d/nagios for a 30 sec timeout. Wil monitor to see if this solves the issue

Rgds,

Re: Multiple process - Nagios.cfg

Posted: Thu Sep 20, 2018 1:12 pm
by scottwilkerson
nms wrote:Hi

The current XI version is 5.4.13 running on a VM with centos 6.9.

In the meantime, I have set /etc/init.d/nagios for a 30 sec timeout. Wil monitor to see if this solves the issue

Rgds,
Sounds good, let us know if it returns