Monitor Resource Commands

When defining a monitor resource you can specify activate, deactivate and monitor commands. Any command is suitable that can be executed in the NetView environment. These commands are divided into two groups:

  • NetView activate and deactivate commands that expect a return code of zero
  • Monitor commands that return a health status

The main difference between these two groups is that the activate and deactivate commands are executed only once, and SA z/OS expects a return code of zero.

If the activate command ended with a non-zero return code, the monitor resource remains in an INACTIVE status. The monitor resource ends in a BROKEN status if the deactivate command ended with a non-zero return code.

  • The activate command is optional and can be used to establish the environment the monitoring routine can run in. The command is executed every time the monitor is started. The command must exit with return code 0.
  • The deactivate command is optional and can be used to cleanup the environment. The command is executed every time the monitor is stopped. The command must exit with return code 0.
  • The monitor command is executed after the activate command and then periodically if a monitoring interval is given. SA z/OS expects the monitor command to return a valid health status code. Additionally the monitor command can issue a message that is then attached to the health status. The absence of a monitoring interval indicates that the given monitor resource is a passive or event-based health monitor. In this case, the monitor command is optional and, if specified, it is invoked for initial health monitoring only. Otherwise, if a monitoring interval is provided, the given monitor resource is an active health monitor. In this case, a monitor command must be provided to return a health status.

The activate, deactivate and monitor command can be a command procedure written in any language that is supported by NetView: REXX, Assembler, PL/I, C, or the NetView Command List Language (NCLL). Writing a monitor routine can be simple or it can be complex. The complexity depends upon the application that you are attempting to monitor.