[OpenAFS] Find windows openafs version

Steve Simmons scs@umich.edu
Fri, 23 Aug 2013 12:16:14 -0400


On Aug 22, 2013, at 10:39 AM, Christof Hanke <hanke@rzg.mpg.de> wrote:

> Hi,
> Am 22.08.2013, 16:33 Uhr, schrieb G=E9mes G=E9za <geza@kzsdabas.hu>:
>=20
>> Sorry for this slightly off topic question, but what is the =
recommended way to find out the version of the openafs installation.
>> I ask this because I wrote different installation scripts (which take =
into account if the installation is 32 or 64 bit), (using wpkg to deploy =
them), but the problem is always the same: Is the installed version the =
newest, or it needs to be upgraded?
>=20
> not sure if it is recommended,
> but executing "rxdebug localhost 7001 -v"
> should give you what you need.

At one point we did semi-annual audits of all AFS clients hitting our =
hosts. Another fellow here wrote some scripts to help with it; I'll =
check with him to see what state they're in and if they're releasable. I =
did one myself but it was a one-off; as I recall the hard part was =
writing the funky regex/filter that read logfiles and removed everything =
that didn't look like an IP address.=20

The audit process involved taking the last few months of the fileserver =
logs from each server (FileLog) and filtering out anything that doesn't =
look like an IP address; then running them through 'sort | uniq -c > =
clientlist'. That gave us a file with a frequency use of each address, =
eg,
     1 10.0.0.1
  2341 141.211.168.44
   784 141.213.104.192

I wrote a tiny little bash script 'getversions' that generated the =
version numbers on stdout and the failed probes on stderr. The result =
files are in a form that lets you feed them back into the script as =
you'll see below. Be patient when you do this sort of run; for every =
host that doesn't respond expect a 30-second delay. Note also that this =
isn't perfect - NAT boxes and changing addresses across wireless =
connections will fool you. But for our purpose, it's good enough.

Edited sample run and rerun, including data and script. Addresses =
changed to protect the guilty:

  scs$ more getversions
  ::::::::::::::
  getversions
  ::::::::::::::
  #!/bin/bash
  while read COUNT ADDR DUMMY ; do
      ARRAY=3D($(echo $(rxdebug $ADDR 7001 -v 2>&1)))
      if [[ "AFS" =3D=3D "${ARRAY[4]}" ]] ; then
          echo $COUNT $ADDR ${ARRAY[6]} ${ARRAY[7]} ${ARRAY[8]} =
${ARRAY[9]}
      else
          echo $COUNT $ADDR "'${ARRAY[*]}'" >&2
      fi
  done
  scs$ ./getversions < clientlist > clients.identified 2> =
clients.unidentified
  scs$ more client*
  ::::::::::::::
  clientlist
  ::::::::::::::
  1 192.168.1.141
  2 192.168.2.142
  3 192.168.3.143
  ::::::::::::::
  clients.identified
  ::::::::::::::
  1 141.211.1.141 OpenAFS 1.4.11 built 2009-08-18
  3 141.211.3.143 OpenAFS 1.4.15 built 2013-07-31
  ::::::::::::::
  clients.unidentified
  ::::::::::::::
  2 192.168.2.142 'Trying 192.168.2.142 (port 7001): get version call =
failed with
  code -1, errno 0'
  scs$ ./getversions < clients.unidentified >> clients.identified
  2 192.168.2.142 'Trying 192.168.2.142 (port 7001): get version call =
failed with code -1, errno 0'
  scs$=20


Enjoy,

Steve=