Forum Discussion
Wade_98751
Nimbostratus
Aug 15, 2008Having .initialize issues
Good morning,
Need some assistance initializing (objIControl.initialize) as it fails to return true. I downloaded the iControlAssembly and ran the testclient which also returns the err...
Wade_98751
Nimbostratus
Sep 24, 2008Thanks Joe. Yes, i had something confused initially.
The iRule is working nicely now. Do you know a while loop i could use to check the session to know when they're connections are bled off the node? I've seen the logic in the iControls but I'm not sure the objects are available to iRules.
Thank you,
Wade
Here is some working logic others could use:
**the string trimming may not have been necessary
URI to control the iRule
https://172.1.1.2/drainserver?ip=172.20.1.1&port=80&poolname=WadesPool&prioritystatus=active&
iRule:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/drainserver"} {
set strSvrIP [string trim [findstr [HTTP::query] "ip=" 3 &]]
set strPort [string trim [findstr [HTTP::query] "port=" 5 &]]
set strPoolName [findstr [HTTP::query] "poolname=" 9 &]
set strPoolName [string trim [findstr [HTTP::query] "poolname=" 9 &]]
set strPriorityStatus [string trim [findstr [HTTP::query] "prioritystatus=" 15 &]]
if { $strPriorityStatus == "active" } {
LB::up pool "$strPoolName" "member" "$strSvrIP" "$strPort"
} elseif { $strPriorityStatus == "inactive"} {
LB::down pool "$strPoolName" "member" "$strSvrIP" "$strPort"
}
log "$strPoolName $strPort $strSvrIP was set to $strPriorityStatus by the server mainteance job on servernamehere"
HTTP::respond 200 content "Web Server Reboot Programmatic MaintenanceThank you. The $strPoolName pool member $strSvrIP was successfully set to $strPriorityStatus.
"
}
}
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
