Is there a way to monitor agents whether they are enabled/disabled

Is there a way to monitor agents whether they are enabled/disabled and to trigger an event like "email X when agent is turned off"

Hello Nuri,

Agents information on the server can known by using the AMGR command, Please find the below help on amgr commands and switches and see if using any of these helps. Thank you.

> tell amgr -?
>
[6AD4:0002-7CB8] Purpose: Runs scheduled agents in Domino database(s).
[6AD4:0002-7CB8] Usage: Tell AMGR [options]...
[6AD4:0002-7CB8] [options]:
[6AD4:0002-7CB8] run db 'a' Runs agent 'a' in database db (Quotes are required).
[6AD4:0002-7CB8] cancel db 'a' Cancels agent 'a' in database db (Quotes are required).
[6AD4:0002-7CB8] status Show current queues and configuration information.
[6AD4:0002-7CB8] schedule Shows todays scheduled agents, database, trigger and start time.
[6AD4:0002-7CB8] pause Pauses scheduling of agent runs.
[6AD4:0002-7CB8] resume Resumes paused scheduling of agent runs.
[6AD4:0002-7CB8] debug Shows current debug control settings.
[6AD4:0002-7CB8] debug [n] Sets n debug control setting(s):
[6AD4:0002-7CB8] [options n]:
[6AD4:0002-7CB8] m Memory warnings
[6AD4:0002-7CB8] e Events
[6AD4:0002-7CB8] c Control parameters
[6AD4:0002-7CB8] v Verbose debug output
[6AD4:0002-7CB8] r Run reports
[6AD4:0002-7CB8] s Schedules of agents
[6AD4:0002-7CB8] p Performance statistics
[6AD4:0002-7CB8] l Loading reports
[6AD4:0002-7CB8] - Remove all debug flags

Regards

Shrikant J

In the Domino Administrator "Status - Schedules - Agents" you can see the scheduled agents.

To have a full picture of all agents and settings you can create a LotusScript agent to collect the details out of all databases.

a) Agent properties:

https://help.hcltechsw.com/dom_designer/10.0.1/basic/H_NOTESAGENT_CLASS.html

b) Notes API for details:

Type AssistInfo
Version As Integer
TriggerType As Integer ' 0 none, 1 schedule, 2 new mail, 3 paste, 4 manual, 5 update, 6 router
SearchType As Integer ' 0 none, 1 all, 2 new, 3 new/mod, 4 selected, 5 view, 6 unread, 7 prompt, 8 UI
IntervalType As Integer ' 0 none, 1 minutes, 2 days, 3 weeks, 4 months
Interval As Integer
Time1 As Variant ' Start time (ms since midnight)
Time2 As Variant ' Long (weekday or day of month) or end time (ms since midnight)
StartTime As Variant ' Time/Date
EndTime As Variant ' Time/Date
Flags As Long ' 1 hidden, 2 no weekends, 4 store highlights, 8 mail/paste, 16 choose server
Spare(15) As Long
End Type


Sub GetAssistInfo(db As NotesDatabase, agent As String, info As AssistInfo)
' Notes API benötigt: Security - Allow restricted operations (für Agent Info)
'
' Beispiel:
' dbtitel = DB Scanner Test
' agenttitel = agScanServer
' agentactive = aktiviert
' AGTINFOVERSION = 1
' AGTINFOTRIGGERTYPE = 1 On Event, On Schedule
' More than once a day, Schedule
' Action menu selection
' AGTINFOSEARCHTYPE = 0
' AGTINFOINTERVALTYPE = 1
' AGTINFOINTERVAL = 5
' AGTINFOTIME1 = 0
' AGTINFOTIME2 = 31.12.1899
' AGTINFOSTARTTIME = 06.05.2015
' AGTINFOENDTIME = 06.05.2015
' AGTINFOFLAGS = 0

On Error GoTo Error_Handler

Dim np$, pt&, ti$, dt%, nv&, p&, v&, t$, nt%

np$ = Space(1024)
OSPathNetConstruct 0, db.Server, db.FilePath, np$

Dim hDB As Long
NSFDbOpen np$, hDB
If hDB = 0 Then
Call LogEvent("Can't open database", "Error", 1)
Exit Sub
End If

pt& = InStr(agent, "|")
If pt& = 0 Then ti$ = Trim$(agent) Else ti$ = Trim$(Left$(agent, pt& - 1))
Dim nID As Long
NIFFindDesignNote hDB, ti$, NOTE_CLASS_FILTER, nID
If nID = 0 Then
Call LogEvent("Can't find agent " & ti$, "Error", 1)
Exit Sub
End If

If InStr(db.GetDocumentByID(Hex$(nID)).~$Flags(0), "f") = 0 Then
Call LogEvent(ti$ & " is not an agent", "Error", 1)
Exit Sub
End If

Dim hNT As Long
NSFNoteOpen hDB, nID, 0, hNT

Dim iB As BlockID, vB As BlockID
NSFItemInfo hNT&, "$AssistInfo", 11, iB, dt%, vB, nv&

If Not vB.hPool = 0 Then
Call LogEvent("Setting agent info: " + agent, "Line", 1)
p& = OSLockObject(vB.hPool) + vB.Block
Peek info.Version, p& + 2, 2
Peek info.TriggerType, p& + 4, 2
Peek info.SearchType, p& + 6, 2
Peek info.IntervalType, p& + 8, 2
Peek info.Interval, p& + 10, 2
Peek v&, p& + 12, 4
If v& <= 31 Then info.Time1 = v& Else info.Time1 = CDat(v&/100/60/60/24)
Peek v&, p& + 16, 4
If v& <= 31 Then info.Time2 = v& Else info.Time2 = CDat(v&/100/60/60/24)
t$ = Space(81)
ConvertTIMEDATEToText 0, 0, p& + 20, t$, 80, nt%
If Not nt% = 0 Then info.StartTime = CDat(Left$(t$, nt%))
t$ = Space(81)
ConvertTIMEDATEToText 0, 0, p& + 28, t$, 80, nt%
If Not nt% = 0 Then info.EndTime = CDat(Left$(t$, nt%))
Peek info.Flags, p& + 36, 4
OSUnlockObject vB.hPool
Else
Call LogEvent("No agent info: " + agent, "Line", 1)
End If

NSFNoteClose hNT
NSFDbClose hDB

Exit Sub

'*******************************************************************************************************
'*** Error Handler
'*******************************************************************************************************
Error_Handler:
Dim lineout As String
Print "Error handler"
LineOut = Date$+" "+Time$+" Error " + CStr(Err()) + " auf Zeile Nummer " + Format$(Erl()) + ": " + Error$ + { (Sub: GetAssistInfo)}
Call LogEvent(LineOut, "Error", 1)
End Sub

In the Domino Administrator "Status - Schedules - Agents" you can see the scheduled agents.

To have a full picture of all agents and settings you can create a LotusScript agent to collect the details out of all databases.

Here I can only see the agents which are scheduled daily only. I cannot see all the other weekly scheduled agents. Is there a way to see ALL the scheduled agents?

Ytria AgentEZ. And you might want the entire toolkit. It is REALLY useful.