This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Create custom variable for Cisco device and execute change using the custom variable

We have been unable to find the answer to this, and if it exists somewhere on the platform I apologize in advance.

We are trying to change hostnames on a group of Cisco devices by adding additional text to the end of the existing hostname.

In other tools I have been able to use a script to define a new variable, then create a template to define what portion of a running config to associate with the new variable, and then use that variable to make a change in the device. Is this possible in NCM and if so can someone provide an example or useful documentation?

  • cooper.cash​ While this can be achieved several ways, this should be a fairly simple task. I have renamed numerous nodes previously by adding a custom property to each group of nodes (you can edit in bulk, by importing an Excel sheet, matching on name, or IP, or anything else unique). That new custom property contained the new name for each node. Then, I just ran an NCM job to run a CLI command, subbing in that new custom property variable for the new hostname.

    I'm pretty sure I've posted something about it before. Give me a few to look through that jungle of Thwack posts... Hopefully I can find it.

  • cooper.cash​ Ah, here you go. Try what I mention in the following post:Script to remove characters out of host name

    I know that post is asking to remove chars, and you are wanting to add chars, but the solution is the same.
    Create custom property to hold new name.

    Create NCM job to run command on device(s).

    Use new custom property variable to rename device(s).

    I hope this helps. Please let us know how it goes, and if you need anything else.

    Thank you,

    -Will