Gregor Mosheh > RAS-HiPerARC-1.03 > RAS::HiPerARC



Annotate this POD


New  1
Open  0
View/Report Bugs
Module Version: 1.03   Source  

NAME ^ - PERL Interface to 3Com/USR Total Control HiPerARC

Version 1.03, June 9, 2000


RAS::HiPerARC is a PERL 5 module for interfacing with a 3Com/USR Total Control HiPerARC remote access server. Using this module, one can very easily construct programs to find a particular user in a bank of ARCs, disconnect users, get usage statistics, or execute arbitrary commands on a ARC.



Installation is easy, thanks to MakeMaker:

  1. "perl Makefile.PL && make && make test"
  2. If the tests worked all right, "make install"
  3. Check out the examples in this documentation.


At this time, the following methods are implemented:

creating an object with new

Use the new() method to create a new object.

      use RAS::HiPerARC;
      $foo = new RAS::HiPerARC(
         hostname => '',
         login => '!root',
         password => 'mysecret',



Prompt handling has been vastly improved. If a prompt is not specified, a reasonable default is assumed that should work just fine. If you want to specify a prompt, supply a regular expression without delimiters or anchors that represents your router's prompt, e.g. prompt => 'hiper>' If you get errors about a bad match operator or a bad delimiter, you likely have a bad prompt string.


This is for debugging only. It prints to STDOUT a list of its configuration hash, e.g. the hostname, login, and password. The printenv method does not return a value.


This takes a list of commands to be executed on the ARC, executes the commands, and returns a list of references to arrays containg the text of each command's output.


      # Execute a command and print the output
      $command = 'list conn';

      # Execute a string of commands
      # and show the output from one of them
      (@output) = $foo->run_command('list interface','list con');

Supply a username as an argument, and usergrep will return an array of ports on which that user was found (or an empty array, if they're not found). If no username is supplied, returns undefined. Internally, this does a run_command('list connections') and parses the output.


This does a usergrep, but with a twist: it disconnects the user by resetting the modem on which they're connected. Like usergrep, it returns an array of ports to which the user was connected before they were reset or an empty array if they weren't found. An undef is returned if no username was supplied.



This returns an array consisting of 2 items: The 1st element is the number of ports. The rest is a list of users who are currently online.

      print "They are: @people\n";



      %userports = $foo->userports;
      foreach $user (keys(%userports)) {

EXAMPLE PROGRAMS ^ - Prints a summary of port usage on a bank of modems

use RAS::HiPerARC; $used = $total = 0; foreach ('','','') { $foo = new RAS::HiPerARC( hostname => $_, login => '!root', password => 'mysecret' );

   $total += $ports;
   $used += scalar(@ports);


### - Finds a user on a bank of modems

($username) = @ARGV; die "Usage: $0 <username>\nFinds the specified user.\n" unless $username ;








1.03 Added userports() method. Added better prompt support (YAY!). Made error messages more useful.

1.02 Fixed portusage() to only count Up interfaces. The ARC remembers modems even when they've been removed, and this accounts for that oddity. Cleaned up the code substantially. Fixed the prompt-matching code so that a prompt mismatch will cause run_command() to return instead of hanging in a loop.

1.01 Added a test suite. Corrected some errors in the documentation. Improved error handling a bit.


RAS::HiPerARC uses the Net::Telnet module by Jay Rogers <> - thank you, Jay!

Gregor Mosheh <> wrote RAS::HiPerARC originally, but the prompt handling needed some help in case people cuztomized their prompts.

Luke Robins <> and Todd Caine <> helped out substantially with the prompt handling with RAS::AS5200 and the changes were carried over into RAS::HiPerARC. Thank you, Luke and Todd!

The maintainer of RAS::HiPerARC is Gregor Mosheh, at the address above.


Since we use this for port usage monitoring, new functions will be added slowly on an as-needed basis. If you need some specific functionality let me know and I'll see what I can do. If you write an addition for this, please send it in and I'll incororate it and give credit.





syntax highlighting: