Converts Bits to Mbits

AP.Isilon.DataSource.Performance.ConvertBitsToMb (DataSourceModuleType)

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
OutputTypeSystem.Performance.Data

Member Modules:

ID Module Type TypeId RunAs 
SnmpDataSource DataSource System.NetworkManagement.SnmpDataSource Default
ScriptProbePS ProbeAction Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe Default
Mapper ConditionDetection System.Performance.DataGenericMapper Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
IntervalSecondsint$Config/IntervalSeconds$Interval SecondsFrequency in seconds that module is run.
NoOfRetriesint$Config/NoOfRetries$Number of RetriesNumber of times that the request should be retried if the first request fails.
Timeoutint$Config/Timeout$TimeoutSeconds that the request must be complete before it is terminated.

Source Code:

<DataSourceModuleType ID="AP.Isilon.DataSource.Performance.ConvertBitsToMb" Accessibility="Public" Batching="false">
<Configuration>
<IncludeSchemaTypes>
<SchemaType>System!System.ParamListSchema</SchemaType>
<SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
<SchemaType>SNMP!System.SnmpVarBindsSchema</SchemaType>
</IncludeSchemaTypes>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="NoOfRetries" type="xsd:unsignedInt" default="3"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Timeout " type="xsd:unsignedInt" default="500"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IP" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Community" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SnmpVarBinds" type="SnmpVarBindsType"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ObjectName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="CounterName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="InstanceName" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="NoOfRetries" Selector="$Config/NoOfRetries$" ParameterType="int"/>
<OverrideableParameter ID="Timeout" Selector="$Config/Timeout$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="SnmpDataSource" TypeID="SNL!System.NetworkManagement.SnmpDataSource">
<Scheduler>
<SimpleReccuringSchedule>
<Interval Unit="Seconds">$Config/IntervalSeconds$</Interval>
<SpreadInitializationOverInterval Unit="Seconds">$Config/IntervalSeconds$</SpreadInitializationOverInterval>
</SimpleReccuringSchedule>
<ExcludeDates/>
</Scheduler>
<NoOfRetries>$Config/NoOfRetries$</NoOfRetries>
<Timeout>$Config/Timeout$</Timeout>
<Port>161</Port>
<IP>$Config/IP$</IP>
<CommunityString>$Config/Community$</CommunityString>
<Version>2</Version>
<SnmpVarBinds>$Config/SnmpVarBinds$</SnmpVarBinds>
<OutputOnError>false</OutputOnError>
</DataSource>
<ProbeAction ID="ScriptProbePS" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe">
<ScriptName>ConvertBitsToMb.ps1</ScriptName>
<ScriptBody><Script>#==================================================================================
# Script: ConvertBitsToMb.ps1
# Date: 12/07/18
# Author: Andi Patrick
# Purpose: Converts Bits Per Second to Mbits Per Second
#==================================================================================

# Named Parameters
param($Number)

#Start by setting up API object.
$api = New-Object -comObject 'MOM.ScriptAPI'

#Create a property bag.
$bag = $api.CreatePropertyBag()

# Add Value to Property Bag
$bag.AddValue('Number', [math]::Round([Double]($Number / 1024 / 1024),4))

# Return Property Bag
#$api.Return($bag)
$bag</Script></ScriptBody>
<SnapIns/>
<Parameters>
<Parameter>
<Name>Number</Name>
<Value>$Data/SnmpVarBinds/SnmpVarBind[1]/Value$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>60</TimeoutSeconds>
</ProbeAction>
<ConditionDetection ID="Mapper" TypeID="Perf!System.Performance.DataGenericMapper">
<ObjectName>$Config/ObjectName$</ObjectName>
<CounterName>$Config/CounterName$</CounterName>
<InstanceName>$Config/InstanceName$</InstanceName>
<Value>$Data/Property[@Name="Number"]$</Value>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="Mapper">
<Node ID="ScriptProbePS">
<Node ID="SnmpDataSource"/>
</Node>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>Perf!System.Performance.Data</OutputType>
</DataSourceModuleType>