Giter Club home page Giter Club logo

Comments (7)

ytti avatar ytti commented on July 18, 2024

The first line looks to be the version, so you're only missing running-config. Not sure why, but I'm guessing maybe 'cfg' is 'nil' here for some reason:

cmd 'show running-config' do |cfg|
cfg = cfg.each_line.to_a[3..-1]
cfg = cfg.reject { |line| line.match /^ntp clock-period / }.join
cfg.gsub! /^Current configuration : [^\n]\n/, ''
cfg.gsub! /^\ tunnel\ mpls\ traffic-eng\ bandwidth[^\n]
\n_(
(?:\ [^\n]\n)_
tunnel\ mpls\ traffic-eng\ auto-bw)/mx, '\1'
cfg
end

Probably this returns nil, instead of the expected config string.

There aren't really good ways to debug the models, you can get full ssh and telnet session logs though, by setting:
input:
debug: input.log

For module development/debugging maybe easiest is to copy the model to your oxidized directory under 'model' directory (i.e. ~/.config/oxidized/model/ios.rb), if model is found there it is used, instead of the global/shipping definition, so you could add there your own debugging code.

Certainly

  1. model needs to be fixed
  2. we need better way to debug models, but i don't want solution which bloats the models themselves

from oxidized.

sts avatar sts commented on July 18, 2024

Seems like it doesn't run the 'enable' command.

from oxidized.

ytti avatar ytti commented on July 18, 2024

How does your config look with regarding 'enable'

from oxidized.

sts avatar sts commented on July 18, 2024
---
username: manager
password: S3cret
enable: S3cret
model: junos
interval: 3600
log: /home/sts/.config/oxidized/log
debug: true
threads: 30
timeout: 30
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
rest: 127.0.0.1:8888
vars: {}
groups: {}
remove_secret: false
input:
  default: ssh
  debug: /home/sts/.config/oxidized/input.log
  ssh:
    secure: true
output:
  default: file
  file:
    directory: /home/sts/.config/oxidized/configs
source:
  default: csv
  csv:
    file: /home/sts/.config/oxidized/router.db
    delimiter: !ruby/regexp /:/
    map:
      name: 0
      model: 1
      username: 2
model_map:
  cisco: ios
  juniper: junos

from oxidized.

ytti avatar ytti commented on July 18, 2024

Try

vars:
enable: 'foof'

I don't think the old way is supported anymore. The vars is now used as it supports multiple levels (global, per-group, per-node)

from oxidized.

sts avatar sts commented on July 18, 2024

Yes that worked! Documentation should be updated regarding this (also include the debug tip!). Also an example for setting it per item would be cool. Thanks!

from oxidized.

ytti avatar ytti commented on July 18, 2024

Yeah documents leave lot to be desired right now.

from oxidized.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.