Dell Server Health CookDown UMT

Dell.ManagedServer.ServerHealthCookDownUMT (UnitMonitorType)

Common CookDown UMT used by the Server Health Unit Monitor

Element properties:

RunAsDefault
AccessibilityPublic
Support Monitor RecalculateFalse

Member Modules:

ID Module Type TypeId RunAs 
DSP DataSource System.SimpleScheduler Default
PB ProbeAction Microsoft.Windows.PowerShellPropertyBagProbe Default
OperationStatusError ConditionDetection System.ExpressionFilter Default
OperationStatusSuccess ConditionDetection System.ExpressionFilter Default
OperationStatusWarning ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
IntervalSecondsint$Config/IntervalSeconds$Interval SecondsInterval for the UMT script execution
SyncTimestring$Config/SyncTime$Sync TimeSync Time for the UMT script execution
TimeoutSecondsint$Config/TimeoutSeconds$TimeoutSecondsTimeout for the UMT script execution
LogLevelint$Config/LogLevel$Log LevelLog Level for the UMT script execution

Source Code:

<UnitMonitorType ID="Dell.ManagedServer.ServerHealthCookDownUMT" Accessibility="Public">
<MonitorTypeStates>
<MonitorTypeState ID="Success" NoDetection="false"/>
<MonitorTypeState ID="Warning" NoDetection="false"/>
<MonitorTypeState ID="Error" NoDetection="false"/>
</MonitorTypeStates>
<Configuration>
<IncludeSchemaTypes>
<SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
<SchemaType>Windows!Microsoft.Windows.PowerShellSchema</SchemaType>
</IncludeSchemaTypes>
<xsd:element name="IntervalSeconds" type="xsd:integer"/>
<xsd:element name="SyncTime" type="xsd:string"/>
<xsd:element name="TimeoutSeconds" type="xsd:integer"/>
<xsd:element name="InstanceIndex" type="xsd:string"/>
<xsd:element name="ComponentType" type="xsd:string"/>
<xsd:element name="LogLevel" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
<OverrideableParameter ID="LogLevel" Selector="$Config/LogLevel$" ParameterType="int"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource ID="DSP" TypeID="System!System.SimpleScheduler">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<SyncTime>$Config/SyncTime$</SyncTime>
</DataSource>
<ProbeAction ID="PB" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagProbe">
<ScriptName>DellServerHealthCookDownUMT.ps1</ScriptName>
<ScriptBody><Script>
param($LogLevel)
$api = New-Object -comObject 'MOM.ScriptAPI'

$scriptname = "DelliSMServerHealthCookDownUMT"
$logDirectory = "DellManagedServeriSM_log"

try
{
$ErrorActionPreference = "SilentlyContinue"
if ($LogLevel -ne 0)
{
$TempFolder = $env:SystemRoot + "\Temp"
$LogLocation = $TempFolder + "\" + $logDirectory + "\"
If(!(Test-Path -path($TempFolder)))
{
# create the directory if not present
New-Item $TempFolder -type directory
}

If(!(Test-Path -path($LogLocation)))
{
# create the directory if not present
New-Item $LogLocation -type directory
}
$Global:LogFileLocation = $LogLocation + $scriptname + ".log"
If(!(Test-Path -path($LogFileLocation)))
{
# create the file if it does not exist
New-Item $LogFileLocation -type file
}
Else
{
$logFileSize = Get-ChildItem $LogFileLocation | ForEach-Object {($_.Length/1KB)}
If ($logFileSize -gt 512)
{
# existingLogFile is greater than 512 KB
$archiveTime = Get-Date -f "yyyy-MM-dd_HH.mm"
Rename-Item $LogFileLocation ("ArchivedLog_" + $scriptname + "_" + $archiveTime + ".log")
New-Item $LogFileLocation -type file
}
}
}
}
catch
{
$ErrorMessage = $_.Exception.Message
$FailedItem = $_.Exception.ItemName
$message = "Exception in creating log file. Exception-Message:" + $ErrorMessage + $FailedItem
$api.LogScriptEvent("DellServerHealthCookDownUMT.ps1",1345,0,$message)
}
Function psDebugLog
{
param($level, $message)
if (($level -gt 0) -and ($level -le $LogLevel))
{
$currentTime = Get-Date -f "yyyy-MM-dd_HH.mm.ss"
Out-File -FilePath $LogFileLocation -InputObject ($currentTime + " :: " + $message) -Append -EA SilentlyContinue
}
}

psDebugLog -level 1 -message "Server Health CookDownUMT Script is Started"

# Update for all profiles inventory.
$profiles = @(
"DCIM_SystemView",
"DCIM_NICStatistics",
"DCIM_Sensor",
"DCIM_NumericSensor",
"DCIM_IDRACCardString",
"DCIM_IDRACCardEnumeration",
"DCIM_vFlashView",
"DCIM_HostNetworkInterfaceView",
"DCIM_CPUView",
"DCIM_MemoryView",
"DCIM_PowerSupplyView",
"DCIM_License",
"DCIM_ControllerView",
"DCIM_EnclosureView",
"DCIM_ControllerBatteryView",
"DCIM_VirtualDiskView",
"DCIM_PhysicalDiskView",
"DCIM_EnclosurePSUView",
"DCIM_EnclosureEMMView",
"DCIM_EnclosureFanSensor",
"DCIM_EnclosureTemperatureSensor",
"DCIM_PCIeSSDExtenderView",
"DCIM_PCIeSSDBackPlaneView",
"DCIM_PCIeSSDView",
"DCIM_PresenceAndStatusSensor"
)

