EMM MDF Wizard

Answered Question

I am testing the menu definition file and it could be very userful to give some access to a user that doesn't know how to configure a cisco router. The only think that I am having difficulty is with the wizard. I got the question that appear correclty but when I type the information I got a error: EMM TCL Error: invalid command name "Test::5"


I am not using any TCL but maybe I am missing something for the wizard to work correctly.


mdf file
<?xml version="1.0" encoding="UTF-8"?>
<Menu Standalone="true" Main="true" MenuName="Menu Test" schemaVersion="1.1">
  <MenuTitle>
    <Constant String="Simple IP troubleshooting menu" />
  </MenuTitle>
  <Item ContinuePrompt="true">
    <ItemTitle>
      <Constant String="Show uptime/IOS Version" />
    </ItemTitle>
    <HelpString>
      <Constant String="This will display the router uptime and IOS version"/>
    </HelpString>
    <IOSExecCommand>show version</IOSExecCommand>
  </Item>
  <Item ContinuePrompt="true">
    <ItemTitle>
      <Constant String="Show Network Device" />
    </ItemTitle>
    <HelpString>
      <Constant String="This will display all devices communicating with the router"/>
    </HelpString>
    <IOSExecCommand>show arp</IOSExecCommand>
  </Item>
  <Item ContinuePrompt="true">
    <ItemTitle>
      <Constant String="Show DHCP negociation" />
    </ItemTitle>
    <HelpString>
      <Constant String="This will enable the DHCP negotiation"/>
    </HelpString>
    <IOSExecCommand>debug dhcp detail</IOSExecCommand>
  </Item>
  <Item ContinuePrompt="true">
    <ItemTitle>
      <Constant String="Reset Wan Interface" />
    </ItemTitle>
    <HelpString>
      <Constant String="This will shutdown the Wan Interface and then reenable it"/>
    </HelpString>
    <IOSConfigCommand>"interface fastethernet 4" "shutdown" "no shutdown"</IOSConfigCommand>
  </Item>
    <Item ContinuePrompt="false" ItemJustification="LEFT">
    <ItemTitle>
      <EmbTCLValue>
       <TCLCommand>return "Change hostname"</TCLCommand>
      </EmbTCLValue>
    </ItemTitle>
    <HelpString>
      <Constant String="Selecting this will change the router hostname."/>
    </HelpString>
    <Wizard>
    <QueryPrompt>
       <Constant String="Please enter new hostname"/>
    </QueryPrompt>
    <FreeForm MaxResponse="30" />
    </Wizard>
    <IOSConfigCommand>"hostname $r(1)"</IOSConfigCommand>
  </Item>
  <Item ContinuePrompt="true">
    <ItemTitle>
      <Constant String="Show Default Route" />
    </ItemTitle>
    <HelpString>
      <Constant String="This will display the default route"/>
    </HelpString>
    <IOSExecCommand>show ip route 0.0.0.0</IOSExecCommand>
  </Item>
  <Item ContinuePrompt="true">
    <ItemTitle>
      <Constant String="Show wan interface status" />
    </ItemTitle>
    <HelpString>
      <Constant String="Displays the status of individual interfaces"/>
    </HelpString>
    <IOSExecCommand>show ip interface brief f4</IOSExecCommand>
  </Item>
  <Item ContinuePrompt="true">
    <ItemTitle>
      <Constant String="Exit" />
    </ItemTitle>
  </Item>
  <DefaultSelection>
    <Constant String="8" />
  </DefaultSelection>
</Menu>
Correct Answer by Joe Clarke about 7 years 6 days ago

Here is an example MDF I did a while back to show off some of EMM features.  It should help you with some of your project questions.

Correct Answer by Joe Clarke about 7 years 6 days ago

Your Menu Name has a space in it.  This is not allowed.  Try this MDF file.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Joe Clarke Fri, 04/23/2010 - 00:01
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

I just want to confirm that you get this error after entering the new hostname value?  Can you post the output of "debug emm" after reproducing this?

Yes, for my test I am only using a simple question to change the hostname, but the final goal is give the possibily to the user to change his own PPPoE username and password.





routerlab#debug emm
EMM debugging is on
routerlab#emm mdf nvram:
006413: .Apr 23 09:59:54.062: %SYS-5-CONFIG_I: Configured from console by  on vty0 (EEM:DHCPrenew)
006414: .Apr 23 09:59:54.070: %HA_EM-4-LOG: DHCPrenew:  PRIMARY INTERFACE: DHCP RENEW //
006415: .Apr 23 09:59:57.022: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet4, changed state to up
006416: .Apr 23 10:00:02.919: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet4, changed state to downdebugmen
u.mdf
Menu
MenuTitle
  Constant
