Skip to main content

Using the z/OSMF REST API

SMF data can be read from z/OS using the z/OSMF Dataset and Files REST API. This uses a https connection to z/OSMF to transfer the data.

Specify a URL as the input to the program e.g.

java -jar easysmf-events-v.r.m.jar --config <config-file> https://zosmf.example.com:10443/zosmf/restfiles/ds/MY.SMF.DATASET

The z/OSMF URL is somewhat flexible. It will also accept URLs of the form

  • https://zosmf.example.com:10443/MY.SMF.DATASET
  • https://zosmf.example.com:10443/zosmf/MY.SMF.DATASET

and the program will normalize it to the form: https://zosmf.example.com:10443/zosmf/restfiles/ds/MY.SMF.DATASET

z/OSMF Authentication

z/OSMF requires autheentication. Credentials can be supplied from:

  1. Credential files under CREDENTIALS_DIRECTORY
  2. A .netrc file in your home directory
  3. An interactive prompt for userid and password

If the CREDENTIALS_DIRECTORY environment variable is set, EasySMF will read credentials from the following files:

FileContents
CREDENTIALS_DIRECTORY/zosmf_useridUserid for z/OSMF
CREDENTIALS_DIRECTORY/zosmf_passwordPassword for z/OSMF

See Credentials Directory for details.

netrc File

Create a .netrc file in your home directory with the following format:

machine zosmf.example.com
login your_userid
password your_password

Store your .netrc file with appropriate permissions (600 on Unix/Linux.

Interactive Prompt

If no credentials are supplied, the program will prompt for userid and password. This may be useful for initial testing.