Store predefined watches in a table with these watch definition CL commands
Since release 5.4, we’ve had the ability to define and start watches on your IBM i. A watch is a service monitor process that calls a user-written exit program when a predefined event occurs on your system. Besides monitoring the Licensed Internal Code (LIC) log and the Product Activity Log (PAL), a watch can monitor for specific or generic messages in a job log or all messages of a specific type issued in any job or named jobs on the system. The same range of parameters is also available for monitoring one or more nonprogram message queues, including QSYSOPR and the history log.
You can also associate watches with traces when issuing the Trace Internal (TRCINT), Start Trace (STRTRC), Trace Connection (TRCCNN), Trace TCP/IP Application (TRCTCPAPP), or Start Communications Trace (STRCMNTRC) commands that specify watches parameters. Here, the watches in scope are the former ones initiated using the Start Watch (STRWCH) command or the Start Watch (QSCSWCH) API. The STRWCH command and the QSCSWCH API have been significantly enhanced in both release 6.1 and 7.1. When it comes to system and job monitoring, watches are a powerful tool.
Download the save file containing the source code.