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

Prompt problem AOSW - Aruba devices #2381

Closed jonare77 closed 1 year ago

jonare77 commented 3 years ago

Having issues with error regarding Aruba Controllers. Used Oxidized with same units before and it worked, with the latest versions of oxidized they dont anymore. See several post with "prompt" issues. My prompts are:

(ARUBA-MC-RAP) #
(ARUBA-MC-01) *#

Errors that are show in debug:

W, [2021-10-08T13:01:17.178634 #30]  WARN -- : 10.0.0.144 raised Oxidized::PromptUndetect with msg "
(ARUBA-MC-01) *# not matching configured prompt (?-mix:^([\w\(:.@-]+(\)?\s?)[#>]\s?)$)"

D, [2021-10-08T12:59:28.773321 #32] DEBUG -- : lib/oxidized/worker.rb: Jobs running: 0 of 1 - ended: 0 of 298
D, [2021-10-08T12:59:28.773861 #32] DEBUG -- : lib/oxidized/worker.rb: Added /10.0.0.143 to the job queue
D, [2021-10-08T12:59:28.773901 #32] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2021-10-08T12:59:28.774027 #32] DEBUG -- : lib/oxidized/job.rb: Starting fetching process for 10.0.0.143 at 2021-10-08 12:59:28 UTC
D, [2021-10-08T12:59:28.774309 #32] DEBUG -- : lib/oxidized/input/ssh.rb: Connecting to 10.0.0.143
D, [2021-10-08T12:59:28.774529 #32] DEBUG -- : AUTH METHODS::["none", "publickey", "password"]
D, [2021-10-08T12:59:28.937922 #32] DEBUG -- : lib/oxidized/input/ssh.rb: expecting [/^([\w\(:.@-]+(\)?\s?)[#>]\s?)$/] at 10.0.0.143
D, [2021-10-08T12:59:29.743387 #32] DEBUG -- : lib/oxidized/input/cli.rb: Running post_login commands at 10.0.0.143
D, [2021-10-08T12:59:29.743521 #32] DEBUG -- : lib/oxidized/input/cli.rb: Running post_login command: nil, block: #<Proc:0x00005589322e9fd0@/var/lib/gems/2.5.0/gems/oxidized-0.28.0/lib/oxidized/model/aosw.rb:85> at 10.0.0.143
, [2021-10-08T12:59:50.147047 #32]  WARN -- : 10.0.0.143 raised Timeout::Error with msg "execution expired"
D, [2021-10-08T12:59:50.147154 #32] DEBUG -- : lib/oxidized/node.rb: Oxidized::SSH failed for 10.0.0.143
D, [2021-10-08T12:59:50.147267 #32] DEBUG -- : lib/oxidized/job.rb: Config fetched for 10.0.0.143 at 2021-10-08 12:59:50 UTC
W, [2021-10-08T12:59:50.780990 #32]  WARN -- : /10.0.0.143 status no_connection, retry attempt 1
D, [2021-10-08T12:59:50.781074 #32] DEBUG -- : lib/oxidized/worker.rb: Jobs running: 0 of 1 - ended: 0 of 298

Both unit have login success within the oxidized/docker container. All other procurve,comware,cisco ios/asa units works.

Can anyone point me in the right direction, suppose editing the aosw file is the way to go.

Thanks in advance.

ghost commented 3 years ago

Hello,

In what conditions the character appears as part of the prompt? Testing the prompt regex against the device prompts you shared, the prompt is not matching the second one because of the ''

If this is an expected character on these models, we need to make a pull request to have the prompt changed. If it's some particular character you're using, the best way is to create a file under _OXIDIZEDHOME/.config/oxidized/model/junos.rb (see https://github.com/ytti/oxidized/blob/master/docs/Creating-Models.md) with just the prompt.

Something link the one below might work out as a regex (?-mix:^([\w\(:.@-]+(\)?\s?)\*?[#>]\s?)$)

Hope it helped.

jimaraujo6786 commented 2 years ago

Having similar issue with Aruba Controller Aruba7010-US -- ArubaOS 8.6.0.8 (Master Controller). (WLAN001) *[mynode] # not matching configured prompt (?-mix:^([\w(:.@-]+()?\s?)[#>]\s?)$)" W, [2021-11-15T10:43:11.283637 #75179] WARN -- : aruba-group/WLAN001status no_connection, retry attempt 3 W, [2021-11-15T10:43:31.851193 #75179] WARN -- : 10.10.1.20 raised Oxidized::PromptUndetect with msg "

jonare77 commented 2 years ago

Hello,

In what conditions the character appears as part of the prompt? Testing the prompt regex against the device prompts you shared, the prompt is not matching the second one because of the ''

If this is an expected character on these models, we need to make a pull request to have the prompt changed. If it's some particular character you're using, the best way is to create a file under _OXIDIZEDHOME/.config/oxidized/model/junos.rb (see https://github.com/ytti/oxidized/blob/master/docs/Creating-Models.md) with just the prompt.

Something link the one below might work out as a regex (?-mix:^([\w\(:.@-]+(\)?\s?)\*?[#>]\s?)$)

Hope it helped.

*Sorry for late answer on this issue. I think "" is used in cluster mode on Aruba controllers, so its not something I use.**

lucdnb commented 2 years ago

Same issue here. I've try to include the "*#" characters in some variations to aosw.rb file but no success. Do you got solved this problem?

lucdnb commented 2 years ago

Hi! I had the same problem and i've solved as follows:

Backup your "aosw.rb" file; Edit your "aosw.rb" file: 1- If you Aruba prompt show:

# So, edit the prompt regex: From: prompt /^([\w\(:.@-]+(\)?\s?)[#>]\s?)$/ To: `prompt /^(\^M)?([\w(:.@-]+()\s?[\^*]?[?\w]?\s?)*?[#>]\s?)$/` image

If this is not your problem, just pass to step 2.

2- Edit "post_login" statements: From: post_login 'no paging' To: post_login "no paging\nencryp disable\nshow running" And comment all others "post_login" lines: image

I hope it helps.