This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Script for HP/H3C Switches

Hi!

I'm trying to backup the config of our new HP (H3C) Switches (5120, 5800, 10500). The script I created out of the Custom.Template is not working. The prompt of the switches is "<SWITCHNAME>", not "SWITCHNAME>" as in Ciscos IOS. So the script returns the error "Did not receive expected prompt when entering Enable mode".

Has anybody managed to create a script that works with the HP H3C switches?

Regards, lls71

  • What happens to the device prompt when you enter enable/privileged mode?   Does it change from <SWITCHNAME> to [SWITCHNAME] ?

    Did the CatTools provided HP.Switch.2500 device type not work for these HP switches?

    Steve

  • Hi Steve,

    the 5200, 5800, 10500 are H3C switch models that HP took into their portfolio. The 2500 switch is a HP ProCurve switch. The command line interface is not the same.

    After usename & password the switch responds with

    <SWITCHNAME>

    When you issue the command "system-view" the switch answers with

    [SWITCHNAME]

    as you already guessed.

    Regards, Leonardo

  • Hi Leonardo,

    From your custom script, I can tell that the error message you are seeing will occur if you reach the timeout value (default is 30 seconds) after the CR is sent to execute the enable mode command:  "system-view".

    What should be happening is CatTools should be detecting one of the following responses:

        ' Expected possible default return values in order we want to test for them

        rgMult(1) = cl.DeviceEnablePrompt

        rgMult(2) = cl.DeviceVTYPrompt

        rgMult(3) = DEVICE_PASSWORDPROMPT     (being "password: ")

        rgMult(4) = DEVICE_USERNAMEPROMPT      (being "login as: ")

    (Unless you have overridden the prompts in rgMult(3) or rgMult(4) in the 'Prompts' tab of the device set-up.)

    If you turn on 'File > Enable Capture Mode' a device debuglog file will be generated in the \Debug folder which may give you an idea as to what the device is getting stuck on.

    At the end of the session capture, you should see the expected values of cl.DeviceEnablePrompt and cl.DeviceVTYPrompt.

    Steve

  • Here's the result:


    <NEWSESSION CatTools 3.6.0 28.09.2012 07:55:16>
    <PROTOCOL=SSH2>
    <DEVICE TYPE=Custom.HP.H3CSwitch>
    <ACTIVITY TYPE=Device.ConnectivityTest.Login>
    <ACTIVITY SCRIPT=C:\Programme\CatTools3\Scripts\Client.Device.ConnectivityTest.Login.txt>
    <USERS NAME FOR DEVICE=PVIESWFB0001>
    <C OK 07:55:16><R-07:55:16>[13][10]******************************************************************************[13][10]* Copyright (c) 2010-2012 Hewlett-Packard Development Company, L.P.          *[13][10]* Without the owner's prior written consent,                                 *[13][10]* no decompiling or reverse-engineering shall be allowed.                    *[13][10]******************************************************************************[13][10][13][10]<PVIESWFB0001><W-07:55:16>[13]<R-07:55:16>[13][10]<PVIESWFB0001><W-07:55:17>[13]<R-07:55:17>[13][10]<PVIESWFB0001><W-07:55:17>system-view<R-07:55:17>s<R-07:55:17>ystem-view<W-07:55:17>[13]<R-07:55:17>[13][10]System View: return to User View with Ctrl+Z.<R-07:55:17>[13][10][PVIESWFB0001]<W-07:55:17>[13]<R-07:55:17>[13][10][PVIESWFB0001]<W-07:55:17>[13]<R-07:55:17>[13][10][PVIESWFB0001]
    ================================================================================
    WFMDRetVal=1 Waiting for: "<PVIESWFB0001>"
    WFMDRetVal=2 Waiting for: "<PVIESWFB0001]"
    WFMDRetVal=3 Waiting for: "<PVIESWFB0001]"
    WFMDRetVal=4 Waiting for: "(config-"
    WFMDBuffer="[13][10][pvieswfb0001]"
    ================================================================================
    <W-07:55:47>quit[13]<D 07:55:47>
    <SCRIPT VALUES>
    <HOSTNAME="<PVIESWFB0001">
    <PROMPT VTY="<PVIESWFB0001>">
    <PROMPT ENABLE="<PVIESWFB0001]">
    <PROMPT CONFIG="<PVIESWFB0001]">

    So the script is waiting for the wrong prompt value...

    Regards, Leonardo

  • You need to override the cl.DeviceEnablePrompt and cl.DeviceVTYPrompt prompt values to switch the first character '<' with a '['.


    Steve

  • Did you ever get your H3C/A Series scripts to work? I am actually trying to get this done right now.

  • FormerMember
    0 FormerMember in reply to Spartacus

    Hi Steve,

    I am having the same problem.

    I keep getting the error message: "Failed to enter enable mode".

    I have a HP SW 5900. I know that I need to change the script from "enable" to "system view". But can't figure out how to do/change it. The file is encrypted.

    How do you change the script?

    I am looking at the script: C:\Program Files (x86)\CatTools3\Scripts\Client.Device.Backup.Running Config.txt but the file is encrypted.

    Please help!

    Thanks!

  • I would recommend trying version 3.10.0.  Support for newer HP switches was added:

    This version includes the following enhancements:

    • Variations added to the following device types: Cisco Router.General, Cisco.Switch.IOS.
    • Variations added to the following device types: Dell.Switch.CLI, HP.Switch.2500, and Enterasys.SecureStack.
    • Monthly Scheduling options on Activites.
    • Support for Cisco Small Business devices.
    • Support for HP Devices 12000, 12500, and 3500.
    • New option to ignore a block of text from comparison during Device Running Config activity.
    • Support for Windows Server 2012 R2
    • Newest SolarWinds licensing framework adopted
  • Hi, did anyone ever get this to work? I have a couple of HP/H3C 5120 SI switches that I want to pull the configuration from.

    I'm using 3.10 version, but I can't get it to work.

  • Please do the following:

    1. Use the CatTools File menu to select the "Enable capture mode" option.

    2. Run the activity you are having trouble with. This should create a debug file in the \CatTools3\Debug folder.

    3. Remember to deselect the "enable capture mode" option again.

    Remove any sensitive information, and upload the file.