Extensions
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Auto-tag VMware Entities by Name | VMware (remote monitoring) extension

AK
Pro

Hello Folks,

We have enabled VMware extension in our organization. Below are the corresponding entity detection identifiers:

  • VMware vCenter → dt.entity.vmware:vcenter
  • VMware VM → dt.entity.vmware:virtualmachine
  • VMware Cluster → dt.entity.vmware:cluster
  • VMware Datacenter → dt.entity.vmware:datacenter
  • VMware Datastores → dt.entity.vmware:datastore
  • VMware Host → dt.entity.vmware:host
  • VMware Disks → dt.entity.vmware:disk

I would like to create automatic tags based on the entity names.

For instance, a datastore named "dtstore-1" should automatically receive the tag: datastore:dtstore-1.

I tried adding the rule: Apply '{CustomDevice:Name}' to Entities matching type("vmware:datastore")

But it resulted in a warning: Placeholders are not applicable for entity selector based rules.

Is there an alternative method to achieve this? Please guide.

Regards,
AK

2 REPLIES 2

sujit_k_singh
Champion

Hi @AK 

For all Entity selector-based tagging rules, Dynatrace doesn't support placeholders, regardless of whether the matched entities are VMware entities, Custom Devices, Hosts, Services, or Process Groups.

I have used below method and it works perfectly

type("vmware:virtualmachine"),entityName.contains("prod-app")
type("vmware:vcenter"),entityName.contains("vc-prod")
type("vmware:host"),entityName.contains("esx-prod")
type("vmware:datacenter"),entityName.contains("primary")
type("vmware:datastore"),entityName.contains("gold-storage")
type("vmware:cluster"),entityName.contains("compute")
type("vmware:disk"),entityName.contains("data-disk")
 
sujit_k_singh_1-1785190906690.png

 

sujit_k_singh_0-1785189294816.png

Thanks,

Sujit

Dynatrace Professional Certified

JoãoSilva
Newcomer_

Hi @AK ,

I assume you want to tag with the entity name and not a static value. You can do this using placeholders but for the rule use regex.

The only issue with this is it would apply the tag according to what the regex grabs. It really depends on if you have any kind of naming convention in your environment or not. Or you can just simply put a generic automatic tag, something called: Device_Name or something that would apply to all Custom Devices (Which all those entity types are).

 

Here's an example how to apply to every CUSTOM_DEVICE its entity name:

JooSilva_0-1785408189134.png

 

If there's currently a naming convention in your environment for the vmware entities, then you can use the regex to filter them and apply the tag.

 

Alternatively, you can use manual tags:

  • Through a workflow, via API do a GET request to grab those entities (probably a request per entity type)
    • Parse the entity name and tags (Check if the tag already exists)
    • If it doesn't exist, create the tag with a POST request

You can also the same process explained for the workflow but using an external automation source, be it a script somewhere or a solution like N8N.

 

Best regards,

João

Featured Posts