AFS-Monitor
view release on metacpan or search on metacpan
examples/rxdebug view on Meta::CPAN
#!/usr/bin/perl -w
#
# Copyright © 2004 Alf Wachsmann <alfw@slac.stanford.edu> and
# Elizabeth Cassell <e_a_c@mailsnare.net>
#
# $Revision: 1.9 $ $Date: 2004/10/22 15:04:40 $ $Author: alfw $
#
use blib;
use strict;
use AFS::Monitor qw(rxdebug constant);
use Data::Dumper;
my $servers = 'virtue.openafs.org'; # machine to run this on
my $port = 7001; # port to run this on
my $onlyhost = 'andrew.e.kth.se'; # some of the tests will show only connections from this host
my $onlyport = 7000; # some of the tests will show only connections on this port
my $onlyauth = 'auth'; # some of the tests will show only connections with this auth level
my @tests; # choose which tests to run
$tests[1] = 1; # prints version
$tests[2] = 0; # prints all peers and all non-dallying connections.
# (can be long)
$tests[3] = 0; # nonexistant host
$tests[4] = 0; # nonexistant port
$tests[5] = 0; # bad port; getstats fails. (can be slow)
$tests[6] = 0; # prints long version of all peers. (can be long)
$tests[7] = 0; # server $servers port $port. prints default info.
$tests[8] = 0; # prints rxstats, no connections.
$tests[9] = 0; # prints only auth $onlyauth
$tests[10] = 0; # shows all connections. (can be long)
$tests[11] = 0; # shows all server connections. (can be long)
$tests[12] = 0; # shows all client connections on port $port from host $onlyhost
$tests[13] = 0; # doesn't give port, tries default (7000).
$tests[14] = 0; # no arguments, runs on current machine with default port.
$tests[15] = 0; # port $port, runs on current machine.
$tests[16] = 0; # prints rxstats, all connections, long version of all peers.
# (can be very long)
my $all = 1; # show all tests
my $showdump = 0; # dump contents of hash to the screen for each test instead of printing rxdebug formatted output
# all available options:
# rxdebug(nodally => 1,
# allconnections => 1,
# rxstats => 1,
# onlyserver => 1,
# onlyclient => 1,
# onlyport => $onlyport,
# version => 1,
# noconns => 1,
# peers => 1,
# long => 1,
# servers => $servers, # required
# port => $port,
# onlyhost => $onlyhost,
# onlyauth => $onlyauth,
# );
print "***** Starting now... *****\n";
my $rxdeb;
if ($all || $tests[1]) {
print "\n******** TEST 1: ********\n";
print "\nrxdebug -version -servers $servers -port $port\n\n";
$rxdeb = rxdebug(version => 1,
servers => $servers, # required
port => $port
);
parse_results($rxdeb);
}
if ($all || $tests[2]) {
print "\n******** TEST 2: ********\n";
print "\nrxdebug -nodally -allconnections -peers -servers $servers -port $port\n\n";
$rxdeb = rxdebug(nodally => 1,
allconnections => 1,
peers => 1,
servers => $servers,
port => $port
);
parse_results($rxdeb);
}
if ($all || $tests[3]) {
print "\n******** TEST 3: ********\n";
print "\nrxdebug -servers speedy1 -port $port\n\n";
$rxdeb = rxdebug(servers => 'speedy1',
( run in 0.607 second using v1.01-cache-2.11-cpan-39bf76dae61 )