NOTESSIDAN

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(|"user1@acme.com":"user2@acme.com"|)
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")
rt.Addtab(1)
Call rt.Appendtext(CStr(entry.Columnvalues(4)))
rt.Addtab(1)
Call rt.Appendtext(CStr(entry.Columnvalues(5)))
rt.Addtab(1)
Call rt.Appendtext(CStr(entry.Columnvalues(8)))
Call rt.Addnewline(1)
Else
Call rt.Addnewline(2)
If entry.Indentlevel = 0 Then
Call rt.Appendtext(entry.Columnvalues(2))
Else
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)
Loop

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



Relevanta Poster på Notessidan:



Fler Poster om:

Fler bloggar om:

Technorati:

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

Kommentarer

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
Sön - sharepoint (R:1)
Sön - räkna and antal and besökare (R:0)
Sön - browser (R:17)
Sön - stoppar and mail (R:1)
Sön - korrupt (R:3)
Sön - böcker (R:0)
Sön - kalendern (R:12)
Sön - feature (R:15)
Sön - print and mime (R:2)
Sön - länka (R:0)
Sön - databasen (R:94)
Sön - access (R:47)
Sön - outlook (R:15)
Sön - webanvändare (R:0)
Sön - google and maps (R:6)
Sön - juffe (R:2)
Sön - uidoc.print (R:1)
Sön - java and lotusscript (R:26)
Sön - besök (R:0)




Databasstatistik Blogg
Uppdateras var 15:e Minut

Antal Poster:562
Antal Kommentarer: 1048
Alla sidvisningar idag:
Unika Besökare idag:
Databasstorlek: 134,5Mb
Fixup: 2017-11-18 00:30:52
FT:2017-11-15 18:33:24
DB Procent använd: 99,6
Antal Agenter: 42
Antal Formulär: 65
Antal Vyer: 60
Antal Dokument: 7025
Antal Image Resources: 108
Antal Subformulär: 18
Antal Scriptbibliotek: 11
Totalt Antal Designelement: 575
Antal Attachments: 159
Antal Konflikter: 0
Server version 1: 405
Server version 2: Release 9.0.1FP9|August 14, 2017
Server Plattform: Windows/64
Ändrad: 2017-11-18 01:27:37
Server Tidszon: Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZX=97$ZN=W. Europe
Region:
Kommentarsspam Idag: 0
Kommentarsspam Totalt: 10809


BlogRankers.com

Top Sites at iWEBTOOL.com

Fight Spam! Click Here!

Bloggtoppen.se

Listed on BlogShares

Increase website traffic

Top Internet Blogs

Site Checker