Hi
Have made a custom Management Pack that uses a PS script to collect output.
I get this in the output (OpsMgr Eventlog on the agent running the workflow).
Module was unable to convert parameter to a double value
Original parameter: ‘$Data/Property[@Name=’LicensesTotal’]$’
Parameter after $Data replacement: ”
Error: 0x80020005
Details: Type mismatch.
I cant figure out what the fault is. If I runt the PS-script locally the output of LicensesTotal is shown.
Can anyone see if I’ve done something wrong in the below Collection rule?
Here is the Collection Rule:
<ManagementPackFragment SchemaVersion=”2.0″ xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<TypeDefinitions>
<ModuleTypes>
<DataSourceModuleType ID=”PRS.Microsoft.Windows.Server.RemoteDesktopServices.2012.Extensions.TotalLicenses” Accessibility=”Internal” Batching=”false”>
<Configuration>
<xsd:element type=”xsd:integer” name=”IntervalSeconds” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” />
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID=”IntervalSeconds” Selector=”$Config/IntervalSeconds$” ParameterType=”int” />
</OverrideableParameters>
<ModuleImplementation Isolation=”Any”>
<Composite>
<MemberModules>
<DataSource ID=”Scheduler” TypeID=”System!System.Scheduler”>
<Scheduler>
<SimpleReccuringSchedule>
<Interval Unit=”Seconds”>$Config/IntervalSeconds$</Interval>
</SimpleReccuringSchedule>
<ExcludeDates />
</Scheduler>
</DataSource>
<ProbeAction ID=”Probe” TypeID=”PRS.Microsoft.Windows.Server.RemoteDesktopServices.2012.Extensions.TotalLicenses.Rule.ProbeActionModuleType”>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID=”Probe”>
<Node ID=”Scheduler” />
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>
<ProbeActionModuleType ID=”PRS.Microsoft.Windows.Server.RemoteDesktopServices.2012.Extensions.TotalLicenses.Rule.ProbeActionModuleType” Accessibility=”Internal” Batching=”false” PassThrough=”false”>
<Configuration>
</Configuration>
<ModuleImplementation Isolation=”Any”>
<Composite>
<MemberModules>
<ProbeAction ID=”Probe” TypeID=”Windows!Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe”>
<ScriptName>TotalLicenses.ps1</ScriptName>
<ScriptBody>$IncludeFileContent/Scripts/TotalLicenses.ps1$</ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID=”Probe” />
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
<TriggerOnly>true</TriggerOnly>
</ProbeActionModuleType>
</ModuleTypes>
</TypeDefinitions>
<Monitoring>
<Rules>
<Rule ID=”PRS.Microsoft.Windows.Server.RemoteDesktopServices.2012.Extensions.TotalLicenses.Rule” Comment=”Collects Total nr of Licenses” Enabled=”true” Target=”MWSR2!Microsoft.Windows.Server.2012.RemoteDesktopServicesRole.Service.RDLicensing” ConfirmDelivery=”false” Remotable=”true” Priority=”Normal” DiscardLevel=”100″>
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID=”DataSource” TypeID=”PRS.Microsoft.Windows.Server.RemoteDesktopServices.2012.Extensions.TotalLicenses”>
<IntervalSeconds>3600</IntervalSeconds>
</DataSource>
</DataSources>
<ConditionDetection ID=”System.Performance.DataGenericMapper” TypeID=”Perf!System.Performance.DataGenericMapper”>
<ObjectName>Remote Desktop Licensing</ObjectName>
<CounterName>Total Licenses</CounterName>
<InstanceName>ComputerName</InstanceName>
<Value>$Data/Property[@Name=’LicensesTotal’]$</Value>
</ConditionDetection>
<WriteActions>
<WriteAction ID=”Microsoft.SystemCenter.CollectPerformanceData” TypeID=”SC!Microsoft.SystemCenter.CollectPerformanceData” />
<WriteAction ID=”Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData” TypeID=”MSDL!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData” />
</WriteActions>
</Rule>
</Rules>
</Monitoring>
<LanguagePacks>
<LanguagePack ID=”ENU” IsDefault=”true”>
<DisplayStrings>
<DisplayString ElementID=”PRS.Microsoft.Windows.Server.RemoteDesktopServices.2012.Extensions.TotalLicenses”>
<Name>Collects Total nr of Licenses Script</Name>
<Description>Collects Total nr of Licenses Script</Description>
</DisplayString>
<DisplayString ElementID=”PRS.Microsoft.Windows.Server.RemoteDesktopServices.2012.Extensions.TotalLicenses.Rule.ProbeActionModuleType”>
<Name>Collects Total nr of Licenses Rule ProbeActionModuleType</Name>
<Description>Probe Action Module Type for Performance Rule: Collects Total nr of Licenses Rule</Description>
</DisplayString>
<DisplayString ElementID=”PRS.Microsoft.Windows.Server.RemoteDesktopServices.2012.Extensions.TotalLicenses” SubElementID=”IntervalSeconds”>
<Name>Interval Seconds</Name>
</DisplayString>
<DisplayString ElementID=”PRS.Microsoft.Windows.Server.RemoteDesktopServices.2012.Extensions.TotalLicenses.Rule”>
<Name>Collects Total nr of Licenses</Name>
<Description>Collects Total nr of Licenses</Description>
</DisplayString>
</DisplayStrings>
</LanguagePack>
</LanguagePacks>
</ManagementPackFragment>