Skip to main content

smf2db

Pypi version coverage Documentation Status MIT License

This is a CLI application that does upload SMF JSON files to database, summarization and printing reports on the fly without any DBMS.

Table of Contents

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Python 3.11 or later installed on your platform
  • Ensure you have created a virtual environment
  • Get ready of SMF JSON files (you can follow the instructions of my another project in CBTTape)

Installation

smf2db is officially distributed for installation through PyPI for installation with pip. To install smf2db, follow these steps:

On z/OS:

Ensure you download the wheel file and upload to USS before beginning. The requirements for intallingsmf2dbare as follows:

  • Python installed
  • Can access Python AI Tookit for IBM z/OS to get pre-built Python packages for z/OS.
  • Can access PyPI to get other dependent packages. It is optional as the required wheel files will be included in the pax file when expanding it.

If installing from wheel file, you can run this:

python -m pip install smf2db-0.1.1-py3-none-any.whl

For more detail instructions, please refer to the project's official documentation.

On macOS, Linux and Windows:

smf2db can be installed with pip like this:

python -m pip install smf2db

Usage

On z/OS:

There are two methods to run smf2db:

  • Using batch job
  • firing up a telnet terminal window and run the following command:
    $ smf2db --version
    

On macOS, Linux and Windows:

You can just run the following command on the terminal:

$ smf2db --version

Here are flowchart of how to use the smf2db:

graph TD;
    smf2db-->report;
    smf2db-->db;
    db-->initcfg;
    initcfg-->initdb;
    initdb-->initsum;
    initdb-->upload;
    initsum-->sumup;

Usage Examples

If you have some smf70 JSON data on hand for the LPAR, e.g. S0W1, in json_data directory, you can just print the report on the fly by running the following command without any DBMS involvement:

smf2db report 70 json_data/smf70.json -r 'CPU Activity report' -l S0W1

If you would like to upload data to DBMS, say, SQLite, you are required to run db initcfg to create a yaml configuration file first. Here we will create a config.yaml in configs directory with the SQLite db path in data directory which has already created. The partition scheme is a single database without any partition and without any prefix for the database names. The command is shown below:

smf2db db initcfg --config_file configs/config.yaml --db_driver sqlite --sqlite_path data --partitions 'no partition' -x ''

After creation of the configuration file, you can now initialize the database in SQLite by creating the tables in the database. Let's initialzie smf type 70:

smf2db db initdb 70 --config_file configs/config.yaml

To upload smf70 JSON data in json_data/smf70.json to SQLite, you can simply run:

smf2db db upload 70 json_data/smf70.json --config_file configs/config.yaml

For more detail how to use it, please refer to the project's official documentation page.

Technologies

smf2db uses the following technologies and tools:

Features

smf2db currently supports SMF types 30, 70-75, 77, 78, 110 and 123 and has the following set of features:

  • Printing reports on the fly using the JSON files as input without loading to DBMS. It is recommended to output the report to a file for easier browsing.
  • Uploading JSON files to Database (SQLite or Postgresql). You can use SSH to connect to Postgresql if SSH is supported on your platform.
  • Suming up data to hourly or daily database. 15-minutes sum-up is available for some SMF types.

Contact

If you want to contact me you can reach me at franfcwong@hotmail.com.

Change log

  • 0.1.0
    • The first proper release
  • 0.1.1
    • Correct the typo in the contact.
  • 0.1.2
    • Bug fixing.

License

This project uses the following license: LICENSE.

Metadata

Release files for smf2db 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smf2db 0.1.2
File Size Uploaded
smf2db-0.1.2.tar.gz 534.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smf2db 0.1.2
File Interpreter ABI Platform
smf2db-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / smf2db-0.1.2.tar.gz

Download URL smf2db-0.1.2.tar.gz
Size 534.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2f8c475ea655e65065843790740f7a1c0abb23b70206db087dba4a44391ca4e6
BLAKE2b-256 checksum
How to use checksums
fed75baae3a53a907db9b468a2f635912337002742faf9dbc1a7b25045e7cc1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / smf2db-0.1.2-py3-none-any.whl

Download URL smf2db-0.1.2-py3-none-any.whl
Size 604.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e0188d0793e2b3e4b61ff0fa31a65d40b9c1a3f3447f95a1fab935a83cc8697
BLAKE2b-256 checksum
How to use checksums
d5fde0aa1a1cca476f1d5e1236ec3ac47dae2b649ebde8ecfd7466cc7c78c676
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page