Route Table size from a Cisco Router

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Post Reply
Author
Message
UKS-Gavin
Posts: 42
Joined: Fri Oct 06, 2006 7:36 am

Route Table size from a Cisco Router

#1 Post by UKS-Gavin » Mon Oct 01, 2007 10:03 am

=== Script provided as-is without support ===

These scripts and templates should allow you to get the route table size from your Cisco router.

These templates were from Cacti 0.8.6j , I don't expect it to work with any other version so don't ask me. Also, our system uses the 1 minute poller patch so that may effect your importing.

Take the four scripts;

ciscoroutesummary-ssh.sh
ciscoroutesummary-telnet.sh
ciscoroutesummary-ssh.exp
ciscoroutesummary-telnet.exp

And put them in /var/www/cacti/scripts/ modify ciscoroute-summary-ssh.sh and -telnet.sh to have the appropriate username/password

At present these scripts only support a single username across all routers. Not ideal but it was done for proof of concept then went live in a big way!

Cheers,
Gavin

Provided as is with no warranty
Attachments
ciscoroutesummary.tar.gz
extract me to /var/www/cacti/scripts and edit both the .sh files to put your passwords in.
(847 Bytes) Downloaded 726 times
cacti_graph_template_cisco_routing_table_size_via_ssh.xml
import me
(8.29 KiB) Downloaded 571 times
cacti_graph_template_cisco_routing_table_size_via_telnet.xml
import me
(7.76 KiB) Downloaded 674 times

osiris123d
Cacti User
Posts: 59
Joined: Fri Mar 23, 2007 3:38 pm

#2 Post by osiris123d » Wed Oct 03, 2007 3:38 pm

This is very interesting. I had to do the following to get it to work...

I had to do go and install /usr/bin/expect
Didn't have to edit the ciscoroutesummary-ssh.exp at all
In the ciscoroutesummary-ssh.sh I had to edit the OUTPUT=$(/usr/bin/expect -d to point to my /cacti/scripts folder.
In the .xml file I had to edit the line where it says
<input_string>/bin/bash
so that it could also point to my /cacti/scripts directory.
I also had to ssh to the device that I want to monitor from the command line so that it could set up the RSA SSH key for that device.

Nice script.

osiris123d
Cacti User
Posts: 59
Joined: Fri Mar 23, 2007 3:38 pm

#3 Post by osiris123d » Thu Oct 04, 2007 4:08 pm

I edited your doc to graph the memory used by the routing table. When I import the edited .xml into cacti it removes the .xml file you have for routing table. Is there something in the .xml file that tells cacti that both .xml files are the same and not unique??

Just asking.

UKS-Gavin
Posts: 42
Joined: Fri Oct 06, 2006 7:36 am

#4 Post by UKS-Gavin » Sun Nov 04, 2007 4:28 am

osiris123d wrote:I edited your doc to graph the memory used by the routing table. When I import the edited .xml into cacti it removes the .xml file you have for routing table. Is there something in the .xml file that tells cacti that both .xml files are the same and not unique??

Just asking.
Cacti does have a hash function at the top of the xml files though I'm not 100% on it's uses. I believed it was to do with the cacti version more than that of the xml file itself....

If anyone's having problems with this script though let me know.

Thanks
Gavin

MatsB
Cacti User
Posts: 54
Joined: Tue Jan 10, 2006 9:25 am

#5 Post by MatsB » Thu Jul 03, 2008 7:52 am

Don't if anyone is still reading this post but I got the script to work on my system.

The problem how ever is that the graph doesn't display any numbers on the vertical axis. Graphing works ok and I get average, last and maximum values.

MatsB
Cacti User
Posts: 54
Joined: Tue Jan 10, 2006 9:25 am

#6 Post by MatsB » Fri Jul 04, 2008 1:15 am

MatsB wrote:Don't if anyone is still reading this post but I got the script to work on my system.

The problem how ever is that the graph doesn't display any numbers on the vertical axis. Graphing works ok and I get average, last and maximum values.
Never mind. After a couple of polls the number appeared.

Post Reply