Forum Discussion

Martin_Smith_58's avatar
Martin_Smith_58
Icon for Nimbostratus rankNimbostratus
Jul 05, 2013

Problem creating a monitor with a wildcart port and IP using bigsuds

Hi all,

 

 

I'm trying to use the bigsuds library in Python to create a monitor, but I can't get the LTM to accept a wildcard IP address and port... it wants a string and a long, and an empty string and 0 don't work. How to do I replicate the tmsh dump below using bigsuds, if it keeps wanting a real IP and port?

 

 

This is my tmsh dump of it:

 

 

ltm monitor http shib-test-http-monitor { 
    defaults-from /Common/http  
    destination *:*   
    interval 5  
    recv "OK"  
    send "GET /foo\\r\\n"  
    time-until-up 0   
    timeout 16 
 }

 

Here's the code I'm using:

 

 

   mtemplates = [{'template_name' : clean_monitor_name, 'template_type' : 'TTYPE_HTTP'}]  shouldn't need template_type if we specify a parent
    mattributes = [{
                    'parent_template' : 'http',
                    'interval': 5,
                    'timeout': 16,
                    'dest_ipport': {'address_type': 'ATYPE_STAR_ADDRESS_STAR_PORT', 'ipport': {'address':None, 'port': "0"}},
                    'is_read_only': False,
                    'is_directly_usable': True,
    }]
    
    
    print "Creating monitor " + str(mtemplates) + " with attributes " + str(mattributes)
    lb.Monitor.create_template(mtemplates,mattributes)

 

Unfortunately, I'm getting this back:

 

 

bigsuds.ServerError: Server raised fault: 'Exception caught in LocalLB::urn:iControl:LocalLB/Monitor::create_template()
Exception: Common::OperationFailed
    primary_error_code   : 16908320 (0x01020020)
    secondary_error_code : 0
    error_string         : 01020020:3: The text string cannot be converted to an IP address.'

 

 

  • Update -- I found an example that works in the OpenStack wrappers around PyControl:

    
            attrs.dest_ipport.address_type = type.ATYPE_STAR_ADDRESS_STAR_PORT
            attrs.dest_ipport.ipport.address = '0.0.0.0'
            attrs.dest_ipport.ipport.port = 0