Unix Technical Forum

Re: service monitoring and pf load balancing

This is a discussion on Re: service monitoring and pf load balancing within the lucky.openbsd.misc forums, part of the OpenBSD category; --> On 8/4/06, Hasan USTUNDAG <hasust@gmail.com> wrote: > http://www.bsdforums.org/forums/showthread.php?t=33480 > script works fine for me. > You can also use ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > lucky.openbsd.misc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 06:06 AM
NetNeanderthal
 
Posts: n/a
Default Re: service monitoring and pf load balancing

On 8/4/06, Hasan USTUNDAG <hasust@gmail.com> wrote:
> http://www.bsdforums.org/forums/showthread.php?t=33480
> script works fine for me.
> You can also use ping to check host availibilty or perl module
> Net::Telnet to check port availibilty for other protocols.


That pf.conf looks ok, but his script isn't so great.

I tried this and it works in a lab scenario, with the slight advantage
that everything necessary is available within OpenBSD's default
distribution. The <available> table is populated by live nc'd entries
from the <pool> table using the script below, cron'd at your desired
test interval. One caveat is that your first load of pf.conf will
have an empty <www_available> table until the script executes. I
suppose you could mirror <www_pool> to <www_available> in pf.conf to
avoid that.

pf.conf:
---------
table <www_pool> persist { 10.0.0.10 10.0.0.11 10.0.0.12 10.0.0.13 10.0.0.14 }
table <www_available> persist
rdr on $ext_if proto tcp from any to 172.16.10.100 port 80 -> {
<www_available> } round-robin
pass in on $ext_if inet proto tcp from any to <www_pool> port 80 flags
S/SA synproxy state
---------

test_avail.sh:
---------
#!/bin/ksh
for host in `/sbin/pfctl -t www_pool -Ts`
do
/usr/bin/nc -z -w 1 $host 80 2>&1 >/dev/null && action=add || action=delete
/sbin/pfctl -t www_available -T $action $host
done
---------

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:23 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com