SYNAXON / GraphiteReceiver

A vmware statsfeeder receiver to export the stats directly into graphite.
Apache License 2.0
20 stars 7 forks source link

Fix prepended container with brackets when container different than vCenter #15

Closed toni-moreno closed 9 years ago

toni-moreno commented 9 years ago

The previous code always assumed that container was always vCenter

            <container>
                <name>vCenter</name>
                <type>Folder</type>
            </container>

with this PR you can set now any container name.

will fix https://github.com/SYNAXON/GraphiteReceiver/issues/13

About the change:

previous code did

eName=entityName.replace("[vCenter]", "")
                  .replace("[VirtualMachine]", "")
                  .replace("[HostSystem]", "")
                  .replace("[Datastore]", "")
                  .replace("[ResourcePool]", "")

but com.vmware.ee.statsfeeder.MOREFRetriever class has a method to parse entity names.

ret=context.getMorefRetriever();
eName=ret.parseEntityName(entityName)

StatsFeeder always has entityName as:

 [containerName]EntityName[EntityType]