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.3-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.
  • 0.1.3
    • Bug fixing.

License

This project uses the following license: LICENSE.

Metadata

Release files for smf2db 0.1.3

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.3
File Size Uploaded Provenance Actions
smf2db-0.1.3.tar.gz 534.7 kB Without provenance Details for smf2db-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / smf2db-0.1.3.tar.gz

Download URL smf2db-0.1.3.tar.gz
Size 534.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4e31b5f1f0e96842b0eaa7dcaca5c19b9be04a6a0ab4597aca2501d315b0106c
BLAKE2b-256 checksum
How to use checksums
6d94d9b0581a858822f147c7b40aff041634440aa15215e7c2d82c43970b05ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

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

Download URL smf2db-0.1.3-py3-none-any.whl
Size 604.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a88270a31537dcd33e87787e32686077133dd805140f0d5d7260a7c4a0f879a0
BLAKE2b-256 checksum
How to use checksums
4776b421079d8e0db7d921b53443421bb61ce172fcbdd03c8675a953246e9c71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for smf2db 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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