Using Zowe to display CPU consumption of a mainframe address space

Vitezslav Vit Vlcek
Zowe
Published in
2 min readMay 28, 2019

I was working on a performance issue of a mainframe application (API Mediation Layer a part of Zowe) and I needed to see CPU consumption of a mainframe address space. I wanted to capture java core dump via kill -QUIT <pid> when address space starts suffering from high CPU usage.

CA SYSVIEW is a nice monitoring tool that provides metrics I needed and plenty of other functionality via UI panels but it is difficult to make use of it from USS command line CA SYSVIEW however offers REXX API that opens doors to the scripting world.

I leveraged original Petr Plavjaník’s REXX script and created a USS wrapper sysview-cli that allows to invoke CA SYSVIEW commands from USS command line.

Installation

  1. download sysview-cli from a GitHub https://github.com/vvvlc/SYSVIEW-CLI
    curl "https://raw.githubusercontent.com/vvvlc/SYSVIEW-CLI/master/sysview-cli" -o sysview-cli
  2. upload sysview-cli to a USS folder that is on PATH environment variable. In my case it is /a/vlcvi01/bin. You can use Zowe CLI to copy local file to USS zowe files upload file-to-uss sysview-cli /a/vlcvi01/bin/sysview-cli --zosmf-profile my_mainframe or you can use scpor ftp (transfer it in ASCII mode to enforce conversion into EBCDIC).
  3. issue chmod +x /a/vlcvi01/bin/sysview-cli from USS console.

How to use it

Issue on USS console

sysview-cli "ASPERF; SELECT JOBNAME = VLC*" | less -S

to displays all address spaces having jobname = VLC*

screenshot of sysview-cli output

Syntax is straightforward:

sysview-cli <SYSVIEW COMMAND>
sysview-cli JOBSUM

To chain CA SYSVIEW commands use ;

sysview-cli "PRE VLCVI*;JOBSUM; SORT JOBNAME DESC"

When output is too wide use less -S to enable scrolling in terminal window

sysview-cli "ASPERF; SELECT JOBNAME = ZOWE*" | less -S
output of sysview-cli

Compare above and bellow screenshots

screenshot of CA SYSVIEW

To drive sysview-cli from your workstation use ssh

ssh your_mf_host '/path/sysview-cli "asperf ; SELECT JOBNAME = M*"'

CNM4BLOD is not on LINKLIST

To override default CA SYSVIEW loadlib define STEPLIB environment variable

STEPLIB=MY.CUSTOM.CNM4BLOD sysview-cli JOBSUM

Integration with other *nix tools

This command skips first 8 lines, extracts 4th column

sysview-cli "ASPERF; SELECT JOBNAME = ZOWE*" | tail +8 | awk -F '|' '{print $4}'

NOTE: field separator is |

--

--