Welcome, Guest. Please login or register.

Author Topic: libcli.pm for Comware 7  (Read 2180 times)

pakalino

  • Newbie
  • *
  • Posts: 3
    • View Profile
libcli.pm for Comware 7
« on: March 25, 2018, 05:22:46 pm »
Hi,

Any chance for getting some short libcli.pm definition needed for backing up Comware 7 devices?
I spotted that after upgrading FW of several 5920 and 5930 devices NEDI is not able to backup configuration of such devices.
I do not have problems with Comware 5 (like HPE 5820) as libcli.pm definitions of Comware and Comware3 OS work fine.

Thanks

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2893
    • View Profile
    • NeDi
Re: libcli.pm for Comware 7
« Reply #1 on: March 29, 2018, 10:10:35 am »
When I was with HP, CW7 worked like CW5, so I didn't need to specify.

I've made a CLI tutorial on youtube to help find out what goes wrong. Essentially start the backup with -vdc and look at the resulting logfiles.

If you let me access a CW7 I'll look at it myself, just send me a mail...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

pakalino

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: libcli.pm for Comware 7
« Reply #2 on: April 11, 2018, 02:27:42 pm »
Thanks for helpful info and sorry for my late reply buy I was on holiday.
I checked input and output log.
It seems nedi is able to login to the switch correctly but after showing switch login banner and correct enable prompt nothing happens.
I tried to set cfto to 15 (though it was not needed in the past) but nothing changed.
As I checked my comware 5 and comware 7 devices - in both cases I have OS:  HP Comware set in Definition files. But comware 7 devices behave differently now. 

Looking at backup operation:

CLI2:Matched 'password: ' sending password
CLI3:Password sent
ERR3:pattern match timed-out


Looking at input log - nedi logs in but is not moving from initial prompt to configuration prompt (system-view) command




Unfortunately I cannot enable any remote access.
« Last Edit: April 11, 2018, 03:09:02 pm by pakalino »

pakalino

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: libcli.pm for Comware 7
« Reply #3 on: April 11, 2018, 04:42:06 pm »
OK - I finally found some time at work to modify libcli.pm and test each change.

It seems Comware3  enable prompt  works but  due to  lack of screen-length disable  and incorrect "more" definition it fails to complete the backup.
I totally forgot about it since testing with Comware3 was the first thing I tried few months ago...

So at the moment I am using following Comware3 definition and it works perfectly:

# HP
$cmd{'Comwar3'}{'ropr'} = 'GitsDoNid';
$cmd{'Comwar3'}{'enpr'} = '[\w+()<\[.-]+[>\]]\s?(\n%.+)?$';                                             # Sends a % line after login prompt!
$cmd{'Comwar3'}{'enab'} = 'super';
#$cmd{'Comwar3'}{'more'} = '  ---- More ----';                              # Experimental, to get old 3Com switches backed up
$cmd{'Comwar3'}{'more'} = '---- More ----';                                   #  added by pakalino                                               
$cmd{'Comwar3'}{'page'} = 'screen-length disable';                        #  added by pakalino
$cmd{'Comwar3'}{'shcf'} = 'display current';
$cmd{'Comwar3'}{'cfst'} = '#';

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2893
    • View Profile
    • NeDi
Re: libcli.pm for Comware 7
« Reply #4 on: April 19, 2018, 08:54:42 pm »
Weird, back when I've tested with CW3 it worked (at least with the devices I had access to). Thanks for solving this!
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo