Add push monitors for system metrics and fix anthropic version
All checks were successful
Build and Push Container / build (push) Successful in 41s
All checks were successful
Build and Push Container / build (push) Successful in 41s
- Add disk, memory, CPU, and updates push monitor suggestions - Update Claude prompt to always suggest system health monitors - Fix anthropic library version compatibility (proxies error) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@ flask==3.0.0
|
|||||||
flask-cors==4.0.0
|
flask-cors==4.0.0
|
||||||
flask-socketio==5.3.6
|
flask-socketio==5.3.6
|
||||||
paramiko==3.4.0
|
paramiko==3.4.0
|
||||||
anthropic==0.39.0
|
anthropic>=0.40.0
|
||||||
requests==2.31.0
|
requests==2.31.0
|
||||||
python-dotenv==1.0.0
|
python-dotenv==1.0.0
|
||||||
gevent==23.9.1
|
gevent==23.9.1
|
||||||
|
|||||||
@@ -43,12 +43,13 @@ Always respond with valid JSON in this structure:
|
|||||||
"analysis": "Your analysis of what you found on the host",
|
"analysis": "Your analysis of what you found on the host",
|
||||||
"monitors": [
|
"monitors": [
|
||||||
{
|
{
|
||||||
"type": "http|tcp|ping|docker|keyword",
|
"type": "http|tcp|ping|docker|keyword|push",
|
||||||
"name": "Human-readable monitor name",
|
"name": "Human-readable monitor name",
|
||||||
"target": "URL, hostname, or container name",
|
"target": "URL, hostname, container name, or metric type for push",
|
||||||
"port": 80,
|
"port": 80,
|
||||||
"interval": 60,
|
"interval": 60,
|
||||||
"reason": "Why this should be monitored"
|
"reason": "Why this should be monitored",
|
||||||
|
"push_metric": "disk|memory|cpu|updates (only for push type)"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"additional_commands": [
|
"additional_commands": [
|
||||||
@@ -66,6 +67,31 @@ Always respond with valid JSON in this structure:
|
|||||||
- **ping**: Host availability (provide hostname)
|
- **ping**: Host availability (provide hostname)
|
||||||
- **docker**: Docker container status (provide container name)
|
- **docker**: Docker container status (provide container name)
|
||||||
- **keyword**: Check for specific text in response (provide URL and keyword)
|
- **keyword**: Check for specific text in response (provide URL and keyword)
|
||||||
|
- **push**: Push-based monitors for system metrics (scripts on host push to Uptime Kuma)
|
||||||
|
|
||||||
|
## Push Monitors for System Metrics
|
||||||
|
Always suggest push monitors for system health metrics. These run as cron jobs on the host and push status to Uptime Kuma. Suggest these based on what you see:
|
||||||
|
|
||||||
|
1. **Disk Space** - Alert when any partition exceeds 85% usage
|
||||||
|
- Name: "{hostname} - Disk Space"
|
||||||
|
- push_metric: "disk"
|
||||||
|
|
||||||
|
2. **Memory Usage** - Alert when RAM exceeds 90% usage
|
||||||
|
- Name: "{hostname} - Memory"
|
||||||
|
- push_metric: "memory"
|
||||||
|
|
||||||
|
3. **CPU Load** - Alert when load average exceeds CPU count
|
||||||
|
- Name: "{hostname} - CPU Load"
|
||||||
|
- push_metric: "cpu"
|
||||||
|
|
||||||
|
4. **System Updates** - Alert when security updates are pending (Debian/Ubuntu)
|
||||||
|
- Name: "{hostname} - Updates"
|
||||||
|
- push_metric: "updates"
|
||||||
|
|
||||||
|
For push monitors, set:
|
||||||
|
- type: "push"
|
||||||
|
- target: the metric type (disk, memory, cpu, updates)
|
||||||
|
- interval: 300 (5 minutes is typical for system metrics)
|
||||||
|
|
||||||
Be thorough but not excessive. Quality over quantity - suggest monitors that will actually catch real problems."""
|
Be thorough but not excessive. Quality over quantity - suggest monitors that will actually catch real problems."""
|
||||||
|
|
||||||
@@ -81,6 +107,7 @@ class MonitorSuggestion:
|
|||||||
interval: int = 60
|
interval: int = 60
|
||||||
reason: str = ""
|
reason: str = ""
|
||||||
keyword: Optional[str] = None
|
keyword: Optional[str] = None
|
||||||
|
push_metric: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -234,6 +261,7 @@ Respond with JSON as specified in your instructions."""
|
|||||||
interval=m.get("interval", 60),
|
interval=m.get("interval", 60),
|
||||||
reason=m.get("reason", ""),
|
reason=m.get("reason", ""),
|
||||||
keyword=m.get("keyword"),
|
keyword=m.get("keyword"),
|
||||||
|
push_metric=m.get("push_metric"),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user