HewlettPackard.OneView.VCEthernetNetwork.UnitMonitor.DS (DataSourceModuleType)
Element properties:
Member Modules:
Overrideable Parameters:
Source Code:
<DataSourceModuleType ID="HewlettPackard.OneView.VCEthernetNetwork.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="Component" 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>"& '$file/Hewlett-PackardVCEthernetNetworkHealthMonitor.ps1$' $Config/SessionID$ $Config/HostAddress$ $Config/Component$"</CommandLine>
<TimeoutSeconds>300</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>Hewlett-PackardVCEthernetNetworkHealthMonitor.ps1</Name>
<Contents><Script>
#-------------------------------------------------------------------
# <company>Hewlett-Packard</company>
# <copyright>Copyright (c) Hewlett Packard Enterprise Company 2014-2015</copyright>
# <summary>
# Monitor HPE OneView VC Ethernet Network
# </summary>
#-------------------------------------------------------------------
function LoadSnapIn
{
add-pssnapin "HPOneView.ManagedDevicesCmdLets"
}
function Main
{
Param ([string]$SessionID, [string]$HostAddress, [string]$Component)
$OpsMgr = new-object -ComObject "MOM.ScriptAPI"
$EnetStatus = Get-ListOneViewEthernetNetworksHealth -SessionID $SessionID -Address $HostAddress
if(($EnetStatus -ne $null) -and ($EnetStatus.Count -gt 0))
{
foreach ($Enet in $EnetStatus)
{
$PropertyBag = $OpsMgr.CreatePropertyBag()
$PropertyBag.AddValue($Component + ".ErrorCode" , "NOERROR")
$PropertyBag.AddValue($Component + "." + $Enet.ObjectID + ".HealthState" , $Enet.Status)
$OpsMgr.AddItem($PropertyBag)
clear-variable -name PropertyBag
}
}
else
{
$PropertyBag = $OpsMgr.CreatePropertyBag()
$PropertyBag.AddValue($Component + ".ErrorCode" , "ERROR")
$OpsMgr.AddItem($PropertyBag)
clear-variable -name PropertyBag
}
$OpsMgr.ReturnItems()
}
if ($args.Length -eq 3)
{
LoadSnapIn
Main $args[0] $args[1] $args[2]
}
</Script></Contents>
<Unicode>1</Unicode>
</File>
</Files>
</DataSource>
</MemberModules>
<Composition>
<Node ID="DS"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>