Welcome, Guest. Please login or register.

Author Topic: Unable to Backup HP Procurve Switches  (Read 2985 times)

rbeaber

  • Newbie
  • *
  • Posts: 2
    • View Profile
Unable to Backup HP Procurve Switches
« on: September 06, 2018, 01:23:12 am »
New installation of NeDi on Ubuntu Server, and trying to backup a Procurve 2920 switch (or any Procurve Switch it seems), I get the following error:

Prepare (CLI) ----------------------------------------------------------------
SSH :manager;1@172.16.1.41:22 Tout:2s OS:ProCurve EN:(\x1b\[[;\?0-9A-Za-z]+)+[\w\s()'+.-]+#\s?(\x1b\[[;\?0-9A-Za-z]+)+$
PTY :Forking ssh -o 'StrictHostKeyChecking no' -l manager 172.16.1.41
CLI2:Matched 'password: ' sending password
CLI3:Password sent
CLI3:Matched 'any key' sending ctrl-Y
Use of uninitialized value $match in pattern match (m//) at /var/nedi/inc/libcli.pm line 818.
Use of uninitialized value $match in concatenation (.) or string at /var/nedi/inc/libcli.pm line 823.
CLI8:Matched '' enable failed

Any help would be appreciated.  Trying to get the administration to pay for the registered version, but have to get it working first.

Thanks,

-Rick Beaber

Hannu Liljemark

  • Full Member
  • ***
  • Posts: 153
  • Here to help
    • View Profile
Re: Unable to Backup HP Procurve Switches
« Reply #1 on: September 10, 2018, 10:12:22 am »
Hi

What exactly does it look like if you manually login via telnet or ssh to the switch from the Nedi host, and try to display the running config ("show run")?

A sample of how it should go:

SSH :manager@10.10.10.10:22 Tout:2s OS:ProCurve EN:(\x1b\[[;\?0-9A-Za-z]+)+[\w\s()'+.-]+#\s?(\x1b\[[;\?0-9A-Za-z]+)+$
PTY :Forking ssh -o 'StrictHostKeyChecking no' -l manager 10.10.10.10
CLI2:Matched 'password: ' sending password
CLI3:Password sent
CLI3:Matched 'any key' sending ctrl-Y
CLI8:Matched enable prompt, OK
CMDR:no page result is OK
CMDR:show run result is OK
WAIT:show run
WAIT:Running configuration:
WAIT:
CONF:; J9775A Configuration Editor; Created on release #YA.15.12.0007

So, looking at the output from your case, something goes wrong after nedi sends ctrl+y to the "Press any key to continue" prompt. Maybe your customer has a funky login banner that freaks out Nedi?

----
manager@10.10.10.10's password:
HP J9775A 2530-48G Switch
Software revision YA.15.12.0007

Copyright (C) 1991-2013 Hewlett-Packard Development Company, L.P.

                   RESTRICTED RIGHTS LEGEND
 Confidential computer software.  Valid license from HP required for possession,
 use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer
 Software, Computer Software Documentation, and Technical Data for Commercial
 Items are licensed to the U.S. Government under vendor's standard commercial
 license.
                   HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
                   20555 State Highway 249, Houston, TX 77070

Press any key to continue
----

Br,
Hannu
« Last Edit: September 10, 2018, 10:28:21 am by Hannu Liljemark »

Hannu Liljemark

  • Full Member
  • ***
  • Posts: 153
  • Here to help
    • View Profile
Re: Unable to Backup HP Procurve Switches
« Reply #2 on: September 10, 2018, 10:25:31 am »
Actually, now that I rethink about it, Nedi is looking for enable-prompt but can't find it.

If you look at inc/libcli.pm, you'll see what Nedi looks for to determine if it needs to do "enable" or if it has enable-access:

$cmd{'ProCurve'}{'ropr'} = '(\x1b\[[;\?0-9A-Za-z]+)+[\w\s()\'+.-]+>\s?(\x1b\[[;\?0-9A-Za-z]+)+$';
$cmd{'ProCurve'}{'enpr'} = '(\x1b\[[;\?0-9A-Za-z]+)+[\w\s()\'+.-]+#\s?(\x1b\[[;\?0-9A-Za-z]+)+$';

So, here after login the switch prompt is:

SW-LOCATION-1#

Where I can type exit and I get readonly prompt:

SW-LOCATION-1>

So you want to look at what kind of prompt you get after login. Try logging in manually to the switch as I suggested and see what steps you need to do the get "show run" working. Maybe the prompt is not what Nedi regexps are expecting. I'm not sure if the "banner exec" (post-login) can mess up things.

Br,
Hannu
« Last Edit: September 10, 2018, 10:29:13 am by Hannu Liljemark »

rbeaber

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Unable to Backup HP Procurve Switches
« Reply #3 on: September 19, 2018, 05:05:01 pm »
Hannu:
     Thank you very much for the explanation.  I know know the issue.  All my Procurve switches are configured to display the menu interface instead of the CLI at login.  I changed this and it worked perfectly!  Although we prefer the menu interface, it's a small concession to get NeDi to backup all our configurations.  It's well worth it.

     Thank you again,

-Rick Beaber