Hi,Kevin can I use icontrol in sideband? I tried to reuse your code to get which monitor marks pool member down(REST api),it never gives me a formatted response and I can't find the exact url to get the monitor which marks pool member down
2 quick questions
1:how to format this response to a readable text?
2:I don't know which REST API url to get monitor which marks pool member down.if it is not achieveable in REST API,can I use icontrol in sideband send to get the info I want and how?
Here is the code I reused from your sample.
proc send_to_sideband { data } {
set sbserver [connect -protocol TCP -timeout 500 -idle 10 -status conn_status "ip:port"]
send -status send_status -timeout 500 $sbserver $data
return [recv -status recv_status -timeout 300 $sbserver]
}
when LB_FAILED {
set current_pool [string range [LB::server pool] 8 end]
set req "GET /mgmt/tm/ltm/pool/$current_pool/ HTTP/1.1\r\nHost: localhost\r\nAuthorization: xxxxxxxx\r\n\r\n"
set sb [call send_to_sideband $req]
HTTP::respond 200 content [subst -nobackslashes [ifile get f5_new_txt]]
}
This is piece of the $sb I got:
sb is HTTP/1.1 200 OK Date: 25 Apr 2015 02:40:14 UTC Server: com.f5.rest.common.RestRequestSender Set-Cookie: BIGIPAuthCookie=xxx; path=/; Secure; HttpOnly Set-Cookie: BIGIPAuthUsernameCookie=xx; path=/; Secure; HttpOnly X-Frame-Options: SAMEORIGIN Cache-Control: no-cache Content-Length: 630 Content-Type: application/json X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' Strict-Transport-Security: max-age=16070400; includeSubDomains {"kind":"tm:ltm:pool:members:memberscollectionstate","selfLink":"https://localhost/mgmt/tm/ltm/pool/XYZ/members?ver=11.5.1","items":
Have a nice day