Skip to main content

python-SysInformer

The python-SysInformer is a system information tool that allows users to retrieve various types of information about their system. It offers functionalities to gather CPU details, memory information, disk space usage, network activity, process status, container information, and system statistics such as OS type, uptime, and hostname.

Why another system information tool?

Numerous system information tools, like htop, glances, and neofetch, serve Linux systems. While they're excellent, this tool isn't meant to replace them. Instead, it simplifies retrieving both critical and occasional system details. For instance, to quickly find a host IP, instead of using ip a and potentially adding grep, you can now utilize psi run -n. Similarly, to check container ports, the lengthy docker ps command can be swapped for psi -ct.

Additionally, this project is my venture to enhance my Python capabilities. While not a developer, I frequently script and automate tasks. I've been using Python for a few months now, but I've never really taken the time to learn the language. I've always just learned what I needed to get the job done. I've been wanting to change that and this project is my first attempt at doing so. I'm sure there are many things that could be done better, but I'm happy with the progress I've made and the knowledge I've gained so far.

Features

The following gif demonstrates some of the tool's features:

psi-gif

Getting Started

Prerequisites

The tool requires Python 3.11 or higher. Additionally, the tool is inteneded to be used on Linux and macOS systems. The tool is not intended to be used on Windows systems.

Dependencies

The tool uses the following Python packages:

  • distro
  • netifaces
  • ping3
  • psutil
  • PyYAML
  • tabulate

Installation

The easiest way to install the tool is with pip:

  pip install python-SysInformer

  # if using pyenv - upgrade the tool with to avoid potential cache issues:
  pip install --upgrade python-SysInformer --force-reinstall

Additionaly, if you have poetry installed you can install the tool with:

git clone [this repo]
poetry install

# OR

poetry add python-SysInformer

Finally, you can install the tool from source:

git clone [this repo]
pip install -r requirements.txt

Usage

The tool is intended to be used as a command line tool:

Usage: psi [OPTIONS] COMMAND [ARGS]...

  System information tool.

Options:
  --help  Show this message and exit.

Commands:
  config   The config command is used to create a default config file.
  run      The run command is the main command for the tool.
  version  Prints the version of the tool.

The most basic usage to retrieve all information is:

psi run -a

If you prefer to only retrieve specific information, you can use the following options:

Options:
  -a, --all           Show all information
  -s, --system        Show only system information
  -c, --cpu           Show only CPU information
  -m, --memory        Show only memory information
  -d, --disk          Show only disk information
  -n, --network       Show only network and latency information
  -ps, --processes    Show only services information
  -ct, --containers   Show only running container (docker or podman)
                      information

Configuration

You can configure the tool using a YAML file. Currently, the configuration options allow you to specify services and ports to monitor for their operational status, and set targets to ping to measure latency.

A default configuration file can be created using the psi config --create command. By default, the configuration file is located at ~/.config/psi/config.yaml. If you'd like to use a different location, simply provide the path using the --config-path e.g. psi config --create --config-path /some/path/config.yaml. You can then pass the path to the psi run command using the same option.

The config file itself is fairly basic and looks like this:

services:
  - name: FTP Server
    port: 21
    host: localhost
  - name: SSH
    port: 22
    host: localhost
  - name: HTTP
    port: 80
    host: localhost
  - name: HTTPS
    port: 443
    host: localhost
  - name: MySQL Server
    port: 3306
    host: localhost
  - name: PostgreSQL Server
    port: 5432
    host: localhost

ping_hosts:
  - google.com
  - timothybryantjr.com
  - github.com

Note: The tool will still run without a config file, but will not be able to check up or down status for services or ping targets for latency information.

Acknowledgements

This tool was inspired by eZ Server Monitor. Specfically, their eSMsh feature which allows users to retrieve system information from the command line via a bash script. In fact, if you want the portability of a bash script, I would recommend using eSMsh. I'm not sure if the script is still being maintained, but it is still available on Github. But if you don't mind using Python, and want a little more information, then the python-SysInformer tool could be for you.

Metadata

Release files for python-sysinformer 1.10.1

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

Source distribution (sdist)

Source distribution for python-sysinformer 1.10.1
File Size Uploaded
python_sysinformer-1.10.1.tar.gz 29.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-sysinformer 1.10.1
File Interpreter ABI Platform
python_sysinformer-1.10.1-py3-none-any.whl Python 3 none any Details

Total release size: 63.1 kB

Release files / python_sysinformer-1.10.1.tar.gz

Download URL python_sysinformer-1.10.1.tar.gz
Size 29.6 kB
Tags Source
SHA-256 checksum
How to use checksums
36d5cd9f6a240fd0f4a26374e625911e43e77823a020bb498b777e4e58a6482a
BLAKE2b-256 checksum
How to use checksums
c8df9b5d5ababdf0ae7e009eae018ff54c38909bc2e103a2eb1f880f2369c281
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / python_sysinformer-1.10.1-py3-none-any.whl

Download URL python_sysinformer-1.10.1-py3-none-any.whl
Size 33.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4067515e93b9abc38e17c624d06eda82a992c96ada65ab79bf4bcae13022fc44
BLAKE2b-256 checksum
How to use checksums
66ecc2983394fdb7f8997c585bf687adb82465542a1f0bb0a170e9e6aae5059d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

1.10.1 This release

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.15

2 release files

1.2.14

2 release files

1.2.13

2 release files

1.2.12

2 release files

1.2.11

2 release files

1.2.10

2 release files

1.2.5

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.1.0

2 release files

1.0.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