Fujitsu PRIMERGY ESXiSeed Host Server Health Monitor

Fujitsu.Servers.PRIMERGY.ESXiSeed.HostServer.Monitor (UnitMonitor)

A Unit Monitor runs a script to get PRIMERGY ESXiSeed Host Server Health

Knowledge Base article:

Summary

This health monitor runs a script on the Host Server to get the Host Server Health State.

Causes

Host Server Health State presents the health of the Fujitsu PRIMERGY ESXiSeed Host Server. This health state depends on presence of CIM Indications Listener service.

Resolutions

If this health monitor is in Warning state, the CIM Indications Listener service is not installed on target ESXiSeed Host Server.

Element properties:

TargetFujitsu.Servers.PRIMERGY.ESXiSeed.HostServer
Parent MonitorSystem.Health.AvailabilityState
CategoryStateCollection
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveFalse
Monitor TypeFujitsu.Servers.PRIMERGY.ESXiSeed.Monitor.Type
RemotableTrue
AccessibilityPublic
RunAsDefault

Source Code:

<UnitMonitor ID="Fujitsu.Servers.PRIMERGY.ESXiSeed.HostServer.Monitor" Accessibility="Public" Enabled="true" Target="Fujitsu.Servers.PRIMERGY.ESXiSeed.HostServer" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Fujitsu.Servers.PRIMERGY.ESXiSeed.Monitor.Type" ConfirmDelivery="false">
<Category>StateCollection</Category>
<OperationalStates>
<OperationalState ID="OK" MonitorTypeStateID="HealthSuccess" HealthState="Success"/>
<OperationalState ID="Degraded" MonitorTypeStateID="HealthWarning" HealthState="Warning"/>
<OperationalState ID="Error" MonitorTypeStateID="HealthError" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>480</IntervalSeconds>
<ScriptName>HostServerMonitor.ps1</ScriptName>
<ScriptBody><Script>
#-------------------------------------------------------------------
# Fujitsu
# Copyright 2015-2019 FUJITSU LIMITED
#
# HostServerMonitor.ps1
#
# Summary:
# Monitors Fujitsu PRIMERGY ESXi Host Servers.
#
#-------------------------------------------------------------------

$script:RootRegistryKey = "HKLM:\SOFTWARE\Fujitsu\ServerView Suite\SCOM Integration\SVISCOM-ESXi"
$script:RegKeyCIMListener = "CIMIndicationsListener"
$script:ValueDeployStatus = "DeployStatus"
$StatusInstalled = "Installed"

function Main {
$status = Get-RegValue $ValueDeployStatus

$oAPI = New-Object -ComObject "MOM.ScriptAPI"
$oPropertyBag = $script:oAPI.CreateTypedPropertyBag(3)

if ($status -eq $StatusInstalled) {
$oPropertyBag.AddValue("HealthState", "OK")
$oPropertyBag.AddValue("Details", "CIM Indications Listener is installed")
} else {
$oPropertyBag.AddValue("HealthState", "Degraded")
$oPropertyBag.AddValue("Details", "CIM Indications Listener is *NOT* installed")
}

$oPropertyBag
}

function Get-RegValue {
param ( [string] $Name )

try {
return (Get-ItemProperty "$RootRegistryKey\$RegKeyCIMListener" -Name $Name -Ea Stop).$Name
} catch {
}

return $null
}

Main
</Script></ScriptBody>
</Configuration>
</UnitMonitor>