Forum Discussion
Prasad_81758
Feb 10, 2011Nimbostratus
How to Set Health Monitor on a Pool using iControl Java
I am able to create a pool using the iControl java api. However, I am not able to set any health monitors on the pool. Here is thecode:
LocalLBPoolMemberMemberMonitorAssociation[][] ma = poolMember.get_monitor_association(pn);
LocalLBPoolMemberMemberMonitorAssociation[][] newma = new LocalLBPoolMemberMemberMonitorAssociation[1][hostList.size()];
for (int j = 0; j < ma.length; j++)
{
for (int k = 0; k < ma[j].length; k++)
{
LocalLBMonitorIPPort ipp = new LocalLBMonitorIPPort();
ipp = (ma[j][k].getMember()); LocalLBMonitorRule mr = new LocalLBMonitorRule();
String[] mt = {"tcp"}; //Also tried iControl.LocalLBMonitorTemplateType.TTYPE_TCP.getValue()
mr.setMonitor_templates(mt);
mr.setType(LocalLBMonitorRuleType.MONITOR_RULE_TYPE_SINGLE);
newma[j][k] = new LocalLBPoolMemberMemberMonitorAssociation(); newma[j][k].setMember(ipp); newma[j][k].setMonitor_rule(mr);
}
}
poolMember.set_monitor_association(pn, newma);
Thanks for your help.
- Prasad_81758NimbostratusPlease ignore. Found what I was doing wrong. Resolved now.
- Aditya_01_13899NimbostratusHi Prasad, What was it that you were doing wrong please let me know even I have run into the same problem. Thanks
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