Page 1 of 1

Running Web Interface Behind Load Balancer

Posted: Mon Jan 05, 2015 11:34 am
by gw1500se
We have a pair of servers that are behind a load balancer. The problem is that Nagios is only running on one so if the load balancer sends the user to the wrong server a 500 error occurs. I can find lots of information on using nagios to monitor a load balancer but that is not my issue. I need to have nagios web to work regardless of which server the load balancer assigns. Is there a documented way to safely do this? TIA.

Re: Running Web Interface Behind Load Balancer

Posted: Mon Jan 05, 2015 3:31 pm
by sreinhardt
Unfortunately due to the CGI's heavy dependence on in-memory and local files to the running nagios instance, there is not a great way to provide load balancing in the sense of having a single core instance and multiple web servers. You would have to have two identical core systems, that somehow share check results between them in an active fashion, which can kind of be done through forwarding check results, but gets to be very tricky and not always identical data. Have you reached a point where the core interface is having issues with your number of users? This is generally a pretty high number, as the core interface is very light on the system, excluding report generation.

Re: Running Web Interface Behind Load Balancer

Posted: Wed Jan 07, 2015 8:24 am
by gw1500se
Thanks for the reply. Unfortunately I was pretty much expecting that response. These servers are running multiple applications of which Nagios is only one. While the number of Nagios users is small, the users for the other applications can become large. Our solution is to create a separate URL just for Nagios to by-pass the load balancer. However, that means if that specific server goes down so does Nagios but nothing else (kind of prophetic).

Re: Running Web Interface Behind Load Balancer

Posted: Thu Jan 08, 2015 2:14 pm
by sreinhardt
Ya, the webui at least goes down. Hopefully the actual core daemon does not. Hopefully you could still vpn in or remote in, in another way to get access behind the load balancer if really needed.

Re: Running Web Interface Behind Load Balancer

Posted: Thu Jan 08, 2015 2:23 pm
by eloyd
gw1500se wrote:Thanks for the reply. Unfortunately I was pretty much expecting that response. These servers are running multiple applications of which Nagios is only one. While the number of Nagios users is small, the users for the other applications can become large. Our solution is to create a separate URL just for Nagios to by-pass the load balancer. However, that means if that specific server goes down so does Nagios but nothing else (kind of prophetic).
We did this a lot for Kodak's implementation. In fact, we tested the load balancer address (just to make sure that something was responding) and then we used a ?magic_proxy attribute on the URL to test each individual server through the proxy. This ensured that each individual server was running.

Not sure if you can do that, or if that is even what you're asking, but -20 wind chill is making my mind glaze over and all I can think of is Galaga for some reason. Yes, you heard me. GALAGA.

Re: Running Web Interface Behind Load Balancer

Posted: Fri Jan 09, 2015 2:28 pm
by tmcdonald
Load balancers usually assume that the backend stuff is identical, so this sort of situation is not always considered during implementation. As eloyd pointed out, if your LB has any sort of bypass or passthrough capabilities this might be something to look into.