Skip to main content

Swarmauri operations tool for retrieving CPU, memory, disk, network, and sensor telemetry via psutil.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tool_psutil Discord

Swarmauri Tool Psutil

swarmauri_tool_psutil is a Swarmauri operations tool for retrieving system telemetry using psutil. It exposes CPU, memory, disk, network, and sensor metrics through a single tool interface, making it useful for observability, health checks, diagnostics, and agent-driven operations workflows.

Why Use Swarmauri Tool Psutil

  • Expose host telemetry inside Swarmauri agents and automations.
  • Retrieve CPU, memory, disk, network, and sensor data on demand.
  • Return structured system data without custom psutil glue code.
  • Support local diagnostics, service health checks, and runtime audits.

FAQ

What input does the tool expect?
A single info_type string: cpu, memory, disk, network, or sensors.

What does the tool return?
A dictionary of metrics for the requested system-information family.

How are permission-restricted metrics handled?
Network connections and some sensor fields degrade gracefully when access is denied.

Is it suitable for agents?
Yes. The output is already converted into plain Python objects for easy serialization.

Features

  • Swarmauri ToolBase implementation registered as PsutilTool.
  • Collects CPU, memory, disk, network, and sensor metrics.
  • Returns plain dictionary/list structures derived from psutil namedtuples.
  • Handles common permission or platform gaps for sensors and connections.
  • Supports Python 3.10, 3.11, 3.12, 3.13, and 3.14.

Installation

uv add swarmauri_tool_psutil
pip install swarmauri_tool_psutil

Usage

from swarmauri_tool_psutil import PsutilTool

tool = PsutilTool()
cpu = tool("cpu")

print(cpu.keys())

Examples

Inspect memory metrics

from swarmauri_tool_psutil import PsutilTool

tool = PsutilTool()
memory = tool("memory")

print(memory["virtual_memory"])

Gather network telemetry

from swarmauri_tool_psutil import PsutilTool

tool = PsutilTool()
network = tool("network")

print(network["network_io_counters"])

Register the tool in a Swarmauri collection

from swarmauri_standard.tools.ToolCollection import ToolCollection
from swarmauri_tool_psutil import PsutilTool

tools = ToolCollection(tools=[PsutilTool()])
print(tools)

Related Packages

Swarmauri Foundations

More Documentation

Best Practices

  • Expect platform-specific differences in sensor availability.
  • Run with elevated privileges only when you truly need restricted telemetry.
  • Keep sampling frequency reasonable in long-running monitoring loops.
  • Validate info_type before invoking the tool from untrusted user input.

License

This project is licensed under the Apache-2.0 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

swarmauri_tool_psutil-0.11.0.dev1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

swarmauri_tool_psutil-0.11.0.dev1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_tool_psutil-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_tool_psutil-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_tool_psutil-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 929ef30b2bcaf3bb0b6be398e1b9611e467f1b3f2a71291e0080a896795c2696
MD5 99db3b8b600fb595ebc26cc54c7f0f3a
BLAKE2b-256 defdab8146d07e053ff0e26ded742b326e34f3c44c6fad82b0424b35d6adba56

See more details on using hashes here.

File details

Details for the file swarmauri_tool_psutil-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tool_psutil-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_tool_psutil-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 58120833059def1539bdd354a7e5d7848cf250fc6b5304758131b2f8e4de9d9b
MD5 c42bc1b527a4d069191f98d8afa3baa6
BLAKE2b-256 4ccd6035a49f132a0c746ddf1e72713cd4682a45c73b20904225084c8fbe6bb2

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