Storage Array Failure Monitor DataSource Type

NetAppESeries.FailureMonitorDataSourceType (DataSourceModuleType)

The type that represents the script that interacts with the Storage Array and queries for any Recovery Failure Types that it is reporting.

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource System.CommandExecuterPropertyBagSource Default

Source Code:

<DataSourceModuleType ID="NetAppESeries.FailureMonitorDataSourceType" Accessibility="Public" Batching="false">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="TimeoutSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="Trace" type="xsd:integer"/>
</Configuration>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="System!System.CommandExecuterPropertyBagSource">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<ApplicationName>%windir%\system32\windowspowershell\v1.0\powershell.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>-ExecutionPolicy RemoteSigned -Command "&amp;{.\NetAppESeriesMonitor.ps1 $Config/Trace$}"</CommandLine>
<SecureInput/>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>NetAppESeriesMonitor.ps1</Name>
<Contents><Script>param([Boolean]$Trace)

$scriptName = "NetAppESeriesMonitor.ps1"
$E_LVL_ERROR = 2
$E_LVL_WARNING = 1
$E_LVL_INFO = 0
$E_NBR_TRACEM = 3701
$SnapinName = (Get-ItemProperty HKLM:\Software\NetApp\MP PSSnapinName).PSSnapinName

$api= New-Object -ComObject 'MOM.ScriptAPI'

if ( $Trace )
{
$api.LogScriptEvent($ScriptName, $E_NBR_TRACEM, $E_LVL_INFO, 'monitoring begun')
}

if ( (Get-PSSnapin -Name $SnapinName -ErrorAction SilentlyContinue) -eq $null )
{
Add-PsSnapin $SnapinName
}

# Get Disk System Data
$DSCredentials = @(Get-SDCredential -All)
foreach ($cxn in $DSCredentials)
{

$DS = Get-StorageDevice -Credentials $cxn

$log=Get-SDMaintenanceLog -Credentials $cxn

# Check for unreachable array
if ($log -eq $null)
{
$bag= $api.CreatePropertyBag()
$bag.addValue("SSGUID",$DS.WWN)
$bag.addValue("FailureID", 9999)
$bag.addValue("State","Bad")
$bag.addValue("FailureDescription", "Storage Array is unreachable")
$api.addItem($bag)
continue
}

$failureTypeEntries = @($log.MaintenanceLogEntries)
foreach ($failureType in $failureTypeEntries)
{
$bag= $api.CreatePropertyBag()
$bag.addValue("SSGUID",$DS.WWN)
$bag.addValue("FailureID", $failureType.FailureID)
if ( $failureType.FailurePresent )
{
$bag.addValue("State","Bad")
$bag.addValue("FailureDescription", $failureType.FailureDescription)
if ( $Trace )
{
$api.LogScriptEvent($ScriptName, $E_NBR_TRACEM, $E_LVL_INFO, 'Failure found:'+$DS.FriendlyName+' '+$failureType.FailureDescription)
}
}
else
{
$bag.addValue("State","Good")
$bag.addValue("FailureDescription", "")
}
$api.addItem($bag)
}
}
# Send all property bags to the output pipeline.
$api.returnItems()</Script></Contents>
<Unicode>true</Unicode>
</File>
</Files>
</DataSource>
</MemberModules>
<Composition>
<Node ID="DS"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>