Dell.ManagedServer.WMIInterface.Reachability.Probe (ProbeActionModuleType)

Element properties:

TypeProbeActionModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
InputTypeSystem.BaseData
OutputTypeMicrosoft.Windows.SerializedObjectData

Member Modules:

ID Module Type TypeId RunAs 
PA ProbeAction Microsoft.Windows.PowerShellProbe Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
CheckIntervalint$Config/CheckInterval$Node Interface Check Delay(Minutes)Interval for the reachability check execution
TimePeriodToCheckint$Config/TimePeriodToCheck$Task Run Period(Minutes)Time Out for the DSMT script execution
LogEnabledbool$Config/LogEnabled$Log EnabledEnable/Disable the log generation

Source Code:

<ProbeActionModuleType ID="Dell.ManagedServer.WMIInterface.Reachability.Probe" Accessibility="Public">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HostName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeoutSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimePeriodToCheck" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CheckInterval" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="LogEnabled" type="xsd:boolean"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="CheckInterval" Selector="$Config/CheckInterval$" ParameterType="int"/>
<OverrideableParameter ID="TimePeriodToCheck" Selector="$Config/TimePeriodToCheck$" ParameterType="int"/>
<OverrideableParameter ID="LogEnabled" Selector="$Config/LogEnabled$" ParameterType="bool"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<ProbeAction ID="PA" TypeID="Windows!Microsoft.Windows.PowerShellProbe">
<ScriptName>ISMPing.ps1</ScriptName>
<ScriptBody><Script>
param($HostName, [int]$TimePeriodToCheck , $CheckInterval , $LogEnabled)
$logDirectory = "DellDeviceReachability_Logs"
$TempFolder = $env:SystemRoot + "\Temp"

$LogLocation = $TempFolder + "\" + $logDirectory + "\"
$scriptname = "ISM-WMI-Interface-Check"
if($LogEnabled -eq "True"){
If(!(Test-Path -path($TempFolder)))
{
# create the directory if not present
$Obj = New-Item $TempFolder -type directory
}

If(!(Test-Path -path($LogLocation)))
{
# create the directory if not present
$Obj = New-Item $LogLocation -type directory
}
$Global:LogFileLocation = $LogLocation + $scriptname + ".log"
If(!(Test-Path -path($LogFileLocation)))
{
# create the file if it does not exist
$Obj = 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")
$Obj = New-Item $LogFileLocation -type file
}
}}
Function psDebugLog
{
param($message)
if($LogEnabled -eq "True"){


$currentTime = Get-Date -f "yyyy-MM-dd_HH.mm.ss"
Out-File -FilePath $LogFileLocation -InputObject ($currentTime + " Machine HostName " + $HostName + " :: " + $message) -Append
}}
[string]$loop = "true"
[int]$Success =0
[int]$Failure=0
[int]$ISMWMIsuccess=0
[int]$ISMWMIfailure=0

[int]$Attempt=0
[int]$delay = ([int]$CheckInterval * 60)
[int]$TimePeriodCheck = ([int]$TimePeriodToCheck * 60)
psDebugLog -message " ---- Time period for the task to run is $TimePeriodCheck seconds.";
$script:StopWatch = [System.diagnostics.stopwatch]::StartNew()

$profile = "DCIM_SystemView"

try
{
while ($loop -eq "true")
{
psDebugLog -message "---- Starting the in Band interfaces response check.";
if($script:StopWatch.Elapsed.TotalSeconds -le $TimePeriodCheck)
{
$Attempt++
psDebugLog -message "---- Testing connection with device ----- Attempt number: $Attempt -----";

If (Test-Connection $HostName -count 1 -quiet)
{
$Success++
$command = Get-CimClass -Namespace root\cimv2\dcim -ClassName $profile -ComputerName $HostName -ErrorAction SilentlyContinue | select CimClassName
if($command.CimClassName -eq "DCIM_SystemView")
{
$ISMWMIsuccess++

psDebugLog -message "WMI ISM DCIM_SystemView profile found";
}
else
{
$ISMWMIfailure++

psDebugLog -message "WMI ISM DCIM_SystemView profile not found";
}
}
else
{
$Failure++
psDebugLog -message " ----Test connection failure occured with device."
}
psDebugLog -message " ----Going on wait for $delay seconds."

Start-Sleep -s $delay


[int]$Elaspedtime = [int]$StopWatch.Elapsed.TotalSeconds
psDebugLog -message " ---Total elapsed time is $Elaspedtime seconds "
psDebugLog -message " ----------------------------------------Waiting time over for $delay seconds, starting for next cycle of interface connection check ---------------------------------------"

}

else
{
psDebugLog -message "Time period to run the task is completed, coming out of node interface check"
$loop = "false"
}
}
}
catch
{
$Failure++
$ErrorMessage = $_.Exception.Message
psDebugLog -message ("Exception in interface check task ---- " + " Exception-Message:" + $ErrorMessage)
}
psDebugLog -message ("Node interface check completed publishing results on Task Output.")
Write-Host "Reachability Check: Attempted " $Attempt " times, Success " $Success " times, Failure " $Failure " times"
Write-Host "WMI Interface Check: Attempted " $Success " times, Success " $ISMWMIsuccess " times, Failure " $ISMWMIfailure " times"

</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>HostName</Name>
<Value>$Config/HostName$</Value>
</Parameter>
<Parameter>
<Name>TimeoutSeconds</Name>
<Value>$Config/TimeoutSeconds$</Value>
</Parameter>
<Parameter>
<Name>TimePeriodToCheck</Name>
<Value>$Config/TimePeriodToCheck$</Value>
</Parameter>
<Parameter>
<Name>CheckInterval</Name>
<Value>$Config/CheckInterval$</Value>
</Parameter>
<Parameter>
<Name>LogEnabled</Name>
<Value>$Config/LogEnabled$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="PA"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>Windows!Microsoft.Windows.SerializedObjectData</OutputType>
<InputType>System!System.BaseData</InputType>
</ProbeActionModuleType>