Forum Discussion

MadhaviChinni_1's avatar
MadhaviChinni_1
Icon for Nimbostratus rankNimbostratus
Oct 14, 2014

How to append a monitor to existing monitors

Hi All,

 

I have created a monitor using below java code.But when I run this code all the existing monitors are removed and the monitor given in the code is added to the pool.Could anyone tell me how to append a new monitor to a pool.

 

String[] monitors = new String[1]; monitors[0] = "Test_Template1"; iControl.LocalLBMonitorRule rule = new iControl.LocalLBMonitorRule(); rule.setQuorum(0L); rule.setType(iControl.LocalLBMonitorRuleType.MONITOR_RULE_TYPE_SINGLE); 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(poolname); m_interfaces.getLocalLBPool().set_monitor_association(monitor_associations);

 

1 Reply

  • I guess you need first to do a get_monitor_association to retrieve the list of existing monitor associations and then you re add everything in you set_monitor_association.