Dim mhlpPresence, mhlpMessage, mhlpStatus: mhlpPresence = mhlp.IsPresent()
Dim iscompat: iscompat = mhlp.IsCompatible()
log.MOMDebugLog 1, "Is DellDeviceHelper compatible: " & iscompat
mhlpStatus = "Ok"
mhlpMessage = "Dell Device Helper Utility is found and is compatible with Dell Out-of-band Server Management Pack"
If not mhlpPresence Then
mhlpStatus = "Critical"
mhlpMessage = "Dell Device Helper Utility is not found. Expected Dell Helper Utility of version " & mhlp.ReqVersion & "."
ElseIf not iscompat Then
mhlpStatus = "Critical"
if mhlp.ReqVersion < mhlp.Version Then
mhlpMessage = "Higher version of Dell Device Helper Utility is found. Expected " & mhlp.ReqVersion & ". Found " & mhlp.Version
Else
mhlpMessage = "Lower version of Dell Device Helper Utility is found. Expected " & mhlp.ReqVersion & ". Found " & mhlp.Version
End If
End If
if mhlpPresence Then
Dim licenseConfigurationManagerObj: Set licenseConfigurationManagerObj = New LicenseConfigurationManager
licenseConfigurationManagerObj.HelperInterface = "OOBHelper.LicenseConfiguration"
Call licenseConfigurationManagerObj.LoadLicenseConfiguration()
Call licenseConfigurationManagerObj.SetProductName("SCOM-OOB")
Call licenseConfigurationManagerObj.SetProductVersion("")
Call licenseConfigurationManagerObj.SetFeatureName("Server Out-of-Band Monitoring")
Call omAPIHelper.CreatePropertyBag()
Call omAPIHelper.AddInstValue ("InstanceIndex", "LicenseServerConfiguration")
Dim isLicenseServerConfiguredFlag
isLicenseServerConfiguredFlag = licenseConfigurationManagerObj.IsLicenseServerConfigured()
If isLicenseServerConfiguredFlag = False Then
log.MOMDebugLog 1, "License server is not configured"
Call omAPIHelper.AddInstValue ("Status", "Critical")
Call omAPIHelper.AddInstValue ("Message", "Dell License Server is not configured. Install and configure License Server.")
Else
log.MOMDebugLog 1, "License server is configured properly."
Call omAPIHelper.AddInstValue ("Status", "Ok")
Call omAPIHelper.AddInstValue ("Message", "Dell License Server is configured properly.")
End If
Call omAPIHelper.AddDataItem()
log.MOMDebugLog 1, "Checking for license server reachability..."
Dim licenseServerReachable
licenseServerReachable = licenseConfigurationManagerObj.IsLicenseServerReachable()
Call omAPIHelper.CreatePropertyBag()
Call omAPIHelper.AddInstValue ("InstanceIndex", "LicenseServerReachability")
If isLicenseServerConfiguredFlag = True Then
log.MOMDebugLog 1, "License server is configured properly, checking license server reachability..."
If licenseServerReachable = False Then
log.MOMDebugLog 1, "License server is not reachable"
Call omAPIHelper.AddInstValue ("Status", "Critical")
Call omAPIHelper.AddInstValue ("Message", "Dell License Server is not reachable.")
Else
log.MOMDebugLog 1, "License server is reachable"
Call omAPIHelper.AddInstValue ("Status", "Ok")
Call omAPIHelper.AddInstValue ("Message", "Dell License Server is reachable.")
End If
Else
log.MOMDebugLog 1, "License server is not configured properly, but setting license server reachability status in prop bag as OK in order to not generate this alert"
Call omAPIHelper.AddInstValue ("Status", "Ok")
Call omAPIHelper.AddInstValue ("Message", "Unable to check license server reachability. Dell License Server is not configured properly.")
End If
Call omAPIHelper.AddDataItem()
If isLicenseServerConfiguredFlag = True And licenseServerReachable = True Then
log.MOMDebugLog 1, "License server is reachable, checking license availability status..."
Dim licenseUsagePercentageMessaage
licenseUsagePercentageMessaage = "License usage is " & licenseConfigurationManagerObj.getInUseLicensePercentage() & "%."
Select Case licenseConfigurationManagerObj.LicenseAvailabilityStatus
Case "good":
log.MOMDebugLog 1, "License availability is good"
Call omAPIHelper.AddInstValue ("Status", "Ok")
Call omAPIHelper.AddInstValue ("Message", "Dell License usage is within limits.")
Case "bad":
log.MOMDebugLog 1, "License availability is bad"
Call omAPIHelper.AddInstValue ("Status", "Warning")
Call omAPIHelper.AddInstValue ("Message", licenseUsagePercentageMessaage & " License usage has reached warning levels.")
Case "ugly":
log.MOMDebugLog 1, "License availability is ugly"
Call omAPIHelper.AddInstValue ("Status", "Critical")
Call omAPIHelper.AddInstValue ("Message", licenseUsagePercentageMessaage & " Dell License usage has crossed acceptable limits.")
Case "worse":
log.MOMDebugLog 1, "License availability is worse"
Call omAPIHelper.AddInstValue ("Status", "Critical")
Call omAPIHelper.AddInstValue ("Message", "No Licenses are available for this feature.")
Case Else:
log.MOMDebugLog 1, "Internal error during processing the license availability."
Call omAPIHelper.AddInstValue ("Status", "Critical")
Call omAPIHelper.AddInstValue ("Message", "Internal error during processing the license availability.")
End Select
Else
log.MOMDebugLog 1, "License server is not configured/reachable, but setting license usage status in prop bag as OK in order to not generate this alert"
Call omAPIHelper.AddInstValue ("Status", "Ok")
Call omAPIHelper.AddInstValue ("Message", "Unable to calculate license usage. Dell License Server is not configured/reachable.")
End If
Call omAPIHelper.AddDataItem()