Forum Discussion
Error creating an ltm monitor template on an F5 Loadbalancer BigIP 11.x device using the iControl Java API call: LocalLB__Monitor__create_template
- Sep 18, 2014
Try setting the IP address to 0.0.0.0 instead of * when creating the CommonIPPortDefinition.
Ok, I figured it out while learning a few things along the way.
Firstly, to anyone else having this issue creating ltm monitors, please check out this great resource for information on each specific monitor template type and their various settings. It's exremely useful: big-ip ltm monitors reference
So, what I figured out was that a) the XUI interface (https:///xui/) does some checking that the API does not, namely the com.f5.form.IPHostValidator! This does not allow one to modify the Host IP Address to something like ":" through the F5 device's XUI, however, the API does allow this.
So why wasn't my code working? Well, the assumption I made was that the CommonIPPortDefinition was the same as the Host IP Address field for this Monitor. I was wrong. I am not sure why this sin't the case and if someone would like to enlighten me, then please do. (I suspect that it might be used for other monitor templates)
So Jonathan, you are correct, I must set the ip portion to "0.0.0.0"...
CommonIPPortDefinition ipPort = new CommonIPPortDefinition("0.0.0.0", 0);
...BUT then I must make an additional call to set_template_string_property method in the LocalLBMonitorBindingStub class to set the Host IP Address!
public void set_template_string_property(java.lang.String[] template_names,
LocalLBMonitorStringValue[] values) throws java.rmi.RemoteException
For example (please excuse the messy code):
LocalLBMonitorStringValue lbStringValue = new LocalLBMonitorStringValue(
LocalLBMonitorStrPropertyType.STYPE_DIAMETER_HOST_IP_ADDRESS,"*:*");
LocalLBMonitorStringValue[] lbStringValueArray = new LocalLBMonitorStringValue[1];
lbStringValueArray[0] = lbStringValue;
localLBMonitorBindingStub.set_template_string_property(template_names, lbStringValueArray);
//template_names is a simple String[] array with the name of the template in it.
More info here: LocalLB::Monitor::set_template_string_property
Also, there are a number of calls that need to be made when making a monitor depending on whether you specify predefined strings, integer or user defined strings properties in the template e.g. set_template_string_property, set_template_integer_property or set_template_user_defined_property
Thanks for your help.
- Spidey_27_16399Sep 19, 2014NimbostratusI also realised that the Host IP Address cannot be *:*, it makes no sense, you can't have one device with every IP address on every port. So this makes sense that the com.f5.form.IPHostValidator would reject it. :-/
Recent Discussions
Related Content
* 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