Skip to content

Returning Multiple PropertyBags possible with Performance Rules ? #5

@MrDibbley

Description

@MrDibbley

with the following code snippet:

` foreach ($omnistackhost in $omnistackcluster.members) {

$uri = "https://" + $ovc + "/api/hosts/" + $omnistackhost 
$hostresponse = Invoke-RestMethod -Uri $uri -Headers $headers -Method Get

$propertyBag = $scomAPI.CreatePropertyBag()
$propertyBag.AddValue("Instance", $hostresponse.host.name)
$propertyBag.AddValue("Counter", "Used")
$propertyBag.AddValue("Value", $hostresponse.host.used_capacity)
$propertyBag

$propertyBag = $scomAPI.CreatePropertyBag()
$propertyBag.AddValue("Instance", $hostresponse.host.name)
$propertyBag.AddValue("Counter", "Total")
$propertyBag.AddValue("Value", $hostresponse.host.allocated_capacity)
$propertyBag

}`

mapped in the performance mapper as:

Object - OmnistackCapacity
Counter - $Data/Property[@name='Counter']$
Instance - $Data/Property[@name='Instance']$
Value - $Data/Property[@name='Value']$

when results are returned the countername does not get updated, so Countername = UsedBytes for both bags?

from DW db -
2018-02-15 11:21:39.833 265672542208 hh-hpe-i03.diti.lr.net UsedBytes
2018-02-15 11:21:39.833 6091815282278 hh-hpe-i03.diti.lr.net UsedBytes
2018-02-15 11:21:39.520 265151482880 hh-hpe-i04.diti.lr.net UsedBytes
2018-02-15 11:21:39.520 6091815282278 hh-hpe-i04.diti.lr.net UsedBytes

when i was hoping for:

2018-02-15 11:21:39.833 265672542208 hh-hpe-i03.diti.lr.net UsedBytes
2018-02-15 11:21:39.833 6091815282278 hh-hpe-i03.diti.lr.net TotalBytes
2018-02-15 11:21:39.520 265151482880 hh-hpe-i04.diti.lr.net UsedBytes
2018-02-15 11:21:39.520 6091815282278 hh-hpe-i04.diti.lr.net TotalBytes

is it possible to return multiple bags this way or will i need to create two separate collectors?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions