Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArubaOS 8 issue #2124

Closed
mang011 opened this issue Jun 6, 2020 · 12 comments
Closed

ArubaOS 8 issue #2124

mang011 opened this issue Jun 6, 2020 · 12 comments

Comments

@mang011
Copy link

mang011 commented Jun 6, 2020

oxidized fails to fetch configuration from ArubaOS 8,

ArubaOS version :
Aruba Operating System Software.
ArubaOS (MODEL: Aruba7220-US), Version 8.5.0.4

logs :

Jun 05 22:37:47 oxidized-server oxidized[2114]: lib/oxidized/job.rb: Starting fetching process for node-wl1 at 2020
-06-06 02:37:47 UTC
Jun 05 22:37:47 oxidized-server oxidized[2114]: lib/oxidized/input/ssh.rb: Connecting to node-wl1
Jun 05 22:37:48 oxidized-server oxidized[2114]: lib/oxidized/input/ssh.rb: expecting [/^(\^M)?([\w\(:.@-]+(\)\s?[\^\*]
?\[?\w*\]?\s?)\*?[#>]\s?)$/] at node-wl1
Jun 05 22:37:49 oxidized-server oxidized[2114]: lib/oxidized/input/cli.rb: Running post_login commands at node-wl1
Jun 05 22:37:49 oxidized-server oxidized[2114]: lib/oxidized/input/cli.rb: Running post_login command: "no paging", bl
ock: nil at node-wl1
Jun 05 22:37:49 oxidized-server oxidized[2114]: lib/oxidized/input/ssh.rb no paging @ node-wl1 with expect: /^(\^M)
?([\w\(:.@-]+(\)\s?[\^\*]?\[?\w*\]?\s?)\*?[#>]\s?)$/
Jun 05 22:37:49 oxidized-server oxidized[2114]: lib/oxidized/input/ssh.rb: expecting [/^(\^M)?([\w\(:.@-]+(\)\s?[\^\*]
?\[?\w*\]?\s?)\*?[#>]\s?)$/] at node-wl1
Jun 05 22:38:09 oxidized-server oxidized[2114]: lib/oxidized/node.rb: Oxidized::SSH failed for node-wl1
Jun 05 22:38:09 oxidized-server oxidized[2114]: lib/oxidized/job.rb: Config fetched for node-wl1 at 2020-06-06 02:3
8:09 UTC
Jun 05 22:38:09 oxidized-server oxidized[2114]: wireless-controller/node-wl1 status no_connection, retries exhauste
d, giving up

ssh debug log for the node as seen in vim:

^M
(node-wl1) #no paging
^M(node-wl1) #

https://rubular.com/r/DHHXh79HedCi5t
^(^M)?([\w(:.@-]+()\s?[^\*]]?[?\w*]?\s?)*?[#>]\s?)$
regex updated to match aos8 for wireless controller and mobility master but seems to fail only after using cli no paging

@yoakim
Copy link

yoakim commented Jun 8, 2020

Hello,

I can confirm this.
Just like you I first modified the prompt regex to match AOS 8. But when I got the prompt to match it stops after no paging.
Pretty sure I got it to continue to the next command if I added a \n to the no paging command in the aosw.rb file if that would help in troubleshooting. However after the next command, it stops again.
Debug log for my node:

^M
(X-VPNC-7005-02) *#no paging
^M(X-VPNC-7005-02) *#

@mang011
Copy link
Author

mang011 commented Jun 9, 2020

here is a workaround for the issue. **post_login "no paging\nshow version"**
change aosw.rb model file (oxidized/lib/oxidized/model/aosw.rb) to

cfg :ssh do
    if vars :enable
      post_login do
        send "enable\n"
        cmd vars(:enable)
      end
    end
    post_login "no paging\nshow version"
    pre_logout 'exit' if vars :enable
    pre_logout 'exit'

@mang011
Copy link
Author

mang011 commented Jun 9, 2020

@yoakim, did try adding \n after no paging such as "no paging\n" or ''no paging\n\n\n" but still didn't help.

@yoakim
Copy link

yoakim commented Jun 9, 2020

Thanks for the workaround! Any idea why that works?

@wk
Copy link
Contributor

wk commented Jun 12, 2020

^M is typically the representation of carriage-return, and can be matched by including ^\r? at the beginning of the prompt regexp, rather than ^(^M)?

@vkratsberg
Copy link

vkratsberg commented Feb 2, 2022

I m having exactly the same issue with oxidized stopping right after "no paging". Has anyone been able to fix this ?
(dub-md-wlc001) #no paging
(dub-md-wlc001) #

@lucdnb
Copy link

lucdnb commented May 6, 2022

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.

@jesusko
Copy link

jesusko commented May 6, 2022

Hello,

I've just finished troubleshooting of this because no workaround from this thread worked for me. I've changed prompt regex in "aosw.rb" file to: prompt /.*([\^\w\(:.@-]+(\)?\s\*?(\[.*\])?\s?)[#>]\s?)$/
It looks like Oxidized couldn't recognize beginning of the line character, which was showing as ^M (Control-M).

@lucdnb
Copy link

lucdnb commented May 7, 2022

This your workaround is just one part of the possible solution.
Paste your debug if you want, and we maybe solve it.

@techjockeynet
Copy link

techjockeynet commented May 10, 2022

Hi, another example of a prompt not matching...
(hostname) [mynode] # not matching configured prompt (?-mix:^([\w\(:.@-]+(\)?\s?)[#>]\s?)$)"

I've modified my aosw.rb and restarted oxidized...do I have to do anything else to pick up the prompt change?

@jesusko
Copy link

jesusko commented May 10, 2022

Hi, another example of a prompt not matching... (hostname) [mynode] # not matching configured prompt (?-mix:^([\w\(:.@-]+(\)?\s?)[#>]\s?)$)"

I've modified my aosw.rb and restarted oxidized...do I have to do anything else to pick up the prompt change?

Hello,
Try to change that regex in aosw.rb file to the one which I've posted above:
prompt /.*([\^\w\(:.@-]+(\)?\s\*?(\[.*\])?\s?)[#>]\s?)$/

@techjockeynet
Copy link

techjockeynet commented May 10, 2022

Thanks jesusko, this is working..the issue was not your prompt it was my aosw.rb location...aparently it wasn't the one in /opt/oxidized/model/...it was located in /usr/local/lib/ruby/gems/2.4.0/gems/oxidized-0.28.0/lib/oxidized/model/
Thanks again! You rock!

@github-actions github-actions bot added the Stale label Apr 26, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants