Showing results for 
Search instead for 
Did you mean: 
Create Post

Looking to change @ContextNode.OS_Description to @ContextNode."Node Group"

I'm looking for a way to alter a script that a previous employee created, that build the list of commands based on what OS the device has.

We have a custom field in the NCM section of the device properties called OS_Description.  However, it will make much more sense to filter based on what "Node Group" a device is in.  Is there a library of options or a better way to make change?

I attached the script, since I can't seem to paste into this page.

Labels (2)
0 Kudos
1 Reply

I would recommend you utilise core Orion Custom Properties, rather than the NCM Node Group field, which I would not be surprised was removed eventually.

The following is an excerpt from another post on the use of Custom Properties within Config Templates, which should point you in the right direction.


Custom properties are tied with nodes, and therefore can be referenced via the node parameter:

script BaseChangeTemplate (NCM.Nodes @ContextNode)
    show @ContextNode.MyCustomProperty

Assuming we have created and filled in the AssetTag custom property for our devices, we can make use of e.g. it in the following way to change access lists:

script ChangeAccessList (NCM.Nodes @ContextNode)
  string @myip = '10.10.'
  @myip = @myip + @ContextNode.AssetTag        
here we make the asset tag part of the IP address
  @myip = @myip + '.32'                        
finish building IP
commands within a CLI block are sent to the device
    configure terminal
    no access-list 112
    access-list 112 remark This is a test
    access-list 112 permit tcp @myip host eq 445      
include the IP with asset tag info in the access list

0 Kudos