$hash_profileInstances = @{}

foreach($profile in $profiles)
{
psDebugLog -level 1 -message ("Health UMT Retriving " + $profile + " Profile")
Try
{
$ErrorActionPreference = "SilentlyContinue"
$ProfileInstances = Get-CimInstance -Namespace root\cimv2\dcim -ClassName $profile
#Converting single-objects into arrays, as some profiles are not arrrays
if($ProfileInstances -ne $null)
{
if($ProfileInstances -isnot [system.array])
{
$temparray = @()
$temparray += $ProfileInstances
$ProfileInstances = $temparray
}
# Then add array into Hash Map.
$hash_profileInstances.Add($profile, $ProfileInstances)
}
}
Catch
{
$ErrorMessage = $_.exception.Message
psDebugLog -level 1 -message "Exception in Retriving Profile " + $profile + " Exception-Message:" + $ErrorMessage
}
}
$dcimSystemViewArray = $hash_profileInstances.Item("DCIM_SystemView")
$dcimSystemView = $null
if($dcimSystemViewArray -ne $null){
$dcimSystemView = $dcimSystemViewArray[0];
}
$dcimNicStatisticsArray = $hash_profileInstances.Item("DCIM_NICStatistics")
$dcimSensorViewArray = $hash_profileInstances.Item("DCIM_Sensor")
$dcimNumSensorViewArray = $hash_profileInstances.Item("DCIM_NumericSensor")
$dcimiDracCardStringArray = $hash_profileInstances.Item("DCIM_IDRACCardString")
$dcimiDracCardEnumerationArray = $hash_profileInstances.Item("DCIM_IDRACCardEnumeration")
$dcimSdcardViewArray = $hash_profileInstances.Item("DCIM_vFlashView")
$dcimHostNicViewArray = $hash_profileInstances.Item("DCIM_HostNetworkInterfaceView")
$dcimCPUViewArray = $hash_profileInstances.Item("DCIM_CPUView")
$dcimMemViewArray = $hash_profileInstances.Item("DCIM_MemoryView")
$dcimPSViewArray = $hash_profileInstances.Item("DCIM_PowerSupplyView")
$dcimLicenseArray = $hash_profileInstances.Item("DCIM_License")
$dcimControllerViewArray = $hash_profileInstances.Item("DCIM_ControllerView")
$dcimEnclosureViewArray = $hash_profileInstances.Item("DCIM_EnclosureView")
$dcimControllerBatteryViewArray = $hash_profileInstances.Item("DCIM_ControllerBatteryView")
$dcimControllerVirtualDiskViewArray = $hash_profileInstances.Item("DCIM_VirtualDiskView")
$dcimEnclosurePhysicalDiskViewArray = $hash_profileInstances.Item("DCIM_PhysicalDiskView")
$dcimEnclosurePSUViewArray = $hash_profileInstances.Item("DCIM_EnclosurePSUView")
$dcimEnclosureEMMViewArray = $hash_profileInstances.Item("DCIM_EnclosureEMMView")
$dcimEnclosureFanSensorArray = $hash_profileInstances.Item("DCIM_EnclosureFanSensor")
$dcimEnclosureTemperatureSensorArray = $hash_profileInstances.Item("DCIM_EnclosureTemperatureSensor")
$dcimPCIeSSDExtenderViewArray = $hash_profileInstances.Item("DCIM_PCIeSSDExtenderView")
$dcimPCIeSSDBackPlaneViewArray = $hash_profileInstances.Item("DCIM_PCIeSSDBackPlaneView")
$dcimPCIeSSDViewArray = $hash_profileInstances.Item("DCIM_PCIeSSDView")
$dcimPresenceAndStatusSensorArray = $hash_profileInstances.Item("DCIM_PresenceAndStatusSensor")

$serverUID = $dcimSystemView.ServiceTag
$model = $dcimSystemView.Model
if($model.Contains("PowerEdge FM"))
{
$serverUID = $dcimSystemView.NodeID
}

