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

Model for zte olt c3xx #2118

Merged
merged 8 commits into from
Jun 11, 2020
Merged

Model for zte olt c3xx #2118

merged 8 commits into from
Jun 11, 2020

Conversation

kastakhov
Copy link
Contributor

@kastakhov kastakhov commented Jun 4, 2020

Pre-Request Checklist

  • Passes rubocop code analysis (try rubocop --auto-correct)
  • Tests added or adapted (try rake test)
  • Changes are reflected in the documentation
  • User-visible changes appended to CHANGELOG.md

Description

model for zte olt c3xx
working with firmware 1.2.5 and 2.1

model for zte olt c3xx
@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2020

Codecov Report

Merging #2118 into master will increase coverage by 0.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2118      +/-   ##
==========================================
+ Coverage   63.19%   63.32%   +0.13%     
==========================================
  Files          30       30              
  Lines        1497     1497              
==========================================
+ Hits          946      948       +2     
+ Misses        551      549       -2     
Impacted Files Coverage Δ
lib/oxidized/output/git.rb 19.00% <0.00%> (+1.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f28083f...507921c. Read the comment docs.

@wk
Copy link
Contributor

wk commented Jun 11, 2020

Same here as in #2119 - needs a bit of documentation, but looks good! It's also always great to know what's the name of the underlying OS (unless its literally called ZTEOLT), as that would allow to map additional variations to this model in the future.

@kastakhov
Copy link
Contributor Author

Same here as in #2119 - needs a bit of documentation, but looks good! It's also always great to know what's the name of the underlying OS (unless its literally called ZTEOLT), as that would allow to map additional variations to this model in the future.

Hi, soon i will add model for ZTE switches it have some different with command in ZTE olt model.

@wk wk merged commit 6732a67 into ytti:master Jun 11, 2020
@wk
Copy link
Contributor

wk commented Jun 11, 2020

Pulling this one in as well, thanks!

@edielson
Copy link

in the router.db file, I set it up like this
LOGTEL-ZTE-ARARAS: 10.200.1.1:zteolt:zteolt::2334

I use telnet protocol to make the connection

and it is showing the following error in the log

10.200.1.1 raised Net::ReadTimeout (rescued Timeout::Error) with msg "timed out while waiting for more data"
zteolt/LOGTEL-ZTE-ARARAS status no_connection, retry attempt 1

in file config

source:
default: csv
csv:
file: /opt/oxidized/.config/oxidized/router.db
delimiter: !ruby/regexp /:/
map:
name: 0
ip: 1
model: 2
group: 3
vars_map:
ssh_port: 4
telnet_port: 5

@kastakhov
Copy link
Contributor Author

Hi, what zte device you have? This model tested only on zte olt c320 and c300.
Could you share debug log, looks like there unable catch the prompt.

@edielson
Copy link

System Description: C300 Version V2.1.0 Software, Copyright (c) by ZTE Corporation Compiled

@edielson
Copy link

Apr 14 14:32:10 host.myrouter.com.br oxidized[27132]: lib/oxidized/input/cli.rb: Running post_login commands at LOGTEL-ZTE-ARARAS
Apr 14 14:32:10 host.myrouter.com.br oxidized[27132]: lib/oxidized/input/cli.rb: Running post_login command: nil, block: #Proc:0x0000555a28c81220@/var/lib/gems/2.5.0/gems/oxidized-0.28.0/lib/oxidized/model/zteolt.rb:40 at LOGTEL-ZTE-ARARAS
Apr 14 14:32:10 host.myrouter.com.br oxidized[27132]: lib/oxidized/input/ssh.rb enable @ LOGTEL-ZTE-ARARAS with expect: /^[pP]assword:/
Apr 14 14:32:10 host.myrouter.com.br oxidized[27132]: lib/oxidized/input/ssh.rb: expecting [/^[pP]assword:/] at LOGTEL-ZTE-ARARAS

@kastakhov
Copy link
Contributor Author

Hmm, okay, maybe I know why oxi can't catch the prompt...
I no longer have access to zte devices so can't debug and fix it, but think that the following workaround may help you.
So you need to add to your csv mapping "enable" vars

    map:
      name: 0
      ip: 1
      model: 2
      group: 3
    vars_map:
      ssh_port: 4
      telnet_port: 5
      enable: 6

And if your device have enable just add it to your source file, if no add "nil".

@kastakhov
Copy link
Contributor Author

If I remember it right there was problem if device haven't "enable" password but in config you have enable var with no nil value, so when oxi connecting to zte device it send "enable" and waiting for something and no pass to next post_login.

cfg :telnet, :ssh do
    # preferred way to handle additional passwords
    post_login do
      if vars(:enable) == true
        cmd "enable" /// send and not pass to next post_login
      elsif vars(:enable)
        cmd "enable", /^[pP]assword:/
        cmd vars(:enable)
      end
    end
    post_login 'terminal length 0'
    pre_logout 'disable'
    pre_logout 'exit'
  end

But if on device you need to enter "enable" password and you have enable var that model will work correctly.
Maybe someone could fix this issue or just use workaround that I provide above...

@edielson
Copy link

thank you very much I added the enable password and it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants