cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1065
Views
5
Helpful
10
Replies

Parameterized templates

Siebe Brouwer
Level 1
Level 1

I need to change the hostname on a few switches, so I want to the the Parameterized templates in NetConfig.

I've used the following parameter file:

<DEVICE NAME = mySwitch>

<CMDPARAM NAME = hostName>

<value>mySwitch</value>

</CMDPARAM>

</DEVICE>

My template:

hostname $hostName

But the command that is sent to the switch is:

hostname mySwitch.0

Note the .0 at the end. That's not very pretty. Has anyone seen this before?

Kind regards,

Siebe

10 Replies 10

Joe Clarke
Cisco Employee
Cisco Employee

I have not. What version of RME are you using?

jedavis
Level 4
Level 4

I just ran into the same issue. RME 4.0.5.

f0/21-22

27

CLI Output

interface range f0/21-22.0

interface range f0/21-22.0

^

% Invalid input detected at '^' marker.

TSTS02(config)#

switchport access vlan 27

switchport access vlan 27

^

% Invalid input detected at '^' marker.

TSTS02(config)#

Interesting. I noticed in the CLI output above that the .0 was only on the first parameter. So I added a comment line with a dummy parameter before that in my template.

X

f0/21-22

27

The result is still this:

CLI Output

! X for Netconfig.0 problem

TSTS02(config)#

interface range f0/21-22.0

interface range f0/21-22.0

^

% Invalid input detected at '^' marker.

TSTS02(config)#

switchport access vlan 27

switchport access vlan 27

^

% Invalid input detected at '^' marker.

TSTS02(config)#

Please enable ConfigJob debugging under RME > Admin > System Preferences > Loglevel Settings, re-run your job, then post the Netconfig job directory under /var/adm/CSCOpx/files/rme/jobs/NetConfigJob (Solaris) or NMSROOT\files\rme\jobs\NetConfigJob (Windows).

It has something to do with the hyphen. If I take it out of the parameter, it works. If I put a space on either side of the hyphen it also works.

However, I posted the [edited] directory of a failed job.

I think I see the bug. However, I cannot post code on the forum. It will take me some time to test this patch, but if you would like to open a service request with TAC, I can send you the patch to try out. Just tell the engineer who gets your SR to contact me.

Case 607136311

I sent the patch to the engineer you owns the SR. The problem is the way the values are being parsed. The trick is that the line ends with "-22". The parser treats most characters as ordinary characters. However, the '-' was left as a default character. Because of that, when the '-' precedes a numeric value, the resulting string is parsed as a number (-22 in this case). The parser returns numbers in double precision format, thus -22 becomes -22.0.

I have fixed this problem, and local tests show the solution to be effective.

That did the trick Joe.

CLI Output

interface range f0/23-24

TSTS02(config-if-range)#

switchport access vlan 4

TSTS02(config-if-range)#

Thanks for the patch!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: