OPEN-XCHANGE
You are here: Community > Mailinglist
freshmeat.net
[OX User] Script to create a list of active/inactive OX users

Peter Schober peter.schober at univie.ac.at
Fri Apr 20 14:35:40 CEST 2007


* Juergen Ulbts <j.ulbts at uni-oldenburg.de> [2007-04-19 12:11]:
> I was asked if I could provide a list of users that where using OX
> within the last month and/or the users that were inactive within this
> period.
> Has anybody written something like this already and could post his
> solution?

should be rather easy:

all users:
ldapsearch -x -LLL -b ou=people,$BASEDN uid|grep ^uid|sed 's/^uid:\ //'|sort -u

users that used OX:
# fgrep logout /var/log/openexchange/groupware.log|fgrep -v null|sed 's/^.*-\ //'|sort -u

depending on when your logfiles are rotated you may simply habe to
replace groupware.log with the rotated version for the relevant
timespan (e.g. last month) and fgrep with zfgrep, if logs are
compressed.
otherwise you'd have to either cut off the unneeded parts from a copy
of that logfile or write a small (e.g. perl) snipplet that parses the
date and only spits out lines matching your desired timespan.

if you have them at least seperated by year this could be as simple as
adding
  grep ^Mar
to the filter above (to filter by month, e.g march).

regards,
-p.schober

-- 
peter.schober at univie.ac.at - vienna university computer center
Universitaetsstrasse 7, A-1010 Wien, Austria/Europe
Tel. +43-1-4277-14155, Fax. +43-1-4277-9140



More information about the User mailing list