Skip to content

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

Closed as not planned
@procurvr

Description

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions