Hello,
I’m having problems with the NodeAddressV2:set_monitor_rule Ruby API. I’m trying to add a basic monitor rule to a node however, always fail with a restriction error no matter what I set in the “monitor_rule” parameter. Has anyone successfully set a monitor using this API? If so, can you post the code?
Code Snippet:
Add icmp monitor if it doesn’t already exist
unless “{rule[0][‘monitor_templates’]}”.include? ‘/Common/icmp’
bigip[‘LocalLB.NodeAddressV2’].set_monitor_rule([ node_name ], [“monitor_rule” => {“type” => “MONITOR_RULE_TYPE_SINGLE”, “quorum” => 0, “monitor_templates” => “/Common/icmp”}])
puts ‘Added ICMP monitor to "’ + node_name + ‘"…’
end
Failure:
/usr/lib/ruby/1.8/wsdl/xmlSchema/simpleType.rb:66:in `check_restriction’: {urn:iControl}LocalLB.MonitorRuleType: cannot accept ‘’ (XSD::ValueSpaceError)
from /usr/lib/ruby/1.8/wsdl/xmlSchema/simpleType.rb:23:in `check_lexical_format’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:125:in `simpleobj2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:118:in `obj2typesoap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:44:in `obj2soap’
from /usr/lib/ruby/1.8/soap/mapping/mapping.rb:131:in `_obj2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:210:in `elements2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:206:in `each’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:206:in `elements2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:167:in `struct2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:134:in `complexobj2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:120:in `obj2typesoap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:44:in `obj2soap’
from /usr/lib/ruby/1.8/soap/mapping/mapping.rb:131:in `_obj2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:179:in `array2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:178:in `each’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:178:in `array2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:136:in `complexobj2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:120:in `obj2typesoap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:44:in `obj2soap’
from /usr/lib/ruby/1.8/soap/mapping/mapping.rb:131:in `_obj2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:210:in `elements2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:206:in `each’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:206:in `elements2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:167:in `struct2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:134:in `complexobj2soap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:120:in `obj2typesoap’
from /usr/lib/ruby/1.8/soap/mapping/wsdlencodedregistry.rb:44:in `obj2soap’
from /usr/lib/ruby/1.8/soap/mapping/mapping.rb:131:in `_obj2soap’
from /usr/lib/ruby/1.8/soap/mapping/mapping.rb:48:in `obj2soap’
from /usr/lib/ruby/1.8/soap/mapping/mapping.rb:371:in `protect_threadvars’
from /usr/lib/ruby/1.8/soap/mapping/mapping.rb:43:in `obj2soap’
from /usr/lib/ruby/1.8/soap/rpc/proxy.rb:394:in `request_rpc_enc’
from /usr/lib/ruby/1.8/soap/rpc/proxy.rb:376:in `request_rpc’
from /usr/lib/ruby/1.8/soap/rpc/proxy.rb:338:in `request_body’
from /usr/lib/ruby/1.8/soap/rpc/proxy.rb:123:in `call’
from /usr/lib/ruby/1.8/soap/rpc/driver.rb:178:in `call’
from (eval):6:in `set_monitor_rule’
from ./f5-node-initiator-v1:105
Thanks in advance.
Br,
Darrell G.