OT: "show run" parser

Dear Rubyists,
I realize this is a fairly off-topic question, but I’m wondering if any
of you know of a tool that can read the output of “show run” (like in a
Cisco switch), parse the output, and produce a nice-looking document.

Anything perchance written in Ruby?

Thanks much!

Hi,

Am Dienstag, 14. Jul 2009, 02:34:26 +0900 schrieb Sebastian W.:

I realize this is a fairly off-topic question, but I’m wondering if any
of you know of a tool that can read the output of “show run” (like in a
Cisco switch), parse the output, and produce a nice-looking document.

I don’t know the “show run” command and what you want to parse out
of it. I guess the information you like to retrieve is not that
complicated.

show run.grep /^col1/

Bertram

“Sebastian W.” [email protected] writes:

Dear Rubyists,
I realize this is a fairly off-topic question, but I’m wondering if any
of you know of a tool that can read the output of “show run” (like in a
Cisco switch), parse the output, and produce a nice-looking document.

Anything perchance written in Ruby?

It’s difficult to have a generic tool for Cisco configs considering the
vast
number of options there can be and the somewhat idiosyncratic format
they each
come in!

You may find something here: http://cosi-nms.sourceforge.net/

Unlikely to be any in Ruby though.

I have seen the occassional conversion s/w on the web but I have no
references.

It depends a lot on what you mean by “nice looking document” of course.
Presumably you want to extract only certain portions for display.
I wrote a reasonably generic parser in Python some time ago, it
basically
looked for indented sections and common prefixes and specifically
checked for
the sort of thing we have on our routers. I could try and dig it out if
you’re interested (email me). I also started an extendable parser in
Ruby but
it’s far from done and it was the first non-trivial Ruby program I wrote
so
it’s probably very bad Ruby style (it’s probably also way over the top
since
it was for analysing the contents of Pix configs).

Eddie

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs