[OpenAFS] Re: list all AFS clients

Christof Hanke hanke@rzg.mpg.de
Wed, 09 Aug 2006 14:37:08 +0300


Bascically what you do with this command is to check the active 
connections to one server.
Thus, if a client never spoke to that server or only a long time ago (I 
don't know the timeout), you will not get it.
So if you want to get all clients, you need to get a set of servers and 
be sure that each client talks reguarly to least one of them and then 
combine the results.
Thus, the only way to make it usable for everyone without any user 
configuration would be to get all servers with "vos listaddrs" and do 
the rxdebug-thing with all of them and then boil down the lists. It's 
not very efficient, but I guess it should work everywhere out of the box.


Christof

Edward Quick wrote:
> I've written a script which I want to collect version information on all 
> the clients (we have a large network) but unfortunately I don't think 
> the command:
> 
> /usr/afs/bin/rxdebug $vldb -all
> 
> gets them all. From the email yesterday, it sounded like I might have to 
> run this against some other boxes? Could you clarify that for me please? 
> The script is below for anyone who wants it.
> 
> Cheers,
> 
> Ed.
> 
> #!/usr/bin/perl
> 
> use Socket;
> 
> # get list of all AFS connected hosts
> $vldb="rsl155";
> @servers=`/usr/afs/bin/rxdebug $vldb -all | grep host`;
> @servers=map (getip($_),@servers);
> 
> # remove dupes from @servers
> %temp_hash;
> undef @temp_hash{@servers};
> @servers = keys %temp_hash;
> 
> # get AFS version for each server
> foreach $ip ( @servers ){
>         $version=`/usr/afs/bin/rxdebug $ip 7001 -version | grep version`;
>         chomp $version;
>         $version=~/AFS version:\s*(.*)/;
>         $version=$1;
>         $host=gethostbyaddr( inet_aton($ip), AF_INET );
>         $hosts{$host}=$version;
> }
> 
> 
> foreach $host (sort keys %hosts){
>         print "\n$host:$hosts{$host}";
> }
> print "\n\n";
> 
> sub getip{
>         my ($line)=@_;
>         $line=~/(\d+\.\d+\.\d+\.\d+)/;
>         $ip=$1;
>         return $ip;
> }
> 
> 
> 
> 
> ------------------------------------------------------------------------
>  > To: openafs-info@openafs.org
>  > From: jbuehler@spirentcom.com
>  > Subject: [OpenAFS] Re: list all AFS clients
>  > Date: Tue, 8 Aug 2006 09:21:05 -0400
>  >
>  > Edward Quick wrote:
>  >
>  > > Is there an AFS command I can run to list all the boxes with clients? I
>  > > doubt it, but thought I'd ask just in case!
>  >
>  > Depending on how big a setup you have, you can scan the network for
>  > clients.  Roughly:
>  >
>  > for machine in $all_client_machines; do
>  > rxdebug $machine 7001 -version
>  > done
>  >
>  > 
> I have a cron job that does this periodically and keeps a database with the
>  > info.  This has been very useful in keeping things up to date.
>  >
>  > It obviously won't catch offline machines though.
>  > -- 
>  > Joe Buehler
>  >
>  > _______________________________________________
>  > OpenAFS-info mailing list
>  > OpenAFS-info@openafs.org
>  > https://lists.openafs.org/mailman/listinfo/openafs-info
> 
> ------------------------------------------------------------------------
> Be one of the first to try Windows Live Mail. 
> <http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d>