Robbie_Wiley_78
Jan 29, 2015Nimbostratus
How do I read the send string for a monitor using powershell icontrol?
I have an (unknown) number of monitors that look at an asp page. I need to create an equivalent monitor for each of these that looks at the new htm page. My thought was to script this using powershell and icontrol. I want to look at all the send string on each monitor on an LTM, if the send string contains the name of the asp page, create a new monitor based on that monitor name referencing the new htm page.
But I can't seem to pull the send string off the monitor. I've googled around and i see examples for listing, adding and removing monitors - but not listing the details of a monitor.
I'm currently (failing) using the following:
$sv = New-Object -TypeName iControl.LocalLBMonitorStringValue
$sv.type = 'STYPE_SEND'
$monitorname = 'rollout'
$Control.locallbmonitor.get_template_user_defined_string_property(@($monitorname),@($sv.type))
I get the following error:
Exception calling "get_template_user_defined_string_property" with "2" argument(s): "Exception caught in
LocalLB::urn:iControl:LocalLB/Monitor::get_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 (rollout_HTTPS 1 STYPE_SEND=) was not found."
At line:1 char:89
+ ... lout_HTTPS"),@($sv.type))
+ ~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SoapHeaderException