Using 'SET OBSERVER' to Monitor Console Activity

Andrew Bingham, 2/29/04

Information taken from IBM z/VM CP Command and Utility Reference, v4R3.0, p.1265-1266

One of the problems encountered in our program design was the ability to capture console activity from various guests, such as MAINT, and pipe it back to our GUIMAINT guest for parsing, etc. This would be required to monitor for some system events.

The 'SET OBSERVER' command, added in z/VM v4R2.0, allows for the console input and output of one guest to be sent to another guest for observation. Its command line takes the following format for Class A and C users:

SET OBSERVER [<targetid>] [<userid> | OFF | RESET | *]

<targetid> is the userid of the guest whose observer status is	being altered; this defaults to the guest executing the command	if it is not specified.

<userid> is the user ID of the guest that is being set to observe	the guest specified by <targetid>.

The OFF option removes user <targetid> from observation.

The RESET option resets the observer userid to the value	specified in <targetid>s CP directory entry,

The * option sets the observer <userid> for <targetid> (or the	command issuer) to the userid of the virtual machine issuing the	command.

Class G users can only change the status of their own observers.

Example 1

Executing the following command as MAINT:

set observer guimaint

Produces the following output in GUIMAINT's console:

HCPCFX6768I Observation of MAINT initiated for you by MAINT

MAINT : Ready; T=0.01/0.01 06:17:54

MAINT : q cpus

MAINT : 06:19:54 CPU 00 ID FF00A8CA20660000 (BASE)

MAINT : Ready; T=0.01/0.01 06:19:54

MAINT : q n

MAINT : 06:20:31 HUB - DSC , GENTOO2 - DSC , PATCHDOT - DSC , CPINT - DSC

MAINT : 06:20:31 TCPIP - DSC , KERNEL2 - DSC , TEMP05 - DSC , ZSEC2 - DSC

MAINT : 06:20:31 ZSEC1 - DSC , DIRMAINT - DSC , KERNEL1 - DSC , XEN01 - DSC

MAINT : 06:20:31 OPERSYMP - DSC , EREP - DSC , DNSSERVE - DSC , GUIMAINT - L0003

MAINT : 06:20:31 MAINT -L0006

MAINT : 06:20:31 VSM - TCPIP

MAINT : Ready; T=0.01/0.01 06:20:31

All subsequent input and output from MAINT is sent to GUIMAINT as well.

Example 2

Executing the following command as GUIMAINT:

set observer maint *

Will set MAINT's observer userid to GUIMAINT, allowing us to observe a guest without actually executing the SET OBSERVER command from its command line.

Multiple guests can be observed by one other guest simultaneously; for instance, GUIMAINT could observe both MAINT and OPERATOR:

MAINT : q osa

MAINT : 06:38:53 OSA 0100 ATTACHED TO TCPIP 0100

.

.

.

MAINT : 06:38:53 OSA 0120 ATTACHED TO PATCHDOT 0802

MAINT : Ready; T=0.01/0.01 06:38:53

OPERATOR: q stor

OPERATOR: STORAGE = 8064M

OPERATOR: Ready; T=0.01/0.01 06:41:25

2004-02-29T10:02:50