[OpenAFS] Re: list all AFS clients
Edward Quick
edwardquick@hotmail.com
Wed, 9 Aug 2006 10:45:54 +0000
--_763f3d62-86b4-4436-bc73-2b2956fcbb23_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I've written a script which I want to collect version information on all th=
e clients (we have a large network) but unfortunately I don't think the com=
mand:/usr/afs/bin/rxdebug $vldb -allgets 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/perluse Socket;# get list of all AFS connected hosts$=
vldb=3D"rsl155";@servers=3D`/usr/afs/bin/rxdebug $vldb -all | grep host`;@s=
ervers=3Dmap (getip($_),@servers);# remove dupes from @servers%temp_hash;un=
def @temp_hash{@servers};@servers =3D keys %temp_hash;# get AFS version for=
each serverforeach $ip ( @servers ){ $version=3D`/usr/afs/bin/rxdeb=
ug $ip 7001 -version | grep version`; chomp $version; $versio=
n=3D~/AFS version:\s*(.*)/; $version=3D$1; $host=3Dgethostbya=
ddr( inet_aton($ip), AF_INET ); $hosts{$host}=3D$version;}foreach $h=
ost (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: j=
buehler@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 th=
ought I'd ask just in case!> > Depending on how big a setup you have, you c=
an scan the network for> clients. Roughly:> > for machine in $all_client_m=
achines; do> rxdebug $machine 7001 -version> done> > I have a cron job tha=
t does this periodically and keeps a database with the> info. This has bee=
n very useful in keeping things up to date.> > It obviously won't catch off=
line 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=3D5d21c51a-b161-4314-9b0e-=
4911fb2b2e6d=
--_763f3d62-86b4-4436-bc73-2b2956fcbb23_
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>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 t=
he command:<br><br>/usr/afs/bin/rxdebug $vldb -all<br><br>gets them all. Fr=
om the email yesterday, it sounded like I might have to run this against so=
me other boxes? Could you clarify that for me please? The script is below f=
or anyone who wants it.<br><br>Cheers,<br><br>Ed.<br><br>#!/usr/bin/perl<br=
><br>use Socket;<br><br># get list of all AFS connected hosts<br>$vldb=3D"r=
sl155";<br>@servers=3D`/usr/afs/bin/rxdebug $vldb -all | grep host`;<br>@se=
rvers=3Dmap (getip($_),@servers);<br><br># remove dupes from @servers<br>%t=
emp_hash;<br>undef @temp_hash{@servers};<br>@servers =3D keys %temp_hash;<b=
r><br># get AFS version for each server<br>foreach $ip ( @servers ){<br>&nb=
sp; $version=3D`/usr/afs/bin/rxdebug $i=
p 7001 -version | grep version`;<br> &nb=
sp; chomp $version;<br> $version=
=3D~/AFS version:\s*(.*)/;<br> $v=
ersion=3D$1;<br> $host=3Dgethostb=
yaddr( inet_aton($ip), AF_INET );<br> &n=
bsp; $hosts{$host}=3D$version;<br>}<br><br><br>foreach $host (sort keys %ho=
sts){<br> print "\n$host:$hosts{$=
host}";<br>}<br>print "\n\n";<br><br>sub getip{<br> =
my ($line)=3D@_;<br> =
$line=3D~/(\d+\.\d+\.\d+\.\d+)/;<br> &n=
bsp; $ip=3D$1;<br> return $=
ip;<br>}<br><br><br><br><br><hr id=3D"stopSpelling">> To: openafs-info@o=
penafs.org<br>> From: jbuehler@spirentcom.com<br>> Subject: [OpenAFS]=
Re: list all AFS clients<br>> Date: Tue, 8 Aug 2006 09:21:05 -0400<br>&=
gt; <br>> Edward Quick wrote:<br>> <br>> > Is&nb=
sp;there an AFS command I can run to&nbs=
p;list all the boxes with clients? I<br>> =
> doubt it, but thought I'd ask just&=
nbsp;in case!<br>> <br>> Depending on how big&nbs=
p;a setup you have, you can scan the&nbs=
p;network for<br>> clients. Roughly:<br>> <br>> fo=
r machine in $all_client_machines; do<br>> rxdebug&=
nbsp;$machine 7001 -version<br>> done<br>> <br>> I =
have a cron job that does this periodica=
lly and keeps a database with the<br>> inf=
o. This has been very useful in ke=
eping things up to date.<br>> <br>> It obvio=
usly won't catch offline machines though.<br>> =
-- <br>> Joe Buehler<br>> <br>> ________________________=
_______________________<br>> OpenAFS-info mailing list<br>>=
OpenAFS-info@openafs.org<br>> https://lists.openafs.org/mailman/listinf=
o/openafs-info<br><br /><hr />Be one of the first to try <a href=3D'http:/=
/ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-9b0e-4911fb=
2b2e6d' target=3D'_new'>Windows Live Mail.</a></body>=0A=
</html>=
--_763f3d62-86b4-4436-bc73-2b2956fcbb23_--