Forum Discussion
Anthony_Hatch_3
Mar 28, 2011Nimbostratus
I just realized something that I had completely missed before. I could probably cut out much of the code from the iRule by not using the switch statements to test against the result of the LB::status commands for each pool member. I hadn't noticed that the b pool all member all command actually gives the status of the pool member. So if I change up how the class file gets written when the cron job is run, I can get the pool name, pool member, service port, and status all at once and just use the iRule to parse the data out properly. An an example of the command to get the output would now look like:
b pool all member all | grep POOL | awk '{print "\""$3"\""" \:\= ""\""$4"\""","}' | sort
With the resulting output now in the format of:
"test_http-pool/172.20.75.151:http" := "active,up",
"test_http-pool/172.20.75.152:http" := "active,up",
"test_http-pool/172.20.75.153:http" := "active,up",
This solves the original issue of the keys having to all be unique and allows for a shorter iRule. I'll try and post the finished iRule once I have it completed.