RAS-HiPerARC
view release on metacpan or search on metacpan
HiPerARC.pm view on Meta::CPAN
usergrep.pl - Finds a user on a bank of modems
($username) = @ARGV;
die "Usage: $0 <username>\nFinds the specified user.\n" unless $username ;
use RAS::HiPerARC;
foreach ('arc1.example.com','arc2.example.com','arc3.example.com') {
$foo = new RAS::HiPerARC(
hostname => $_,
login => '!root',
password => 'mysecret'
);
@ports = $foo->usergrep($username);
(@ports) && print "Found user $username on $_ ports @ports\n";
}
###
userkill.pl - Kick a user off a bank of modems. Makes a great cron job. ;)
($username) = @ARGV;
die "Usage: $0 <username>\nDisconnects the specified user.\n" unless $username ;
use RAS::HiPerARC;
foreach ('arc1.example.com','arc2.example.com','arc3.example.com') {
$foo = new RAS::HiPerARC(
hostname => $_,
login => '!root',
password => 'mysecret'
);
@ports = $foo->userkill($username);
(@ports) && print "$_ : Killed ports @ports\n";
}
=head1 CHANGES IN THIS VERSION
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...
1.01 Added a test suite. Corrected some errors in the documentation. Improved error handling a bit.
=head1 AUTHORS, MAINTAINERS, AND CONTACT INFO
RAS::HiPerARC uses the Net::Telnet module by Jay Rogers <jay@rgrs.com> - thank you, Jay!
Gregor Mosheh <stigmata@blackangel.net> wrote RAS::HiPerARC originally, but the prompt handling needed some help in case people cuztomized their prompts.
Luke Robins <luker@vicnet.net.au> and Todd Caine <todd_caine@eli.net> 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.
=head1 BUGS
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 incor...
=head1 LICENSE AND WARRANTY
Where would we be if Larry Wall were tight-fisted with PERL itself? For God's sake, it's PERL code. It's free!
This software is hereby released into the Public Domain, where it may be freely distributed, modified, plagiarized, used, abused, and deleted without regard for the original author.
Bug reports and feature requests will be handled ASAP, but without guarantee. The warranty is the same as for most freeware:
It Works For Me, Your Mileage May Vary.
=cut
( run in 1.115 second using v1.01-cache-2.11-cpan-df04353d9ac )