Forum Discussion

rogerwelin_1426's avatar
rogerwelin_1426
Icon for Nimbostratus rankNimbostratus
Mar 25, 2014

icontrol api, when creating monitor I cannot set Alias Address to * All Addresses

Hi,

 

I'm using iControl Soap api, version 11.4, and I have written a script that creates virutual server, pool with nodes and health monitor.

 

When creating the monitor I want to set the configuration like this: Alias Address * All Addresses Alias Service Port * All Ports

 

But I'm not able to do that. I have to set these to settings to a specific ip and port, otherwise I'm running into an exception. I've tried to set these to wildcard or leaving them empty but to no success.

 

The relevant code looks like this:

 

def create_monitor_for_pool(monitor_name, vip, pool_name, send_string)

 

begin
  bigip["LocalLB.Monitor"].create_template([{"template_name" => monitor_name, "template_type" => "TTYPE_HTTP"}],[{"parent_template" => "http_head_f5", "interval" => 5, "timeout" => 8, 
                                         "dest_ipport" => {"address_type" => "ATYPE_STAR_ADDRESS", "ipport" => {"address" => vip, "port" => 80}}, "is_read_only" => "false", "is_directly_usable" => "true"}])

  bigip["LocalLB.Monitor"].set_template_string_property([monitor_name], [{"type" => "STYPE_SEND", "value" => "HEAD /{send_string}/ping HTTP/1.0\\r\\n\\r\\n"}])
  bigip["LocalLB.Monitor"].set_template_string_property([monitor_name], [{"type" => "STYPE_RECEIVE", "value" => "HTTP/1\.(0|1) 200 OK"}])    
  bigip["LocalLB.Monitor"].set_template_integer_property([monitor_name],[{"type" => "ITYPE_UP_INTERVAL", "value" => 2}])
  bigip["LocalLB.Monitor"].set_template_integer_property([monitor_name],[{"type" => "ITYPE_TIME_UNTIL_UP", "value" => 30}])
  bigip["LocalLB.Monitor"].set_template_integer_property([monitor_name],[{"type" => "ITYPE_TIMEOUT", "value" => 8}])

  bigip["LocalLB.Pool"].set_monitor_association(["pool_name" => pool_name, "monitor_rule" => {"type" => "MONITOR_RULE_TYPE_AND_LIST", "quorum" => 0, "monitor_templates" => [monitor_name]}])
rescue StandardError => e
  raise "Exception in creating monitor: {e.message}"
end

end

 

it's this line that gives me headache: "ipport" => {"address" => vip, "port" => 80}

 

Anyone who knows how to achieve this?

 

Best regards, Roger

 

  • Ok, I figured it out.

     

    The correct code for my problem is:

     

      bigip["LocalLB.Monitor"].create_template([{"template_name" => monitor_name, "template_type" => "TTYPE_HTTP"}],[{"parent_template" => "http_head_f5", "interval" => 5, "timeout" => 8, "dest_ipport" => {"address_type" => "ATYPE_STAR_ADDRESS_STAR_PORT",  "ipport" => {"address" => "0.0.0.0", "port" => 0}}, "is_read_only" => "false", "is_directly_usable" => "true"}])