ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.79k stars 922 forks source link

Oxidized does not pull confg #2035

Closed eKristensen closed 4 years ago

eKristensen commented 4 years ago

Dear Oxidized

I've tried to setup oxidized to backup configuration on serveral comware switches, a mix of 4210G, 5120, 5130, runing comware 5.20 and 7.1

I've been able to set it up to connect via SSH, but it seems to only connect. It does not runt he "show current-configuration" command that actually shows the config. Why is that?

My config file:

username: [HIDDEN]
password: [HIDDEN]
debug: true
model: 3com

interval: 3600
use_syslog: false
log: /etc/oxidized/.config/oxidized/logs/
rest: 127.0.0.1:8888
threads: 30
timeout: 20
retries: 3
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
next_adds_job: false
pid: "/etc/oxidized/pid"

input:
  default: ssh
  debug: true
  ssh:
    secure: false

output:
  file:
    directory: /etc/oxidized/output/configs

source:
  default: http
  debug: true
  http:
    url: https://[HIDDEN]/api/v0/oxidized
    map:
      name: hostname
      model: os
      group: group
    headers:
      X-Auth-Token: '[HIDDEN]'

Output from one of our switches (the ssh debug data):

******************************************************************************
* Copyright (c) 2010-2019 Hewlett Packard Enterprise Development LP          *
* Without the owner's prior written consent,                                 *
* no decompiling or reverse-engineering shall be allowed.                    *
******************************************************************************

<HP>

It is like oxidized times out and then gives out without trying anything. Does it not know the login worked?

Thank you so much in advance!

Regards eKristensen

jarner commented 4 years ago

It looks like your prompt value could be an issue. What do the logs from oxidized show?

For me this file is located here: ~/.config/oxidized/log

eKristensen commented 4 years ago

I only have the ssh debug logs files. It does not generate any log output. It does not output anything in the console either, even if i enable the --debug parameter

jarner commented 4 years ago

Just after the job times out, what is the output of systemctl status oxidized -l ?

eKristensen commented 4 years ago

It didn't seem to work when i used systemctl to run oxidized so i ran it manually.

Just now i found some logs here /etc/oxidized/.config/oxidized/logs

There is a lot of debug data. It seems to get data from librenms without any issues. Here is the part for the connection to the switch:

