Generating User Activity Report

Posted on 1999-01-21
Medium Priority
Last Modified: 2013-12-18

I am trying to generate a user activity report using an agent.  I know you can view user activity of a particular database from the database information tab, but how can I display this information in a form... with an automatic process?  For example, I want to display the user activity information in a table... name in one column... type of activity in different column... etc... any ideas from experts out there?  Any help would be appreciated...

Question by:josephj
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

willislt earned 400 total points
ID: 1117960
Well, there is no easy way. The reason is that Lotus gives us no
"hook" to access the User Activity log. There is no class in
LotusScript to access it. I've asked Lotus about this at
LotusSphere this week. They said you could use the C API to do
it, but that's it. One workaround is to use server admin tools
to analyze the database in question and click on the check box
for "User Activity" but it is very slow in producing the information you want.

A better way (just wrote it last week) is to copy the user activity log to the clipboard (from DB properties tab), paste
it into Notepad, run a simple LotusScript agent on it, and produce the output you are looking for. I'll send you the code
if you like when I return from LotusSphere to Minneapolis next

Author Comment

ID: 1117961
Although I was disappointed that there was no easy connection between User Activity Log, I can at least stop wasting time looking in that direction.

If I can't use the user activity, is there another way to generate a report on who accessed the database and when?  I am not even particularly interested what documents were accessed... just want to know who accessed the database... and run a report displaying list of people who accessed it... and person's profile... etc... I just thought if there was a way to link user activity it would be the easiest way... any new ideas willislt?


PS.  Thank you so much for your kind help!  

Expert Comment

ID: 1117962
You can also just look at the server log and view database
activity either by database or by user. Check it out and see if
that meets your need.

The OTHER alternative I mentioned is to write a simple agent, put it in some "play with" database and activate it from there.

Usage steps are as follows:
1. Paste from the clipboard the user activity log text of the
database you want info on into a new Notepad file window.
2. Save the notepad file as "c:\larry\UserAct1.txt"
3. Run the agent (code below)
4. After the agent runs, you will have a file called
   "c:\larry\UserAct3.txt" that you can look at
5. That's it!

The code follows. You can just paste the whole thing into the
initialize event of a new agent.

Sub Initialize
     Dim char As String*1
     Dim uline As String
     Dim a As Integer
     Dim p As Integer
     Dim UserName As String
     Dim DateTime As String
     Dim Varray(500,3) As String
     Dim cnt As Integer
     Dim WholeLine As String
     Dim i As Integer
     Open "c:\larry\UserAct1.txt" For Input As #1
     Open "c:\larry\UserAct2.txt" For Output As #2
' Read the initial file and write it out again formatted properly (without the rich text characters)    
     Print "Formatting the input file"
     uline = ""
     While Not Eof(1)
          char = Inputb(1,1)
          a = Asc(char)
          If a <> 10 Then
               uline = uline & char
               Print #2, uline
               uline = ""
          End If
     Close #1
     Close #2
' Now process the second file and build the array of unique user names and other info    
     Print "Building the array"
     cnt = 0
     Open "c:\larry\UserAct2.txt" For Input As #1
     While Not Eof(1)
          Line Input #1, uline
          WholeLine = uline
          p = Instr(uline,"  ")
          DateTime = Left$(uline,p-1)
          UserName = Mid$(uline,p+2)
          p = Instr(UserName,"/")
          UserName = Left$(UserName,p-1)
          UserName = UserName & Space$(25-Len(UserName))
' See if the name already exist in the array. If it does, skip it.          
          found = False
          For i = 1 To cnt
               If Varray(i,1) = UserName Then
                    found = True
                    Exit For
               End If
          If Not found Then
               cnt = cnt + 1
               Varray(cnt,1) = UserName
               Varray(cnt,2) = DateTime
               Varray(cnt,3) = WholeLine
          End If    
     Close #1
' Do a simple bubble sort to sort the file by user name
     Print "Sorting the information"
     sorted = False
     While Not sorted
          sorted = True
          For i = 1 To cnt
               If Varray(i,1) > Varray(i+1,1) Then
                    temp1$ = Varray(i,1)
                    temp2$ = Varray(i,2)
                    temp3$ = Varray(i,3)
                    Varray(i,1) = Varray(i+1,1)
                    Varray(i,2) = Varray(i+1,2)
                    Varray(i,3) = Varray(i+1,3)
                    Varray(i+1,1) = temp1$
                    Varray(i+1,2) = temp2$
                    Varray(i+1,3) = temp3$
                    sorted = False
               End If
' Write out the final file    
     Print "Writing out the final output file"
     Open "c:\larry\UserAct3.txt" For Output As #1
     For i = 1 To cnt
          Print #1, Varray(i,1), Varray(i,2), Varray(i,3)
     Close #1
     Print "Processing completed"
End Sub

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question