ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.79k stars 922 forks source link

comware 3com prompt parse error #1171

Closed aTanCS closed 6 years ago

aTanCS commented 6 years ago

When I login to all our 3COM switches I get this type of output. Prompt is always above the last login info line. That's why I guess prompt detection doesn't work. After 'enter' key is pressed the prompt is on the first line. Is it possible to send 'enter' before prompt detection or fix prompt regex? switch:

********************************************************************************
*  Copyright(c) 2004-2009 3Com Corp. and its licensors. All rights reserved.   *
*  Without the owner's prior written consent,                                  *
*  no decompiling or reverse-engineering shall be allowed.                     *
********************************************************************************

<sw-test-3com>
%Jun 17 15:35:31:872 2000 sw-test-3com SHELL/5/LOGIN:- 1 - xxx(x.x.x.x) in unit1 login

oxidized

raised Oxidized::PromptUndetect with msg "unable to detect prompt: (?-mix:^\0*(<[\w.-]+>)$)"
laf commented 6 years ago

Is this not something to do with logging in the console? If so, it looks like it would be better for you to disable that so it's not printed out in the first place.

tracerrx commented 6 years ago

If you comment out the below line in comware.rb file it will work fine...

cfg.gsub! /^.*\e[42D/, '' # example how to handle pager

aTanCS commented 6 years ago

@laf it is a default behavior, but it can be disabled by

info-center source default channel 1 log state off debug state off

but there just too many such switches to reconfigure them all manually. So this is my plan B solution.

@tracerrx this line is already commented out in original source files.

laf commented 6 years ago

We don't have a pre_login function in models so I'm not sure how possible this.

aTanCS commented 6 years ago

I've managed to disable log printing in all switches using ssh batch script, so I guess it can be closed, if it is not possible to process in oxidized.

laf commented 6 years ago

I've added a model note about this OS for people to configure the devices correctly.

cemtiger commented 3 years ago

I've managed to disable log printing in all switches using ssh batch script, so I guess it can be closed, if it is not possible to process in oxidized.

@aTanCS Can you describe a little clearer how you disabled this? I have HPE Comware switches that are having this exact same trouble; however, the command you give is not valid either in regular cli or after i have logged in with the _cmdline-mode on