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

Audiocodes Model: SSH not working because of missing newline characters #2006

Closed
procurvr opened this issue Jan 3, 2020 · 3 comments
Closed

Comments

@procurvr
Copy link

procurvr commented Jan 3, 2020

audiocodes.rb is not working for me, I have tested with Mediant 1000B (M1KB)
I think this is because of missing newline in MS Windows Style (\r\n).
I inserted \r\n at the end of the command (also with the pre_logout exit command)
Following code works for me with telnet, ssh password auth and ssh pubkey auth:

class M1kb < Oxidized::Model

  prompt /^\r?([\w.@() -]+[#>]\s?)$/
  comment '## '

  expect /\s*--MORE--$/ do |data, re|
    send ' '

    data.sub re, ''
  end

  cmd "show running-config\r\n" do |cfg|
    cfg
  end

  cfg :ssh do
    username /^login as:\s$/
    password /^.+password:\s$/
    pre_logout "exit\r\n"
  end

  cfg :telnet do
    username /^Username:\s$/
    password /^Password:\s$/
    pre_logout 'exit'
  end
end

It is also very important to set the "Default terminal window height" (Administration -> WEB & CLI -> CLI Settings) on the Audiocodes device to something diffent than "-1". I think the problem is that in the ssh session there is no window height defined so the line buffer is nul. You can set the value to "0" or much higher (which reduces --MORE-- paging in the output).

@lukeod
Copy link

lukeod commented Sep 28, 2020

+1. The above model fixed a problem i was having with M800C running 7.2.

@bkeifer
Copy link

bkeifer commented Nov 17, 2021

+1. This model fixed the issue for me on a Mediant 2600 on 7.20A

@ghost
Copy link

ghost commented Jan 12, 2022

Please provide a PR

@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

3 participants