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

Unable to Telnet to FastIron switches #1784

Closed
perfectly-preserved-pie opened this issue Apr 24, 2019 · 6 comments · Fixed by #1811
Closed

Unable to Telnet to FastIron switches #1784

perfectly-preserved-pie opened this issue Apr 24, 2019 · 6 comments · Fixed by #1811

Comments

@perfectly-preserved-pie

Hi,

I can't connect to any of my FastIron switches due to a regex error. I am using the default ironware.db.

This is the Telnet prompt:

straying@acomputer:~$ telnet 1.2.3.4
Trying 1.2.3.4...
Connected to 1.2.3.4.
Escape character is '^]'.

User Access Verification

Please Enter Password:

This is the error that Oxidized displays:
W, [2019-04-24T12:57:28.119269 #197137] WARN -- : 1.2.3.4 raised Oxidized::PromptUndetect with msg "unable to detect prompt: (?i-mx:^.*(telnet|ssh)@.+[>#]\s?$)"

This is my config:

---
username: username
password: password
model: junos
resolve_dns: true
interval: 3600
use_syslog: false
debug: true
threads: 30
timeout: 20
retries: 3
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
rest: 127.0.0.1:8888
next_adds_job: false
vars: {}
groups: {}
models: {}
pid: "/home/straying/.config/oxidized/pid"
crash:
  directory: "/home/straying/.config/oxidized/crashes"
  hostnames: false
stats:
  history_size: 10
input:
  default: telnet
  debug: true
  ssh:
    secure: false
  ftp:
    passive: true
  utf8_encoded: true
output:
  default: file
  file:
    directory: "/home/straying/.config/oxidized/configs"
source:
  default: csv
  csv:
    file: "/home/straying/.config/oxidized/router.db"
    delimiter: !ruby/regexp /:/
    map:
      name: 0
      model: 1
      password: 2
      enable: 3
    gpg: false
model_map:
  juniper: junos
  cisco: ios
  ironware: ironware

This is my router.db:
1.2.3.4:ironware:telnetpassword:enablepassword

I've tried modifying the regex, and verified my result in the various regex generators online, but I still can't get past this error message.

Does anyone know what else I can try?

@wk
Copy link
Contributor

wk commented Apr 24, 2019

The model appears to assume a user + password style login, while your device appears to present only the password prompt - most likely because no users are configured, and only a super-user password is present; you might have better luck if you configure your device along the lines of:

username someuser password somepassword
aaa authentication login default local enable

Then configure someuser and somepassword as the credentials for Oxidized.

@perfectly-preserved-pie
Copy link
Author

perfectly-preserved-pie commented Apr 24, 2019

Thank you. I've done as you said, and created an 'oxidized' user and updated my router.db accordingly. But it still fails. When I try to telnet, I'm still not prompted for a username either.

That's less of an Oxidized problem and more of a FastIron issue though I think. Is there any way I can make Oxidized work with the "password only" situation?

EDIT: Nevermind, I'm now prompted for a Telnet username --

User Access Verification

Please Enter Login Name: 
Please Enter Password:

How do I make the regex work with this?

@wk
Copy link
Contributor

wk commented Apr 25, 2019

Based on the current model, the prompt you are now seeing should be a match:

irb(main):001:0> "Please Enter Login Name: ".match /^(Please Enter Login Name|Username):/
=> #<MatchData "Please Enter Login Name:" 1:"Please Enter Login Name">
irb(main):002:0> "Please Enter Password:".match /^(Please Enter Password ?|Password):/
=> #<MatchData "Please Enter Password:" 1:"Please Enter Password">
irb(main):003:0>

Are you testing this with an unmodified ironware model (you mention attempting to edit the regexp) from Oxidized 0.26.3? If so, this could be the result of your device inserting some control characters into the session. A debug log of the Telnet session might shed more light on the issue.

@perfectly-preserved-pie
Copy link
Author

perfectly-preserved-pie commented May 1, 2019

I am using an unmodified Oxidized 0.26.3, yes.

Here's my debug log:

User Access Verification

Please Enter Login Name: oxidized
 

Quitz321 added a commit to Quitz321/oxidized that referenced this issue May 17, 2019
ytti pushed a commit that referenced this issue May 18, 2019
@wk
Copy link
Contributor

wk commented May 20, 2019

Also see #1808 - as there's now a dedicated fastiron model separate from ironware (one for each type of Brocade OS).

@rosstex
Copy link

rosstex commented Sep 29, 2020

Random Q, why is your model 'junos' for a fastiron/brocade router?

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

Successfully merging a pull request may close this issue.

3 participants