Router::Statistics

Router Statistics and Information Collection
Download

Router::Statistics Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Andrew S. Kennedy
  • Publisher web site:
  • http://search.cpan.org/~shamrock/

Router::Statistics Tags


Router::Statistics Description

Router Statistics and Information Collection Router::Statistics is a Perl module for router statistics and information collection.SYNOPSISRouter Statistics and Information Colleciton. Currently this covers a multitude of areas from different types of routers and in a future release this will change. There are some 'action' functions within this module which do need moving to another module so no complaining too much, please.The following examples shows how to setup the module to retrieve interface statistics from routers that support the standard IFMIB. All the work about OIDs etc is taken care of by the module so you are left with a hash tree, rooted by the router IPs information was received for. use Router::Statistics; use strict; my ( $result, $statistics ); my ( %routers, %interfaces ); $statistics = new Router::Statistics(); $result = $statistics->Router_Add( "10.1.1.1" , "public" ); $result = $statistics->Router_Ready_Blocking( "10.1.1.1" ); .... $result = $statistics->Router_Add( "10.1.1.200" , "public" ); $result = $statistics->Router_Ready_Blocking( "10.1.1.200" ); $result = $statistics->Router_Test_Connection_Blocking(\%routers); if ( !%routers ) { print "No access to Any of the Routers specified. ";exit(0); } $result = $statistics->Router_get_interfaces_Blocking( \%interfaces ); foreach my $router ( keys %interfaces ) { print "Router IP is '$router' "; print "Router Hostname is '$routers{$router}{'hostName'}' "; foreach my $interface ( keys %{$interfaces{$router}} ) { print "Interface ID '$interface' "; print "Interface Description '$interfaces{$ubr}{$interface}{'ifDescr'}' "; print "Interface ifType '$interfaces{$ubr}{$interface}{'ifType'}' "; print "Interface ifMtu '$interfaces{$ubr}{$interface}{'ifMtu'}' "; print "Interface ifSpeed '$interfaces{$ubr}{$interface}{'ifSpeed'}' "; print "Interface ifPhysAddress '$interfaces{$ubr}{$interface}{'ifPhysAddress'}' "; print "Interface ifOperStatus '$interfaces{$ubr}{$interface}{'ifOperStatus'}' "; print "Interface ifInOctets '$interfaces{$ubr}{$interface}{'ifInOctets'}' "; print "Interface ifInUcastPkts '$interfaces{$ubr}{$interface}{'ifInUcastPkts'}' "; print "Interface ifInNUcastPkts '$interfaces{$ubr}{$interface}{'ifInNUcastPkts'}' "; print "Interface ifInDiscards '$interfaces{$ubr}{$interface}{'ifInDiscards'}' "; print "Interface ifInErrors '$interfaces{$ubr}{$interface}{'ifInErrors'}' "; print "Interface ifInUnknownProtos '$interfaces{$ubr}{$interface}{'ifInUnknownProtos'}' "; print "Interface ifOutOctets '$interfaces{$ubr}{$interface}{'ifOutOctets'}' "; print "Interface ifOutUcastPkts '$interfaces{$ubr}{$interface}{'ifOutUcastPkts'}' "; print "Interface ifOutNUcastPkts '$interfaces{$ubr}{$interface}{'ifOutNUcastPkts'}' "; print "Interface ifOutDiscards '$interfaces{$ubr}{$interface}{'ifOutDiscards'}' "; print "Interface ifOutErrors '$interfaces{$ubr}{$interface}{'ifOutErrors'}' "; print " "; } }I am currently in need of access to alternative vendor routers, ie. anyone but Cisco ( ABC ) as I only have real access to Cisco equipment so this code can not be confirmed 100% against anyone else.I would also like to expand the library to cover other actions , rather than just DOCSIS functions, which is the primary action focus at the moment.The module current has two(2) global variables that can be set when creating the object the first DEBUG turns on all the debug output, the second, STM_Safety_Limit, allows you to change the STM safety margin by subtracting the number (minutes) specified from the end time. This is also settable in the STM functions but only if you are also using an enable password.An example of how to use them is $statistics = new Router::Statistics( );This would turn on debug and set the safety marging to 10 minutes. The default safety marging is 15 minutes. Requirements: · Perl


Router::Statistics Related Software