Install
openclaw skills install server-mateBuild or extend a lightweight server monitoring and AI operations workflow for Linux hosts running Nginx or Apache. Use when Codex needs to collect psutil metrics, parse access, error, or auth logs, design JSON payloads or APIs, add webhook alerts, generate PDF ops reports with SSL expiry summaries, answer natural-language monitoring questions, or implement guarded auto-ban and auto-heal behaviors.
openclaw skills install server-mateVersion: 1.3.3
Use this skill to design or implement a two-plane monitoring system:
OPENAI_API_KEY is injected by the runtime when AI analysis is enabled. Do not ask the user to export it manually. Treat webhook URLs or tokens in config.yaml as secrets and do not commit them../data/GeoIP.conf the same way. It may contain MaxMind AccountID and LicenseKey, so keep it local-only and out of Git../data/GeoIP.conf and geoipupdate. Treat the built-in public mirror fallback only as an operator-reviewed bootstrap path when no local .mmdb file is present.dry_run: true until reviewed.psutil, and the standard library for the first implementation../config.yaml plus local SQLite state such as ./metrics.db before adding external services../config.yaml, ./metrics.db, ./logs/, and ./reports/. Do not default to /opt, /var/log, or other system-wide directories.system_metrics + sites[] matrix layout from config.example.yaml instead of new single-site keys.dry_run: true and keep it there until the user has observed automation notifications and audit history for several days.dry_run to false, or enable auto_ban.enabled / auto_heal.enabled, unless the operator explicitly approves the command templates, allowlists, cooldowns, and audit destinations.automation_actions and banned_ips, and expose simple lookup queries in user-facing docs.Use external scheduling for production unless the user explicitly wants an always-on daemon-only design.
server_agent.py --once every 10 minutes from cron or a systemd timer.systemd deployments in Clawhub-style packaging:
.service file inside the skill package.server_agent.py --config ./config.yaml --generate-service, then paste it into /etc/systemd/system/server-mate.service.report_generator.py as one-shot scheduled jobs.01:00.01:10.1 at 01:20.report_generator.py run should iterate over every configured site unless the user explicitly passes --site.sites[] plus global system_metricsdry_run, whitelist checks, TTL-based unban, cooldown-based auto-heal, and SQLite audit traillogs.auth_log with ssh_brute_force alerting and optional linked auto-ban./data/GeoIP.conf and geoipupdate, with an operator-reviewed public mirror bootstrap fallbackconfig.example.yaml and docs updated for MaxMind GeoLite2 setup in the current workspaceCopyable cron examples:
*/10 * * * * /usr/bin/env bash -lc 'python3 ./scripts/server_agent.py --config ./config.yaml --once >> ./logs/server-mate-agent.log 2>&1'
0 1 * * * /usr/bin/env bash -lc 'python3 ./scripts/report_generator.py --config ./config.yaml pdf --range daily --send >> ./logs/server-mate-report.log 2>&1'
10 1 * * 1 /usr/bin/env bash -lc 'python3 ./scripts/report_generator.py --config ./config.yaml pdf --range weekly --send >> ./logs/server-mate-report.log 2>&1'
20 1 1 * * /usr/bin/env bash -lc 'python3 ./scripts/report_generator.py --config ./config.yaml pdf --range monthly --send >> ./logs/server-mate-report.log 2>&1'
Systemd note:
systemd, prefer Type=oneshot services plus timers for reports.Restart=always only for the long-running --daemon agent mode.