Collect server or cloud VM monitoring data, generate formatted Excel reports, and optionally send summaries via email or Feishu/Lark.
SourceAuthNotesZabbixUser/Pass or API TokenHost groups, memory, CPU, diskPrometheusURL onlyPromQL queriesAlibaba Cloud CMSAccessKey/SecretKeyECS, RDS, SLB, EIP metricsTencent Cloud CAMSecretID/KeyTC3-HMAC-SHA256 signatureHuawei Cloud IAMAccessKey/SecretKeyIAM Token auth
Data sources are auto-detected from .env — configure credentials for any combination and they will all be collected.
Create/edit ~/.hermes/.env. Only configure the sources you need:
bash
# --- Zabbix (pick one auth method) ---
ZABBIX_URL=https://zabbix.example.com/api_jsonrpc.php
ZABBIX_USER=Admin
ZABBIX_PASSWORD=your_password
# ZABBIX_TOKEN=your_api_token # optional, takes priority over password
# --- Alibaba Cloud ---
ALIBABA_ACCESS_KEY_ID=your_key_id
ALIBABA_ACCESS_KEY_SECRET=your_secret
ALIBABA_REGION=cn-hangzhou
# ALIBABA_METRICS=CPUUtilization,MemoryUtilization,InternetInRate # optional
# --- Tencent Cloud ---
TENCENT_SECRET_ID=your_secret_id
TENCENT_SECRET_KEY=your_secret_key
TENCENT_REGION=ap-shanghai
# --- Huawei Cloud ---
HUAWEI_ACCESS_KEY=your_access_key
HUAWEI_SECRET_KEY=your_secret_key
HUAWEI_REGION=cn-east-3
# --- Notifications ---
FEISHU_CHAT_ID=oc_xxxx # optional
SMTP_HOST=smtp.example.com # optional, omit to skip email
SMTP_PORT=465
SMTP_FROM=alarm@example.com
SMTP_TOKEN=your_token
TARGET_EMAIL=admin@example.com
# --- Report options ---
# TOPN: show top N hosts by memory+CPU score, 0=off (default: 50)
TOPN=50
Zabbix / Prometheus — no extra deps:
bash
python3 zabbix_cron.py
Alibaba Cloud — needs SDK (use uv since venv has no pip):
bash
uv run --with aliyun-python-sdk-core --with aliyun-python-sdk-cms \
python3 cloud_monitor.py
Tencent / Huawei — pure Python, only httpx needed:
bash
uv run --with httpx python3 cloud_monitor.py
bash
python3 zabbix_cron.py
Expected output:
~/.hermes/cron/output/zabbix_monitor.csv~/.hermes/cron/output/zabbix_monitor.xlsx (one sheet per host group + overview + TOP sheet)bash
hermes cron create \
--name "Daily Server Health Report" \
--script zabbix_cron.py \
--schedule "30 9 * * *"
主机组, 主机名, IP, 内存可用(GB), 内存总量(GB), 内存占用率(%), CPU占用率(%)🔴 ≥80% red, 🟠 ≥60% orange, 🟡 ≥40% yellowScripts detect which sources to use based on which env vars are set:
Env var presentData source usedZABBIX_URLZabbix APIALIBABA_ACCESS_KEY_IDAlibaba Cloud CMS (SDK)TENCENT_SECRET_IDTencent Cloud CAM (TC3签名)HUAWEI_ACCESS_KEYHuawei Cloud IAM (Token)PROMETHEUS_URLPrometheus PromQL
These groups are excluded by default (set in EXCLUDE_GROUPS in script):
Templates* — template groupsDiscovered hosts — Zabbix auto-discoveryKeyDescriptionvm.memory.size[available]Memory available (bytes)vm.memory.size[total]Memory total (bytes)system.cpu.utilCPU utilization (%)vfs.fs.size[/,pused]Root disk usage (%)
MetricWarningAlarmMemory usage≥40% yellow≥60% orange, ≥80% redCPU usage≥40% yellow≥60% orange, ≥80% red
Markdown card sent to FEISHU_CHAT_ID containing:
服务器监控报告 YYYY-MM-DD HH:MMzabbix_monitor.xlsxreferences/zabbix-config.md — Zabbix API details, item keys, auth optionsreferences/notification-config.md — Feishu and email SMTP setup, common providersreferences/cloud-config.md — Alibaba / Tencent / Huawei API endpoints, namespaces, SDK usage~/.hermes/.envN/A, CPU still worksMemoryUtilization requires Cloud Monitor Agent installed on ECS instance