Discussion:
[rancid] Adding "show interfaces status" to rancid
Niles, Stéphane (DSS\MAS)
2010-05-25 13:25:35 UTC
Permalink
Hi,
Per Carlson
2010-05-26 19:35:11 UTC
Permalink
Hi.
I would like to add the “show interfaces status” command to rancid. From
%commands=(
        'show interfaces status'          => "ShowIntStatus",  …
@commands=(
        "show interfaces status", …
Are you looking at an old RNACID version? In 2.3.2 there is only one
list of hashes to modify:

# Main
@commandtable = (
{'admin show version' => 'ShowVersion'},
{'show version' => 'ShowVersion'},
...
{'write term' => 'WriteTerm'},
);

The actual %commands and @commands are automatically built based on
@commandtable.

To answer the question: yes just add {'show interfaces status' =>
-        Develop a new sub (“ShowIntStatus”) to process/format the output
Correct. The hard part is to figure out how to use ProcessHistory.
Is there any other (easier) way to accomplish this, or is this the
recommended approach?
AFAIK it's the recommended and only way.

I would also recommend to put the code in a separate patch. That way
it's easier to re-apply it whenever a new upstream is released.
--
Pelle

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
Per Carlson
2010-05-28 07:46:24 UTC
Permalink
I would like to add the “show interfaces status” command to rancid. From
%commands=(
        'show interfaces status'          => "ShowIntStatus",  …
@commands=(
        "show interfaces status", …
Are you looking at an old RANCID version? In 2.3.2 there is only one
list of hashes to modify:

# Main
@commandtable = (
{'admin show version' => 'ShowVersion'},
{'show version' => 'ShowVersion'},
...
{'write term' => 'WriteTerm'},
);

The actual %commands and @commands variables are automatically built based on
@commandtable.

To answer the question: yes, just add
{'show interfaces status' => "ShowIntStatus"},
- Develop a new sub (“ShowIntStatus”) to process/format the output
Correct. The hard part is to figure out how to use ProcessHistory.
Is there any other (easier) way to accomplish this, or is this the
recommended approach?
AFAIK it's the recommended and only way.

I would also recommend to put the code in a separate patch. That way
it's easier to re-apply it whenever a new upstream is released.
--
Pelle

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
Loading...