Fujitsu ETERNUS Probe Action Module FTRP Script

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

Element properties:

TypeProbeActionModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

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

Source Code:

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

write-eventLog -LogName ETERNUS -Message "FTRP DS" -Source Cs -id 212

$api = new-object -comObject 'MOM.ScriptAPI'

Add-PSSnapin Get-FTRPList
$ftrps = Get-FTRPList
$ftrpPCount = $ftrps.Length

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

$bag = $api.CreatePropertyBag()
$bag.AddValue('FTRPName',$ftrps[$i].ObjectName)

$Result = 'Normal'
if($ftrps[$i].State.Equals('Exposed'))
{
$Result = 'Warning'
}
elseif($ftrps[$i].State.Equals("Blockade") -or $ftrps[$i].State.Equals("No Disk Path") -or $ftrps[$i].State.Equals("Broken") -or $ftrps[$i].State.Equals("Data Lost"))
{
$Result = 'Error'
}

if($Result.Equals("Normal") -and $ftrps[$i].AlarmState.Equals("Caution"))
{
$Result = 'Warning'
}

if($Result.Equals("Normal") -and $ftrps[$i].AlarmState.Equals("Warning"))
{
$Result = 'Error'
}

if($Result.Equals("Warning") -and $ftrps[$i].AlarmState.Equals("Warning"))
{
$Result = 'Error'
}

$bag.AddValue('Result',$Result)
$bag.AddValue('State',$ftrps[$i].State)
$bag.AddValue('AlarmState',$ftrps[$i].AlarmState)
$bag

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