A CLI application that does upload SMF JSON files to database, summarization and printing reports on the fly without any DBMS.
Project description
smf2db
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.
License
This project uses the following license: LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smf2db-0.1.1.tar.gz.
File metadata
- Download URL: smf2db-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
916e100168c9ba55719f1e25f825d4edab3fa09c3025bc00a00682829e319339
|
|
| MD5 |
7eef2bd888b747ab4092252ac222cb11
|
|
| BLAKE2b-256 |
ca21aa79a04c45ac36735553fec2b5499f3bef9ff0588e92bcf244ea75c456d0
|
File details
Details for the file smf2db-0.1.1-py3-none-any.whl.
File metadata
- Download URL: smf2db-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74897bd8a5655bfd304d490313f58a23ab77d9ef86b05e0d5870cc67a7552429
|
|
| MD5 |
770fcab6f49435f37fe680019f7895c8
|
|
| BLAKE2b-256 |
540e53bbced4de50eed60f953e4859ee1c4a74b8dd3d776961053e1aa537e936
|