oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

Two new models, Nokia SROS ISAM 7360 and Huawei VRP

Open rinsekloek opened this issue 3 years ago • 3 comments

Added two new models for Nokia/Huawei devices

vrp58.rb is a file for the Huawei MA58xx platform sros_isam is model file for the Nokia ISAM platforn (7360)

rinsekloek avatar Jul 06 '21 13:07 rinsekloek

@rinsekloek
This is awesome!

I had a very barebone model for our Nokia ISAM: https://github.com/ytti/oxidized/issues/2290#issuecomment-830345876

Thank you for posting this!!

davama avatar Jul 06 '21 20:07 davama

@rinsekloek Two things we noticed with this model:

  1. When using these cmds, it only runs the first post_login and nothing after that
    post_login 'environment no terminal-timeout'
    post_login 'environment print no-more'
    post_login 'environment inhibit-alarms'

Our workaround:

  cfg :telnet, :ssh do
    #post_login 'environment no terminal-timeout'
    #post_login 'environment print no-more'
    #post_login 'environment inhibit-alarms'
    post_login 'echo 123\n123\n123\n123\n'
    pre_logout 'logout'
  end

Because this creates alarms on the terminal we added this cfg.gsub

    cfg.gsub! /^\d+\/\d+\/\d+\s\d+:\d+:\d+\smajor\salarm\s(cleared|occurred)\sfor\s.*$/, ''
  1. There is a lot of bargabe:
+-[1D\[1D|[1D/[1D-[1D\[1D|[1D/[1D-[1D\[1D|[1D/[1D-[1D\[1D|[1D/[1D-[1D [1D  exit

Our workaround, added the below:

  # replace all used vt100 control sequences
  expect /\e\[\??\d+(;\d+)*[A-Za-z]/ do |data, re|
    data.gsub re, ''
  end

  # replace remaining junk; literally "-\|/"
  expect /^(-\\\|\/)+/ do |data, re|
    data.gsub re, ''
  end

  # replace hopefully last junk; literatlly "-\" or "-"
  expect /^(\-\\ |- )/ do |data, re|
    data.gsub re, ''
  end

  cmd :all do |cfg, cmdstring|
    new_cfg = comment "COMMAND: #{cmdstring}\n"

Any input is appreciated! Thank you, Dave

davama avatar Jul 28 '21 23:07 davama

Please update the documentation and CHANGELOG

mortzu avatar May 13 '22 18:05 mortzu