Lenovo.TMM.Server.Fan.Monitor.Property.Bag.Probe (ProbeActionModuleType)

Element properties:

TypeProbeActionModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
InputTypeSystem.BaseData
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
Fan.ProbeAction ProbeAction Microsoft.Windows.PowerShellPropertyBagProbe Default

Source Code:

<ProbeActionModuleType ID="Lenovo.TMM.Server.Fan.Monitor.Property.Bag.Probe" Accessibility="Internal">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ComputerName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="Description" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="RotationalSpeed" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="LowerCriticalThreshold" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="LowerNonCriticalThreshold" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="LowerNonRecoverableThreshold" type="xsd:string"/>
</Configuration>
<ModuleImplementation>
<Composite>
<MemberModules>
<ProbeAction ID="Fan.ProbeAction" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagProbe">
<ScriptName>PSUFan.ps1</ScriptName>
<ScriptBody><Script>

# **********************************************************************************
# Script Name : PSUFan
# Authored by : MphasiS Corporation
# Description : ProbeAction for Fans
#
# Copyright (c) 2013 Lenovo Group. All rights reserved.
# Redistribution and use in source and binary forms, with or without modification,
# is not permitted without specific prior written permission from Lenovo.
# **********************************************************************************

param($computerName, $Description, $RotationalSpeed, $LowerCriticalThreshold, $LowerNonCriticalThreshold, $LowerNonRecoverableThreshold )

$api = new-object -comObject 'MOM.ScriptAPI'
$bag = $api.CreatePropertyBag()

$bag.AddValue('ComputerName',$computerName)
$bag.AddValue('Description',$Description)
$bag.AddValue('RotationalSpeed',$RotationalSpeed)
$bag.AddValue('LowerCriticalThreshold',$LowerCriticalThreshold)
$bag.AddValue('LowerNonCriticalThreshold',$LowerNonCriticalThreshold)
$bag.AddValue('LowerNonRecoverableThreshold',$LowerNonRecoverableThreshold)

[double]$CurrentSpeed = $RotationalSpeed
[double]$CriticalThresholdSpeed = $LowerCriticalThreshold
[double]$NonRecoverableThresholdSpeed = $LowerNonRecoverableThreshold
[double]$NonCriticalThresholdSpeed = $LowerNonCriticalThreshold

if ( ($NonCriticalThresholdSpeed -eq 0) -and ($CriticalThresholdSpeed -eq 0) -and ($NonRecoverableThresholdSpeed -eq 0))
{
$bag.AddValue('Status', 'OK')
}
elseif ( $CurrentSpeed -gt $CriticalThresholdSpeed )
{
$bag.AddValue('Status', 'OK')
}
elseif ( ($CurrentSpeed -le $CriticalThresholdSpeed ) -and ( $CurrentSpeed -gt $NonRecoverableThresholdSpeed))
{
$bag.AddValue('Status', 'Warning')
}
elseif ( $CurrentSpeed -le $NonRecoverableThresholdSpeed)
{
$bag.AddValue('Status', 'Bad')
}

#Return the property bag
$bag


</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>ComputerName</Name>
<Value>$Config/ComputerName$</Value>
</Parameter>
<Parameter>
<Name>Description</Name>
<Value>$Config/Description$</Value>
</Parameter>
<Parameter>
<Name>RotationalSpeed</Name>
<Value>$Config/RotationalSpeed$</Value>
</Parameter>
<Parameter>
<Name>LowerCriticalThreshold</Name>
<Value>$Config/LowerCriticalThreshold$</Value>
</Parameter>
<Parameter>
<Name>LowerNonCriticalThreshold</Name>
<Value>$Config/LowerNonCriticalThreshold$</Value>
</Parameter>
<Parameter>
<Name>LowerNonRecoverableThreshold</Name>
<Value>$Config/LowerNonRecoverableThreshold$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>300</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="Fan.ProbeAction"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
<InputType>System!System.BaseData</InputType>
</ProbeActionModuleType>