Route Table size from a Cisco Router

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

Moderators: Developers, Moderators

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

Route Table size from a Cisco Router

Post by UKS-Gavin »

=== 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 765 times
cacti_graph_template_cisco_routing_table_size_via_ssh.xml
import me
(8.29 KiB) Downloaded 606 times
cacti_graph_template_cisco_routing_table_size_via_telnet.xml
import me
(7.76 KiB) Downloaded 703 times
osiris123d
Cacti User
Posts: 59
Joined: Fri Mar 23, 2007 3:38 pm

Post by osiris123d »

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

Post by osiris123d »

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

Post by UKS-Gavin »

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: 57
Joined: Tue Jan 10, 2006 9:25 am

Post by MatsB »

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: 57
Joined: Tue Jan 10, 2006 9:25 am

Post by MatsB »

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

Who is online

Users browsing this forum: No registered users and 2 guests