Fujitsu ETERNUS Probe Action Module Flexible Tier Sub Pool Script

Fujitsu.Storage.ETERNUS.ProbeActionModule.FTSPScript (ProbeActionModuleType)

Element properties:

TypeProbeActionModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
ProbeScript ProbeAction Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe Default

Source Code:

<ProbeActionModuleType ID="Fujitsu.Storage.ETERNUS.ProbeActionModule.FTSPScript" Accessibility="Public" Batching="false" PassThrough="false">
<Configuration/>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<ProbeAction ID="ProbeScript" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe">
<ScriptName>FTSPScript.ps1</ScriptName>
<ScriptBody><Script>

write-eventLog -LogName ETERNUS -Message "FTSP DS" -Source Cs -id 214

$api = new-object -comObject 'MOM.ScriptAPI'
Add-PSSnapin Get-FTSPList
$FTSPs = Get-FTSPList
$FTSPCount = $FTSPs.Length

for($i = 0; $i -lt $FTSPCount; $i++)
{

$bag = $api.CreatePropertyBag()
$bag.AddValue('FTSPName',$FTSPs[$i].ObjectName)
if($FTSPs[$i].State.Equals('Exposed'))
{
$bag.AddValue('Result','Warning')
}
elseif($FTSPs[$i].State.Equals("Blockade") -or $FTSPs[$i].State.Equals("No Disk Path") -or $FTSPs[$i].State.Equals("Broken") -or $FTSPs[$i].State.Equals("Data Lost"))
{
$bag.AddValue('Result','Error')
}
else
{
$bag.AddValue('Result','Normal')
}
$bag.AddValue('State',$FTSPs[$i].State)
$bag

}
</Script></ScriptBody>
<TimeoutSeconds>90</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="ProbeScript"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
<TriggerOnly>true</TriggerOnly>
</ProbeActionModuleType>