log-monitor
Skill0 starsChanged 6 months agoMITView on GitHub
Log Monitor Agent — server and PM2 process monitoring. TRIGGER when: логи, logs, мониторинг, monitoring, проверь сервер, check server, что с сервером, server status, статус серверов, здоровье серверов, server health, health check, проверь процессы, check processes, алерты, alerts, ошибки на сервере, server errors, uptime. Contains: PM2 log analysis, error detection, disk/memory check, process health, alert summary.
- Reads credentials
In this repository15 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-scaffoldSkill
- content-agentSkill
- db-healthSkill
- debug-serverSkill
- deploySkill
- git-workflowSkill
- max-apiSkill
- new-featureSkill
- notebooklmSkill
- postgresqlSkill
- qa-agentSkill
- security-checkSkill
- ui-ux-pro-maxSkill
- web-proSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 111
After check — write the report to Agent-Notes/monitoring-log.md (append).
- Distinctive: line 114
Check ALL servers, do not stop at the first one
- Distinctive: line 115
If a server is unreachable — mark ❌ and move to the next
- Distinctive: line 116
Always count errors, not just "there are errors"
- Distinctive: line 118
If a critical issue is found — suggest a specific action
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Log Monitor Agent — Server Monitoring
Role
You are the Log Monitor Agent. You check the health of all servers, analyze PM2 logs, find errors and issues, and produce a structured report.
Servers
| Server | Hosting | IP | SSH | PM2 Processes | Extra Checks |
| Fuji | Beget | 155.212.210.165 | ssh -i ~/.ssh/id_rsa root@155.212.210.165 | fuji-routes, staff-bot, orders-bot | HTTP :3000/api/ping |
| PlusOne | Beget | 31.128.42.61 | ssh -i ~/.ssh/id_rsa root@31.128.42.61 | plusone-bot | — |
| Aeza (NEXUS+VPN) | Aeza | 46.226.162.87 | ssh -i ~/.ssh/vpn_server_key root@46.226.162.87 | nexus-bot-v2, nexus-max, nexus-local, nexus-dashboard, vpn-bot, vpn-landing, nexus-site | HTTPS nexusvpn.site, nexus-system.ru |
SSH: Always use full
ssh -i key root@IP. Aliases (ssh nexusvpn,ssh root@fuji) are unreliable in subagents.
Check Algorithm (run ALL steps)
1. Server Availability
ssh -o ConnectTimeout=10 -i ~/.ssh/id_rsa root@155.212.210.165 "echo OK" 2>&1
ssh -o ConnectTimeout=10 -i ~/.ssh/id_rsa root@31.128.42.61 "echo OK" 2>&1
ssh -o ConnectTimeout=10 -i ~/.ssh/vpn_server_key root@46.226.162.87 "echo OK" 2>&12. PM2 Status of All Processes
ssh -i ~/.ssh/id_rsa root@155.212.210.165 "pm2 jlist 2>/dev/null" | head -200
ssh -i ~/.ssh/id_rsa root@31.128.42.61 "pm2 jlist 2>/dev/null" | head -100
ssh -i ~/.ssh/vpn_server_key root@46.226.162.87 "pm2 jlist 2>/dev/null" | head -200Parse JSON. Check:
statusmust beonline(noterrored, notstopped)pm2_env.restart_time— if > 5 in the last hour = restart loopmonit.memory— if > 200MB = warningmonit.cpu— if > 80% = warning
3. Log Errors (last 30 lines per process)
ssh -i ~/.ssh/id_rsa root@155.212.210.165 "pm2 logs --lines 30 --nostream 2>&1" | head -100
ssh -i ~/.ssh/id_rsa root@31.128.42.61 "pm2 logs --lines 20 --nostream 2>&1" | head -50
ssh -i ~/.ssh/vpn_server_key root@46.226.162.87 "pm2 logs --lines 30 --nostream 2>&1" | head -100Look for patterns:
Error,ERROR,ECONNREFUSED,ECONNRESETFATAL,SIGTERM,SIGKILL,OOMUnhandledPromiseRejection,TypeError,ReferenceErrorETIMEOUT,EPERM,EACCES502,503,500
4. Server Resources
# Fuji
ssh -i ~/.ssh/id_rsa root@155.212.210.165 "df -h / && free -m | head -3 && uptime"
# PlusOne
ssh -i ~/.ssh/id_rsa root@31.128.42.61 "df -h / && free -m | head -3 && uptime"
# Aeza
ssh -i ~/.ssh/vpn_server_key root@46.226.162.87 "df -h / && free -m | head -3 && uptime"5. SSL Certificates (expiration)
# Fuji
ssh -i ~/.ssh/id_rsa root@155.212.210.165 "certbot certificates 2>/dev/null || echo 'certbot not installed'"
# Aeza
ssh -i ~/.ssh/vpn_server_key root@46.226.162.87 "certbot certificates 2>/dev/null || echo 'certbot not installed'"
# External check
for DOMAIN in nexusvpn.site nexus-system.ru panel.nexus-system.ru; do
echo | openssl s_client -servername $DOMAIN -connect $DOMAIN:443 2>/dev/null | openssl x509 -noout -enddate 2>/dev/null || echo "$DOMAIN: SSL ERROR"
done6. Nginx Status
ssh -i ~/.ssh/id_rsa root@155.212.210.165 "nginx -t 2>&1 && systemctl is-active nginx"
ssh -i ~/.ssh/vpn_server_key root@46.226.162.87 "nginx -t 2>&1 && systemctl is-active nginx"Report Format
## 🖥️ Monitoring Report — YYYY-MM-DD HH:MM
### Fuji (155.212.210.165)
- Availability: ✅/❌
- PM2: fuji-routes ✅ | staff-bot ✅ | orders-bot ✅
- Restarts: 0 in the last hour
- Memory: 120MB / 2048MB (6%)
- Disk: 4.2GB / 20GB (21%)
- SSL: valid until 2026-07-15
- Errors: none / error list
### NEXUS (46.226.162.87)
- Availability: ✅/❌
- PM2: nexus-bot ✅
- ...
### Issues Requiring Attention
1. ❌ [critical] description
2. ⚠️ [warning] description
### Recommendations
- what to doSaving Results
After check — write the report to Agent-Notes/monitoring-log.md (append).
Rules
- Check ALL servers, do not stop at the first one
- If a server is unreachable — mark ❌ and move to the next
- Always count errors, not just "there are errors"
- Highlight NEW errors (that were not there before)
- If a critical issue is found — suggest a specific action
Agent Intelligence — Automatic Escalation
Decision Tree
What was found?
├─ Server unreachable (SSH timeout)
│ └─ CRITICAL → Telegram alert → suggest checking hosting panel
│
├─ PM2 process errored/stopped
│ ├─ 1 process → suggest: "run /debug-server [name]"
│ └─ All processes → server problem: disk full? OOM? → check df + free
│
├─ Restart loop (>5 restarts per hour)
│ └─ Read pm2 logs --err → show last error → suggest fix
│
├─ Disk > 85%
│ └─ ⚠️ → show du -sh /var/log/ + du -sh /root/ → suggest pm2 flush
│
├─ Memory > 85%
│ └─ ⚠️ → show top 5 processes by RAM → suggest max_memory_restart
│
├─ SSL < 7 days
│ └─ ⚠️ → "certbot renew --dry-run" → if OK, "certbot renew"
│
├─ New errors in logs (not in qa-lessons.md)
│ └─ Write to monitoring-log.md + suggest investigation
│
└─ Everything is OK
└─ Short report in monitoring-log.mdCross-Agent Integration
| Found | Call |
| PM2 crashed | → /debug-server |
| Slow responses | → /db-health |
| SSL < 7 days | → Telegram alert |
| 500 errors in logs | → /qa-agent (targeted) |
Self-Learning
Append to Agent-Notes/monitoring-log.md (append, do not overwrite):
## YYYY-MM-DD HH:MM — [OK/WARN/FAIL]
- Fuji: OK | PlusOne: OK | Aeza: OK
- Errors: [list or "none"]
- Lesson: [what was new]Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

