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.
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)
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
CLI commands within a CLI block are sent to the device
no access-list 112
access-list 112 remark This is a test
access-list 112 permit tcp @myip 0.0.0.31 host 18.104.22.168 eq 445 include the IP with asset tag info in the access list
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 150,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.