if ($dcimSystemView -ne $null)
{
#Server Health
$primaryStatus = $dcimSystemView.PrimaryStatus
psDebugLog -level 1 -message ("Server Monitoring Script is Started - PrimaryStatus: " + $primaryStatus)
if($primaryStatus -eq "1"){
$statusValue = "OK"
}
elseif($primaryStatus -eq "3"){
$statusValue = "Error"
}
elseif(($primaryStatus -eq "2") -or ($primaryStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer")
$propertyBag.AddValue("InstanceIndex", $serverUID)
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "Server Monitoring Script End"

#Processor Health Check
$cpuRollUpStatus = $dcimSystemView.CPURollupStatus
psDebugLog -level 1 -message ("Processor Health Script is Started - CPURollupStatus: " + $cpuRollUpStatus)
if($cpuRollUpStatus -eq "1"){
$statusValue = "OK"
}
elseif($cpuRollUpStatus -eq "3"){
$statusValue = "Error"
}
#on par with MOF file
elseif(($cpuRollUpStatus -eq "2") -or ($cpuRollUpStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Processors")
$propertyBag.AddValue("InstanceIndex", "Processor Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "Processor Health Script is Ended"

if(($dcimCPUViewArray -ne $null) -and ($dcimCPUViewArray.count -gt 0))
{
psDebugLog -level 1 -message ("Processor Instance Health Script is started")
$statusValue = "OK"
foreach($dcimCPUView in $dcimCPUViewArray)
{
$cpuPrimaryStatus = $dcimCPUView.PrimaryStatus
psDebugLog -level 1 -message ("Processor Instance Health Script for " + $dcimCPUView.InstanceID + "- PrimaryStatus: " + $cpuPrimaryStatus)
if($cpuPrimaryStatus -eq "1"){
$statusValue = "OK"
}
elseif($cpuPrimaryStatus -eq "3"){
$statusValue = "Error"
}
#on par with MOF file
elseif(($cpuPrimaryStatus -eq "2") -or ($cpuPrimaryStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.ProcUnit")
$propertyBag.AddValue("InstanceIndex", $dcimCPUView.InstanceID)
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
}
psDebugLog -level 1 -message "Processor Instance Health Script is Ended"
}

#Memory Health Check
$memPrimeStatus = $dcimSystemView.SysMemPrimaryStatus
psDebugLog -level 1 -message ("Memory Health Script is Started - SysMemPrimaryStatus: " + $memPrimeStatus)
if($memPrimeStatus -eq "1"){
$statusValue = "OK"
}
elseif($memPrimeStatus -eq "3"){
$statusValue = "Error"
}
#on par with MOF file
elseif(($memPrimeStatus -eq "2") -or ($memPrimeStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Memory")
$propertyBag.AddValue("InstanceIndex", "Memory Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "Memory Health Script is Ended"

if(($dcimMemViewArray -ne $null) -and ($dcimMemViewArray.count -gt 0))
{
psDebugLog -level 1 -message ("Memory Instance Health Script is started")
$statusValue = "OK"
foreach($dcimMemiew in $dcimMemViewArray)
{
$memPrimaryStatus = $dcimMemiew.PrimaryStatus
psDebugLog -level 1 -message ("Memory Instance Health Script for " + $dcimMemiew.FQDD + "- PrimaryStatus: " + $memPrimaryStatus)
if($memPrimaryStatus -eq "1"){
$statusValue = "OK"
}
elseif($memPrimaryStatus -eq "3"){
$statusValue = "Error"
}
#on par with MOF file
elseif(($memPrimaryStatus -eq "2") -or ($memPrimaryStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.MemoryUnit")
$propertyBag.AddValue("InstanceIndex", $dcimMemiew.FQDD)
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
}
psDebugLog -level 1 -message "Memory Instance Health Script is Ended"
}

#Storage Health Check
$storagerollupStatus = $dcimSystemView.StorageRollupStatus
psDebugLog -level 1 -message ("Storage Health Script is Started - StorageRollupStatus: " + $storagerollupStatus)
if($storagerollupStatus -eq "1"){
$statusValue = "OK"
}
elseif($storagerollupStatus -eq "3"){
$statusValue = "Error"
}
#on par with MOF file
elseif(($storagerollupStatus -eq "2") -or ($storagerollupStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage")
$propertyBag.AddValue("InstanceIndex", $serverUID)
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "Storage Health Script is Ended"

#LicenseGroup Health Check
$licenserollupStatus = $dcimSystemView.LicensingRollupStatus
psDebugLog -level 1 -message ("LicenseGroup Health Script is Started - LicensingRollupStatus: " + $licenserollupStatus)
if($licenserollupStatus -eq "1"){
$statusValue = "OK"
}
elseif($licenserollupStatus -eq "3"){
$statusValue = "Error"
}
#on par with MOF file
elseif(($licenserollupStatus -eq "2") -or ($licenserollupStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.LicenseGroup")
$propertyBag.AddValue("InstanceIndex", "License Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "LicenseGroup Health Script is Ended"

if(($dcimLicenseArray -ne $null) -and ($dcimLicenseArray.count -gt 0))
{
psDebugLog -level 1 -message ("License Instance Health Script is started")
$statusValue = "OK"
foreach($dcimLicense in $dcimLicenseArray)
{
$licPrimaryStatus = $dcimLicense.LicensePrimaryStatus
psDebugLog -level 1 -message ("License Instance Health Script for " + $dcimLicense.InstanceID + "- PrimaryStatus: " + $licPrimaryStatus)
if($licPrimaryStatus -eq "1"){
$statusValue = "OK"
}
elseif($licPrimaryStatus -eq "3"){
$statusValue = "Error"
}
#on par with MOF file
elseif(($licPrimaryStatus -eq "2") -or ($licPrimaryStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.License")
$propertyBag.AddValue("InstanceIndex", $dcimLicense.InstanceID)
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
}
psDebugLog -level 1 -message "License Instance Health Script is Ended"
}

#PowerSupply Health Check
$PSRollupStatus = $dcimSystemView.PSRollupStatus
psDebugLog -level 1 -message ("PowerSupplyGroup Health Script is Started - PowerSupplyRollupStatus: " + $PSRollupStatus)
if($PSRollupStatus -eq 1)
{
$statusValue = "OK"
}
elseif($PSRollupStatus -eq 3)
{
$statusValue = "Error"
}
else
{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.PowerSupplies")
$propertyBag.AddValue("InstanceIndex", "Power Supply Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "PowerSupply Health Script is Ended"

if(($dcimPSViewArray -ne $null) -and ($dcimPSViewArray.count -gt 0))
{
psDebugLog -level 1 -message ("PS Instance Health Script is started")
$statusValue = "OK"
foreach($dcimPSiew in $dcimPSViewArray)
{
$psPrimaryStatus = $dcimPSiew.PrimaryStatus
psDebugLog -level 1 -message ("PS Instance Health Script for " + $dcimPSiew.FQDD + "- PrimaryStatus: " + $psPrimaryStatus)
if($psPrimaryStatus -eq "1"){
$statusValue = "OK"
}
elseif($psPrimaryStatus -eq "3"){
$statusValue = "Error"
}
#on par with MOF file
elseif(($psPrimaryStatus -eq "2") -or ($psPrimaryStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.PSUnit")
$propertyBag.AddValue("InstanceIndex", $dcimPSiew.FQDD)
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
}
psDebugLog -level 1 -message "PS Instance Health Script is Ended"
}

#Fan Sensor Group
$fanRollupStatus = $dcimSystemView.FanRollupStatus
psDebugLog -level 1 -message ("FanSensorGroup Health Script is Started - FanRollupStatus: " + $fanRollupStatus)
if($fanRollupStatus -eq "1"){
$statusValue = "OK"
}
elseif($fanRollupStatus -eq "3"){
$statusValue = "Error"
}
elseif(($fanRollupStatus -eq "2") -or ($fanRollupStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.FanSensorGroup")
$propertyBag.AddValue("InstanceIndex", "Fan Sensor Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "FanSensorGroup Health Script is Ended"

#Temperature Sensor Group
$tempRollupStatus = $dcimSystemView.TempRollupStatus
psDebugLog -level 1 -message ("TemperatureSensorGroup Health Script is Started - TempRollupStatus: " + $tempRollupStatus)
if($tempRollupStatus -eq "1"){
$statusValue = "OK"
}
elseif($tempRollupStatus -eq "3"){
$statusValue = "Error"
}
elseif(($tempRollupStatus -eq "2") -or ($tempRollupStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.TemperatureSensorGroup")
$propertyBag.AddValue("InstanceIndex", "Temperature Sensor Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "TemperatureSensorGroup Health Script is Ended"

#Voltage Sensor Group
$voltRollupStatus = $dcimSystemView.VoltRollupStatus
psDebugLog -level 1 -message ("VoltageSensorGroup Health Script is Started - VoltRollupStatus: " + $voltRollupStatus)
if($voltRollupStatus -eq "1"){
$statusValue = "OK"
}
elseif($voltRollupStatus -eq "3"){
$statusValue = "Error"
}
elseif(($voltRollupStatus -eq "2") -or ($voltRollupStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.VoltageSensorGroup")
$propertyBag.AddValue("InstanceIndex", "Voltage Sensor Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "VoltageSensorGroup Health Script is Ended"

#Battery Sensor Group
$batteryRollupStatus = $dcimSystemView.BatteryRollupStatus
psDebugLog -level 1 -message ("BatterySensorGroup Health Script is Started - BatteryRollupStatus: " + $batteryRollupStatus)
if($batteryRollupStatus -eq "1"){
$statusValue = "OK"
}
elseif($batteryRollupStatus -eq "3"){
$statusValue = "Error"
}
elseif(($batteryRollupStatus -eq "2") -or ($batteryRollupStatus -eq "0")){
$statusValue = "Warning"
}
else{
$statusValue = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.BatterySensorGroup")
$propertyBag.AddValue("InstanceIndex", "Battery Sensor Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "BatterySensorGroup Health Script is Ended"
}

if(($dcimSdcardViewArray -ne $null) -and ($dcimSdcardViewArray.count -gt 0))
{
#SD card Health
psDebugLog -level 1 -message ("SDCard Health Script is Started with instance count "+$dcimSdcardViewArray.count)
[int]$sdGrpHealthInt = 0
foreach($sdcard in $dcimSdcardViewArray)
{
$sdcardID = $sdcard.FQDD
psDebugLog -level 1 -message ("SDCard Health Script is Started for instance $sdcardID")
$statusValue = "OK"
if([string]::IsNullOrEmpty($sdcard.HealthStatus))
{
psDebugLog -level 1 -message ("SDCard Health Script is NULL Status hence warning")
$statusValue = "Warning"
if($sdGrpHealthInt -lt 1)
{
$sdGrpHealthInt = 1
}
}
else
{
psDebugLog -level 1 -message ("SDCard group Health Script in for loop not NULL "+$sdcard.HealthStatus)
if(($sdcard.HealthStatus -eq "Critical"))
{
$statusValue = "Error"
if($sdGrpHealthInt -lt 2)
{
$sdGrpHealthInt = 2
}
}
elseif($sdcard.HealthStatus -ne "OK")
{
$statusValue = "Warning"
if($sdGrpHealthInt -lt 1)
{
$sdGrpHealthInt = 1
}
}
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.SDCard")
$propertyBag.AddValue("InstanceIndex", $sdcardID)
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("SDCard Health for Instance "+$sdcardID+" Ended with Status "+$statusValue)
}
$sdcardGroupHealth = @("OK", "Warning", "Error")
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.SDCardGroup")
$propertyBag.AddValue("InstanceIndex", "SD Card Group")
$propertyBag.AddValue("Status", $sdcardGroupHealth[$sdGrpHealthInt])
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("SDCard GROUP Health Script is Ended with Status $($sdcardGroupHealth[$sdGrpHealthInt])")
}

if(($dcimSensorViewArray -ne $null) -and ($dcimSensorViewArray.count -gt 0)){
#Intrusion Sensor Group
psDebugLog -level 1 -message "IntrusionSensorGroup Health Script is Started"
$statusValue = "OK"
foreach($sensor in $dcimSensorViewArray){
if($sensor.SensorType -eq 16)
{
if($sensor.PrimaryStatus -eq "1")
{
$statusValue = "OK"
}
elseif($sensor.PrimaryStatus -eq "3")
{
$statusValue = "Error"
}
elseif(($sensor.PrimaryStatus -eq "2") -or ($sensor.PrimaryStatus -eq "0"))
{
$statusValue = "Warning"
}
else
{
$statusValue = "Warning"
}
}
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.IntrusionSensorGroup")
$propertyBag.AddValue("InstanceIndex", "Intrusion Sensor Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "IntrusionSensorGroup Health Script is Ended"

#Current Sensor Group Health
psDebugLog -level 1 -message "CurrentSensorGroup Health Script is Started"
$statusValue = "OK"
foreach($sensor in $dcimSensorViewArray){
if($sensor.SensorType -eq 4)
{
if($sensor.PrimaryStatus -eq "1")
{
$statusValue = "OK"
}
elseif($sensor.PrimaryStatus -eq "3")
{
$statusValue = "Error"
}
elseif(($sensor.PrimaryStatus -eq "2") -or ($sensor.PrimaryStatus -eq "0"))
{
$statusValue = "Warning"
}
else
{
$statusValue = "Warning"
}
}
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.CurrentSensorGroup")
$propertyBag.AddValue("InstanceIndex", "Current Sensor Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "CurrentSensorGroup Health Script is Ended"
}

if(($dcimNicStatisticsArray -ne $null) -and ($dcimNicStatisticsArray.count -gt 0))
{
#NIC Group Health
psDebugLog -level 1 -message "NICGroup Health Script is Started"
$statusValue = "OK"
foreach($nic in $dcimNicStatisticsArray){
if($nic.LinkStatus -eq "3") {
$statusValue = "Error"
break
}
else{
if(($nic.LinkStatus -eq "0") -or ($nic.LinkStatus -eq "")){
$statusValue = "Warning"
}
}
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.NICGroup")
$propertyBag.AddValue("InstanceIndex", "NIC Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "NICGroup Health Script is Ended"

#NIC Health
foreach($nic in $dcimNicStatisticsArray){
$fqdd = $nic.FQDD
$linkStatus = $nic.LinkStatus
$state = "Warning"
if($linkStatus -eq "1") {
$state = "OK"
}
elseif($linkStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.NetworkInterfaceUnit")
$propertyBag.AddValue("InstanceIndex", $fqdd)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $fqdd + " state: " + $state + " Status code: " + $linkStatus
psDebugLog -level 1 -message ("NIC: " + $message)
}
}

if(($dcimiDracCardEnumerationArray -ne $null) -and ($dcimiDracCardEnumerationArray.count -gt 0))
{
#iDrac Health
psDebugLog -level 1 -message "iDRAC NIC Health Script is Started"
$statusValue = "OK"
foreach($iDracCardStringInst in $dcimiDracCardEnumerationArray){
if(($iDracCardStringInst.AttributeDisplayName -eq "NIC Enable") -and ($iDracCardStringInst.GroupID -eq "NIC.1")){
$currValue = $iDracCardStringInst.CurrentValue
if($currValue -eq "Enabled"){
$statusValue = "OK"
}
elseif($currValue -eq "Disabled"){
$statusValue = "Error"
}
else{
$statusValue = "Error"
}
}
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.iDRAC.NetworkInterfaceUnit")
$propertyBag.AddValue("InstanceIndex", $dcimiDracCardStringArray[0].FQDD)
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "iDRAC NIC Health Script is Ended"
}

if(($dcimHostNicViewArray -ne $null) -and ($dcimHostNicViewArray.count -gt 0))
{
#Host NIC Group Health
psDebugLog -level 1 -message "Host NIC Health Script is Started"
$statusValue = "OK"
foreach($hostNicInst in $dcimHostNicViewArray){
if($hostNicInst.DeviceFQDD[0] -ne $null){
if(($hostNicInst.Status -eq "1") -or ($hostNicInst.Status -eq "6")){
$statusValue = "Error"
break
}
else{
if(($hostNicInst.Status -eq "2") -or ($hostNicInst.Status -eq "3") -or ($hostNicInst.Status -eq "4") -or ($hostNicInst.Status -eq "5")){
$statusValue = "Warning"
}
}
}
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.HostNICGroup")
$propertyBag.AddValue("InstanceIndex", "HostNIC Group")
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message "Host NIC Health Script is Ended"

#Host NIC Health
foreach($hostNicInst in $dcimHostNicViewArray){
if($hostNicInst.DeviceFQDD[0] -ne $null){
$instanceID = $hostNicInst.InstanceID
$statusValue = "Warning"
if($hostNicInst.Status -eq "0"){
$statusValue = "OK"
}
elseif(($hostNicInst.Status -eq "1") -or ($hostNicInst.Status -eq "6")){
$statusValue = "Error"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.HostNIC")
$propertyBag.AddValue("InstanceIndex", $instanceID)
$propertyBag.AddValue("Status", $statusValue)
$api.AddItem($propertyBag)
$propertyBag
$message = $instanceID + " state: " + $statusValue + " Status code: " + $hostNicInst.Status
psDebugLog -level 1 -message ("Host NIC: " + $message)
}
}
}

if($dcimSensorViewArray -ne $null)
{
Foreach($sensorViewObj in $dcimSensorViewArray)
{
$SensorType = $sensorViewObj.SensorType
$sDeviceID = $sensorViewObj.DeviceID
$sPrimaryStatus = $sensorViewObj.PrimaryStatus
$state = "Warning"
if($sPrimaryStatus -eq "1"){
$state = "OK"
}
elseif(($sPrimaryStatus -eq "2") -or ($sPrimaryStatus -eq "0")){
$state = "Warning"
}
elseif($sPrimaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$message = $sDeviceID + " state: " + $state + " Status code: " + $sPrimaryStatus
if(($SensorType -eq 1) -and ($sensorViewObj.OtherSensorTypeDescription -eq "Battery"))
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.BatterySensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("BatterySensor : " + $message)
}
elseif($SensorType -eq 16)
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.IntrusionSensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("Intrusion Sensor: " + $message)
}
elseif($SensorType -eq 2)
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.TemperatureSensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("Temperature Sensor: " + $message)
}
elseif($SensorType -eq 3)
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.VoltageSensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("Voltage Sensor: " + $message)
}
elseif($SensorType -eq 4)
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.CurrentSensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("Current Sensor: " + $message)
}
elseif($SensorType -eq 5)
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.FanSensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("Fan Sensor: " + $message)
}
else{
#Do nothing
}
}
}
if($dcimNumSensorViewArray -ne $null)
{
Foreach($sensorViewObj in $dcimNumSensorViewArray)
{
$SensorType = $sensorViewObj.SensorType
$sDeviceID = $sensorViewObj.DeviceID
$sPrimaryStatus = $sensorViewObj.PrimaryStatus
$state = "Warning"
if($sPrimaryStatus -eq "1"){
$state = "OK"
}
elseif(($sPrimaryStatus -eq "2") -or ($sPrimaryStatus -eq "0")){
$state = "Warning"
}
elseif($sPrimaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$message = $sDeviceID + " state: " + $state + " Status code: " + $sPrimaryStatus
if(($SensorType -eq 1) -and ($sensorViewObj.OtherSensorTypeDescription -eq "Battery"))
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.BatterySensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("Battery Sensor: " + $message)
}
elseif($SensorType -eq 16)
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.IntrusionSensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("Intrusion Sensor: " + $message)
}
elseif($SensorType -eq 2)
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.TemperatureSensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("Temperature Sensor: " + $message)
}
elseif($SensorType -eq 3)
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.VoltageSensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("Voltage Sensor: " + $message)
}
elseif($SensorType -eq 4)
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.CurrentSensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("Current Sensor: " + $message)
}
elseif($SensorType -eq 5)
{
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.FanSensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("Fan Sensor: " + $message)
}
else{
#Do nothing
}
}
}
#ChassisController Sensor Health
if (($dcimPresenceAndStatusSensorArray -ne $null) -and ($dcimPresenceAndStatusSensorArray.count -gt 0))
{
$sensorViewObj = $dcimPresenceAndStatusSensorArray | Where-Object {$_.ElementName -eq "Chassis Controller"}
If( $sensorViewObj -ne $null )
{
$sDeviceID = $sensorViewObj.DeviceID

$state = "Error"
$sPrimaryStatus = $sensorViewObj.CurrentState
if($sPrimaryStatus.ToUpper() -eq "OK"){
$state = "OK"
}
elseif($sPrimaryStatus.ToUpper() -eq "CRITICAL"){
$state = "Error"
}
$message = $sDeviceID + " state: " + $state + " Status code: " + $sPrimaryStatus
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.ChassisControllerSensor")
$propertyBag.AddValue("InstanceIndex", $sDeviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
psDebugLog -level 1 -message ("ChassisController Sensor: " + $message)
}
else
{
psDebugLog -level 1 -message ("ChassisController Sensor: " + " Null value")
}
}

#Storage Controller Health
if(($dcimControllerViewArray -ne $null) -and ($dcimControllerViewArray.count -gt 0))
{
foreach($dcimController in $dcimControllerViewArray)
{
$deviceID = $dcimController.FQDD
$primaryStatus = $dcimController.PrimaryStatus
$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Controller")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " PrimaryStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Controller: " + $message)
}
}

#Storage Controller Health
if(($dcimEnclosureViewArray -ne $null) -and ($dcimEnclosureViewArray.count -gt 0))
{
foreach($dcimEnclosure in $dcimEnclosureViewArray)
{
$deviceID = $dcimEnclosure.FQDD
$primaryStatus = $dcimEnclosure.PrimaryStatus
$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Controller.Enclosure")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " PrimaryStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Enclosure: " + $message)
}
}

#Storage Controller Battery Unit Health
if(($dcimControllerBatteryViewArray -ne $null) -and ($dcimControllerBatteryViewArray.count -gt 0))
{
foreach($dcimControllerBattery in $dcimControllerBatteryViewArray)
{
$deviceID = $dcimControllerBattery.FQDD
$primaryStatus = $dcimControllerBattery.PrimaryStatus
$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Controller.Battery")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " PrimaryStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Controller Battery: " + $message)
}
}

#Storage Controller VirtualDisk Unit Health
if(($dcimControllerVirtualDiskViewArray -ne $null) -and ($dcimControllerVirtualDiskViewArray.count -gt 0))
{
foreach($dcimControllerVirtualDisk in $dcimControllerVirtualDiskViewArray)
{
$deviceID = $dcimControllerVirtualDisk.FQDD
$primaryStatus = $dcimControllerVirtualDisk.PrimaryStatus
$raidStatus = $dcimControllerVirtualDisk.RAIDStatus
$lockStatus = $dcimControllerVirtualDisk.LockStatus
$objectStatus = $dcimControllerVirtualDisk.ObjectStatus

$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Controller.VirtualDisk")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$propertyBag.AddValue("RaidStatus", $raidStatus)
$propertyBag.AddValue("LockStatus", $lockStatus)
$propertyBag.AddValue("ObjectStatus", $objectStatus)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " PrimaryStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Controller VirtualDisk: " + $message)
}
}

#Storage Enclosure Physical Disk Unit Health UMT
if(($dcimEnclosurePhysicalDiskViewArray -ne $null) -and ($dcimEnclosurePhysicalDiskViewArray.count -gt 0))
{
foreach($dcimEnclosurePhysicalDisk in $dcimEnclosurePhysicalDiskViewArray)
{
$deviceID = $dcimEnclosurePhysicalDisk.FQDD
$primaryStatus = $dcimEnclosurePhysicalDisk.PrimaryStatus
$raidStatus = $dcimEnclosurePhysicalDisk.RAIDStatus
$lcaseInstanceId = $instanceId.ToLower()
$predictiveFailureState = $dcimEnclosurePhysicalDisk.PredictiveFailureState

$lcaseDeviceID = $deviceID.ToLower()
if ($lcaseDeviceID.Contains("direct"))
{
psDebugLog -level 1 -message ("InstanceID: " + $deviceID)
$className = "Dell.ManagedServer.Storage.Controller.DirectAttachedPhysicalDisk"
$className1 = "Dell.ManagedServer.Storage.Controller.DirectAttachedPhysicalDisk.PredictiveFailure"
$className2 = "Dell.ManagedServer.Storage.Controller.DirectAttachedPhysicalDisk.Aggregate"
}
elseif ($lcaseDeviceID.Contains("internal"))
{
psDebugLog -level 1 -message ("InstanceID: " + $deviceID)
$className = "Dell.ManagedServer.Storage.Controller.InternalPhysicalDisk"
$className1 = "Dell.ManagedServer.Storage.Controller.InternalPhysicalDisk.PredictiveFailure"
$className2 = "Dell.ManagedServer.Storage.Controller.InternalPhysicalDisk.Aggregate"
}
elseif($lcaseDeviceID.Contains("external"))
{
psDebugLog -level 1 -message ("InstanceID: " + $deviceID)
$className = "Dell.ManagedServer.Storage.Controller.ExternalPhysicalDisk"
$className1 = "Dell.ManagedServer.Storage.Controller.ExternalPhysicalDisk.PredictiveFailure"
$className2 = "Dell.ManagedServer.Storage.Controller.ExternalPhysicalDisk.Aggregate"
}

$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", $className)
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$propertyBag.AddValue("RaidStatus", $raidStatus)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " PrimaryStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Enclosure Physical Disk(PrimaryStatus Health): " + $message)

$state = "Warning"
if($predictiveFailureState -eq "0") {
$state = "OK"
}
elseif($predictiveFailureState -eq "1"){
$state = "Warning"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", $className1)
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " PredictiveFailureState: " + $predictiveFailureState
psDebugLog -level 1 -message ("Enclosure Physical Disk(PredictiveFailureState Health): " + $message)

$state = "Warning"
if(($primaryStatus -eq "1") -and ($predictiveFailureState -eq "0"))
{
$state = "OK"
}
elseif($primaryStatus -eq "3")
{
$state = "Error"
}
elseif(($primaryStatus -eq "2") -or ($primaryStatus -eq "0") -or ($predictiveFailureState -eq "1"))
{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", $className2)
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " Aggregate Healthstate: " + $state
psDebugLog -level 1 -message ("Enclosure Physical Disk(Aggregate Health): " + $message)
}
}

#Storage Enclosure PowerSupply Unit Health
if(($dcimEnclosurePSUViewArray -ne $null) -and ($dcimEnclosurePSUViewArray.count -gt 0))
{
foreach($dcimEnclosurePSU in $dcimEnclosurePSUViewArray)
{
$deviceID = $dcimEnclosurePSU.FQDD
$primaryStatus = $dcimEnclosurePSU.PrimaryStatus
$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Controller.Enclosure.PowerSupply")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " PrimaryStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Enclosure PowerSupply: " + $message)
}
}

#Storage Enclosure EMM Unit Health
if(($dcimEnclosureEMMViewArray -ne $null) -and ($dcimEnclosureEMMViewArray.count -gt 0))
{
foreach($dcimEnclosureEMM in $dcimEnclosureEMMViewArray)
{
$deviceID = $dcimEnclosureEMM.InstanceID
$primaryStatus = $dcimEnclosureEMM.PrimaryStatus
$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Controller.Enclosure.EMM")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " PrimaryStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Enclosure EMM: " + $message)
}
}

#Enclosure Fan Sensor Unit Health
if(($dcimEnclosureFanSensorArray -ne $null) -and ($dcimEnclosureFanSensorArray.count -gt 0))
{
foreach($dcimEnclosureFanSensor in $dcimEnclosureFanSensorArray)
{
$deviceID = $dcimEnclosureFanSensor.FQDD
$primaryStatus = $dcimEnclosureFanSensor.PrimaryStatus
$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Controller.Enclosure.FanSensor")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " PrimaryStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Enclosure Fan Sensor: " + $message)
}
}

#Enclosure Temperature Sensor Unit Health
if(($dcimEnclosureTemperatureSensorArray -ne $null) -and ($dcimEnclosureTemperatureSensorArray.count -gt 0))
{
foreach($dcimEnclosureTemperatureSensor in $dcimEnclosureTemperatureSensorArray)
{
$deviceID = $dcimEnclosureTemperatureSensor.FQDD
$primaryStatus = $dcimEnclosureTemperatureSensor.PrimaryStatus
$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Controller.Enclosure.TempSensor")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " PrimaryStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Enclosure Temperature Sensor: " + $message)
}
}

#Storage Extender Health
if(($dcimPCIeSSDExtenderViewArray -ne $null) -and ($dcimPCIeSSDExtenderViewArray.count -gt 0))
{
foreach($dcimPCIeSSDExtender in $dcimPCIeSSDExtenderViewArray)
{
$deviceID = $dcimPCIeSSDExtender.InstanceID
$primaryStatus = $dcimPCIeSSDExtender.RollupStatus
$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Extender")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " RollupStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Storage Extender: " + $message)
}
}

#Storage Extender BackPlane Health
if(($dcimPCIeSSDBackPlaneViewArray -ne $null) -and ($dcimPCIeSSDBackPlaneViewArray.count -gt 0))
{
foreach($dcimPCIeSSDBackPlane in $dcimPCIeSSDBackPlaneViewArray)
{
$deviceID = $dcimPCIeSSDBackPlane.InstanceID
$primaryStatus = $dcimPCIeSSDBackPlane.RollupStatus
$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Extender.BackPlane")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " RollupStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Storage Extender BackPlane: " + $message)
}
}

#Storage Extender Physical Disk Primary Status Health
if(($dcimPCIeSSDViewArray -ne $null) -and ($dcimPCIeSSDViewArray.count -gt 0))
{
foreach($dcimPCIeSSD in $dcimPCIeSSDViewArray)
{
$deviceID = $dcimPCIeSSD.InstanceID
$primaryStatus = $dcimPCIeSSD.PrimaryStatus
$predictiveFailureState = $dcimPCIeSSD.FailurePredicted
$predictiveFailureState = $predictiveFailureState.ToLower()

$state = "Warning"
if($primaryStatus -eq "1") {
$state = "OK"
}
elseif($primaryStatus -eq "3"){
$state = "Error"
}
else{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Extender.PhysicalDisk.primaryStatus")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " PrimaryStatus: " + $primaryStatus
psDebugLog -level 1 -message ("Storage Extender Physical Disk Primary Status: " + $message)

if ($predictiveFailureState -eq "yes"){
$state = "Warning"
}
elseif ($predictiveFailureState -eq "no"){
$state = "OK"
}
else {
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Extender.PhysicalDisk.PredictiveFailure")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " state: " + $state + " FailurePredicted: " + $predictiveFailureState
psDebugLog -level 1 -message ("Storage Extender Physical Disk PredictiveFailure: " + $message)

$state = "Warning"
if(($primaryStatus -eq "1") -and ($predictiveFailureState -eq "no"))
{
$state = "OK"
}
elseif($primaryStatus -eq "3")
{
$state = "Error"
}
elseif(($primaryStatus -eq "2") -or ($primaryStatus -eq "0") -or ($predictiveFailureState -eq "yes"))
{
$state = "Warning"
}
$propertyBag = $api.CreatePropertyBag()
$propertyBag.AddValue("ComponentType", "Dell.ManagedServer.Storage.Extender.PhysicalDisk.Aggregate")
$propertyBag.AddValue("InstanceIndex", $deviceID)
$propertyBag.AddValue("Status", $state)
$api.AddItem($propertyBag)
$propertyBag
$message = $deviceID + " Aggregate Healthstate : " + $state
psDebugLog -level 1 -message ("Storage Extender Physical Disk : " + $message)
}
}
psDebugLog -level 1 -message "Server Health CookDownUMT Script is Ended"
</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>LogLevel</Name>
<Value>$Config/LogLevel$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
</ProbeAction>
<ConditionDetection ID="OperationStatusSuccess" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='ComponentType']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/ComponentType$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='InstanceIndex']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/InstanceIndex$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='Status']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">OK</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
<ConditionDetection ID="OperationStatusWarning" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='ComponentType']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/ComponentType$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='InstanceIndex']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/InstanceIndex$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='Status']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Warning</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
<ConditionDetection ID="OperationStatusError" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='ComponentType']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/ComponentType$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='InstanceIndex']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/InstanceIndex$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='Status']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Error</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="Success">
<Node ID="OperationStatusSuccess">
<Node ID="PB">
<Node ID="DSP"/>
</Node>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="Warning">
<Node ID="OperationStatusWarning">
<Node ID="PB">
<Node ID="DSP"/>
</Node>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="Error">
<Node ID="OperationStatusError">
<Node ID="PB">
<Node ID="DSP"/>
</Node>
</Node>
</RegularDetection>
</RegularDetections>
</MonitorImplementation>
</UnitMonitorType>