HewlettPackard.OneView.EMS.UnitMonitor.DS (DataSourceModuleType)
Element properties:
Member Modules:
Overrideable Parameters:
Source Code:
<DataSourceModuleType ID="HewlettPackard.OneView.EMS.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="Interval" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="SyncTime" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="Component" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter Selector="$Config/Interval$" ParameterType="int" ID="Interval"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="System!System.CommandExecuterPropertyBagSource">
<IntervalSeconds>$Config/Interval$</IntervalSeconds>
<ApplicationName>%windir%\System32\WindowsPowerShell\v1.0\PowerShell.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>"& '$file/Hewlett-PackardEMSHealthMonitor.ps1$' $Config/Component$"</CommandLine>
<TimeoutSeconds>300</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>Hewlett-PackardEMSHealthMonitor.ps1</Name>
<Contents><Script>
#-------------------------------------------------------------------
# <company>Hewlett-Packard</company>
# <copyright>Copyright (c) Hewlett Packard Enterprise Company 2014-2015</copyright>
# <summary>
# Monitor HPE OneView Event Manager
# </summary>
#-------------------------------------------------------------------
function LoadSnapIn
{
add-pssnapin "HPOneView.ManagedDevicesCmdLets"
}
function Main
{
Param ([string]$Component)
$OpsMgr = new-object -ComObject "MOM.ScriptAPI"
$PropertyBag = $OpsMgr.CreatePropertyBag()
$EMSStatus = Get-EventManagerHealth
if ($EMSStatus -ne $null)
{
$status = $EMSStatus.Status
$PropertyBag.AddValue($Component + ".HealthState" , $status)
}
else
{
$PropertyBag.AddValue($Component + ".HealthState" , "ERROR")
}
$OpsMgr.Return($PropertyBag)
}
if ($args.Length -eq 1)
{
LoadSnapIn
Main $args[0]
}
</Script></Contents>
<Unicode>1</Unicode>
</File>
</Files>
</DataSource>
</MemberModules>
<Composition>
<Node ID="DS"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>