[mrtg] Re: Cisco Routing Table

Ruediger Biernat info at 24prompt.de
Wed Aug 29 16:16:43 MEST 2001


Hi,


I don't have a solution with MRTG but a simple script in perl
(net::telnet::cisco) + php should do it..
But as the others already said : No graphics.


---------------------
use Net::Telnet::Cisco;

$ROUTER="192.168.1.1";

   my $cs = Net::Telnet::Cisco->new( Host => $ROUTER);

    # Login Sequence / Omits the Login if no username is asked
    if ( $cs->login( 'cisco' , 'yournormalpasswd') ) {
             print "\nLogin $ROUTER     OK";
             } else {
        warn  "\nLogin $ROUTER FAILED " . $cs->errmsg;

# Set terminal-length to zero to prevent a stop in the output
    my @cmd_output = $cs->cmd( 'terminal length 0' );

  # Go to enable modus
                if ( $cs->enable("yourpasswort") ) {
                    print "\nEnable                 OK ";
                    } else {
                    warn  "\nEnable             FAILED " . $cs->errmsg;

@cmd_output = $cs->cmd (show ip route');

  open(OUTPUTFILE,"> $ROUTER");

            # now we are going to write the whole crap to a file
            print OUTPUTFILE @cmd_output;

      close(OUTPUTFILE);
------------------------------------

Now you should use a read function in PHP to display it on a webpage.


Sincerely
Ruediger Biernat



----- Original Message -----
From: "Badiel Kante" <badielk at yahoo.fr>
To: <mrtg at list.ee.ethz.ch>
Sent: Wednesday, August 29, 2001 4:03 PM
Subject: [mrtg] Cisco Routing Table


>
> Hello Guys,
>
> is it possible to display cisco's 2600 routing table
> by using mrtg ?
>
> I ve tried hardly to find the OIDs related to the
> command sh ip route on cisco box , unfortunately with
> no success.
>
> If someone on the list did that before, that would be
> great if he can share his job with me
>
> Regards
>
> Badiel
>
> ___________________________________________________________
> Do You Yahoo!? -- Un e-mail gratuit @yahoo.fr !
> Yahoo! Courrier : http://fr.mail.yahoo.com
>
> --
> Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> Archive     http://www.ee.ethz.ch/~slist/mrtg
> FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
> WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
>
>


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list