Allt om Lotus Notes & Domino

Daily email event report from DDM 2
I have improved the script that send me daily reports from DDM. This version will now color code each severity in the email and it now also use the "recent events" view instead of the "open events"
Put the script below in a daily scheduled agent and you will recieve an nicely color coded email containing todays events

If you setup a server collection hierarchy in events4.nsf your should run the script on the collecting server to get events from all servers in your email.

Image show what the daily email looks like

' Loop all open and recent ddm events and email them
' Put this script in a scheduled agent and run it daily

On Error GoTo e
Dim session As New NotesSession,db As NotesDatabase
Dim view As NotesView,maxdays As Integer, style As NotesRichTextStyle
Dim maildoc As NotesDocument, rt As NotesRichTextItem, c As Integer
Dim entry As NotesViewEntry, nav As NotesViewNavigator
Dim server As String, emails As Variant,sev As Variant

emails = Evaluate(|"":""|)
maxdays = 1
server = "domino1"
Dim dt As New NotesDateTime("Today")

Set db = session.GetDatabase(server,"ddm.nsf")
Set view = db.getView("vwEventsByDate2")
Set nav = view.CreateViewNav
Set style = session.CreateRichTextStyle
style.FontSize = 8
style.NotesFont = FONT_HELV

Set maildoc = db.Createdocument()
maildoc.Form = "Memo"
maildoc.Subject = "Domino events for " + dt.Dateonly
Set rt = maildoc.Createrichtextitem("Body")
c = 0

Call rt.AppendStyle(style)
Call rt.Appendtext("Open DDM -> ")
Call rt.Appenddoclink(db,"Link to DDM")
Call rt.Addnewline(1)
Call rt.Appendtext("Domino events for " + dt.Dateonly)
Call rt.Addnewline(1)

Set nav = view.CreateViewNav
Set entry = nav.GetFirst
Do Until entry Is Nothing
If entry.IsDocument Then

sev = entry.Columnvalues(7)
Select Case sev
Case ".high":
style.Notescolor = COLOR_RED
Call rt.AppendStyle(style)
Case ".failure":
style.Notescolor = COLOR_RED
Call rt.AppendStyle(style)
Case ".low":
style.Notescolor = COLOR_DARK_RED
Call rt.AppendStyle(style)
Case ".normal":
style.Notescolor = COLOR_BLACK
Call rt.AppendStyle(style)
Case Else:
style.Notescolor = COLOR_BLACK
Call rt.AppendStyle(style)
End Select
Call rt.Appenddoclink(entry.document,"Link to ddm.nsf")
Call rt.Appendtext(CStr(entry.Columnvalues(4)))
Call rt.Appendtext(CStr(entry.Columnvalues(5)))
Call rt.Appendtext(CStr(entry.Columnvalues(8)))
Call rt.Addnewline(1)
Call rt.Addnewline(2)
If entry.Indentlevel = 0 Then
Call rt.Appendtext(entry.Columnvalues(2))
If c=> maxdays Then Exit do
Call rt.Appendtext(entry.Columnvalues(3))
c = c + 1
End If
Call rt.Addnewline(2)

End If
Set entry = nav.GetNext(entry)

Call maildoc.send(False,emails)
Exit Sub
Print Error,erl

Relevanta Poster på Notessidan:

Fler Poster om:

Fler bloggar om:


Publicerad 2014-06-12 | Kommentarer: 2 | Läsningar:


Palmi ( 2014-06-12 14:07:31 )

Stephy Wilson ( 2014-12-18 08:00:38 )

Sök på Notessidan
Thomas Adrian
ThomasCertifierad utvecklare och administratör inom Notes & Domino

Kontakta mig

Senaste Sökningarna på Notessidan
Tor - bild and signatur (R:1)
Tor - värdnamn (R:0)
Tor - användarguide (R:1)
Tor - Sortera and Lista (R:1)
Tor - Processa and XML (R:1)
Tor - datatyper (R:1)
Tor - böcker (R:0)
Tor - tipset (R:7)
Tor - systemkrav and för and lotus and notes and 8 (R:0)
Tor - h�nger (R:0)
Tor - ta and bort and användare (R:0)
Tor - söka and i and flera and databaser (R:0)
Tor - genväg (R:0)
Tor - sort and array (R:7)
Tor - säkerhet (R:0)
Tor - läs and xml (R:0)
Tor - öppna and notes and från and webben (R:0)
Tor - Se and om and mail and lästs (R:1)
Tor - svara and till and avsändaren (R:0)
Tor - fönster (R:0)
Tor - Connection and document (R:8)
Tor - genväg and på and skrivbordet (R:0)
Tor - brev* (R:4)
Tor - dominoserver (R:24)
Tor - mall and blog (R:0)
Tor - Multi-User (R:1)
Tor - Å and ä and ö (R:0)
Tor - cheklista (R:1)
Tor - ecl (R:2)
Tor - gör and tillgänglig (R:7)

Databasstatistik Blogg
Uppdateras var 15:e Minut

Antal Poster:562
Antal Kommentarer: 1024
Alla sidvisningar idag:
Unika Besökare idag:
Databasstorlek: 121Mb
Fixup: 2017-03-30 00:30:48
FT:2017-03-30 02:00:48
DB Procent använd: 99,6
Antal Agenter: 42
Antal Formulär: 65
Antal Vyer: 60
Antal Dokument: 7190
Antal Image Resources: 108
Antal Subformulär: 18
Antal Scriptbibliotek: 11
Totalt Antal Designelement: 573
Antal Attachments: 159
Antal Konflikter: 0
Server version 1: 405
Server version 2: Release 9.0.1FP8|February 23, 2017
Server Plattform: Windows/64
Ändrad: 2017-03-30 02:32:27
Server Tidszon: Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZX=97$ZN=W. Europe
Kommentarsspam Idag: 0
Kommentarsspam Totalt: 8008

Top Sites at

Fight Spam! Click Here!

Listed on BlogShares

Increase website traffic

Top Internet Blogs

Site Checker