Forum Discussion
problem with locallb.monitor.set_template_user_defined_string_property()
I am using Python trying to call LocalLB.Monitor.set_template_user_defined_string_property() to set a user defined string:
def _shared_updates_template_user_defined_string_property(self, template_name, attr, val):
udsv = self.monitor.typefactory.create('LocalLB.Monitor.UserDefinedStringValue')
udsv.name = attr
udsv.value = val
self.monitor.set_template_user_defined_string_property([template_name], [udsv])
The (truncated) traceback:
NotFoundError: Server raised fault: 'Exception caught in LocalLB::urn:iControl:LocalLB/Monitor::set_template_user_defined_string_property()
Exception: Common::OperationFailed
primary_error_code : 16908342 (0x01020036)
secondary_error_code : 0
error_string : 01020036:3: The requested monitor parameter (test_monitor_name 1 template_user_defined_string_property.user_string_1=) was not found.'
I can understand such a message when trying to get the user defined string, but not setting it.
Does the name of the user defined string need to begin with some specifc string?
I am able to successfully use the get_ and set_template_string_property() methods.
Thanks,
Kevin
5 Replies
- Kevin_Randolph1
Nimbostratus
It occurs to me that the monitor type (http) I used may not support user defined strings.
Is there a list of what monitor types support user defined strings, and what user defined strings are used for each?
-KR - Kevin_Randolph1
Nimbostratus
On a related matter, how do monitor template types such as SNMP DCA deal with variables?
I created a SNMP DCA type template, and set a few variable names var1 = 1, etc. Then I tried all the various get_template methods and did not see any indication of var1. How do I get such variables from a template? Are they stored in user defined strings? If so, what name is used? I tried doing a get of user defined string 'var1' but no joy.
- Kevin_Randolph1
Nimbostratus
Problem solved.
Monitor templates of type HTTP do not use user-defined strings.
Monitor templates like SNMP DCA do use user-defined strings to hold user-defined variables. I had been using incorrect code attempting to get them. - Kevin_Randolph1
Nimbostratus
I spoke too soon.
I was able to get the user-defined strings for a SNMP DCA template that was created via the GUI, and had some variables defined. The variables are stored as user-defined strings.
However, I am unable to set user-defined strings in such a monitor:udsv = self.monitor.typefactory.create('LocalLB.Monitor.UserDefinedStringValue') udsv.name = 'user_string_1' udsv.value = 'user_test_string_1' self.monitor.set_template_user_defined_string_property([template_name], [udsv]) --------- [...] NotFoundError: Server raised fault: 'Exception caught in LocalLB::urn:iControl:LocalLB/Monitor::set_template_user_defined_string_property() Exception: Common::OperationFailed primary_error_code : 16908342 (0x01020036) secondary_error_code : 0 error_string : 01020036:3: The requested monitor parameter (test_monitor_TTYPE_SNMP_DCA 1 user_string_1=) was not found.'- Christopher_Wo2
Altocumulus
I'm having the same issue in 2016/01 using perl and SOAP::Lite against 11.5.4.
 
There doesn't seem to be a way to do this in the REST API either, so I suppose we're doing these by the GUI for now?
 
https://devcentral.f5.com/s/feed/0D51T00006i7a8tSAA
 
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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