08-05-2020 12:29 AM
Hi,
I have device c0, c1, c2, and want to configure c0 and c1 from NSO cli. If I use the following wildcard, it would catch c2 as well which is unwanted:
admin@ncs(config)# devices device c*
admin@ncs(config-device-c*)# config
admin@ncs(config-config)#
Is there a way to do this from NSO CLI ?
I know about device template, but want to check if there is another way.
Thanks,
Simon
Solved! Go to Solution.
08-05-2020 12:52 AM
One simple way to go about it is to make your configs for one device and before you commit do "top ; show conf | display xml", then copy the output to notepad, and duplicate the <device> block per the devices you want (setting the device names accordingly).
Then you can load these configs to NSO (e.g. with "load merge terminal") and commit.
08-05-2020 07:36 AM
Hello Simon,
Presuming you want to change the same config on all devices specified as indicated by your example, you can list the devices that you want to configure, much like your c*, but more specifically with a comma separated 'range':
admin@ncs(config)# devices device
Possible completions:
A string uniquely identifying the managed device
devxr-0
devxr-1
devxr-2
devxr-3
admin@ncs(config)# devices device devxr-0,2
admin@ncs(config-device-devxr-0,2)# description "test device list"
admin@ncs(config-device-devxr-0,2)# commit dry-run
cli {
local-node {
data devices {
device devxr-0 {
+ description "test device list";
}
device devxr-2 {
+ description "test device list";
}
}
}
}
A bit of a discussion on this in the NSO User Guide, see "Range Expressions" section
Device-groups may be a consideration as well.
08-05-2020 12:52 AM
One simple way to go about it is to make your configs for one device and before you commit do "top ; show conf | display xml", then copy the output to notepad, and duplicate the <device> block per the devices you want (setting the device names accordingly).
Then you can load these configs to NSO (e.g. with "load merge terminal") and commit.
08-05-2020 07:36 AM
Hello Simon,
Presuming you want to change the same config on all devices specified as indicated by your example, you can list the devices that you want to configure, much like your c*, but more specifically with a comma separated 'range':
admin@ncs(config)# devices device
Possible completions:
A string uniquely identifying the managed device
devxr-0
devxr-1
devxr-2
devxr-3
admin@ncs(config)# devices device devxr-0,2
admin@ncs(config-device-devxr-0,2)# description "test device list"
admin@ncs(config-device-devxr-0,2)# commit dry-run
cli {
local-node {
data devices {
device devxr-0 {
+ description "test device list";
}
device devxr-2 {
+ description "test device list";
}
}
}
}
A bit of a discussion on this in the NSO User Guide, see "Range Expressions" section
Device-groups may be a consideration as well.
08-05-2020 08:46 PM
Thanks, both of these solution would do the job!
Device-group would have been ideal, but somehow the config option is not available with it:
admin@ncs(config)# devices device-group dg1
admin@ncs(config-device-group-dg1)# config
------------------------------------^
syntax error: unknown command
admin@ncs(config-device-group-dg1)#
08-06-2020 12:06 AM
The way it works with device-groups is to apply a device template as device-groups could have members from different type of devices.
08-06-2020 12:30 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide