Forum Discussion

t_mantel_89732's avatar
t_mantel_89732
Icon for Nimbostratus rankNimbostratus
Nov 25, 2009

Problems with irule "Pool_Member_Status_Page_on_a_Virtual_Server" after migrating to Bigip LTM v10.0.1 HF3

Hello,

 

 

we did an upgrade from Bigip LTM 9.3.0 HF3 to 10.0.1 HF3 and were using an irule we think was written by Bhattman (cmbhatt)... this one

 

 

http://devcentral.f5.com/wiki/default.aspx/iRules/Pool__Member__Status__Page_on_a__Virtual__Server_v10.html

 

 

The previous version was one of the winner in the irule contest and worked fine for us.

 

 

Now in version 10.x.x some things and commands are different and so we took your new version of the irule.

 

But we get an error with it, something like that in /var/log/ltm

 

 

----

 

Nov 24 13:36:05 local/tmm err tmm[2365]: 01220001:3: TCL error: bigip-poolstatus - can't read "addr": no such variable while executing "append response " >INVALID [string tolower $poolname]$addr$port$f..." ("foreach" body line 36) invoked from wi

 

thin "foreach { selectedpool } $::pool_member_status_list { if { [catch { scan [split [getfield $se..." invoked from w

 

ithin "if { [HTTP::uri] eq "/_itools/lbstatus" } { set response "itools kl-lbstatus - \ [clock format [cl..."

 

----

 

 

hope someone can help us with that.

 

Thank you

 

 

t.mantel

10 Replies

  • Hi t.mantel,

     

     

    Replacing $::pool_member_status_list with [class get pool_member_status_list] should do the trick.

     

     

     

    Bhattman
  • Hi Bhattman,

     

     

    thank you for advise and help. I've updated the irule at both units and checked our according cron entry.

     

    Everything seems to work fine now, so replacing $::pool_member_status_list with [class get pool_member_status_list] was helpfull.

     

     

    have a nice day.

     

     

    best regards,

     

     

    Toby

     

     

    t.mantel
  • DB's avatar
    DB
    Icon for Nimbostratus rankNimbostratus
    Maybe Bhattman can help with this adaptation: in my world my developers love this view but pool names don't mean much to them, virtual server names do. Can you point me in the right direction to be able to add a higher level of information to the output to include Virtual Server names too, as in:

     

     

    Virtual_abc --- UP -- Pool_node_1 -- 10.10.10.10 -- 80

     

    Virtual_abc --- DOWN -- Pool_node_2 -- 10.10.10.11 -- 80

     

    Virtual_xyz --- UP -- Pool_node_1 -- 10.20.20.20 -- 80

     

    etc.

     

     

    I've been grasping for straws, looking for a way to issue a bigpipe command from within the iRule to assocate pool names to each pool name that gets parsed out in your most excellent script. If I could, I'd also try to add some simple statistics (like current connection counts found in "b virtual all").
  • Hi DB,

     

    I have been thinking about that for sometime now, as one of my clients asked about this. I figure I would need to build a iControl script that would output the information I need to run the pool status. I just haven't sat down and wrote it yet.

     

     

    Bhattman
  • Seems like it might be easier to give them readonly access to the GUI and have them use the network map and/or stats pages. Or if you want to customise it you could use iControl like this and add the connection info:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iControl/codeshare

     

     

    PerlLocalTrafficMap - This application will replicate the network map functionality found in the BIG-IP management GUI with a perl console application.

     

     

    PsLocalTrafficMap - This application will replicate the network map functionality found in the BIG-IP management GUI with a PowerShell console implementation.

     

     

    Aaron
  • Hi Folks,

     

     

    we solved this by using a local file where we store nodenames like the /etc/hosts at unix/linux systems, and source this file within the irule

     

     

    set nodelist [class get node_screen_name_list]

     

     

    have a nice day

     

     

    Toby
  • Hi Toby,

     

    Is this local file manually updated or automatically updated when a VS and pool is added?

     

     

    Thanks,

     

    Bhattman

     

  • Hi,

     

     

    we do updates to this files manually because usally our nodes and hostnames don't change very often.

     

    we did a grep for some services like dns which we want to monitor ... code is from a internal developer ...

     

     

    We got a cronjob at /etc/cron.daily which does ...

     

     

    -----------------------------

     

     

    !/bin/bash

     

     

    LOG=/tmp/cron_pool.$$.log

     

    failoverstatus und syncstatus bestimmen

     

    folgender befehl sollte entweder standby oder active liefern

     

    STATE=`b failover show | awk '{print $2}'`

     

    folgender befehl liefert eine '0' wenn im SYNC oder 1,2 oder 3 wenn nicht im Sync

     

    SYNC_VORHER=`b config sync show | grep Status | awk '{print $2}'`

     

     

    if [ "$STATE" = "active" ]; then

     

    erzeugen der neuen Listen

     

    echo "Erzeuge vorlaeufige Pool- und Node-Liste" >> $LOG

     

    b pool all member all -n | grep -i " ACTIVE" |egrep ":25|:80|:110|:53|:995|:7210" | awk '{print "\""$3"\","}' | sort >/var/class/pool_member_status_list.class.tmp

     

    b node all screen | awk '{print "\"" $2 "/" $6 "\","}' > /var/class/node_screen_name_list.class.tmp

     

     

    CHK='gleich'

     

    achtung diff liefert exitcode 0 bei gleichheit

     

    if ! diff /var/class/pool_member_status_list.class.tmp /var/class/pool_member_status_list.class >> $LOG ; then

     

    CHK='pool'

     

    elif ! diff /var/class/node_screen_name_list.class.tmp /var/class/node_screen_name_list.class >> $LOG ; then

     

    CHK='node'

     

    fi

     

    if [ $CHK = 'gleich' ]; then

     

    echo "keine Aenderungen, nix zu tun [$CHK]" >> $LOG

     

    else

     

    echo "Es gibt Aenderungen [$CHK]" >> $LOG

     

    mv /var/class/pool_member_status_list.class.tmp /var/class/pool_member_status_list.class 2>>$LOG >>$LOG

     

    mv /var/class/node_screen_name_list.class.tmp /var/class/node_screen_name_list.class 2>>$LOG >>$LOG

     

    in jedem Fall laden, denn ich bin ja auf dem aktiven System

     

    echo "Lade neue Config" >> $LOG

     

    b load 2>>$LOG >>$LOG

     

     

    wenn die Config auf der aktiven Maschine geaendert wurde

     

    auf den Peer syncen. Der Sync transferriert auch die

     

    gerade neue erzeugten class-Files

     

    ABER nur, wenn vorher gesynct war

     

    if [ "$SYNC_VORHER" = "0" ]; then

     

    echo "synce $SYNC_VORHER" >> $LOG

     

    b config sync all 2>>$LOG >>$LOG

     

    fi

     

    fi

     

    else

     

    echo "ich bin standby -> Listen werden nur auf aktivem erzeugt und dann gesynct" >> $LOG

     

    fi

     

    exit 0

     

     

    ---------------------------

     

     

    and the class file looks like

     

     

    /var/class/pool_member_status_list.class

     

     

    "admin_A/192.168.10.100:53",

     

    "admin_B/192.168.10.112:53"

     

     

    the /var/class/node_screen_name_list.class

     

     

    "192.168.10.100/none",

     

    "192.168.10.112/none"

     

     

     

    Toby