Python SDK and CLI to interact with the sysmon daemon
Project description
sysmon_sdk
A lightweight Python system monitoring SDK and CLI...
A lightweight Python system monitoring SDK and CLI that communicates with a background daemon process via Unix Domain Sockets (UDS). It lets users query system metrics like CPU and memory, and control the daemon using simple CLI commands.
🚀 Features
- 🔧 Multithreaded daemon to monitor CPU and memory usage
- 📡 Client-server communication over Unix domain sockets
- 🧪 Test coverage with
pytest,pytest-cov - 🖥 Simple CLI interface:
status,metrics,shutdown - 🔐 PID file support and graceful shutdown
📦 Installation (from TestPyPI)
You can install the package from TestPyPI using:
pip install --index-url https://test.pypi.org/simple/ sysmon-sdk
⚠️ Make sure
psutilis installed if not already. You can run:
pip install psutil
🧑💻 Usage
First, run the daemon (this runs in the background):
python -m sysmon_sdk.daemon
Then use the CLI commands:
sysmon status # Check daemon status
sysmon metrics # View current CPU and memory usage
sysmon shutdown # Gracefully shut down the daemon
🛠 Developer Setup
Clone the repository and install locally:
git clone https://github.com/YOUR_USERNAME/sysmon-sdk.git
cd sysmon-sdk
pip install .
To run the CLI directly from source:
python -m sysmon_sdk.cli status
🧪 Running Tests
Run all unit and integration tests:
pytest
To get test coverage:
pytest --cov=sysmon_sdk --cov-report=html
open htmlcov/index.html
To run all tests and generate coverage reports with daemon:
./test_runner.sh
📁 Project Structure
sysmon_sdk/
├── cli.py # CLI entry point
├── core.py # Client-side socket interaction
├── daemon.py # Multithreaded background process
├── config.py # Loads socket path/config
├── config.json # Optional config file
📜 License
This project is licensed under the MIT License.
Feel free to use, modify, and distribute.
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 sysmon_sdk-0.1.4.tar.gz.
File metadata
- Download URL: sysmon_sdk-0.1.4.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01ebdedab81122b729bfcac0a397e9b1f69e04afa3b8dc27d18ed9acbdd45741
|
|
| MD5 |
13c4fd10d2fb22e2a08e0a76d4b1b49f
|
|
| BLAKE2b-256 |
88e62e788d1a4900e598f7a6683d31b9359aa37da60d1c6c6cf83cdcb1d70082
|
File details
Details for the file sysmon_sdk-0.1.4-py3-none-any.whl.
File metadata
- Download URL: sysmon_sdk-0.1.4-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9069adba51b62d17a204bb5ee2cade0d43d602ea3eda405da08f6afd4a8278c5
|
|
| MD5 |
bf0ccec49c933fb6df7e6ebc51c9078c
|
|
| BLAKE2b-256 |
5700ad1fda5baba0be9268580aa66075a5de0fd3392e2132ce3374e0483b8bba
|