Tuesday, July 14, 2020

Determining L4 or L7 Load balancer

I have a need in a shell script to determine if a L4 or L7 load balancer is in use. I don’t care, at least for now, about any more detail than that. Simply is it a 4 or 7?

My vision is to do a curl and inspect the response. But I’m stumped as to what to look for. Any advice? Thanks?

Really nothing more complex than this pseudo code -

curl http://my.intenral.site # inspect response if checkForL4 then return 4 Else if checkForL7 then Return 7 else return 0 

More detail about my use case. Working with a very complex piece of software. Many variables to tune. A problematic piece is around the LB environment. If it’s an L4 then this collection of app runtime Variables need to be setup in a certain way. If a L7 then this different but overlapping set of variables needs to be set in such and such a way. In my org (large, distributed, siloed and very bureaucratic) we deal with at least 13 different groups re: load balancers. Some use this product, others use that. Some “allow” L4 if it’s the Tuesday before a full moon, others don’t. Some respond to questions within a week, others not so much. All seem to randomly change stuff on you.

So I’m trying to do a monitoring script that can on a schedule to hit URL’s used by our several dozen installations, look to see how the LB is configed and throw and alert if needed. Again a simple L4 or L7 answer is all that’s needed. I don’t have a foreseeable need for anything more.



No comments:

Post a Comment