List of inactive databases via LotusScript, is it possible?

I want to have an agent, that will monitor the user activity on databases. I know, that I can use db.LastModified to check, if the database was modified somehow, but I need to be able to determine, if users have read the documents in a database and for this I can’t find any LS functions.

Is ther any other way to get this information?

Thanks!

Subject: List of inactive databases via LotusScript, is it possible?

This is probably a very non complex way around it and I hope someone else will have a better way.

In the DB’s that you want to monitor on DBOpen script create a process that will look into another database and update the document for its database name with a new time stamp as last accessed. In your other database create an agent that goes through the directory and creates documents for any databases found in there that are not already in the database so you can keep up to date as DB’s are accessed.

then you can create an agent that goes though all the documents and those that have not been updated in x number of days or whatever criteria you want can be listed and mailed out to the appropriate people.

Subject: RE: List of inactive databases via LotusScript, is it possible?

Thank you, it looks like a good idea, excep for the fact that I have more than 200 very different dbs to monitor and it looks like a challenge to place a script in them, unless I’ll find a way to post it via LotusScript. THanks!

Subject: RE: List of inactive databases via LotusScript, is it possible?

check out the NotesUserActivity class in the Sandbox:

http://www-10.lotus.com/ldd/sandbox.nsf/Threads/C12A2FD2142758B68525688D00708397?OpenDocument

Subject: RE: List of inactive databases via LotusScript, is it possible?

Thank you very much - I’m checking it right now!

Subject: RE: List of inactive databases via LotusScript, is it possible?

Hello

Based on the sandbox code I’ve created an application that will go over databases on one or more servers and collect their user activity.

Added benefits are that it will combine the activity in multiple replicas of databases on one document, so you get to find the less used databases regardless of there server.

Another benefit is that it has the option to give a list of usernames (or parts of it) of users that you don’t want to count as real users.

For activity of the signers of scheduled agents, servers and administrators should not be counted.

This way we identified a lot of databases that where not used for several years and we could delete them.

If you are interested let me know. I will look for a place to post this for download.

Subject: RE: List of inactive databases via LotusScript, is it possible?

This looks very interesting. I have one database per server, but the possibility to exclude users is a very suitable feature for me. Is it a commercial application?

Thanks,

Natalie

Subject: RE: List of inactive databases via LotusScript, is it possible?

I’d sure like to get copy, it sounds interesting.

Subject: RE: List of inactive databases via LotusScript, is it possible?

I’me interested to by this application.if it’s possible to have a copy

thanks

Subject: List of inactive databases via LotusScript, is it possible?

If you look in the server log there is a view called - I forget jsut what it’s called but it’s something like Activity By Date. It shows documents called Activity docs. There is one Activity doc per app on the server. In the activity doc there is a rich text field; this field stores the view names and the size of the view index, like this:

view1 tab number newline

view2 tab number newline

and so on. If you extract tihs information to another database, and there extract the text of the rich text field, and split it into an array based on newline, and then split each element of this array based on tab, you will have the name of each view and the size of the index.

Because Notes discards the view index after 45 days of disuses, this gives you a very simple and more or less accurate way of identifying unused apps. If, for example, 95% of the views have a size of zero you can flag that app for a closer look.

The rich text data is not perfectly consistent, so the call to split() should be in an error trap.

Sample code:

		' **********************************************************

		' Split the item's data into an array based on Newline.

		' This gives us an array whose values are like:

		'

		' {viewname tab number; viewname tab number}

		' **********************************************************

		v1 = Split(activity_richtext.GetUnFormattedText, Chr$(13)&Chr$(10), -1,5)

		

		total_views = 0

		total_populated_views = 0

		

		' **********************************************************

		' Split each element of that array based on tab. This 

		' gives us an array whose values are like:

		' {viewname;number}

		' **********************************************************

		For c = 0 To Ubound(v1)

			v2 = Split(v1(c), Chr$(9), -1,5)	

			

			' **********************************************************

			' Some documents will contain "No views" or something

			' similar in their rich text item. The resulting ubound will

			' be 0, not 1. We step over these. The marker will be

			' ACTIVITY_MARKER_UNKNOWN.

			' **********************************************************

			If Ubound(v2) < 1 Then Goto NextView

			

			' **********************************************************

			' We keep track of two numbers: the number of views,

			' and the number of non-zero view sizes. These tell us

			' what percentage of the views have an index, and thus

			' indirectly whether the db is in use or not.

			' **********************************************************

			total_views = total_views + 1	

			

			' **********************************************************

			' Inconsistencies in the way the data is stored may

			' result in a value that we cannot convert to a number,

			' so this cast may raise an exception.

			' **********************************************************

			On Error Resume Next

			tmp_double = Cdbl( v2(1) )

			On Error Goto 0

			

			' **********************************************************

			' If it does we just skip to the next view.

			' **********************************************************

			If Err <> 0 Then

				Err = 0

				Goto NextView

			End If

			

			If tmp_double > 0 Then

				total_populated_views = total_populated_views+1

			End If

nextView:

	Next c

We use LEI to pump the data out of each server catalog, and then we run an agent against the results. You could do the same thing without LEI it would just be a lot more work and you might have to run it manually.

Note Somewhere in the sandbox there’s an example of how to read the app’s activity log via calls to the Notes API. Be very cautious about running such code on your server unless you really understand what it’s doing.