[OpenAFS] Re: list all AFS clients
Edward Quick
edwardquick@hotmail.com
Wed, 9 Aug 2006 12:35:54 +0000
--_1950a33d-b0b7-41e4-88f5-071cf8a457bb_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Thanks for your help again. When I run 'vos listaddrs' I get a list of serv=
ers, followed by the message:vos: could not list the server addressesvl: In=
dex out of rangeDo you know what that is?> Date: Wed, 9 Aug 2006 14:37:08 +=
0300> From: hanke@rzg.mpg.de> To: edwardquick@hotmail.com> CC: openafs-info=
@openafs.org> Subject: Re: [OpenAFS] Re: list all AFS clients> > 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 a=
go (I > don't know the timeout), you will not get it.> So if you want to ge=
t all clients, you need to get a set of servers and > be sure that each cli=
ent talks reguarly to least one of them and then > combine the results.> Th=
us, the only way to make it usable for everyone without any user > configur=
ation 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 effic=
ient, 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 vers=
ion information on all > > the clients (we have a large network) but unfort=
unately I don't think > > the command:> > > > /usr/afs/bin/rxdebug $vldb -a=
ll> > > > 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 m=
e please? > > The script is below for anyone who wants it.> > > > Cheers,> =
> > > Ed.> > > > #!/usr/bin/perl> > > > use Socket;> > > > # get list of al=
l AFS connected hosts> > $vldb=3D"rsl155";> > @servers=3D`/usr/afs/bin/rxde=
bug $vldb -all | grep host`;> > @servers=3Dmap (getip($_),@servers);> > > >=
# remove dupes from @servers> > %temp_hash;> > undef @temp_hash{@servers};=
> > @servers =3D keys %temp_hash;> > > > # get AFS version for each server>=
> foreach $ip ( @servers ){> > $version=3D`/usr/afs/bin/rxdebug $i=
p 7001 -version | grep version`;> > chomp $version;> > $ver=
sion=3D~/AFS version:\s*(.*)/;> > $version=3D$1;> > $host=
=3Dgethostbyaddr( inet_aton($ip), AF_INET );> > $hosts{$host}=3D$ve=
rsion;> > }> > > > > > foreach $host (sort keys %hosts){> > print "=
\n$host:$hosts{$host}";> > }> > print "\n\n";> > > > sub getip{> > =
my ($line)=3D@_;> > $line=3D~/(\d+\.\d+\.\d+\.\d+)/;> > $ip=
=3D$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 l=
ist all the boxes with clients? I> > > > doubt it, but thought I'd ask jus=
t in case!> > >> > > Depending on how big a setup you have, you can scan =
the network for> > > clients. Roughly:> > >> > > for machine in $all_cl=
ient_machines; do> > > rxdebug $machine 7001 -version> > > done> > >> > =
> > > I have a cron job that does this periodically and keeps a database w=
ith 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> > > http=
s://lists.openafs.org/mailman/listinfo/openafs-info> > > > ----------------=
--------------------------------------------------------> > Be one of the f=
irst to try Windows Live Mail. > > <http://ideas.live.com/programpage.aspx?=
versionId=3D5d21c51a-b161-4314-9b0e-4911fb2b2e6d>>=20
_________________________________________________________________
Be one of the first to try Windows Live Mail.
http://ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-9b0e-=
4911fb2b2e6d=
--_1950a33d-b0b7-41e4-88f5-071cf8a457bb_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>=0A=
<head>=0A=
<style>=0A=
P=0A=
{=0A=
margin:0px;=0A=
padding:0px=0A=
}=0A=
body=0A=
{=0A=
FONT-SIZE: 10pt;=0A=
FONT-FAMILY:Tahoma=0A=
}=0A=
</style>=0A=
</head>=0A=
<body>Thanks for your help again. When I run 'vos listaddrs' I get a list o=
f servers, followed by the message:<br><br>vos: could not list the server a=
ddresses<br>vl: Index out of range<br><br>Do you know what that is?<br><br>=
<br><br><hr id=3D"stopSpelling">> Date: Wed, 9 Aug 2006 14:37:08 +0300<b=
r>> From: hanke@rzg.mpg.de<br>> To: edwardquick@hotmail.com<br>> C=
C: openafs-info@openafs.org<br>> Subject: Re: [OpenAFS] Re: list all AFS=
clients<br>> <br>> Bascically what you do with&n=
bsp;this command is to check the active =
<br>> connections to one server.<br>> Thus, if&nb=
sp;a client never spoke to that server o=
r only a long time ago (I <br>> don't=
know the timeout), you will not get&nbs=
p;it.<br>> So if you want to get all =
clients, you need to get a set of s=
ervers and <br>> be sure that each client&=
nbsp;talks reguarly to least one of them =
;and then <br>> combine the results.<br>> Thus,&n=
bsp;the only way to make it usable for&n=
bsp;everyone without any user <br>> configuration&nb=
sp;would be to get all servers with "vos=
listaddrs" and do <br>> the rxdebug-thing =
;with all of them and then boil down&nbs=
p;the lists. It's <br>> not very efficient,&nbs=
p;but I guess it should work everywhere =
out of the box.<br>> <br>> <br>> Christof<br>> <=
br>> Edward Quick wrote:<br>> > I've written&n=
bsp;a script which I want to collect ver=
sion information on all <br>> > the cli=
ents (we have a large network) but unfor=
tunately I don't think <br>> > the comm=
and:<br>> > <br>> > /usr/afs/bin/rxdebug $vldb&n=
bsp;-all<br>> > <br>> > gets them all. =
;From the email yesterday, it sounded like&nb=
sp;I might have to <br>> > run this&nbs=
p;against some other boxes? Could you clarify=
that for me please? <br>> > The s=
cript is below for anyone who wants it.<=
br>> > <br>> > Cheers,<br>> > <br>> >=
; Ed.<br>> > <br>> > #!/usr/bin/perl<br>> >=
; <br>> > use Socket;<br>> > <br>> >&=
nbsp;# get list of all AFS connected hos=
ts<br>> > $vldb=3D"rsl155";<br>> > @servers=3D`/usr/a=
fs/bin/rxdebug $vldb -all | grep host`;<br>> &g=
t; @servers=3Dmap (getip($_),@servers);<br>> > <br>>=
; > # remove dupes from @servers<br>> >&n=
bsp;%temp_hash;<br>> > undef @temp_hash{@servers};<br>> =
> @servers =3D keys %temp_hash;<br>> > <b=
r>> > # get AFS version for each s=
erver<br>> > foreach $ip ( @servers ){<br>&g=
t; > $version=3D`/u=
sr/afs/bin/rxdebug $ip 7001 -version | grep v=
ersion`;<br>> > =
chomp $version;<br>> > =
$version=3D~/AFS version:\s*(.*)/;<br>> >  =
; $version=3D$1;<br>> > =
; $host=3Dgethostbyaddr(&nbs=
p;inet_aton($ip), AF_INET );<br>> > =
$hosts{$host}=3D$version;<br>> > }=
<br>> > <br>> > <br>> > foreach $host=
(sort keys %hosts){<br>> > &nb=
sp; print "\n$host:$hosts{$host}";<br>> >=
}<br>> > print "\n\n";<br>> > <br>> >=
; sub getip{<br>> > &nbs=
p; my ($line)=3D@_;<br>> > &nb=
sp; $line=3D~/(\d+\.\d+\.\d+\.\d+)/;<br>> >&nb=
sp; $ip=3D$1;<br>> >&n=
bsp; return $ip;<br>>=
; > }<br>> > <br>> > <br>> > <br>&=
gt; > <br>> > ------------------------------------------=
------------------------------<br>> > > To: o=
penafs-info@openafs.org<br>> > > From: jbuehl=
er@spirentcom.com<br>> > > Subject: [OpenAFS]=
Re: list all AFS clients<br>> > =
> Date: Tue, 8 Aug 2006 09:21:05 -040=
0<br>> > ><br>> > > Edward&nbs=
p;Quick wrote:<br>> > ><br>> > &g=
t; > Is there an AFS command I c=
an run to list all the boxes with c=
lients? I<br>> > > > doubt it,&n=
bsp;but thought I'd ask just in case!<br>>=
> ><br>> > > Depending on&n=
bsp;how big a setup you have, you can&nb=
sp;scan the network for<br>> > > cl=
ients. Roughly:<br>> > ><br>> > &=
nbsp;> for machine in $all_client_machines; do<=
br>> > > rxdebug $machine 7001 -ver=
sion<br>> > > done<br>> > ><br=
>> > > <br>> > I have a =
cron job that does this periodically and =
;keeps a database with the<br>> > >=
info. This has been very useful i=
n keeping things up to date.<br>> > &nb=
sp;><br>> > > It obviously won't =
;catch offline machines though.<br>> > >=
-- <br>> > > Joe Buehler<br>> &=
gt; ><br>> > > _____________________=
__________________________<br>> > > OpenAFS-info&n=
bsp;mailing list<br>> > > OpenAFS-info@openaf=
s.org<br>> > > https://lists.openafs.org/mailman/l=
istinfo/openafs-info<br>> > <br>> > -----------------=
-------------------------------------------------------<br>> > B=
e one of the first to try Windows L=
ive Mail. <br>> > <http://ideas.live.com/programpag=
e.aspx?versionId=3D5d21c51a-b161-4314-9b0e-4911fb2b2e6d><br>> <br><br=
/><hr />Be one of the first to try <a href=3D'http://ideas.live.com/progr=
ampage.aspx?versionId=3D5d21c51a-b161-4314-9b0e-4911fb2b2e6d' target=3D'_ne=
w'>Windows Live Mail.</a></body>=0A=
</html>=
--_1950a33d-b0b7-41e4-88f5-071cf8a457bb_--