Forum Discussion

johns_45949's avatar
johns_45949
Icon for Nimbostratus rankNimbostratus
Nov 11, 2009

Scripting some basic admin

Hi all

 

I am trying to find out how I can script some basic admin tasks that we do almost daily. I am not a developer so I was hoping that something like BigPipe would be my answer. I am struggling to get the syntax to do what I need though. I believe I use an LTM on version 9.3??

 

 

I have 8 webservers. Each server has 5 different IP addresses. I have 5 different pools. One IP adress from each server belongs to each pool.

 

 

In order to speed up my release process, I would like to run a script that puts 4 of the servers into {Forced Offline (Only active connections allowed)] state for all of the pools they belong to so that I can release to them without impacting live trafic.

 

 

I would then like to add them back, and remove/disable the other 4 servers.

 

 

Lastly id like to add the last 4 servers back to their respective pools.

 

 

Any ideas on how I can script this?

 

 

Many tanks

 

5 Replies

  • Hi John,

     

     

    You can use 'b node 1.1.1.1 down' to set 1.1.1.1 to forced offline. You can reset the stats for a node by running 'b node 1.1.1.1 stats reset' and then check for active connections using 'b node 1.1.1.1 stats' and check the "cur" total.

     

     

    To set the node to disabled (Only persistent or active connections allowed), you can use 'b node 1.1.1.1 session disable/enable'.

     

     

    Aaron
  • Thanks Aaron

     

     

    It looks like the way forward is to create a few bash scripts using these commands. Ive tested a few simple ones and it seems to work very well. Many thanks for your help!

     

     

  • If you end up putting something together, can you reply here with the script? It would make a nice addition to the management codeshare section:

     

     

    Advanced Design and Config Codeshare

     

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

     

     

    Thanks,

     

    Aaron
  • Do you know if you can remove the active connections for a member of a specific pool? For example Pool ABC has a member 1.1.1.1:80 & Pool XYZ has a member 1.1.1.1:443 and I just want to remove the active sessions for Pool ABC, 1.1.1.1:80.

     

     

    Thanks!
  • I don't think you can differentiate between connections to an IP:port from one pool versus another if the pool member IP:port is the same in two pools. The 'b conn all show all' output doesn't have any detail on the pool.

     

     

    If your pool members are on different ports, this should work for you:

     

     

    b conn ss server 1.1.1.1:80 delete

     

     

    I assume the ss indicates serverside.

     

     

    Aaron