NeDi Community

NeDi Software Specific => Discovery => Topic started by: mueller-dv on January 24, 2014, 09:34:29 AM

Title: Backup HP Procurve 5406zl
Post by: mueller-dv on January 24, 2014, 09:34:29 AM
I have plenty of switches from HP all working fine.

My colleague set his factory up with active directory login on the hp switches and all i get is operator mode.
So i will have to enable first.

This ends up in the libcli.pm with an error.

        }elsif($match =~ /any key|Ctrl-Y/i){                                                            # Some want this now (with SSH)...
                &misc::Prt("CLI3:Matched '$match' sending ctrl-Y\n");
                $session->put("\cY");                                                                   # Since Nortel wants Ctrl-Y...
                ($pre, $match) = $session->waitfor("/$cmd{$os}{ropr}/i"); 
#               ($pre, $match) = $session->waitfor("/$cmd{$os}{enpr}/i");
#               print "PRE :$pre\nMTCH:$match\n" if $main::opt{'d'};
                $err = $session->errmsg;

The ropr works fine for his switches, the enpr fine for all other ones... So, i am not that good in programming anyway..
How do i get it both working?
So the libcli checks if the login is ropr or enpr, if ropr it enables, if enpr it just backups....

Any ideas?
Title: Re: Backup HP Procurve 5406zl
Post by: mueller-dv on January 24, 2014, 11:04:42 AM
Ok, i got it...

I change this:

345a346
> $cmd{'ProCurve'}{'tepr'} = '(\x1b\[[;\?0-9A-Za-z]+)+[\w+\s().-]+[>#]\s?(\x1b\[[;\?0-9A-Za-z]+)+$';
595c596
<               ($pre, $match) = $session->waitfor("/$cmd{$os}{enpr}/i");
---
>               ($pre, $match) = $session->waitfor("/$cmd{$os}{tepr}/i");
597c598
<       }else{
---
>       }
635d635
<       }

Perhaps this helps someone else...
Title: Re: Backup HP Procurve 5406zl
Post by: rickli on January 24, 2014, 04:45:22 PM
>My colleague set his factory up with active directory login on the hp switches and all i get is operator mode.
>So i will have to enable first.

Not sure I really understand. You get an any-key prompt after logging in and then need to enable?
Title: Re: Backup HP Procurve 5406zl
Post by: mueller-dv on January 28, 2014, 07:58:11 AM
Yes...

It seems that i am in operator mode after login.
When i then enable i have the "SwitchName#" prompt, which the cli is waiting for...