Forum Discussion

Justin_Lanoue's avatar
4 months ago

New vCenter Module Tags

Not sure why LogicMonitor changed the way the tags are stored on the VM instances in the new vCenter modules but it seems to hinder the ability to map the VM to clients we host.

Before this would nicely add a property to each VM like

auto.tag1 = value

auto.tag2 = value

Now it just puts them all into 1 property such as:

auto.vm.tags = tag1.value, tag1.value.

We use to be able to create a specific alert template to grab the ##auto.tag1## and use that as the mapping to our client but that’s no longer easily done when they are all grouped together.

Does anyone have an easy solution or would I need to modify the code like before?

Thanks,

3 Replies

  • Ah, right, i didn’t realize they were instance level properties. So, you’re stuck with two options:

    1. Modify the datasource discovery script so that the properties are split out instead of in a list.
    2. Create a separate script that uses the API to read auto.vm.tags and patch the instance with the split tags.

    Technically, there is a third option: submit a feature request. But I imagine you need a solution before you kids invent time travel using their quantum cybernetic implants.

  • I’m struggling to answer your question, because the way you were doing it is not really a reliable method. What if the tags come in a different order and the value you expect to be the first tag in the list ends up being the second tag in the list? Maybe i misunderstand because i’m not using the new vCenter modules yet. Are the tags not actually called tag1, tag2? So in reality, the names are unique?

    If they are unique and “tag1.value” is actually something like “customerId.123456”, you can easily create a propertysource to parse auto.vm.tags:

    hostProps.get("auto.vm.tags").tokenize(",").each{pair ->
    pair.tokenize(".").each{k,v->
    println("${k}: ${v}")
    }
    }
    return 0
  • This is what it was before where the VM instance under the vCenter had 2 tags which would then apply as 2 separated properties.

    vCenter

      VM Performance

         VM Name

            auto.tenant = LogicMonitor

            auto.backup = No

    Now it shows like this in the new modules.

    vCenter

      VM Performance

         VM Name

            auto.vm.tags = tenant.LogicMonitor, backup.No

    I use to put ##auto.tenant## into our subject line of the email and it would put the ticket under LogicMonitor client as an example since it would map subject line variable to the client if they matched.

    With the new modules, I can’t simply put ##auto.vm.tags## as it would be multiple tags in a random order like you said.

    I also don’t think I can add a property source as the VM tags are a instance level property. I believe I would have to make the instance level properties within the script myself like they use to do it.