HPE Storage Volume Unit Monitor Data Source

HewlettPackard.OneView.StorageVolumes.UnitMonitor.DS (DataSourceModuleType)

HPE Storage Volume Unit Monitor Data Source.

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityPublic
RunAsHewlettPackard.OneView.RunAsProfile
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource System.CommandExecuterPropertyBagSource Default

Overrideable Parameters:

IDParameterTypeSelector
Intervalint$Config/PeriodInSeconds$

Source Code:

<DataSourceModuleType ID="HewlettPackard.OneView.StorageVolumes.UnitMonitor.DS" Accessibility="Public" Batching="false" RunAs="HOL!HewlettPackard.OneView.RunAsProfile">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="SessionID" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="HostAddress" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="PeriodInSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="SyncTime" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter Selector="$Config/PeriodInSeconds$" ParameterType="int" ID="Interval"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="System!System.CommandExecuterPropertyBagSource">
<IntervalSeconds>$Config/PeriodInSeconds$</IntervalSeconds>
<ApplicationName>%windir%\System32\WindowsPowerShell\v1.0\PowerShell.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>"&amp; '$file/Hewlett-PackardStorageVolumesHealthMonitor.ps1$' $Config/SessionID$ $Config/HostAddress$"</CommandLine>
<TimeoutSeconds>300</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>Hewlett-PackardStorageVolumesHealthMonitor.ps1</Name>
<Contents><Script>

#-------------------------------------------------------------------
# &lt;company&gt;Hewlett-Packard&lt;/company&gt;
# &lt;copyright&gt;Copyright (c) Hewlett-Packard Company 2014-2015&lt;/copyright&gt;
# &lt;summary&gt;
# Monitor HPE OneView Storage Volumes
# &lt;/summary&gt;
#-------------------------------------------------------------------
function LoadSnapIn
{
add-pssnapin "HPOneView.ManagedDevicesCmdLets"
}

function Main
{
Param ([string]$SessionID, [string]$HostAddress)

$OpsMgr = new-object -ComObject "MOM.ScriptAPI"

$Volumes = Get-ListOneViewStorageVolumesHealth -Address $HostAddress -SessionID $SessionID
$SSHostAddress = $HostAddress
if(($Volumes -ne $null) -and ($Volumes.Count -gt 0))
{
foreach ($Volume in $Volumes)
{
$PropertyBag = $OpsMgr.CreatePropertyBag()
$PropertyBag.AddValue("DeviceID" , $Volume.ObjectID)
$PropertyBag.AddValue("HostIPAddress", $SSHostAddress)
$PropertyBag.AddValue("DeviceState", $Volume.Status)
$PropertyBag.AddValue("ErrorCode" , "NOERROR")
$OpsMgr.AddItem($PropertyBag)
clear-variable -name PropertyBag
}
}
else
{
$PropertyBag = $OpsMgr.CreatePropertyBag()
$PropertyBag.AddValue("ErrorCode" , "ERROR")

$OpsMgr.AddItem($PropertyBag)
clear-variable -name PropertyBag
}
$OpsMgr.ReturnItems()
}

if ($args.Length -eq 2)
{
LoadSnapIn
Main $args[0] $args[1]
}


</Script></Contents>
<Unicode>1</Unicode>
</File>
</Files>
</DataSource>
</MemberModules>
<Composition>
<Node ID="DS"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>