Is it possible to create String Arrays in NCM yet. I saw reference to a post 11 years ago and someone responded that String Arrays are only supported as a Template input. Has this ever been made an available option. Or does anybody else have any other ideas. I'm trying to create a script that will deploy the configuration globally on all of our devices based on the Custom Attribute Region they are located.
We have multiple different device types around the globe, and depending on the region we use a specific set of three nodes. I'm able to create a Comma deliniated string, but can't seem to put it into an array. If i put the string in a "for each(@ntp in @NTPGROUP) It seperates the entire string each line by line.
Script
string @HOST1 = '1.1.1.1'
string @HOST2 = '2.2.2.2'
string @HOST3= '3.3.3.3'
string @HOST4 = '4.4.4.4'
string @HOST5 = '5.5.5.5'
string @NTPGROUP1 = @HOST1 + ',' + @HOST2+ ',' + @HOST3
foreach (@NTP in @NTPGROUP1)
{
CLI
{
ntp-server @NTP
}
The ouptut shows up like this.
ntp-server 1
ntp-server .
ntp-server 1
ntp-server .
ntp-server 1
ntp-server .
ntp-server 1
ntp-server ,
ntp-server 2
ntp-server .
ntp-server 2
ntp-server .
ntp-server 2
ntp-server .
ntp-server 2
ntp-server ,
ntp-server 3
ntp-server .
ntp-server 3
------- ETC