Parameterized templates

Unanswered Question
Oct 16th, 2007
User Badges:


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

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Joe Clarke Tue, 10/23/2007 - 07:55
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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

jedavis Tue, 10/23/2007 - 11:05
User Badges:

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


jedavis Tue, 10/23/2007 - 11:32
User Badges:

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


Joe Clarke Tue, 10/23/2007 - 11:37
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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

jedavis Tue, 10/23/2007 - 11:54
User Badges:

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.



Attachment: 
Joe Clarke Tue, 10/23/2007 - 12:06
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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.

Joe Clarke Tue, 10/23/2007 - 19:01
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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.

jedavis Wed, 10/24/2007 - 04:59
User Badges:

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!

Actions

This Discussion