oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

Oxidized and issue with TP-Link devices

Open GeComDohlad opened this issue 1 year ago • 8 comments

Hello guys, I need help with getting config backups from TP-Link devices from our network. We're using TP-Link devices as TL-SG3428, TL-SG3210, TL-SG3210 and TP-Link JetStream T2500G-10TS 1.0.

Here is my Oxidized installation root@nms:/home/gecom# oxidized -v 0.28.0

root@nms:/home/gecom# ruby -v ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]

Here is my tplink.rb model

class TPLink < Oxidized::Model
  # tp-link prompt
  prompt  /^\r?([\w.@()-]+[#>]\s?)$/
  comment '! '

  def ssh
    @input.class.to_s.match(/SSH/)
  end

  # With disable paging this is not needed
  # # handle paging
  # # workaround for sometimes missing whitespaces with "\s?"
  expect /Press\s?any\s?key\s?to\s?continue\s?(Q\s?to\s?quit)/ do |data, re|
  send ' '
    data.sub re, ''
  end

  # send carriage return because \n with the command is not enough
  # checks if line ends with prompt >,#,: or \r,\n otherwise send \r
  expect /[^>#\r\n:]$/ do |data, re|
    send "\r" if ssh
    data.sub re, ''
  end

  cmd :all do |cfg|
    # # remove unwanted paging line
    cfg.gsub! /^Press any key to contin.*/, ''
    # normalize linefeeds
    cfg.gsub! /(\r|\r\n|\n\r)/, "\n"
    # remove redundant prompt lines
    cfg.gsub! /^([\w.@()-]+[#>])$/, ''
    # remove empty lines
    cfg.each_line.reject { |line| line.match /^[\r\n\s\u0000#]+$/ }.join
  end

  cmd :secret do |cfg|
    cfg.gsub! /^enable password (\S+)/, 'enable password '
    cfg.gsub! /^user (\S+) password (\S+) (.)/, 'user \1 password \3'
    cfg.gsub! /^(snmp-server community)./, '\1 '
    cfg.gsub! /secret (\d+) (\S+).*/, ''
    cfg
  end

  cmd "show system-info" do |cfg|
    cfg.gsub! /(System Time\s+-)./, '\1 '
    cfg.gsub! /(Running Time\s+-)./, '\1 '
    comment cfg.each_line.to_a[3..-3].join
  end

  cmd "show running-config" do |cfg|
    lines = cfg.each_line.to_a[1..-1]
    # cut config after "end"
    lines[0..lines.index("end\n")].join
  end

  cfg :telnet, :ssh do
    username /^(User ?[nN]ame|User):/
    password /^\r?[pP]assword:/
  end

  cfg :telnet, :ssh do
    post_login do
      if vars(:enable) == true
        cmd "enable"
      elsif vars(:enable)
        cmd "enable", /^[pP]assword:/
        send vars(:enable) + "\n\r"
      end
      # disable paging
      cmd "terminal length 0"
      # enable-admin gives admin privileges for regular users
      # Sending enable-admin with an admin user returns a message warning that
      # the user already is admin without further consequences. So, always
      # send the enable-admin.
      # There is an option to set a password for enable-admin, but testing
      # with firmware 2.0.5 Build 20200109 Rel.36203 that option didn't works.
      # So we'll leave enable-admin without password here.
      cmd "enable-admin"
    end

    pre_logout do
      send "exit\r"
      send "logout\r"
    end
  end
end

after detailed logs from oxidized i have success executing commands as show-info, show running-config atc. and fetched config are complete in the end of logs. But my output is still

--------^ Error:Bad command switch>

any ideas ? Thank you TP

GeComDohlad avatar Nov 18 '24 09:11 GeComDohlad

Why do are you not using tplink model?

robertcheramy avatar Nov 29 '24 20:11 robertcheramy

Hello, because the results with tplink model is... image here is debug log after restart oxidized service image and here is crash file image

but if i commented rows from tplink.rd, service oxidized after restart now working image here is debug with fetching config from device "jh67"

I, [2024-12-02T09:29:39.209902 #2935868] INFO -- : Oxidized starting, running as pid 2935868 I, [2024-12-02T09:29:39.211621 #2935868] INFO -- : lib/oxidized/nodes.rb: Loading nodes D, [2024-12-02T09:29:39.211959 #2935868] DEBUG -- : resolving DNS for jh67... D, [2024-12-02T09:29:39.212039 #2935868] DEBUG -- : IPADDR D, [2024-12-02T09:29:39.213842 #2935868] DEBUG -- : node.rb: resolving node key 'model', with passed global value of '' and node value 'tplink' D, [2024-12-02T09:29:39.213982 #2935868] DEBUG -- : node.rb: setting node key 'model' to value 'edgecos' from global D, [2024-12-02T09:29:39.214046 #2935868] DEBUG -- : node.rb: returning node key 'model' with value 'tplink' D, [2024-12-02T09:29:39.214115 #2935868] DEBUG -- : lib/oxidized/node.rb: Loading model "tplink" D, [2024-12-02T09:29:39.216195 #2935868] DEBUG -- : lib/oxidized/model/model.rb Added all to the commands list D, [2024-12-02T09:29:39.216280 #2935868] DEBUG -- : lib/oxidized/model/model.rb Added secret to the commands list D, [2024-12-02T09:29:39.216347 #2935868] DEBUG -- : lib/oxidized/model/model.rb Added show system-info to the commands list D, [2024-12-02T09:29:39.216427 #2935868] DEBUG -- : lib/oxidized/model/model.rb Added show running-config to the commands list D, [2024-12-02T09:29:39.216765 #2935868] DEBUG -- : node.rb: resolving node key 'input', with passed global value of 'ssh, telnet' and node value '' D, [2024-12-02T09:29:39.216843 #2935868] DEBUG -- : node.rb: returning node key 'input' with value 'ssh, telnet' D, [2024-12-02T09:29:39.494905 #2935868] DEBUG -- : node.rb: resolving node key 'output', with passed global value of 'git' and node value '' D, [2024-12-02T09:29:39.495056 #2935868] DEBUG -- : node.rb: returning node key 'output' with value 'git' D, [2024-12-02T09:29:39.525537 #2935868] DEBUG -- : node.rb: resolving node key 'username', with passed global value of '' and node value 'admin' D, [2024-12-02T09:29:39.525678 #2935868] DEBUG -- : node.rb: setting node key 'username' to value 'admin' from global D, [2024-12-02T09:29:39.525736 #2935868] DEBUG -- : node.rb: returning node key 'username' with value 'admin' D, [2024-12-02T09:29:39.525774 #2935868] DEBUG -- : node.rb: resolving node key 'password', with passed global value of '' and node value 'Gecom0mos' D, [2024-12-02T09:29:39.525814 #2935868] DEBUG -- : node.rb: setting node key 'password' to value 'Gecom0mos' from global D, [2024-12-02T09:29:39.525853 #2935868] DEBUG -- : node.rb: returning node key 'password' with value 'Gecom0mos' I, [2024-12-02T09:29:39.525958 #2935868] INFO -- : lib/oxidized/nodes.rb: Loaded 1 nodes D, [2024-12-02T09:29:40.474633 #2935868] DEBUG -- : lib/oxidized/core.rb: Starting the worker... D, [2024-12-02T09:29:41.475927 #2935868] DEBUG -- : lib/oxidized/worker.rb: Jobs running: 0 of 1 - ended: 0 of 1 D, [2024-12-02T09:29:41.476703 #2935868] DEBUG -- : lib/oxidized/worker.rb: Added /jh67 to the job queue D, [2024-12-02T09:29:41.476788 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:41.478297 #2935868] DEBUG -- : lib/oxidized/job.rb: Starting fetching process for jh67 at 2024-12-02 08:29:41 UTC D, [2024-12-02T09:29:41.478859 #2935868] DEBUG -- : lib/oxidized/input/ssh.rb: Connecting to jh67 D, [2024-12-02T09:29:41.479182 #2935868] DEBUG -- : AUTH METHODS::["none", "publickey", "password"] D, [2024-12-02T09:29:41.480892 #2935868] DEBUG -- net.ssh.transport.session[3c0]: establishing connection to 10.0.86.61:22 D, [2024-12-02T09:29:41.483286 #2935868] DEBUG -- net.ssh.transport.session[3c0]: connection established I, [2024-12-02T09:29:41.483427 #2935868] INFO -- net.ssh.transport.server_version[3d4]: negotiating protocol version D, [2024-12-02T09:29:41.483499 #2935868] DEBUG -- net.ssh.transport.server_version[3d4]: local is SSH-2.0-Ruby/Net::SSH_5.2.0 x86_64-linux-gnu' D, [2024-12-02T09:29:41.487015 #2935868] DEBUG -- net.ssh.transport.server_version[3d4]: remote is SSH-1.99-IPSSH-6.6.0' I, [2024-12-02T09:29:41.488389 #2935868] INFO -- net.ssh.transport.algorithms[3e8]: sending KEXINIT D, [2024-12-02T09:29:41.488731 #2935868] DEBUG -- socket[3fc]: queueing packet nr 0 type 20 len 1324 D, [2024-12-02T09:29:41.488827 #2935868] DEBUG -- socket[3fc]: sent 1328 bytes D, [2024-12-02T09:29:41.491904 #2935868] DEBUG -- socket[3fc]: read 704 bytes D, [2024-12-02T09:29:41.492104 #2935868] DEBUG -- socket[3fc]: received packet nr 0 type 20 len 700 I, [2024-12-02T09:29:41.492194 #2935868] INFO -- net.ssh.transport.algorithms[3e8]: got KEXINIT from server I, [2024-12-02T09:29:41.492372 #2935868] INFO -- net.ssh.transport.algorithms[3e8]: negotiating algorithms D, [2024-12-02T09:29:41.492593 #2935868] DEBUG -- net.ssh.transport.algorithms[3e8]: negotiated:

  • kex: diffie-hellman-group1-sha1
  • 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, [2024-12-02T09:29:41.492658 #2935868] DEBUG -- net.ssh.transport.algorithms[3e8]: exchanging keys D, [2024-12-02T09:29:41.496279 #2935868] DEBUG -- socket[3fc]: queueing packet nr 1 type 30 len 140 D, [2024-12-02T09:29:41.496426 #2935868] DEBUG -- socket[3fc]: sent 144 bytes D, [2024-12-02T09:29:41.727623 #2935868] DEBUG -- socket[3fc]: read 448 bytes D, [2024-12-02T09:29:41.727921 #2935868] DEBUG -- socket[3fc]: received packet nr 1 type 31 len 444 D, [2024-12-02T09:29:41.729120 #2935868] DEBUG -- socket[3fc]: queueing packet nr 2 type 21 len 20 D, [2024-12-02T09:29:41.729257 #2935868] DEBUG -- socket[3fc]: sent 24 bytes D, [2024-12-02T09:29:41.733262 #2935868] DEBUG -- socket[3fc]: read 16 bytes D, [2024-12-02T09:29:41.733442 #2935868] DEBUG -- socket[3fc]: received packet nr 2 type 21 len 12 D, [2024-12-02T09:29:41.734092 #2935868] DEBUG -- net.ssh.authentication.session[410]: beginning authentication of `admin' D, [2024-12-02T09:29:41.734294 #2935868] DEBUG -- socket[3fc]: queueing packet nr 3 type 5 len 28 D, [2024-12-02T09:29:41.734426 #2935868] DEBUG -- socket[3fc]: sent 96 bytes D, [2024-12-02T09:29:41.739106 #2935868] DEBUG -- socket[3fc]: read 96 bytes D, [2024-12-02T09:29:41.739582 #2935868] DEBUG -- socket[3fc]: received packet nr 3 type 6 len 28 D, [2024-12-02T09:29:41.739989 #2935868] DEBUG -- net.ssh.authentication.session[410]: trying none D, [2024-12-02T09:29:41.740520 #2935868] DEBUG -- socket[3fc]: queueing packet nr 4 type 50 len 44 D, [2024-12-02T09:29:41.740787 #2935868] DEBUG -- socket[3fc]: sent 112 bytes D, [2024-12-02T09:29:41.744657 #2935868] DEBUG -- socket[3fc]: read 112 bytes D, [2024-12-02T09:29:41.744949 #2935868] DEBUG -- socket[3fc]: received packet nr 4 type 51 len 44 D, [2024-12-02T09:29:41.745283 #2935868] DEBUG -- net.ssh.authentication.session[410]: allowed methods: publickey,password D, [2024-12-02T09:29:41.745409 #2935868] DEBUG -- net.ssh.authentication.methods.none[424]: none failed D, [2024-12-02T09:29:41.745555 #2935868] DEBUG -- net.ssh.authentication.session[410]: trying publickey D, [2024-12-02T09:29:41.745782 #2935868] DEBUG -- net.ssh.authentication.agent[438]: connecting to ssh-agent E, [2024-12-02T09:29:41.745926 #2935868] ERROR -- net.ssh.authentication.agent[438]: could not connect to ssh-agent: Agent not configured D, [2024-12-02T09:29:41.746009 #2935868] DEBUG -- net.ssh.authentication.session[410]: trying password D, [2024-12-02T09:29:41.746282 #2935868] DEBUG -- socket[3fc]: queueing packet nr 5 type 50 len 60 D, [2024-12-02T09:29:41.746427 #2935868] DEBUG -- socket[3fc]: sent 128 bytes D, [2024-12-02T09:29:42.478065 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:43.479492 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:44.480843 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:45.482276 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:46.483570 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:47.484564 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:48.485852 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:49.487152 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:50.488556 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:51.490044 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:51.775027 #2935868] DEBUG -- socket[3fc]: read 80 bytes D, [2024-12-02T09:29:51.775787 #2935868] DEBUG -- socket[3fc]: received packet nr 5 type 52 len 12 D, [2024-12-02T09:29:51.776201 #2935868] DEBUG -- net.ssh.authentication.methods.password[4c4]: password succeeded D, [2024-12-02T09:29:51.776934 #2935868] DEBUG -- socket[3fc]: queueing packet nr 6 type 90 len 44 D, [2024-12-02T09:29:51.777316 #2935868] DEBUG -- : lib/oxidized/input/ssh.rb: expecting [/^\r?([\w.@()-]+[#>]\s?)$/, /^User ?[nN]ame:/, /^\r?Password:/] at jh67 D, [2024-12-02T09:29:51.978866 #2935868] DEBUG -- socket[3fc]: sent 112 bytes D, [2024-12-02T09:29:52.079414 #2935868] DEBUG -- socket[3fc]: read 96 bytes D, [2024-12-02T09:29:52.079777 #2935868] DEBUG -- socket[3fc]: received packet nr 6 type 91 len 28 I, [2024-12-02T09:29:52.080147 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_open_confirmation: 0 1 65536 32768 I, [2024-12-02T09:29:52.080402 #2935868] INFO -- net.ssh.connection.channel[4ec]: sending channel request "env" D, [2024-12-02T09:29:52.080709 #2935868] DEBUG -- socket[3fc]: queueing packet nr 7 type 98 len 44 I, [2024-12-02T09:29:52.080957 #2935868] INFO -- net.ssh.connection.channel[4ec]: sending channel request "pty-req" D, [2024-12-02T09:29:52.081187 #2935868] DEBUG -- socket[3fc]: queueing packet nr 8 type 98 len 60 D, [2024-12-02T09:29:52.181766 #2935868] DEBUG -- socket[3fc]: sent 240 bytes D, [2024-12-02T09:29:52.282275 #2935868] DEBUG -- socket[3fc]: read 80 bytes D, [2024-12-02T09:29:52.282631 #2935868] DEBUG -- socket[3fc]: received packet nr 7 type 99 len 12 I, [2024-12-02T09:29:52.282745 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_success: 0 I, [2024-12-02T09:29:52.282829 #2935868] INFO -- net.ssh.connection.channel[4ec]: sending channel request "shell" D, [2024-12-02T09:29:52.283006 #2935868] DEBUG -- socket[3fc]: queueing packet nr 9 type 98 len 28 D, [2024-12-02T09:29:52.383544 #2935868] DEBUG -- socket[3fc]: sent 96 bytes D, [2024-12-02T09:29:52.484115 #2935868] DEBUG -- socket[3fc]: read 176 bytes D, [2024-12-02T09:29:52.484600 #2935868] DEBUG -- socket[3fc]: received packet nr 8 type 99 len 12 I, [2024-12-02T09:29:52.484741 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_success: 0 D, [2024-12-02T09:29:52.484879 #2935868] DEBUG -- socket[3fc]: received packet nr 9 type 94 len 28 I, [2024-12-02T09:29:52.485302 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 8b D, [2024-12-02T09:29:52.491350 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:52.586895 #2935868] DEBUG -- : lib/oxidized/input/cli.rb: Running post_login commands at jh67 D, [2024-12-02T09:29:52.587098 #2935868] DEBUG -- : lib/oxidized/input/cli.rb: Running post_login command: nil, block: #<Proc:0x00005648e1848610 /var/lib/gems/2.7.0/gems/oxidized-0.28.0/lib/oxidized/model/tplink.rb:57> at jh67 D, [2024-12-02T09:29:52.587329 #2935868] DEBUG -- : lib/oxidized/model/model.rb Collecting commands' outputs D, [2024-12-02T09:29:52.587506 #2935868] DEBUG -- : lib/oxidized/model/model.rb Executing show system-info D, [2024-12-02T09:29:52.587593 #2935868] DEBUG -- : lib/oxidized/input/ssh.rb show system-info @ jh67 with expect: /^\r?([\w.@()-]+[#>]\s?)$/ D, [2024-12-02T09:29:52.587940 #2935868] DEBUG -- socket[3fc]: queueing packet nr 10 type 94 len 44 D, [2024-12-02T09:29:52.588053 #2935868] DEBUG -- : lib/oxidized/input/ssh.rb: expecting [/^\r?([\w.@()-]+[#>]\s?)$/] at jh67 D, [2024-12-02T09:29:52.788763 #2935868] DEBUG -- socket[3fc]: sent 112 bytes D, [2024-12-02T09:29:52.889252 #2935868] DEBUG -- socket[3fc]: read 208 bytes D, [2024-12-02T09:29:52.889805 #2935868] DEBUG -- socket[3fc]: received packet nr 10 type 93 len 28 I, [2024-12-02T09:29:52.890052 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_window_adjust: 0 +17 D, [2024-12-02T09:29:52.890382 #2935868] DEBUG -- socket[3fc]: received packet nr 11 type 94 len 44 I, [2024-12-02T09:29:52.890701 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 16b D, [2024-12-02T09:29:52.891300 #2935868] DEBUG -- socket[3fc]: queueing packet nr 11 type 94 len 28 D, [2024-12-02T09:29:52.991797 #2935868] DEBUG -- socket[3fc]: sent 96 bytes D, [2024-12-02T09:29:53.092348 #2935868] DEBUG -- socket[3fc]: read 400 bytes D, [2024-12-02T09:29:53.092770 #2935868] DEBUG -- socket[3fc]: received packet nr 12 type 93 len 28 I, [2024-12-02T09:29:53.092982 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_window_adjust: 0 +1 D, [2024-12-02T09:29:53.093175 #2935868] DEBUG -- socket[3fc]: received packet nr 13 type 94 len 28 I, [2024-12-02T09:29:53.093313 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 2b D, [2024-12-02T09:29:53.093573 #2935868] DEBUG -- socket[3fc]: received packet nr 14 type 94 len 44 I, [2024-12-02T09:29:53.093744 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 28b D, [2024-12-02T09:29:53.094011 #2935868] DEBUG -- socket[3fc]: received packet nr 15 type 94 len 28 I, [2024-12-02T09:29:53.094143 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 8b D, [2024-12-02T09:29:53.194791 #2935868] DEBUG -- : lib/oxidized/model/model.rb Executing show running-config D, [2024-12-02T09:29:53.195010 #2935868] DEBUG -- : lib/oxidized/input/ssh.rb show running-config @ jh67 with expect: /^\r?([\w.@()-]+[#>]\s?)$/ D, [2024-12-02T09:29:53.195317 #2935868] DEBUG -- socket[3fc]: queueing packet nr 12 type 94 len 44 D, [2024-12-02T09:29:53.195440 #2935868] DEBUG -- : lib/oxidized/input/ssh.rb: expecting [/^\r?([\w.@()-]+[#>]\s?)$/] at jh67 D, [2024-12-02T09:29:53.396210 #2935868] DEBUG -- socket[3fc]: sent 112 bytes D, [2024-12-02T09:29:53.492603 #2935868] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel D, [2024-12-02T09:29:53.496632 #2935868] DEBUG -- socket[3fc]: read 304 bytes D, [2024-12-02T09:29:53.496925 #2935868] DEBUG -- socket[3fc]: received packet nr 16 type 93 len 28 I, [2024-12-02T09:29:53.497083 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_window_adjust: 0 +20 D, [2024-12-02T09:29:53.497228 #2935868] DEBUG -- socket[3fc]: received packet nr 17 type 94 len 44 I, [2024-12-02T09:29:53.497354 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 17b D, [2024-12-02T09:29:53.497639 #2935868] DEBUG -- socket[3fc]: received packet nr 18 type 94 len 28 I, [2024-12-02T09:29:53.497738 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 2b D, [2024-12-02T09:29:53.498036 #2935868] DEBUG -- socket[3fc]: queueing packet nr 13 type 94 len 28 D, [2024-12-02T09:29:53.598479 #2935868] DEBUG -- socket[3fc]: sent 96 bytes D, [2024-12-02T09:29:53.699019 #2935868] DEBUG -- socket[3fc]: read 784 bytes D, [2024-12-02T09:29:53.699362 #2935868] DEBUG -- socket[3fc]: received packet nr 19 type 93 len 28 I, [2024-12-02T09:29:53.699489 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_window_adjust: 0 +2 D, [2024-12-02T09:29:53.699651 #2935868] DEBUG -- socket[3fc]: received packet nr 20 type 94 len 28 I, [2024-12-02T09:29:53.699764 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 2b D, [2024-12-02T09:29:53.699986 #2935868] DEBUG -- socket[3fc]: received packet nr 21 type 94 len 28 I, [2024-12-02T09:29:53.700105 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 1b D, [2024-12-02T09:29:53.700556 #2935868] DEBUG -- socket[3fc]: received packet nr 22 type 94 len 44 I, [2024-12-02T09:29:53.700653 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 27b D, [2024-12-02T09:29:53.700858 #2935868] DEBUG -- socket[3fc]: received packet nr 23 type 94 len 28 I, [2024-12-02T09:29:53.700969 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 3b D, [2024-12-02T09:29:53.701153 #2935868] DEBUG -- socket[3fc]: received packet nr 24 type 94 len 28 I, [2024-12-02T09:29:53.701251 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 7b D, [2024-12-02T09:29:53.701427 #2935868] DEBUG -- socket[3fc]: received packet nr 25 type 94 len 28 I, [2024-12-02T09:29:53.701663 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 3b D, [2024-12-02T09:29:53.701848 #2935868] DEBUG -- socket[3fc]: received packet nr 26 type 94 len 28 I, [2024-12-02T09:29:53.701947 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 5b D, [2024-12-02T09:29:53.702246 #2935868] DEBUG -- socket[3fc]: queueing packet nr 14 type 94 len 28 D, [2024-12-02T09:29:53.802816 #2935868] DEBUG -- : lib/oxidized/input/cli.rb Running pre_logout commands at jh67 D, [2024-12-02T09:29:53.803458 #2935868] DEBUG -- socket[3fc]: queueing packet nr 15 type 94 len 28 D, [2024-12-02T09:29:53.803631 #2935868] DEBUG -- socket[3fc]: sent 192 bytes D, [2024-12-02T09:29:53.813780 #2935868] DEBUG -- socket[3fc]: read 96 bytes D, [2024-12-02T09:29:53.814087 #2935868] DEBUG -- socket[3fc]: received packet nr 27 type 93 len 28 I, [2024-12-02T09:29:53.814206 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_window_adjust: 0 +1 D, [2024-12-02T09:29:53.818202 #2935868] DEBUG -- socket[3fc]: read 192 bytes D, [2024-12-02T09:29:53.818366 #2935868] DEBUG -- socket[3fc]: received packet nr 28 type 94 len 28 I, [2024-12-02T09:29:53.818463 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 2b D, [2024-12-02T09:29:53.818700 #2935868] DEBUG -- socket[3fc]: received packet nr 29 type 93 len 28 I, [2024-12-02T09:29:53.818801 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_window_adjust: 0 +12 D, [2024-12-02T09:29:53.824138 #2935868] DEBUG -- socket[3fc]: read 96 bytes D, [2024-12-02T09:29:53.824358 #2935868] DEBUG -- socket[3fc]: received packet nr 30 type 94 len 28 I, [2024-12-02T09:29:53.824486 #2935868] INFO -- net.ssh.connection.session[4d8]: channel_data: 0 3b D, [2024-12-02T09:29:53.853075 #2935868] DEBUG -- socket[3fc]: read 0 bytes D, [2024-12-02T09:29:53.853855 #2935868] DEBUG -- : lib/oxidized/node.rb: Oxidized::SSH ran for jh67 successfully D, [2024-12-02T09:29:53.853971 #2935868] DEBUG -- : lib/oxidized/job.rb: Config fetched for jh67 at 2024-12-02 08:29:53 UTC D, [2024-12-02T09:29:54.495673 #2935868] DEBUG -- : lib/oxidized/worker.rb: Jobs running: 0 of 1 - ended: 1 of 1 D, [2024-12-02T09:29:54.495882 #2935868] DEBUG -- : lib/oxidized/worker.rb: Running :nodes_done hook

but....this is on my LibreNMS server image

Thanks

GeComDohlad avatar Dec 02 '24 08:12 GeComDohlad

Are the problems still present in oxidized v 0.31.0 ? There were problems with refinements which have been fixed since then. If you still have problems with 0.31.0, I'll ask you to submit a YAML Simulation File for your device. I ca provide a commandset and the command line if necessary.

robertcheramy avatar Dec 07 '24 16:12 robertcheramy

Hi Everyone, We have the same issue with all TP-link devices, and we use default tplink model. We are using latest oxidized version 0.31.0, if someone find how to resolve the problem please write a comment. We also make a tests and if I find some workaround I will write a comment.

yansteell avatar Jan 06 '25 11:01 yansteell

Here is one example.

---------------------------------^ Error: Bad command SG2210MPRILA-AC-45.100-PARKING-01>

yansteell avatar Jan 06 '25 11:01 yansteell

Hi, Did someone can resolve this problem.

I think the problem is that the enable command and the password for it are not sent after the oxidized user logs in to the switch.

I tried configuration from other similar devices from cisco and d-link as well as configuration from gitlab but again nothing.

This is an instructions from oxidized github again not working.

The following code snippet demonstrates how to handle sending the 'enable' command and an enable password.

This example is taken from the IOS model. It covers scenarios where users need to enable privileged mode, either without providing a password (by setting enable: true in the configuration) or with a password.

cfg :telnet, :ssh do post_login do if vars(:enable) == true cmd "enable" elsif vars(:enable) cmd "enable", /^[pP]assword:/ cmd vars(:enable) end end end

yansteell avatar Feb 17 '25 17:02 yansteell

Probably duplicate of #3271 and #3182

robertcheramy avatar Feb 17 '25 21:02 robertcheramy

This issue is stale because it has been open 90 days with no activity.

github-actions[bot] avatar May 19 '25 02:05 github-actions[bot]

Closing the issue as the enable code has been implemented in the tplink model. If there still an issue, open a new on (you can hint on this one) an provide a YAML simulation file.

robertcheramy avatar Jun 30 '25 05:06 robertcheramy