Thanks all - (esp. Malcolm - that script is excellent) - Mon is not what I am looking for - piranha does all that for me - just need a qik couple of lines to bring individual realservers down if required - and it had to be something that someone with no knowledge of lvs can use (basically everyone here but me) - heres what I came up with:
-------------start delete-server-----------------
#!/bin/bash

#This shell script is designed to automate the removal of real-servers from the lvs to allow maintainence etc to be performed with no effect on clients.

#set some variables in case we are not called by the correct shell

PATH=$PATH:/sbin:/bin:/usr/sbin

export = PATH

LVS=lvs-name

#I'm using ipvsadm to do the removal - with the server passed as an option - first we should check that we can run ipvsadm - and output the connection list so users can see which servers are connected

/sbin/ipvsadm -L

#Which LVS Service do you wich to modify
        echo "Which LVS Service do you want to modify? (LVS'd Port Number)"
                read SERVICE
#Ok - now we ask for a server to remove
        echo "Which Realserver do you wish to Remove from the LVS? "
                read SERVER
        echo "Removing {$SERVER} from LVS"

/sbin/ipvsadm -d -t $LVS:$SERVICE -r $SERVER:$SERVICE
------------------end delete-server---------------------------

Does everything I need - if anyone wants to use you are most welcome.  Thanks again all for your assistance in getting my LVS up running - works perfectly now :)

jeremy

-----Original Message-----
From: kip@kiplandiles.com [mailto:kip@kiplandiles.com]
Sent: Thursday, 28 March 2002 6:25 AM
To: lvs-users@LinuxVirtualServer.org
Subject: Re: LVS Control Scripts? (was LVS-NAT two nic / two network
problem)

Simple 5 minute script using mon .....

typeset -a STAT
SLEEP=10
VS1=x.x.x.x  # to protect the guilty - put your own VIP here
RS1=172.16.2.15
RS2=172.16.2.16
HTTP=80
BIND=53
STAT[1]=1
STAT[2]=1
HPING="/usr/local/mon/mon.d/http.monitor -p 80 -t 2 -o"

trap "echo $0 killed; ipvsadm -ln; exit 1" SIGINT

echo "NBNMON Startup at `date`"

vs() {
        if [ "${STAT[$2]}" = "1" ] #UP
        then
                if [ "$1" = "-a" ] #ADD
                then
                        return
                else
                        echo "Deleting $3"
                        STAT[$2]=0
                fi

        else #DOWN

                if [ "$1" = "-d" ] #DEL
                then
                        return
                else
                        echo "Adding $3"
                        STAT[$2]=1
                fi
        fi

        ipvsadm $1 -t ${VS1}:$HTTP -r $3 $4
}

#MAIN =============================================

while :
do
        if ( $HPING $RS1 >/dev/null )
        then
                vs -a 1 $RS1 -i
        else
                vs -d 1 $RS1
        fi

        if ( $HPING $RS2 >/dev/null )
        then
                vs -a 2 $RS2 -i
        else
                vs -d 2 $RS2
        fi

        sleep $SLEEP
done
ipvsadm -ln
echo "NBNMON Shutdown at `date`"
exit 0

----- Original Message -----
From: "Jon Molin" <Jon.Molin@resfeber.se>
To: <lvs-users@LinuxVirtualServer.org>
Sent: Wednesday, March 27, 2002 3:35 AM
Subject: Re: LVS Control Scripts? (was LVS-NAT two nic / two network
problem)

> Have you tried mon?
>
http://www.linuxvirtualserver.org/Joseph.Mack/HOWTO/LVS-HOWTO-21.html#ss21.5
>
> /Jon
>
> jlobascher@touchcorp.com wrote:
>
> Am in the process of writing some 'control' scripts for my lvs and
> thought to ask the list if anyone has already done this?
>
> What I am writing is simple 'up/down' scripts to remove realservers from
> the LVS pool - ie: pass the realserver name as a parameter to one script
> and it will remove the server from the list (for maintainence etc) and
> then another script to add servers.
>
> Anyone got something like this?  If not I will post mine once they are
> complete.
>
> jeremy
>
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
> Send requests to lvs-users-request@LinuxVirtualServer.org
> or go to http://www.in-addr.de/mailman/listinfo/lvs-users
>

_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
Send requests to lvs-users-request@LinuxVirtualServer.org
or go to http://www.in-addr.de/mailman/listinfo/lvs-users