Hello,
Since I started scheduling a Reactor chain which uses the REST API to apply configuration, I've seen multiple times hat the Nagios process seems to bhe forked all of a sudden. This has happened at least three times. I know the solution is to execute 'killall -9 nagios && service nagios restart', but I was hoping for a more robust solution stead of a workaround. I've seen it happen with a 'normal' manual apply configuration, but I can't help think that the apply configuration done by the Reactor chain has a higher rate of failure.
The config of the chain is a n action 'submit an http request',
type POST
options apikey=%nagiosxiapikey%&pretty=1
URL https://%nagiosxiserver%/nagiosxi/api/v1/system/applyconfig
And is executed two times a day at 07:00 and 19:00 as a workaround for the memory leak caused by Mod Gearman.
It is also used as part of several superchains.
Any tip to prevent the multiple Nagios instances issue from happening is welcome.
Grtz
Willem
2 Nagios processes found
2 Nagios processes found
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: 2 Nagios processes found
I can tell you it's likely from the 15448 services you have on that machine (according to your signature). The nagios process can take some time to stop/start during an Apply when you have that many, so one possible solution is to modify the init script for nagios. In /etc/init.d/nagios you can change this line:
for i in 1 2 3 4 5 6 7 8 9 10 ; do
to the more compact and inclusive:
for i in {1 .. 20} ; do
This will give it twice as long to stop before it tries to restart itself again. Try that and see if the issue persists.
for i in 1 2 3 4 5 6 7 8 9 10 ; do
to the more compact and inclusive:
for i in {1 .. 20} ; do
This will give it twice as long to stop before it tries to restart itself again. Try that and see if the issue persists.
Former Nagios employee
Re: 2 Nagios processes found
Thanks Trevor, I will try that solution. It might take some before I know if it really helps, so please leave this thread open for some time. I will not respond to your answer.. 
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: 2 Nagios processes found
You have no idea how much that means to us :)WillemDH wrote:I will not respond to your answer.. ;)
But even still, I expect @eloyd to hop in at any moment...
Former Nagios employee
Re: 2 Nagios processes found
Trevor,
I'll be damned your solution worked!
I haven't seen any duplicate Nagios processes for a few weeks now. Close this up please.
Grtz
Willem
I'll be damned your solution worked!
Grtz
Willem
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: 2 Nagios processes found
People are always so surprised when I fix things D:
Glad it's working though, I'll lock this up!
Glad it's working though, I'll lock this up!
Former Nagios employee