Forum Discussion
tarsier_90410
Nimbostratus
Aug 25, 2009way to list pools?
I am trying to find a way for an irule (9.x LTM) to query for a list of all pools on the system, but so far have not found a way to do so. Is this possible?
62 Replies
- David_Larsen
Employee
All the cronjob does is create a list of the pool names. The web page and rss feed you get are real time status of the members of the pools in the list of pool names. So unless you are creating and deleting pools constantly then the list is accurate. If you are doing a bunch of pool creation or deletion then you can rerun the script manually and it will update the list of pools for you and then the data will still be up to date. - Rupa_34586
Nimbostratus
i used the irule and is not working for me. I am getting page cannot be displayed.
Following are the logs.
Jan 11 07:53:45 local/tmm info tmm[7772]: Rule poolstatus : The following contents for class POOL Member Status is: pool_member_status_list
Jan 11 07:53:45 local/tmm err tmm[7772]: 01220001:3: TCL error: poolstatus - can't read "addr": no such variable while executing "append response "INVALID[string tolower $poolname]$addr$port"" ("foreach" body line 25) invoked from within "foreach { selectedpool } $::pool_member_status_list { if { [catch { scan [split [getfield $se..."
not sure where i am going wrong.Could you please help me - Rupa_34586
Nimbostratus
Below is the content of the pool_member_status_list.class file
"ISIDICL01/10.17.6.117:80",
"ISIDICL02/10.17.6.170:9080",
"ISIDICL03/10.17.6.85:9080",
"p_401Kag-dit.nj.adp.com/10.19.46.56:80",
"p_ADP4ME-fit.nj.adp.com/10.25.22.187:80" - The_Bhattman
Nimbostratus
I believe the "," is what's causing the problem. You need to have that removed from the class file.
Are you using:b pool all member all | grep pool_ | awk '{print "\""$3"\""}' | sort >/var/class/pool_member_status_list.class
Bhattman - Rupa_34586
Nimbostratus
my .class looks like this
"p_freedom_ditservicecentre.adpfreedom.com/10.15.81.94:80",
"p_impact1/10.5.131.64:80",
"p_impact1/10.5.131.72:80",
"p_impact2/10.1.177.220:80",
I removed some of the pools from the .class file.But there are still in F5 device, I just editd the .class file.
And my irule is
foreach { selectedpool } {class get pool_member_status_list} {
log local0. " $selectedpool "
scan [split [getfield $selectedpool " " 1] "/"] %s%s poolname addrport
scan [split $addrport ":"] %s%d addr port
switch -glob [LB::status pool $poolname member $addr $port] {
"up" {
append response "UP\
[string tolower $poolname]$addr$port"
}
"down" {
append response "DOWN\
[string tolower $poolname]$addr$port"
}
In the logs for log local0. " $selectedpool "
i see logs as
Jan 12 07:08:13 local/tmm1 info tmm1[7773]: Rule poolstatus : p_freedom.ditportal.adpfreedom.com/10.15.81.90:http {}
Jan 12 07:08:13 local/tmm1 info tmm1[7773]: Rule poolstatus : p_freedom_ditess.adpfreedom.com/10.15.81.93:http {}
Jan 12 07:08:13 local/tmm1 info tmm1[7773]: Rule poolstatus : p_freedom_ditmain.adpfreedom.com/10.15.81.92:http {}
Jan 12 07:08:13 local/tmm1 info tmm1[7773]: Rule poolstatus : p_freedom_ditmain2.adpfreedom.com/10.15.81.92:http {}
Jan 12 07:08:13 local/tmm1 info tmm1[7773]: Rule poolstatus : p_freedom_ditservicecentre.adpfreedom.com/10.15.81.94:http {}
Jan 12 07:08:13 local/tmm1 info tmm1[7773]: Rule poolstatus : p_impact1/10.5.131.64:http {}
Jan 12 07:08:13 local/tmm1 info tmm1[7773]: Rule poolstatus : p_impact1/10.5.131.72:http {}
Jan 12 07:08:13 local/tmm1 info tmm1[7773]: Rule poolstatus : p_impact2/10.1.177.220:http {}
Jan 12 07:08:13 local/tmm1 info tmm1[7773]: Rule poolstatus : p_impact2/10.5.131.73:http {}
And the list follows, prints all the pools in F5 device.
I do not understand eventhough we have edited the .class file.why is looking for all the pools. I hope it should look for only the pools in .class file.
From where is it looking the pools? - Rupa_34586
Nimbostratus
for log entry
log local0."$::pool_member_status_list"
i am getting
Jan 12 07:49:30 local/tmm info tmm[7772]: Rule poolstatus : pool_member_status_list - Rupa_34586
Nimbostratus
I did some debugging and found a cause but not sure fo the solution
whenever I change the pool_member_status_list.class file, i need to update the datagroup as well.Then only the changes in .class files are picking up by the irule.
what could be the problem? - The_Bhattman
Nimbostratus
when you updated the pool_member_status_list.class you need to a 'b load' so it can be loaded up into memory.
Bhattman - Rupa_34586
Nimbostratus
Yeah, i figured it out at last.I am forgetting b load.
Thanks a lot - The_Bhattman
Nimbostratus
No problem
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
