Skip to main content

Check your server status (CPU, Memory, Disk Usage) via nonebot

Project description

nonebot

nonebot-plugin-status

✨ NoneBot 服务器状态(CPU, Memory, Disk Usage)查看插件 ✨

license pypi python

使用方式

通用:

  • 发送 Command 状态

OneBot:

  • 向机器人发送戳一戳表情
  • 双击机器人头像戳一戳

配置项

配置方式:直接在 NoneBot 全局配置文件中添加以下配置项即可。

server_status_only_superusers

  • 类型: bool
  • 默认: True
  • 说明: 是否仅允许超级用户使用

超级用户需在配置文件中如下配置:

SUPERUSERS=["your qq id"]

server_status_template

  • 类型: str
  • 默认: 请参考示例
  • 说明:发送的消息模板,支持的变量以及类型如下:
    • cpu_usage (float): CPU 使用率
    • memory_usage (float): 内存使用率
    • disk_usage (Dict[str, psutil._common.sdiskusage]): 磁盘使用率,包含 total, used, free, percent 属性
    • uptime (timedelta): 服务器运行时间

配置文件示例(默认模板)

SERVER_STATUS_TEMPLATE="
CPU: {{ '%02d' % cpu_usage }}%
Memory: {{ '%02d' % memory_usage }}%
Disk:
{%- for name, usage in disk_usage.items() %}
  {{ name }}: {{ '%02d' % usage.percent }}%
{%- endfor %}
Uptime: {{ uptime }}
"

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

nonebot-plugin-status-0.4.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

nonebot_plugin_status-0.4.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file nonebot-plugin-status-0.4.0.tar.gz.

File metadata

  • Download URL: nonebot-plugin-status-0.4.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.4.0-1074-azure

File hashes

Hashes for nonebot-plugin-status-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7bf071535c9875f056065bbf05b7a25384f50b38fc58fe28dd350614b25b8a64
MD5 cbbe80e9e65cf5b8ffdc7c7c0e0f7126
BLAKE2b-256 6c24e0fb4f0426a301022bb6aa38e4956f8f16f4ff30542657750c36582dfcf5

See more details on using hashes here.

File details

Details for the file nonebot_plugin_status-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_status-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c1b0df558c56e1d49a388e99a58b2ac9be9d50364c9bcff4507ccbd39714234
MD5 aaa5d8e8a46103434d36d9c301beae29
BLAKE2b-256 420e3a2e840dcfab8af0a03b0a37a529bcdcb3c71c91f1eaa24d7547ece9c9fa

See more details on using hashes here.

Supported by

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