Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

Parameterized templates

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
Anonymous
N/A

Re: Parameterized templates

Cisco Employee

Re: Parameterized templates

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

Community Member

Re: Parameterized templates

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)#

Community Member

Re: Parameterized templates

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)#

Cisco Employee

Re: Parameterized templates

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).

Community Member

Re: Parameterized templates

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.

Cisco Employee

Re: Parameterized templates

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.

Community Member

Re: Parameterized templates

Case 607136311

Cisco Employee

Re: Parameterized templates

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.

Community Member

Re: Parameterized templates

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!

161
Views
5
Helpful
10
Replies
CreatePlease to create content