D, [2020-02-15T18:52:46.120445 #10464] DEBUG -- : lib/oxidized/core.rb: Starting the worker...
D, [2020-02-15T18:52:47.121080 #10464] DEBUG -- : lib/oxidized/worker.rb: Jobs running: 0 of 1 - ended: 0 of 9
D, [2020-02-15T18:52:47.121441 #10464] DEBUG -- : lib/oxidized/worker.rb: Added /[SWITCH IP] to the job queue
D, [2020-02-15T18:52:47.121601 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:47.121546 #10464] DEBUG -- : lib/oxidized/job.rb: Starting fetching process for [SWITCH IP] at 2020-02-15 17:52:47 UTC
D, [2020-02-15T18:52:47.121939 #10464] DEBUG -- : lib/oxidized/input/ssh.rb: Connecting to [SWITCH IP]
D, [2020-02-15T18:52:47.122101 #10464] DEBUG -- : AUTH METHODS::["none", "publickey", "password"]
D, [2020-02-15T18:52:47.122756 #10464] DEBUG -- net.ssh.transport.session[2adb70ceacb8]: establishing connection to [SWITCH IP]:22
D, [2020-02-15T18:52:47.124327 #10464] DEBUG -- net.ssh.transport.session[2adb70ceacb8]: connection established
I, [2020-02-15T18:52:47.124419 #10464]  INFO -- net.ssh.transport.server_version[2adb70cea5c4]: negotiating protocol version
D, [2020-02-15T18:52:47.124462 #10464] DEBUG -- net.ssh.transport.server_version[2adb70cea5c4]: local is `SSH-2.0-Ruby/Net::SSH_5.2.0 x86_64-linux-gnu'
D, [2020-02-15T18:52:47.157855 #10464] DEBUG -- net.ssh.transport.server_version[2adb70cea5c4]: remote is `SSH-2.0-Comware-7.1.070'
I, [2020-02-15T18:52:47.158913 #10464]  INFO -- net.ssh.transport.algorithms[2adb70ce58f8]: sending KEXINIT
D, [2020-02-15T18:52:47.159207 #10464] DEBUG -- socket[2adb70ceaa4c]: queueing packet nr 0 type 20 len 1324
D, [2020-02-15T18:52:47.159318 #10464] DEBUG -- socket[2adb70ceaa4c]: sent 1328 bytes
D, [2020-02-15T18:52:47.167348 #10464] DEBUG -- socket[2adb70ceaa4c]: read 616 bytes
D, [2020-02-15T18:52:47.167489 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 0 type 20 len 612
I, [2020-02-15T18:52:47.167548 #10464]  INFO -- net.ssh.transport.algorithms[2adb70ce58f8]: got KEXINIT from server
I, [2020-02-15T18:52:47.167655 #10464]  INFO -- net.ssh.transport.algorithms[2adb70ce58f8]: negotiating algorithms
D, [2020-02-15T18:52:47.167772 #10464] DEBUG -- net.ssh.transport.algorithms[2adb70ce58f8]: negotiated:
* kex: ecdh-sha2-nistp384
* host_key: ssh-rsa
* encryption_server: aes256-ctr
* encryption_client: aes256-ctr
* hmac_client: hmac-sha2-512
* hmac_server: hmac-sha2-512
* compression_client: none
* compression_server: none
* language_client: 
* language_server: 
D, [2020-02-15T18:52:47.167811 #10464] DEBUG -- net.ssh.transport.algorithms[2adb70ce58f8]: exchanging keys
D, [2020-02-15T18:52:47.172061 #10464] DEBUG -- socket[2adb70ceaa4c]: queueing packet nr 1 type 30 len 108
D, [2020-02-15T18:52:47.172252 #10464] DEBUG -- socket[2adb70ceaa4c]: sent 112 bytes
D, [2020-02-15T18:52:47.362814 #10464] DEBUG -- socket[2adb70ceaa4c]: read 680 bytes
D, [2020-02-15T18:52:47.362992 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 1 type 31 len 660
D, [2020-02-15T18:52:47.367008 #10464] DEBUG -- socket[2adb70ceaa4c]: queueing packet nr 2 type 21 len 20
D, [2020-02-15T18:52:47.367128 #10464] DEBUG -- socket[2adb70ceaa4c]: sent 24 bytes
D, [2020-02-15T18:52:47.367204 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 2 type 21 len 12
D, [2020-02-15T18:52:47.367580 #10464] DEBUG -- net.ssh.authentication.session[2adb70cc3398]: beginning authentication of `root'
D, [2020-02-15T18:52:47.367713 #10464] DEBUG -- socket[2adb70ceaa4c]: queueing packet nr 3 type 5 len 28
D, [2020-02-15T18:52:47.367768 #10464] DEBUG -- socket[2adb70ceaa4c]: sent 96 bytes
D, [2020-02-15T18:52:47.375321 #10464] DEBUG -- socket[2adb70ceaa4c]: read 96 bytes
D, [2020-02-15T18:52:47.375473 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 3 type 6 len 28
D, [2020-02-15T18:52:47.375622 #10464] DEBUG -- net.ssh.authentication.session[2adb70cc3398]: trying none
D, [2020-02-15T18:52:47.375791 #10464] DEBUG -- socket[2adb70ceaa4c]: queueing packet nr 4 type 50 len 44
D, [2020-02-15T18:52:47.375866 #10464] DEBUG -- socket[2adb70ceaa4c]: sent 112 bytes
D, [2020-02-15T18:52:47.932872 #10464] DEBUG -- socket[2adb70ceaa4c]: read 96 bytes
D, [2020-02-15T18:52:47.933123 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 4 type 51 len 28
D, [2020-02-15T18:52:47.933217 #10464] DEBUG -- net.ssh.authentication.session[2adb70cc3398]: allowed methods: password
D, [2020-02-15T18:52:47.933296 #10464] DEBUG -- net.ssh.authentication.methods.none[2adb70cb5ec8]: none failed
D, [2020-02-15T18:52:47.933361 #10464] DEBUG -- net.ssh.authentication.session[2adb70cc3398]: trying password
D, [2020-02-15T18:52:47.933528 #10464] DEBUG -- socket[2adb70ceaa4c]: queueing packet nr 5 type 50 len 60
D, [2020-02-15T18:52:47.933656 #10464] DEBUG -- socket[2adb70ceaa4c]: sent 128 bytes
D, [2020-02-15T18:52:47.960103 #10464] DEBUG -- socket[2adb70ceaa4c]: read 80 bytes
D, [2020-02-15T18:52:47.960252 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 5 type 52 len 12
D, [2020-02-15T18:52:47.960341 #10464] DEBUG -- net.ssh.authentication.methods.password[2adb70cb499c]: password succeeded
D, [2020-02-15T18:52:47.960542 #10464] DEBUG -- socket[2adb70ceaa4c]: queueing packet nr 6 type 90 len 44
D, [2020-02-15T18:52:47.960611 #10464] DEBUG -- : lib/oxidized/input/ssh.rb: expecting [/^\0*(<[\w.-]+>).?$/] at [SWITCH IP]
D, [2020-02-15T18:52:48.121852 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:48.161327 #10464] DEBUG -- socket[2adb70ceaa4c]: sent 112 bytes
D, [2020-02-15T18:52:48.261715 #10464] DEBUG -- socket[2adb70ceaa4c]: read 96 bytes
D, [2020-02-15T18:52:48.261951 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 6 type 91 len 28
I, [2020-02-15T18:52:48.262132 #10464]  INFO -- net.ssh.connection.session[2adb70ca17d4]: channel_open_confirmation: 0 0 0 32768
I, [2020-02-15T18:52:48.262271 #10464]  INFO -- net.ssh.connection.channel[2adb70ca152c]: sending channel request "env"
D, [2020-02-15T18:52:48.262413 #10464] DEBUG -- socket[2adb70ceaa4c]: queueing packet nr 7 type 98 len 44
I, [2020-02-15T18:52:48.262533 #10464]  INFO -- net.ssh.connection.channel[2adb70ca152c]: sending channel request "pty-req"
D, [2020-02-15T18:52:48.262701 #10464] DEBUG -- socket[2adb70ceaa4c]: queueing packet nr 8 type 98 len 60
D, [2020-02-15T18:52:48.363039 #10464] DEBUG -- socket[2adb70ceaa4c]: sent 240 bytes
D, [2020-02-15T18:52:48.463350 #10464] DEBUG -- socket[2adb70ceaa4c]: read 80 bytes
D, [2020-02-15T18:52:48.463553 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 7 type 99 len 12
I, [2020-02-15T18:52:48.463629 #10464]  INFO -- net.ssh.connection.session[2adb70ca17d4]: channel_success: 0
I, [2020-02-15T18:52:48.463681 #10464]  INFO -- net.ssh.connection.channel[2adb70ca152c]: sending channel request "shell"
D, [2020-02-15T18:52:48.463805 #10464] DEBUG -- socket[2adb70ceaa4c]: queueing packet nr 9 type 98 len 28
D, [2020-02-15T18:52:48.564124 #10464] DEBUG -- socket[2adb70ceaa4c]: sent 96 bytes
D, [2020-02-15T18:52:48.664403 #10464] DEBUG -- socket[2adb70ceaa4c]: read 176 bytes
D, [2020-02-15T18:52:48.664607 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 8 type 93 len 28
I, [2020-02-15T18:52:48.664746 #10464]  INFO -- net.ssh.connection.session[2adb70ca17d4]: channel_window_adjust: 0 +2097152
D, [2020-02-15T18:52:48.664842 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 9 type 99 len 12
I, [2020-02-15T18:52:48.664897 #10464]  INFO -- net.ssh.connection.session[2adb70ca17d4]: channel_success: 0
I, [2020-02-15T18:52:48.865323 #10464]  INFO -- net.ssh.connection.keepalive[2adb70ca16f8]: sending keepalive 0
I, [2020-02-15T18:52:48.865421 #10464]  INFO -- net.ssh.connection.session[2adb70ca17d4]: sending global request keepalive@openssh.com
D, [2020-02-15T18:52:48.865605 #10464] DEBUG -- socket[2adb70ceaa4c]: queueing packet nr 10 type 80 len 44
D, [2020-02-15T18:52:49.066075 #10464] DEBUG -- socket[2adb70ceaa4c]: sent 112 bytes
D, [2020-02-15T18:52:49.122070 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:49.166375 #10464] DEBUG -- socket[2adb70ceaa4c]: read 80 bytes
D, [2020-02-15T18:52:49.166612 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 10 type 82 len 12
I, [2020-02-15T18:52:49.166675 #10464]  INFO -- net.ssh.connection.session[2adb70ca17d4]: global request failure
D, [2020-02-15T18:52:49.166721 #10464] DEBUG -- net.ssh.connection.keepalive[2adb70ca16f8]: keepalive response successful. Missed 0 keepalives
D, [2020-02-15T18:52:50.122338 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:51.070092 #10464] DEBUG -- socket[2adb70ceaa4c]: read 592 bytes
D, [2020-02-15T18:52:51.122572 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:51.170595 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 11 type 94 len 428
I, [2020-02-15T18:52:51.170718 #10464]  INFO -- net.ssh.connection.session[2adb70ca17d4]: channel_data: 0 408b
D, [2020-02-15T18:52:51.170900 #10464] DEBUG -- socket[2adb70ceaa4c]: received packet nr 12 type 94 len 28
I, [2020-02-15T18:52:51.170961 #10464]  INFO -- net.ssh.connection.session[2adb70ca17d4]: channel_data: 0 8b
D, [2020-02-15T18:52:52.122781 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:53.123053 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:54.123355 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:55.123589 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:56.123866 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:57.124151 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:58.124418 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:52:59.124691 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:00.124927 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:01.125209 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:02.125465 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:03.125710 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:04.125948 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:05.126214 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:06.126489 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:07.126802 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
W, [2020-02-15T18:53:07.961292 #10464]  WARN -- : [SWITCH IP] raised Oxidized::PromptUndetect with msg "******************************************************************************
* Copyright (c) 2010-2019 Hewlett Packard Enterprise Development LP          *
* Without the owner's prior written consent,                                 *
* no decompiling or reverse-engineering shall be allowed.                    *
******************************************************************************

<HP> not matching configured prompt (?-mix:^\0*(<[\w.-]+>).?$)"
D, [2020-02-15T18:53:07.961394 #10464] DEBUG -- : lib/oxidized/node.rb: Oxidized::SSH failed for [SWITCH IP]
D, [2020-02-15T18:53:07.961483 #10464] DEBUG -- : lib/oxidized/job.rb: Config fetched for [SWITCH IP] at 2020-02-15 17:53:07 UTC
W, [2020-02-15T18:53:08.127259 #10464]  WARN -- : /[SWITCH IP] status no_connection, retry attempt 1
D, [2020-02-15T18:53:08.127347 #10464] DEBUG -- : lib/oxidized/worker.rb: Jobs running: 0 of 1 - ended: 0 of 9
D, [2020-02-15T18:53:08.127589 #10464] DEBUG -- : lib/oxidized/job.rb: Starting fetching process for [SWITCH IP] at 2020-02-15 17:53:08 UTC
D, [2020-02-15T18:53:08.127519 #10464] DEBUG -- : lib/oxidized/worker.rb: Added /[SWITCH IP] to the job queue
D, [2020-02-15T18:53:08.127835 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:08.127877 #10464] DEBUG -- : lib/oxidized/input/ssh.rb: Connecting to [SWITCH IP]
D, [2020-02-15T18:53:08.128103 #10464] DEBUG -- : AUTH METHODS::["none", "publickey", "password"]
D, [2020-02-15T18:53:08.132327 #10464] DEBUG -- net.ssh.transport.session[2adb70cddb08]: establishing connection to [SWITCH IP]:22
D, [2020-02-15T18:53:08.133941 #10464] DEBUG -- net.ssh.transport.session[2adb70cddb08]: connection established
I, [2020-02-15T18:53:08.134036 #10464]  INFO -- net.ssh.transport.server_version[2adb70cb4adc]: negotiating protocol version
D, [2020-02-15T18:53:08.134078 #10464] DEBUG -- net.ssh.transport.server_version[2adb70cb4adc]: local is `SSH-2.0-Ruby/Net::SSH_5.2.0 x86_64-linux-gnu'
D, [2020-02-15T18:53:08.200015 #10464] DEBUG -- net.ssh.transport.server_version[2adb70cb4adc]: remote is `SSH-2.0-Comware-7.1.070'
I, [2020-02-15T18:53:08.204393 #10464]  INFO -- net.ssh.transport.algorithms[2adb707d33ec]: sending KEXINIT
D, [2020-02-15T18:53:08.207328 #10464] DEBUG -- socket[2adb70cdd784]: queueing packet nr 0 type 20 len 1324
D, [2020-02-15T18:53:08.207527 #10464] DEBUG -- socket[2adb70cdd784]: sent 1328 bytes
D, [2020-02-15T18:53:08.212168 #10464] DEBUG -- socket[2adb70cdd784]: read 616 bytes
D, [2020-02-15T18:53:08.212332 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 0 type 20 len 612
I, [2020-02-15T18:53:08.212420 #10464]  INFO -- net.ssh.transport.algorithms[2adb707d33ec]: got KEXINIT from server
I, [2020-02-15T18:53:08.212547 #10464]  INFO -- net.ssh.transport.algorithms[2adb707d33ec]: negotiating algorithms
D, [2020-02-15T18:53:08.212689 #10464] DEBUG -- net.ssh.transport.algorithms[2adb707d33ec]: negotiated:
* kex: ecdh-sha2-nistp384
* host_key: ssh-rsa
* encryption_server: aes256-ctr
* encryption_client: aes256-ctr
* hmac_client: hmac-sha2-512
* hmac_server: hmac-sha2-512
* compression_client: none
* compression_server: none
* language_client: 
* language_server: 
D, [2020-02-15T18:53:08.212733 #10464] DEBUG -- net.ssh.transport.algorithms[2adb707d33ec]: exchanging keys
D, [2020-02-15T18:53:08.216485 #10464] DEBUG -- socket[2adb70cdd784]: queueing packet nr 1 type 30 len 108
D, [2020-02-15T18:53:08.216672 #10464] DEBUG -- socket[2adb70cdd784]: sent 112 bytes
D, [2020-02-15T18:53:08.431956 #10464] DEBUG -- socket[2adb70cdd784]: read 680 bytes
D, [2020-02-15T18:53:08.432136 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 1 type 31 len 660
D, [2020-02-15T18:53:08.436145 #10464] DEBUG -- socket[2adb70cdd784]: queueing packet nr 2 type 21 len 20
D, [2020-02-15T18:53:08.436266 #10464] DEBUG -- socket[2adb70cdd784]: sent 24 bytes
D, [2020-02-15T18:53:08.439078 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 2 type 21 len 12
D, [2020-02-15T18:53:08.439563 #10464] DEBUG -- net.ssh.authentication.session[3fe08c20f218]: beginning authentication of `root'
D, [2020-02-15T18:53:08.439706 #10464] DEBUG -- socket[2adb70cdd784]: queueing packet nr 3 type 5 len 28
D, [2020-02-15T18:53:08.439832 #10464] DEBUG -- socket[2adb70cdd784]: sent 96 bytes
D, [2020-02-15T18:53:08.444791 #10464] DEBUG -- socket[2adb70cdd784]: read 96 bytes
D, [2020-02-15T18:53:08.444945 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 3 type 6 len 28
D, [2020-02-15T18:53:08.445077 #10464] DEBUG -- net.ssh.authentication.session[3fe08c20f218]: trying none
D, [2020-02-15T18:53:08.445217 #10464] DEBUG -- socket[2adb70cdd784]: queueing packet nr 4 type 50 len 44
D, [2020-02-15T18:53:08.445296 #10464] DEBUG -- socket[2adb70cdd784]: sent 112 bytes
D, [2020-02-15T18:53:08.905586 #10464] DEBUG -- socket[2adb70cdd784]: read 96 bytes
D, [2020-02-15T18:53:08.905826 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 4 type 51 len 28
D, [2020-02-15T18:53:08.905918 #10464] DEBUG -- net.ssh.authentication.session[3fe08c20f218]: allowed methods: password
D, [2020-02-15T18:53:08.905996 #10464] DEBUG -- net.ssh.authentication.methods.none[3fe08c1f5e6c]: none failed
D, [2020-02-15T18:53:08.906061 #10464] DEBUG -- net.ssh.authentication.session[3fe08c20f218]: trying password
D, [2020-02-15T18:53:08.906233 #10464] DEBUG -- socket[2adb70cdd784]: queueing packet nr 5 type 50 len 60
D, [2020-02-15T18:53:08.906353 #10464] DEBUG -- socket[2adb70cdd784]: sent 128 bytes
D, [2020-02-15T18:53:08.951648 #10464] DEBUG -- socket[2adb70cdd784]: read 80 bytes
D, [2020-02-15T18:53:08.951830 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 5 type 52 len 12
D, [2020-02-15T18:53:08.951941 #10464] DEBUG -- net.ssh.authentication.methods.password[3fe08c1f4a08]: password succeeded
D, [2020-02-15T18:53:08.952122 #10464] DEBUG -- socket[2adb70cdd784]: queueing packet nr 6 type 90 len 44
D, [2020-02-15T18:53:08.952196 #10464] DEBUG -- : lib/oxidized/input/ssh.rb: expecting [/^\0*(<[\w.-]+>).?$/] at [SWITCH IP]
D, [2020-02-15T18:53:09.128063 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:09.152771 #10464] DEBUG -- socket[2adb70cdd784]: sent 112 bytes
D, [2020-02-15T18:53:09.253028 #10464] DEBUG -- socket[2adb70cdd784]: read 96 bytes
D, [2020-02-15T18:53:09.253214 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 6 type 91 len 28
I, [2020-02-15T18:53:09.253442 #10464]  INFO -- net.ssh.connection.session[3fe08c1fd860]: channel_open_confirmation: 0 0 0 32768
I, [2020-02-15T18:53:09.253572 #10464]  INFO -- net.ssh.connection.channel[3fe08c1fd720]: sending channel request "env"
D, [2020-02-15T18:53:09.253742 #10464] DEBUG -- socket[2adb70cdd784]: queueing packet nr 7 type 98 len 44
I, [2020-02-15T18:53:09.253851 #10464]  INFO -- net.ssh.connection.channel[3fe08c1fd720]: sending channel request "pty-req"
D, [2020-02-15T18:53:09.254672 #10464] DEBUG -- socket[2adb70cdd784]: queueing packet nr 8 type 98 len 60
D, [2020-02-15T18:53:09.355012 #10464] DEBUG -- socket[2adb70cdd784]: sent 240 bytes
D, [2020-02-15T18:53:09.455339 #10464] DEBUG -- socket[2adb70cdd784]: read 80 bytes
D, [2020-02-15T18:53:09.455534 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 7 type 99 len 12
I, [2020-02-15T18:53:09.455610 #10464]  INFO -- net.ssh.connection.session[3fe08c1fd860]: channel_success: 0
I, [2020-02-15T18:53:09.455660 #10464]  INFO -- net.ssh.connection.channel[3fe08c1fd720]: sending channel request "shell"
D, [2020-02-15T18:53:09.455785 #10464] DEBUG -- socket[2adb70cdd784]: queueing packet nr 9 type 98 len 28
D, [2020-02-15T18:53:09.556086 #10464] DEBUG -- socket[2adb70cdd784]: sent 96 bytes
D, [2020-02-15T18:53:09.656383 #10464] DEBUG -- socket[2adb70cdd784]: read 176 bytes
D, [2020-02-15T18:53:09.656587 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 8 type 93 len 28
I, [2020-02-15T18:53:09.656686 #10464]  INFO -- net.ssh.connection.session[3fe08c1fd860]: channel_window_adjust: 0 +2097152
D, [2020-02-15T18:53:09.656833 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 9 type 99 len 12
I, [2020-02-15T18:53:09.656889 #10464]  INFO -- net.ssh.connection.session[3fe08c1fd860]: channel_success: 0
I, [2020-02-15T18:53:09.857301 #10464]  INFO -- net.ssh.connection.keepalive[3fe08c1fd784]: sending keepalive 0
I, [2020-02-15T18:53:09.857399 #10464]  INFO -- net.ssh.connection.session[3fe08c1fd860]: sending global request keepalive@openssh.com
D, [2020-02-15T18:53:09.857582 #10464] DEBUG -- socket[2adb70cdd784]: queueing packet nr 10 type 80 len 44
D, [2020-02-15T18:53:10.058089 #10464] DEBUG -- socket[2adb70cdd784]: sent 112 bytes
D, [2020-02-15T18:53:10.128343 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:10.158390 #10464] DEBUG -- socket[2adb70cdd784]: read 80 bytes
D, [2020-02-15T18:53:10.158588 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 10 type 82 len 12
I, [2020-02-15T18:53:10.158651 #10464]  INFO -- net.ssh.connection.session[3fe08c1fd860]: global request failure
D, [2020-02-15T18:53:10.158695 #10464] DEBUG -- net.ssh.connection.keepalive[3fe08c1fd784]: keepalive response successful. Missed 0 keepalives
D, [2020-02-15T18:53:11.128580 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:12.086042 #10464] DEBUG -- socket[2adb70cdd784]: read 496 bytes
D, [2020-02-15T18:53:12.128826 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:12.186447 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 11 type 94 len 428
I, [2020-02-15T18:53:12.186572 #10464]  INFO -- net.ssh.connection.session[3fe08c1fd860]: channel_data: 0 408b
D, [2020-02-15T18:53:12.186728 #10464] DEBUG -- socket[2adb70cdd784]: read 96 bytes
D, [2020-02-15T18:53:12.186824 #10464] DEBUG -- socket[2adb70cdd784]: received packet nr 12 type 94 len 28
I, [2020-02-15T18:53:12.186884 #10464]  INFO -- net.ssh.connection.session[3fe08c1fd860]: channel_data: 0 8b
D, [2020-02-15T18:53:13.129050 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:14.129444 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:15.129685 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:16.129924 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:17.130242 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:18.130490 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:19.130806 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:20.131187 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:21.131471 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:22.131734 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:23.131983 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:24.132242 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:25.132529 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:26.132820 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2020-02-15T18:53:27.133065 #10464] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
eKristensen commented 4 years ago

It is like the line with:

W, [2020-02-15T18:53:07.961292 #10464]  WARN -- : [SWITCH IP] raised Oxidized::PromptUndetect with msg "******************************************************************************
* Copyright (c) 2010-2019 Hewlett Packard Enterprise Development LP          *
* Without the owner's prior written consent,                                 *
* no decompiling or reverse-engineering shall be allowed.                    *
******************************************************************************

<HP> not matching configured prompt (?-mix:^\0*(<[\w.-]+>).?$)"

is the issue. What can i do about it ? :)

jarner commented 4 years ago

That message is where I'd start from. You'll need to modify the model file, and the instructions can be found here

If you don't want to risk losing your changes don't modify the existing model file in place, or when you upgrade it will revert back to what is in the repo. Place your modified file in the directory called out in the instructions above.

your prompt line should look something like prompt: !ruby/regexp ^\0*(<[\w.]+>).?$/

xosepe commented 4 years ago

Hi eKristensen, I have lots of those nodes under oxidized working fine. The 3Coms like 4210G need a couple of small tweaks, and Comware v7 needs SSH running if you don´t have a recent version of oxidized.

You should not use "show current-configuration". The correct command is "display current-configuration".

eKristensen commented 4 years ago

We have a few 4210G with SSH enabled. Oxidized does login, but it thinks the login failed. I've not looked further into it as it required more than configuration files changes. Sadly I'm too busy right now to do as jarnet suggest. But i intend to do it at some time hopefully soon :)

Oxidized never registered the login actually worked so it didn't execute the command to show to configuration.

xosepe commented 4 years ago

Hi again! If you are only trying with the 3Com 4120G with a 3Com OS V3, then you need to configure this command in the switch: info-center source default channel 1 log state off debug state off

As per this: https://github.com/ytti/oxidized/issues/1171

And then you also need "screen-length 0" under "user-interface vty 0 4" config section in order to avoid timeout due to paging.

That´s not needed with Comware 5 nor Comware 7 (just Comware v3).

I have lots of these Comwares, so just ask when you have time ;)

eKristensen commented 4 years ago

It is a 3Com Switch 4210G 24-Port running Comware 5.20 Release 2222P11

Not comware 3, screen length is set to zero. The problem is oxidized thinks the login failed.

Faddy96 commented 4 years ago

To me it seems like oxidized can't detect your prompt. It does this by trying to match your prompt to a regular expression. This can be seen here: "...not matching configured prompt (?-mix:^\0*(<[\w.-]+>).?$)".

When Oxidized logs in to your device, it's looking for your prompt to make sure that it actually has logged in and to make sure that it doesn't start doing all the commands until the session is ready. What it finds instead is all that copyright text. Usually this page comes up every time you login to an HP device and you have to press any key to progress to the actual prompt. This is a behaviour that I can see on my own HP Procurve switches as well. In my case however, Oxidized seems to manage to go past this screen and find the prompt.

After looking into procurve.rb I can see that they implemented code to bypass the copyright screen. I can also see that the regex pattern used in procurve.rb does not match the one seen in your error, and this raises me two questions:

  1. Are you sure that Oxidized is actually using procurve.rb when trying to login to your HP device and not any other model file?
  2. How old is your Oxidized installation? If Oxidized is using the correct model file, then the model file used by your Oxidized might be outdated considering that your regex pattern does not match the latest pattern found on procurve.rb.
eKristensen commented 4 years ago

My installation was all new when i stared back in February. I haven't looked at it since... Sadly I've not yet found time to dive into the problem :/

Faddy96 commented 4 years ago

Aah my bad, I got confused and presumed that you were having issues on a HP Procurve switch after seeing HP Copyright.

I looked into comware.rb and it seems like it doesn't have that bypass for the copyright screen. If you scroll up and look at @xosepe comment, there seems to be someone who had similar issues like you and who solved it by disabling logging. Have you tried entering the command info-center source default channel 1 log state off debug state off on your 3com device?

eKristensen commented 4 years ago
******************************************************************************
* Copyright (c) 2010-2019 Hewlett Packard Enterprise Development LP          *
* Without the owner's prior written consent,                                 *
* no decompiling or reverse-engineering shall be allowed.                    *
******************************************************************************

<HP>info-center source default channel 1 log state off debug state off
        ^
 % Unrecognized command found at '^' position.
<HP>sys
System View: return to User View with Ctrl+Z.
[HP]info-center source default channel 1 log state off debug state off
                                   ^
 % Unrecognized command found at '^' position.
[HP]quit
<HP>quit
Faddy96 commented 4 years ago

Hmm, now that I've got a better picture of your console I can see that you do not have the same problem as mentioned in #1171. Their issue was the console outputting a 'last-login' line after the prompt, but you don't seem to have that. So even though the command didn't work, it probably wouldn't solve your issue.

I have zero personal experience with comware products and therefore am limited in how much I can help and test this myself. And this is a tougher one to grasp since I don't see why the regex pattern should not match your prompt, the pattern looks pretty correct.

eKristensen commented 4 years ago

We're moving away from the 3Com/H3C switches. Therefore, I no longer need this issue to be resolved, and I won't find time to resolve the issue.

As the issue is no longer relevant for me who opened the issue I'm closing it, though I didn't get it resolved. If anybody wants to reopen it, feel free to do so.