Create the lotus script agent below on a schedule basis of every 5 minutes. It will also skip the restart if it has already been done recently. If you're having multiple JVM failures within the window of one log entry document, you should really address that issue instead of using this agent to clear it. Be sure to set the runtime security of the agent to "3. Allow restricted operations with full administration rights".
Sub Initialize
Dim session As New NotesSession
Dim db As notesdatabase
Set db = session.currentdatabase
Dim Ldb As NotesDatabase
Set Ldb = session.GetDatabase(db.server, "log.nsf")
If Not Ldb.IsOpen Then Exit Sub
Dim view As NotesView
Set view = Ldb.GetView("MiscEvents")
Dim doc As notesdocument
Set doc = view.GetLastDocument
If doc Is Nothing Then Exit Sub
Dim item As NotesItem
Set item = doc.GetFirstItem("EventList")
Dim x As Long
Dim stringtotest As String
Dim trigger As String
'#################################################
trigger = Lcase("OutOfMemoryError")
'#################################################
'parse thru all values from last to first
For x = Ubound(item.values) To 0 Step -1
'retrieve the row by index value
stringtotest = Lcase(item.values(x))
'test if the http task has already been restarted, if so, skip and exit
If Right(stringtotest,17) = "restart task http" Then Exit For
'continue to test if the trigger value is present in this index
If Instr(1, stringtotest, trigger) >1 Then
'Restart the JVM via http task.
Dim consoleReturn As String
consoleReturn = session.SendConsoleCommand( "", "restart task http" )
'Send notification
Dim edoc As notesdocument
Set edoc = db.CreateDocument
'///////////////////////////////////////////////////////////
edoc.INetFrom = "ServerName <ServerEmailAddress@domain.com>"
edoc.From = "ServerName <ServerEmailAddress@domain.com>"
edoc.Submitter = "ServerName <ServerEmailAddress@domain.com>"
'///////////////////////////////////////////////////////////
edoc.Form = "Memo"
edoc.Subject = "URGENT! - JVM Memory Failure"
Dim rtitem As NotesRichTextItem
Set rtItem = edoc.CreateRichTextItem("Body")
Call rtitem.AppendText("An Out-Of-Memory Error has occured on ServerName.")
Call rtitem.Addnewline(2)
Call rtitem.AppendText("The RESTART TASK HTTP command was sent to the console to restart the JVM.")
Call rtitem.Addnewline(2)
edoc.Sendto = "YourEmailAddress@domain.com"
Call edoc.Send( False )
Exit For
End If
Next x
End Sub