SCUtils.APC.UPS.BatteryRunTime.DS (DataSourceModuleType)

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
SnmpProbe DataSource SCUtils.APC.UPS.BasicSnmpProbe.DS Default
PSScriptProbe ProbeAction Microsoft.Windows.PowerShellPropertyBagProbe Default

Overrideable Parameters:

IDParameterTypeSelector
IntervalSecondsint$Config/IntervalSeconds$

Source Code:

<DataSourceModuleType ID="SCUtils.APC.UPS.BatteryRunTime.DS" Accessibility="Internal" Batching="false">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="IPAddress" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="CommunityString" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="SnmpVersion" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="OID" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="SnmpProbe" TypeID="SCUtils.APC.UPS.BasicSnmpProbe.DS">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<IPAddress>$Config/IPAddress$</IPAddress>
<CommunityString>$Config/CommunityString$</CommunityString>
<SnmpVersion>$Config/SnmpVersion$</SnmpVersion>
<SnmpVarBinds>
<SnmpVarBind>
<OID>$Config/OID$</OID>
<Syntax>0</Syntax>
<Value VariantType="8"/>
</SnmpVarBind>
</SnmpVarBinds>
<PreProbeFilterExpression>
<SimpleExpression>
<ValueExpression>
<Value Type="String">1</Value>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">1</Value>
</ValueExpression>
</SimpleExpression>
</PreProbeFilterExpression>
</DataSource>
<ProbeAction ID="PSScriptProbe" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagProbe">
<ScriptName>ConvertToMinutes.ps1</ScriptName>
<ScriptBody><Script>
param ([string] $nValue)
$api = New-Object -comObject 'MOM.ScriptAPI'

if ([double]$nValue -ge 0){
[double]$nMinutes = $nValue/6000

$bag = $api.CreatePropertyBag()
$bag.AddValue("nMinutes",$nMinutes)
$bag

Remove-Variable api
Remove-Variable bag
}

</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>nValue</Name>
<Value>$Data/SnmpVarBinds/SnmpVarBind[1]/Value$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>300</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="PSScriptProbe">
<Node ID="SnmpProbe"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>