[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">&gt; Date: Wed, 9 Aug 2006 14:37:08 +0300<b=
r>&gt; From: hanke@rzg.mpg.de<br>&gt; To: edwardquick@hotmail.com<br>&gt; C=
C: openafs-info@openafs.org<br>&gt; Subject: Re: [OpenAFS] Re: list all AFS=
 clients<br>&gt; <br>&gt; Bascically&nbsp;what&nbsp;you&nbsp;do&nbsp;with&n=
bsp;this&nbsp;command&nbsp;is&nbsp;to&nbsp;check&nbsp;the&nbsp;active&nbsp;=
<br>&gt; connections&nbsp;to&nbsp;one&nbsp;server.<br>&gt; Thus,&nbsp;if&nb=
sp;a&nbsp;client&nbsp;never&nbsp;spoke&nbsp;to&nbsp;that&nbsp;server&nbsp;o=
r&nbsp;only&nbsp;a&nbsp;long&nbsp;time&nbsp;ago&nbsp;(I&nbsp;<br>&gt; don't=
&nbsp;know&nbsp;the&nbsp;timeout),&nbsp;you&nbsp;will&nbsp;not&nbsp;get&nbs=
p;it.<br>&gt; So&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;get&nbsp;all&nbsp;=
clients,&nbsp;you&nbsp;need&nbsp;to&nbsp;get&nbsp;a&nbsp;set&nbsp;of&nbsp;s=
ervers&nbsp;and&nbsp;<br>&gt; be&nbsp;sure&nbsp;that&nbsp;each&nbsp;client&=
nbsp;talks&nbsp;reguarly&nbsp;to&nbsp;least&nbsp;one&nbsp;of&nbsp;them&nbsp=
;and&nbsp;then&nbsp;<br>&gt; combine&nbsp;the&nbsp;results.<br>&gt; Thus,&n=
bsp;the&nbsp;only&nbsp;way&nbsp;to&nbsp;make&nbsp;it&nbsp;usable&nbsp;for&n=
bsp;everyone&nbsp;without&nbsp;any&nbsp;user&nbsp;<br>&gt; configuration&nb=
sp;would&nbsp;be&nbsp;to&nbsp;get&nbsp;all&nbsp;servers&nbsp;with&nbsp;"vos=
&nbsp;listaddrs"&nbsp;and&nbsp;do&nbsp;<br>&gt; the&nbsp;rxdebug-thing&nbsp=
;with&nbsp;all&nbsp;of&nbsp;them&nbsp;and&nbsp;then&nbsp;boil&nbsp;down&nbs=
p;the&nbsp;lists.&nbsp;It's&nbsp;<br>&gt; not&nbsp;very&nbsp;efficient,&nbs=
p;but&nbsp;I&nbsp;guess&nbsp;it&nbsp;should&nbsp;work&nbsp;everywhere&nbsp;=
out&nbsp;of&nbsp;the&nbsp;box.<br>&gt; <br>&gt; <br>&gt; Christof<br>&gt; <=
br>&gt; Edward&nbsp;Quick&nbsp;wrote:<br>&gt; &gt;&nbsp;I've&nbsp;written&n=
bsp;a&nbsp;script&nbsp;which&nbsp;I&nbsp;want&nbsp;to&nbsp;collect&nbsp;ver=
sion&nbsp;information&nbsp;on&nbsp;all&nbsp;<br>&gt; &gt;&nbsp;the&nbsp;cli=
ents&nbsp;(we&nbsp;have&nbsp;a&nbsp;large&nbsp;network)&nbsp;but&nbsp;unfor=
tunately&nbsp;I&nbsp;don't&nbsp;think&nbsp;<br>&gt; &gt;&nbsp;the&nbsp;comm=
and:<br>&gt; &gt;&nbsp;<br>&gt; &gt;&nbsp;/usr/afs/bin/rxdebug&nbsp;$vldb&n=
bsp;-all<br>&gt; &gt;&nbsp;<br>&gt; &gt;&nbsp;gets&nbsp;them&nbsp;all.&nbsp=
;From&nbsp;the&nbsp;email&nbsp;yesterday,&nbsp;it&nbsp;sounded&nbsp;like&nb=
sp;I&nbsp;might&nbsp;have&nbsp;to&nbsp;<br>&gt; &gt;&nbsp;run&nbsp;this&nbs=
p;against&nbsp;some&nbsp;other&nbsp;boxes?&nbsp;Could&nbsp;you&nbsp;clarify=
&nbsp;that&nbsp;for&nbsp;me&nbsp;please?&nbsp;<br>&gt; &gt;&nbsp;The&nbsp;s=
cript&nbsp;is&nbsp;below&nbsp;for&nbsp;anyone&nbsp;who&nbsp;wants&nbsp;it.<=
br>&gt; &gt;&nbsp;<br>&gt; &gt;&nbsp;Cheers,<br>&gt; &gt;&nbsp;<br>&gt; &gt=
;&nbsp;Ed.<br>&gt; &gt;&nbsp;<br>&gt; &gt;&nbsp;#!/usr/bin/perl<br>&gt; &gt=
;&nbsp;<br>&gt; &gt;&nbsp;use&nbsp;Socket;<br>&gt; &gt;&nbsp;<br>&gt; &gt;&=
nbsp;#&nbsp;get&nbsp;list&nbsp;of&nbsp;all&nbsp;AFS&nbsp;connected&nbsp;hos=
ts<br>&gt; &gt;&nbsp;$vldb=3D"rsl155";<br>&gt; &gt;&nbsp;@servers=3D`/usr/a=
fs/bin/rxdebug&nbsp;$vldb&nbsp;-all&nbsp;|&nbsp;grep&nbsp;host`;<br>&gt; &g=
t;&nbsp;@servers=3Dmap&nbsp;(getip($_),@servers);<br>&gt; &gt;&nbsp;<br>&gt=
; &gt;&nbsp;#&nbsp;remove&nbsp;dupes&nbsp;from&nbsp;@servers<br>&gt; &gt;&n=
bsp;%temp_hash;<br>&gt; &gt;&nbsp;undef&nbsp;@temp_hash{@servers};<br>&gt; =
&gt;&nbsp;@servers&nbsp;=3D&nbsp;keys&nbsp;%temp_hash;<br>&gt; &gt;&nbsp;<b=
r>&gt; &gt;&nbsp;#&nbsp;get&nbsp;AFS&nbsp;version&nbsp;for&nbsp;each&nbsp;s=
erver<br>&gt; &gt;&nbsp;foreach&nbsp;$ip&nbsp;(&nbsp;@servers&nbsp;){<br>&g=
t; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$version=3D`/u=
sr/afs/bin/rxdebug&nbsp;$ip&nbsp;7001&nbsp;-version&nbsp;|&nbsp;grep&nbsp;v=
ersion`;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
chomp&nbsp;$version;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;$version=3D~/AFS&nbsp;version:\s*(.*)/;<br>&gt; &gt;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$version=3D$1;<br>&gt; &gt;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$host=3Dgethostbyaddr(&nbs=
p;inet_aton($ip),&nbsp;AF_INET&nbsp;);<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$hosts{$host}=3D$version;<br>&gt; &gt;&nbsp;}=
<br>&gt; &gt;&nbsp;<br>&gt; &gt;&nbsp;<br>&gt; &gt;&nbsp;foreach&nbsp;$host=
&nbsp;(sort&nbsp;keys&nbsp;%hosts){<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;"\n$host:$hosts{$host}";<br>&gt; &gt;=
&nbsp;}<br>&gt; &gt;&nbsp;print&nbsp;"\n\n";<br>&gt; &gt;&nbsp;<br>&gt; &gt=
;&nbsp;sub&nbsp;getip{<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;my&nbsp;($line)=3D@_;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;$line=3D~/(\d+\.\d+\.\d+\.\d+)/;<br>&gt; &gt;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ip=3D$1;<br>&gt; &gt;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$ip;<br>&gt=
; &gt;&nbsp;}<br>&gt; &gt;&nbsp;<br>&gt; &gt;&nbsp;<br>&gt; &gt;&nbsp;<br>&=
gt; &gt;&nbsp;<br>&gt; &gt;&nbsp;------------------------------------------=
------------------------------<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;To:&nbsp;o=
penafs-info@openafs.org<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;From:&nbsp;jbuehl=
er@spirentcom.com<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;Subject:&nbsp;[OpenAFS]=
&nbsp;Re:&nbsp;list&nbsp;all&nbsp;AFS&nbsp;clients<br>&gt; &gt;&nbsp;&nbsp;=
&gt;&nbsp;Date:&nbsp;Tue,&nbsp;8&nbsp;Aug&nbsp;2006&nbsp;09:21:05&nbsp;-040=
0<br>&gt; &gt;&nbsp;&nbsp;&gt;<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;Edward&nbs=
p;Quick&nbsp;wrote:<br>&gt; &gt;&nbsp;&nbsp;&gt;<br>&gt; &gt;&nbsp;&nbsp;&g=
t;&nbsp;&gt;&nbsp;Is&nbsp;there&nbsp;an&nbsp;AFS&nbsp;command&nbsp;I&nbsp;c=
an&nbsp;run&nbsp;to&nbsp;list&nbsp;all&nbsp;the&nbsp;boxes&nbsp;with&nbsp;c=
lients?&nbsp;I<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;&gt;&nbsp;doubt&nbsp;it,&n=
bsp;but&nbsp;thought&nbsp;I'd&nbsp;ask&nbsp;just&nbsp;in&nbsp;case!<br>&gt;=
 &gt;&nbsp;&nbsp;&gt;<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;Depending&nbsp;on&n=
bsp;how&nbsp;big&nbsp;a&nbsp;setup&nbsp;you&nbsp;have,&nbsp;you&nbsp;can&nb=
sp;scan&nbsp;the&nbsp;network&nbsp;for<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;cl=
ients.&nbsp;&nbsp;Roughly:<br>&gt; &gt;&nbsp;&nbsp;&gt;<br>&gt; &gt;&nbsp;&=
nbsp;&gt;&nbsp;for&nbsp;machine&nbsp;in&nbsp;$all_client_machines;&nbsp;do<=
br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;rxdebug&nbsp;$machine&nbsp;7001&nbsp;-ver=
sion<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;done<br>&gt; &gt;&nbsp;&nbsp;&gt;<br=
>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;<br>&gt; &gt;&nbsp;I&nbsp;have&nbsp;a&nbsp;=
cron&nbsp;job&nbsp;that&nbsp;does&nbsp;this&nbsp;periodically&nbsp;and&nbsp=
;keeps&nbsp;a&nbsp;database&nbsp;with&nbsp;the<br>&gt; &gt;&nbsp;&nbsp;&gt;=
&nbsp;info.&nbsp;&nbsp;This&nbsp;has&nbsp;been&nbsp;very&nbsp;useful&nbsp;i=
n&nbsp;keeping&nbsp;things&nbsp;up&nbsp;to&nbsp;date.<br>&gt; &gt;&nbsp;&nb=
sp;&gt;<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;It&nbsp;obviously&nbsp;won't&nbsp=
;catch&nbsp;offline&nbsp;machines&nbsp;though.<br>&gt; &gt;&nbsp;&nbsp;&gt;=
&nbsp;--&nbsp;<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;Joe&nbsp;Buehler<br>&gt; &=
gt;&nbsp;&nbsp;&gt;<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;_____________________=
__________________________<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;OpenAFS-info&n=
bsp;mailing&nbsp;list<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;OpenAFS-info@openaf=
s.org<br>&gt; &gt;&nbsp;&nbsp;&gt;&nbsp;https://lists.openafs.org/mailman/l=
istinfo/openafs-info<br>&gt; &gt;&nbsp;<br>&gt; &gt;&nbsp;-----------------=
-------------------------------------------------------<br>&gt; &gt;&nbsp;B=
e&nbsp;one&nbsp;of&nbsp;the&nbsp;first&nbsp;to&nbsp;try&nbsp;Windows&nbsp;L=
ive&nbsp;Mail.&nbsp;<br>&gt; &gt;&nbsp;&lt;http://ideas.live.com/programpag=
e.aspx?versionId=3D5d21c51a-b161-4314-9b0e-4911fb2b2e6d&gt;<br>&gt; <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_--