Alex_Chow_3394
Oct 29, 2007Nimbostratus
Perl unable to print String[] - get_monitor_association
Hi.
I am trying to use get_monitor_association() to query monitors of a server.
monitor_rule has structure of:
- type:MonitorRuleType(An indicator of how to deal/interpret with the list of monitors in monitor_templates.)
- quorum:long(A value to be used when type is MONITOR_RULE_TYPE_M_OF_N, i.e. this value is the M in M of N. This value is ignored for other rule types.)
- monitor_templates:String[](The list of monitors that constitute this monitor rule.)
However, the following Perl code is unable to retrieve the monitor_templates list.
Please kindly give advice.
Thanks in advance.
Alex
$soapResponse = $NodeAddress->get_monitor_association
(
SOAP::Data->name(server_names => [$sServerName]),
);
&checkResponse($soapResponse);
my @MonitorAssociationList = @{$soapResponse->result};
foreach $MonitorAssociation (@MonitorAssociationList)
{
print $MonitorAssociation ->{'server_name'} . "\n";
$monitorRule = $MonitorAssociation -> {'monitor_rule'};
print $monitorRule -> {'type'} . "\n";
Okay so far for the above
**** Unable to show result for followings ****
@MonitorTemplatesList = $monitorRule -> {'monitor_templates'};
print "$MonitorTemplatesList[0]\n";
print "@MonitorTemplatesList \n";
}