Item
  ItemTitle
   Constant
  HelpString
   Constant
  IOSExecCommand
Item
  ItemTitle
   Constant
  HelpString
   Constant
  IOSExecCommand
Item
  ItemTitle
   Constant
  HelpString
   Constant
  IOSExecCommand
Item
  ItemTitle
   Constant
  HelpString
   Constant
  IOSConfigCommand
Item
  ItemTitle
   EmbTCLValue
    TCLCommand
  HelpString
   Constant
  Wizard
   QueryPrompt
    Constant
   FreeForm
  IOSConfigCommand
Item
  ItemTitle
   Constant
  HelpString
   Constant
  IOSExecCommand
Item
  ItemTitle
   Constant
  HelpString
   Constant
  IOSExecCommand
Item
  ItemTitle
   Constant
DefaultSelection
  Constant


================================================================================
                        Simple IP troubleshooting menu


                                                          Enter ?# for item help
--------------------------------------------------------------------------
006417: .Apr 23 10:00:13.676: mm_loader_common line 458: File (nvram://debugmenu.mdf) read 2728 bytes
006418: .Apr 23 10:00:13.696: mm_loader_common line 475: File (nvram://debugmenu.mdf) read 2728 bytes
006419:------
1. Show uptime/IOS Version
2. Show Network Device
3. Show DHCP negociation
4. Reset Wan Interface
5. Change hostname
6. Show Default Route
7. Show wan interface status
8. Exit


Enter selection [8]:  .Apr 23 10:00:14.292: Looking for GlobalTCL, parent = Menu
006420: .Apr 23 10:00:14.292: Looking for MenuTitle, parent = Menu
006421: .Apr 23 10:00:14.292: Looking for HelpString, parent = Menu, current_elem = Menu, depth = 0
006422: .Apr 23 10:00:14.292: Looking for HelpString, parent = Menu, current_elem = MenuTitle, depth = 1
006423: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = Constant, depth = 2
006424: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = Item, depth = 1
006425: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = ItemTitle, depth = 2
006426: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = HelpString, depth = 2
006427: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = IOSExecCommand, depth = 2
006428: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = Item, depth = 1
006429: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = ItemTitle, depth = 2
006430: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = HelpString, depth = 2
006431: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = IOSExecCommand, depth = 2
006432: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = Item, depth = 1
006433: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = ItemTitle, depth = 2
006434: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = HelpString, depth = 2
006435: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = IOSExecCommand, depth = 2
006436: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = Item, depth = 1
006437: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = ItemTitle, depth = 2
006438: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = HelpString, depth = 2
006439: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = IOSConfigCommand, depth = 2
006440: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = Item, depth = 1
006441: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = ItemTitle, depth = 2
006442: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = HelpString, depth = 2
006443: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = Wizard, depth = 2
006444: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = IOSConfigCommand, depth = 2
006445: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = Item, depth = 1
006446: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = ItemTitle, depth = 2
006447: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = HelpString, depth = 2
006448: .Apr 23 10:005


Please enter new hostname


Enter value (Max. 30 chars): :14.296: Looking for HelpString, parent = Menu, current_elem = IOSExecCommand, depth = 2
006449: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = Item, depth = 1
006450: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = ItemTitle, depth = 2
006451: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = HelpString, depth = 2
006452: .Apr 23 10:00:14.296: Looking for HelpString, parent = Menu, current_elem = IOSExecCommand, depth = 2
006453: .Apr 23 10:00:14.300: Looking for HelpString, parent = Menu, current_elem = Item, depth = 1
006454: .Apr 23 10:00:14.300: Looking for HelpString, parent = Menu, current_elem = ItemTitle, depth = 2
006455: .Apr 23 10:00:14.300: Looking for HelpString, parent = Menu, current_elem = DefaultSelection, depth = 1
006456: .Apr 23 10:00:14.300: Looking for HelpString, parent = Menu, current_elem = Constant, depth = 2
006457: .Apr 23 10:00:14.300: Looking for HelpString, parent = Item, current_elem = Menu, depth = 0
006458: .Apr 23 10:00:14.300: Looking for HelpString, parent = Item, current_elem = MenuTitle, depth = 1
006459: .Apr 23 10:00:14.300: Looking for HelpString, parent = Item, current_elem = Constant, depth = 2
006460: .Apr 23 10:00:14.300: Looking for HelpString, parent = Item, current_elem = Item, depth = 1
006461: .Apr 23 10:00:14.300: Looking for HelpString, parent = Item, current_elem = ItemTitle, depth = 2
006462: .Apr 23 10:00:14.300: Looking for HelpString, parent = Item, current_elem = Constant, depth = 3
006463: .Apr 23 10:00:14.300: Looking for HelpString, parent = Item, current_elem = HelpString, depth = 2
006464: .Apr 23 10:00:14.300: Found HelpString, parent = Item, return 845FC56C
006465: .Apr 23 10:00:14.300: Returned 845FC56C from sibling search
006466: .Apr 23 10:00:14.300: Returned 845FC56C from child search
006467: .Apr 23 10:00:14.300: Returned 845FC56C from sibling search
006468: .Apr 23 10:00:14.300: Returned 845FC56C qwertfrom child search
006469: .Apr 23 10:00:15.124: Looking for Item, parent = Menu
006470: .Apr 23 10:00:21.373: mm_run: Node count = 55
006471: .Apr 23 10:00:21.373: Looking for Item, parent = Menu, current_elem = Menu, depth = 0
006472: .Apr 23 10:00:21.373: Looking for Item, parent = Menu, current_elem = MenuTitle, depth = 1
006473: .Apr 23 10:00:21.373: Looking for Item, parent = Menu, current_elem = Constant, depth = 2
006474: .Apr 23 10:00:21.373: Looking for Item, parent = Menu, currey


EMM TCL Error: invalid command name "Test::5"


Press any key to continue...nt_elem = Item, depth = 1
006475: .Apr 23 10:00:21.373: Found Item, parent = Menu, return 839FEBD0
006476: .Apr 23 10:00:21.373: Returned 846CEAB0 from sibling search
006477: .Apr 23 10:00:21.373: Returned 846CEAB0 from child search
006478: .Apr 23 10:00:21.373: Looking for Wizard, parent = Item
006479: .Apr 23 10:00:21.373: Looking for HelpString, parent = Wizard, current_elem = Wizard, depth = 2
006480: .Apr 23 10:00:21.373: Looking for HelpString, parent = Wizard, current_elem = QueryPrompt, depth = 3
006481: .Apr 23 10:00:21.373: Looking for HelpString, parent = Wizard, current_elem = Constant, depth = 4
006482: .Apr 23 10:00:21.373: Looking for HelpString, parent = Wizard, current_elem = FreeForm, depth = 3
006483: .Apr 23 10:00:21.373: Looking for HelpString, parent = Wizard, current_elem = IOSConfigCommand, depth = 2
006484: .Apr 23 10:00:21.373: Looking for Choice, parent = Wizard, current_elem = Wizard, depth = 2
006485: .Apr 23 10:00:21.373: Looking for Choice, parent = Wizard, current_elem = QueryPrompt, depth = 3
006486: .Apr 23 10:00:21.373: Looking for Choice, parent = Wizard, current_elem = Constant, depth = 4
006487: .Apr 23 10:00:21.377: Looking for Choice, parent = Wizard, current_elem = FreeForm, depth = 3
006488: .Apr 23 10:00:21.377: Looking for Choice, parent = Wizard, current_elem = IOSConfigCommand, depth = 2
006489: .Apr 23 10:00:21.377: Looking for CustomPrompt, parent = Wizard, current_elem = Wizard, depth = 2
006490: .Apr 23 10:00:21.377: Looking for CustomPrompt, parent = Wizard, current_elem = QueryPrompt, depth = 3
006491: .Apr 23 10:00:21.377: Looking for CustomPrompt, parent = Wizard, current_elem = Constant, depth = 4
006492: .Apr 23 10:00:21.377: Looking for CustomPrompt, parent = Wizard, current_elem = FreeForm, depth = 3
006493: .Apr 23 10:00:21.377: Looking for CustomPrompt, parent = Wizard, current_elem = IOSConfigCommand, depth = 2
006494: .Apr 23 10:00:21.377: Looking for ChoiceList, parent = Wizard
006495: .Apr 23 10:00:21.377: Looking for Choice, parent = Wizard
006496: .Apr 23 10:00:21.377: Looking for Range, parent = Wizard
006497: .Apr 23 10:00:21.377: Looking for FreeForm, parent = Wizard
006498: .Apr 23 10:00:21.377: Looking for DefaultValue, parent = Wizard


8EMM TCL Error: invalid command name "Test::5"


Press any key to continue...


routerlab#


006499: .Apr 23 10:00:33.375: mm_load_from_file: Node count before free = 55
006500: .Apr 23 10:00:33.375: mm_load_from_file: Node count after free = 0
006501: .Apr 23 10:00:33.375: mm_load_from_file: Node count after free = 218959117
un all
All possible debugging has been turned off

Correct Answer
Joe Clarke Fri, 04/23/2010 - 10:45
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

Your Menu Name has a space in it.  This is not allowed.  Try this MDF file.

Attachment: 
Correct Answer
Joe Clarke Fri, 04/23/2010 - 12:11
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

Here is an example MDF I did a while back to show off some of EMM features.  It should help you with some of your project questions.

Attachment: 

Actions

This Discussion