Forum Discussion

jiseruk_43901's avatar
jiseruk_43901
Icon for Nimbostratus rankNimbostratus
Feb 19, 2015

Encoding problem in LocalLB.Monitor.set_template_string_property

I'm trying to set up the monitor send_string attribute from python and bigsuds with a call like this: bigip.LocalLB.Monitor.set_template_string_property(["monitor"],[{"type": "STYPE_SEND", "value": "GET /ping HTTP/1.1\r\n\r\n"}, {"type": "STYPE_RECEIVE", "value": "pong"}])

 

But I'm getting the error: ServerError: Server raised fault: 'Exception caught in LocalLB::urn:iControl:LocalLB/Monitor::set_template_string_property() Exception: Common::OperationFailed primary_error_code : 17237600 (0x01070660) secondary_error_code : 0 error_string : 01070660:3: Monitor /test/child parameter contains non-printable char with value 10.'

 

Then I tried encoding the STYPE_SEND value: self.session.LocalLB.Monitor.set_template_string_property([monitor],[{"type": "STYPE_SEND", "value": "GET /ping HTTP/1.1\r\n\r\n".encode("string-escape")},{"type": "STYPE_RECEIVE", "value": "pong"}])

 

and now I don`t get an error, but the change is not applied.

 

And finally, I double encoded the string, and it almost worked: self.session.LocalLB.Monitor.set_template_string_property([monitor],[{"type": "STYPE_SEND", "value": "GET /ping HTTP/1.1\r\n\r\n".encode("string-escape").encode("string-escape")},{"type": "STYPE_RECEIVE", "value": "pong"}])

 

But, when I see the monitor, the send string looks like this: GET /ping HTTP/1.0\r\n\r\n when it should look like this: GET /ping HTTP/1.0\r\n\r\n

 

How can I do this to get the expected result?

 

Thanks!

 

1 Reply

  • I don't see the difference between the last two strings you list??? All I see is that it's HTTP/1.0 instead of HTTP/1.1. Is this a typo?