Recent versions of z/OS include the SMF Real Time Interface.
The z/OS SMF Real Time Interface allows application programs to read SMF data as it is written, without system exits or authorized code. Multiple SMF in memory resources can be defined to receive different sets of records, and access to each resource is RACF protected.
Using the SMF Real Time Interface from Java
EasySMF:RTI provides an easy way to use this interface from Java.
Using the interface is as simple as a few lines of code:
try (SmfConnection connection =
SmfConnection.forResourceName("IFASMF.MYRECS")
.disconnectOnStop()
.connect())
{
// process data here
}
This code connects to the resource and sets up a MVS command handler to disconnect when a MVS STOP command is received. The connection will be automatically closed when the program exits the try block.
EasySMF:JE provides Java classes to map the records you read from the real time interface.
See examples of how to use the Real Time Interface on Github:
https://github.com/BlackHillSoftware/easysmf-samples/tree/main/easysmf-rti
Samples include:
- A simple demonstration of connecting, reading, disconnecting
- Send SMF record data in binary format to a http(s) URL
- Send SMF record data in JSON format to a http(s) URL
- Send notifications of failed jobs by SMS message using Twilio
The Javadoc for EasySMF:RTI can be found here: