Multiple process - Nagios.cfg

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

Multiple process - Nagios.cfg

Post 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,
jforcier

Re: Multiple process - Nagios.cfg

Post by jforcier »

Hello nms, what version of Nagios XI do you have? What OS?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Multiple process - Nagios.cfg

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

Re: Multiple process - Nagios.cfg

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

Re: Multiple process - Nagios.cfg

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked