Skip to main content

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

Project description

smf2db

Pypi 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.0-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 franfwong@hotmail.com.

Change log

  • 0.1.0
    • The first proper release

License

This project uses the following license: LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smf2db-0.1.0.tar.gz (537.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smf2db-0.1.0-py3-none-any.whl (607.8 kB view details)

Uploaded Python 3

File details

Details for the file smf2db-0.1.0.tar.gz.

File metadata

  • Download URL: smf2db-0.1.0.tar.gz
  • Upload date:
  • Size: 537.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for smf2db-0.1.0.tar.gz
Algorithm Hash digest
SHA256 19e48273272e4b5413d9189989da16dcf41b575003812c2488581f4738352b6d
MD5 93a2a7400c986ff01d0c96896dfbfb5a
BLAKE2b-256 fba9925c07d9d022d91f9c0ecdb532858e501f1febf6be295c5b97e6fb47eed3

See more details on using hashes here.

File details

Details for the file smf2db-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: smf2db-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 607.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for smf2db-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 860eff82554281918315b728929852f3f779cd5d2371c351d4aec1002025ab59
MD5 fa235da7ca4dc7bebef5a2decef7948b
BLAKE2b-256 fea6553e177f9522a01d13646fe7bc15c4d186770f6f23d8e3ea519a4486d9aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page