To ensure the checking of this DECS activity gets the priority it deserves, I created a scheduled agent that runs everyday to check the connection. If it is not running, it sends an e-mail to the required personnel so we can be more pro-active in responding to the failure.
Below is the code I put in the agent that checks the server tasks and whether or not the DECS activity is running, and then sends an e-mail to the required people.
Dim session As New NotesSession Dim db As NotesDatabase Dim servername As String Dim result As String Dim MailDoc As NotesDocument Dim richtextitem As NotesRichTextItem Dim richstyle As NotesRichTextStyle Set db = session.Currentdatabase servername = db.Server result = session.SendConsoleCommand ( servername, "Show Tasks" ) result = Strright( result, "DECS Server" ) If result = "" Then Goto sendemail result = Ltrim( result ) result = Left$( result, 4 ) If Ucase( result ) = "IDLE" Then Goto sendemail Exit Sub sendemail: Set MailDoc = New NotesDocument( db ) MailDoc.Form = "Memo" MailDoc.SendTo = "Agent Error Notifications" Set richtextitem = New NotesRichTextItem( MailDoc, "Body" ) Set richStyle = session.CreateRichTextStyle 'subject MailDoc.Subject = "DECS Activity not running" 'Body Call richtextitem.AppendText( "Please note that there are no DECS Activities running on " & _ db.server ) Call richtextitem.AddNewline( 2 ) Call richtextitem.AppendText( "Please investigate this as the Customer Complaints Activity should be running at all times." ) Call maildoc.Send( False)
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip exchange by member Graham Frey. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.
This was first published in August 2004