Forum Discussion
Jonathan_Scholi
Cirrostratus
Aug 23, 2011Add health monitor to pool using Java iControl
Are there any code examples of how to add a health monitor to a pool using a Java iControl?
John_Gruber_432
Aug 23, 2011Historic F5 Account
Using the axis wsdl2java classes.. I use the jar file downloaded from labs section of dev central. This is a code snippet that creates a single monitor on a LocalLB::Pool.
iControl.LocalLBPoolLocator
node_locator = new iControl.LocalLBPoolLocator();
iControl.LocalLBPoolBindingStub stub = (iControl.LocalLBPoolBindingStub) node_locator.getLocalLBPoolPort([BIGIPURL]);
String[] monitors = new String[1];
monitors[0] = monitor_name;
iControl.LocalLBMonitorRule rule = new iControl.LocalLBMonitorRule();
rule.setQuorum(0L);
rule.setType(iControl.LocalLBMonitorRuleType.MONITOR_RULE_TYPE_AND_LIST);
rule.setMonitor_templates(monitors);
iControl.LocalLBPoolMonitorAssociation[] monitor_associations = new iControl.LocalLBPoolMonitorAssociation[1];
monitor_associations[0] = new
iControl.LocalLBPoolMonitorAssociation();
monitor_associations[0].setMonitor_rule(rule);
monitor_associations[0].setPool_name(pool_name);
stub.set_monitor_association(monitor_associations);
You will want to see what monitor rule types are possible so you get what you want.
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